forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: will on May 15, 2007, 10:10:30 pm

Title: Top Uploaders Of The Month
Post by: will 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
Title: Re: Top Uploaders Of The Month
Post by: Nibbler 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.
Title: Re: Top Uploaders Of The Month
Post by: will on May 16, 2007, 07:55:58 pm
the current month Nibbler, would be great if you can help ;D
Title: Re: Top Uploaders Of The Month
Post by: Nibbler 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
Title: Re: Top Uploaders Of The Month
Post by: will 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();

?>
Title: Re: Top Uploaders Of The Month
Post by: Nibbler 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");
Title: Re: Top Uploaders Of The Month
Post by: will on May 17, 2007, 03:43:10 pm
Thank you Nibbler, works perfect ;D
Title: Re: Top Uploaders Of The Month
Post by: will 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
Title: Re: Top Uploaders Of The Month
Post by: Nibbler on August 12, 2007, 09:53:33 pm
You need to alter the code so it will work with invision.
Title: Re: Top Uploaders Of The Month
Post by: will 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 ;)
Title: Re: Top Uploaders Of The Month
Post by: Joachim Müller on November 15, 2007, 08:08:01 am
If you're ready to pay then do as suggested in coppermine-gallery.net > Support > Looking for Freelancers / Paid help > sub-board rules, read first! (http://forum.coppermine-gallery.net/index.php?topic=8170.0)