Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Top Uploaders Of The Month  (Read 6521 times)

0 Members and 1 Guest are viewing this topic.

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Top Uploaders Of The Month
« on: May 15, 2007, 10:10:30 pm »

Hi guys

Just wondering weather anybody could help me make a top uploaders of the month page. I'm thinking of having some uploader competitions each month so this would be great to specify which members are the top uploaders of the month.

Please let me know

Thanks ;D
« Last Edit: May 17, 2007, 04:07:44 pm by GauGau »
Logged

Nibbler

  • Guest
Re: Top Uploaders Of The Month
« Reply #1 on: May 16, 2007, 03:08:40 am »

Do you mean literally the current month or the last 30 days? I'm sure I've posted similar in the past.
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Top Uploaders Of The Month
« Reply #2 on: May 16, 2007, 07:55:58 pm »

the current month Nibbler, would be great if you can help ;D
Logged

Nibbler

  • Guest
Re: Top Uploaders Of The Month
« Reply #3 on: May 16, 2007, 09:33:16 pm »

See here: http://forum.coppermine-gallery.net/index.php?topic=32970.0

For the current month, add this code

Code: [Select]
$startofmonth = strtotime('first '.date('F'));
Then change the SQL query to something like

Code: [Select]
WHERE ctime > $startofmonth
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Top Uploaders Of The Month
« Reply #4 on: May 16, 2007, 09:57:39 pm »

I'm probably sounding thick right now but where to I add the code

Code: [Select]
<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.3.2                                            //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002-2004 Gregory DEMAR                                     //
// http://www.chezgreg.net/coppermine/                                       //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team                                        //
// (http://coppermine.sf.net/team/)                                          //
// see /docs/credits.html for details                                        //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify      //
// it under the terms of the GNU General Public License as published by      //
// the Free Software Foundation; either version 2 of the License, or         //
// (at your option) any later version.                                       //
// ------------------------------------------------------------------------- //
// CVS version: $Id: anycontent.php,v 1.5 2004/07/24 15:03:52 gaugau Exp $
// ------------------------------------------------------------------------- //

echo '<table width="100%"><tr><td width="50%">';
starttable("100%""Top posters",2);

$result cpg_db_query("SELECT user_name, user_id, group_name, COUNT(*) AS numcom FROM {$CONFIG['TABLE_COMMENTS']}{$CONFIG['TABLE_USERS']}{$CONFIG['TABLE_USERGROUPS']} WHERE user_id = author_id AND user_group = group_id AND user_group <> 1 GROUP BY author_id ORDER BY numcom DESC LIMIT 5");

$i 1;
while (
$row mysql_fetch_assoc($result)){
echo "<tr><td class=\"tableb\" >" $i++ . ") <a href=\"profile.php?uid={$row['user_id']}\">{$row['user_name']}</a> - {$row['group_name']}</td><td class=\"tableb\"><a href=\"thumbnails.php?album=lastcomby&uid={$row['user_id']}\">{$row['numcom']} comments</a></td></tr>";
}

endtable();
echo 
'</td><td width="50%">';

starttable("100%""Top uploaders",2);

$result cpg_db_query("SELECT user_name, user_id, group_name, COUNT(*) AS numpics FROM {$CONFIG['TABLE_PICTURES']}{$CONFIG['TABLE_USERS']}{$CONFIG['TABLE_USERGROUPS']} WHERE user_id = owner_id AND user_group = group_id AND user_group <> 1 GROUP BY owner_id ORDER BY numpics DESC LIMIT 5");

$i 1;
while (
$row mysql_fetch_assoc($result)){
echo "<tr><td class=\"tableb\" >" $i++ . ") <a href=\"profile.php?uid={$row['user_id']}\">{$row['user_name']} - {$row['group_name']}</a></td><td class=\"tableb\"><a href=\"thumbnails.php?album=lastupby&uid={$row['user_id']}\">{$row['numpics']} uploads</a></td></tr>";
}

endtable();
echo 
'</td></tr>';
endtable();

?>
Logged

Nibbler

  • Guest
Re: Top Uploaders Of The Month
« Reply #5 on: May 17, 2007, 12:33:40 pm »

Code: [Select]
$startofmonth = strtotime('first '.date('F'));
$result = cpg_db_query("SELECT user_name, user_id, group_name, COUNT(*) AS numpics FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_USERS']}, {$CONFIG['TABLE_USERGROUPS']} WHERE user_id = owner_id AND user_group = group_id AND user_group <> 1 AND ctime > $startofmonth GROUP BY owner_id ORDER BY numpics DESC LIMIT 5");
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Top Uploaders Of The Month
« Reply #6 on: May 17, 2007, 03:43:10 pm »

Thank you Nibbler, works perfect ;D
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Top Uploaders Of The Month
« Reply #7 on: August 12, 2007, 09:47:31 pm »

I know is a solved thread but since I have bridged my gallery to invision forum I have lost all the Top Uploaders Of The Month data, is there anything I need to change

Thanks
Logged

Nibbler

  • Guest
Re: Top Uploaders Of The Month
« Reply #8 on: August 12, 2007, 09:53:33 pm »

You need to alter the code so it will work with invision.
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Top Uploaders Of The Month
« Reply #9 on: November 14, 2007, 03:51:28 pm »

Has I'm not a php coder is there anyone that can help me make this work with Invision. Since adding this I've not started the uploader comps but we will be starting in December so I need help sorting this by then. I'm will to pay to nobody can help in free support.

Thanks ;)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Top Uploaders Of The Month
« Reply #10 on: November 15, 2007, 08:08:01 am »

Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.