News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

top uploaders commenters

Started by Justttt, June 22, 2006, 12:58:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Justttt

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 :)
J U S T T T T

will

I understand from your post that it doesn't show admin uploads but is there a way of showing theirs also. ;D

Justttt

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


:)
J U S T T T T

will


will

Is there anyway of making this into a seperate page so it can be viewed like Most Viewed for example.

Thanks  ;D

will


Nibbler

Yes, copy/paste it into a skeleton page.


<?php

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

/*mod code here */

pagefooter();

will

1 more thing please, is there a way of taking out the usergroups by just showing the usernames ;D

MarkP

I know this is old and I have been trying to get it to work but it only shows one person "me!"  ;D

Nibbler

Not designed for a bridged gallery.

iorkara

How can I get this to show on my Index? Like just underneath my Menu Buttons?

Nibbler

Add the code provided to your content.php and then set anycontent to be at the top in config.

iorkara

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.

Nibbler

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.