forum.coppermine-gallery.net
No Support => Modifications/Add-Ons/Hacks => Mods: Statistics => Topic started by: Justttt on June 22, 2006, 12:58:33 pm
-
in the attached zip file is top files top50.php / anycontent.php
the top50.php has the top 50 uploaders, posters, viewers
the anycontent has the top 5 posters, uploaders < and dose not show admin's
the number of top users to be shown can easly be changed
/code from nibbler 1.3 :)
-
I understand from your post that it doesn't show admin uploads but is there a way of showing theirs also. ;D
-
edit the anycontent to
<?php
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 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 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();
?>
:)
-
Cheers bro ;D
-
Is there anyway of making this into a seperate page so it can be viewed like Most Viewed for example.
Thanks ;D
-
Anybody ???
-
Yes, copy/paste it into a skeleton page.
<?php
define('IN_COPPERMINE', true);
require('include/init.inc.php')
pageheader('Whatever');
/*mod code here */
pagefooter();
-
1 more thing please, is there a way of taking out the usergroups by just showing the usernames ;D
-
I know this is old and I have been trying to get it to work but it only shows one person "me!" ;D
-
Not designed for a bridged gallery.
-
How can I get this to show on my Index? Like just underneath my Menu Buttons?
-
Add the code provided to your content.php and then set anycontent to be at the top in config.
-
Hi Nibbler.
Thanks for your quick reply.
However I'm abit of a noob when it comes to this, sorry. I'm still learning.
So the code that is provided, I copy paste it into content.php (but i dont have one called content.php)
Then set anycontent to be at the top in config. How would i go about that?
Thank you.
-
That's a typo, I meant anycontent.php. See config setting 'The content of the main page' and add 'anycontent' at the start of the list.