forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Statistics => Topic started by: Justttt on June 22, 2006, 12:58:33 pm

Title: top uploaders commenters
Post 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 :)
Title: Re: top uploaders commenters
Post by: will on June 22, 2006, 05:58:04 pm
I understand from your post that it doesn't show admin uploads but is there a way of showing theirs also. ;D
Title: Re: top uploaders commenters
Post by: Justttt on June 25, 2006, 02:30:14 pm
edit the anycontent to
Code: [Select]
<?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();
?>

:)
Title: Re: top uploaders commenters
Post by: will on June 26, 2006, 04:06:08 pm
Cheers bro ;D
Title: Re: top uploaders commenters
Post by: will on August 11, 2006, 03:30:19 pm
Is there anyway of making this into a seperate page so it can be viewed like Most Viewed for example.

Thanks  ;D
Title: Re: top uploaders commenters
Post by: will on August 25, 2006, 12:17:08 am
Anybody ???
Title: Re: top uploaders commenters
Post by: Nibbler on August 25, 2006, 12:25:38 am
Yes, copy/paste it into a skeleton page.

Code: [Select]
<?php

define
('IN_COPPERMINE'true);
require(
'include/init.inc.php')
pageheader('Whatever');

/*mod code here */

pagefooter();
Title: Re: top uploaders commenters
Post by: will on March 20, 2007, 08:24:58 pm
1 more thing please, is there a way of taking out the usergroups by just showing the usernames ;D
Title: Re: top uploaders commenters
Post by: MarkP on April 23, 2007, 05:22:51 pm
I know this is old and I have been trying to get it to work but it only shows one person "me!"  ;D
Title: Re: top uploaders commenters
Post by: Nibbler on April 23, 2007, 05:29:31 pm
Not designed for a bridged gallery.
Title: Re: top uploaders commenters
Post by: iorkara on September 20, 2008, 06:46:44 pm
How can I get this to show on my Index? Like just underneath my Menu Buttons?
Title: Re: top uploaders commenters
Post by: Nibbler on September 20, 2008, 08:54:04 pm
Add the code provided to your content.php and then set anycontent to be at the top in config.
Title: Re: top uploaders commenters
Post by: iorkara on September 21, 2008, 06:08:04 am
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.
Title: Re: top uploaders commenters
Post by: Nibbler on September 21, 2008, 05:20:43 pm
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.