Top Uploaders Of The Month Top Uploaders Of The Month
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Top Uploaders Of The Month

Started by will, May 15, 2007, 10:10:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

will

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

Nibbler

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

will

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

Nibbler

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

For the current month, add this code

$startofmonth = strtotime('first '.date('F'));

Then change the SQL query to something like

WHERE ctime > $startofmonth

will

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

<?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();

?>

Nibbler

$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");

will

Thank you Nibbler, works perfect ;D

will

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

Nibbler

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

will

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 ;)

Joachim Müller