litle help with top10 litle help with top10
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

litle help with top10

Started by neeth, June 28, 2005, 03:00:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

neeth

there is code from nibbler for my top uploaders

   case 'uploaders' :
      starttable("60%", "Top uploaders",2);
      
      $result = 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 group_id !='1' GROUP BY owner_id ORDER BY numpics DESC LIMIT 100");

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

and how to edit that this code show how many user upload pics but from one album, ex album "20"

mod work on http://www.neeth.info/galerija/anycontent.php?table=uploaders

tnx for any help ...

NeMo
[

kegobeer

WHERE user_id = owner_id AND user_group = group_id AND group_id !='1' and aid='20'

should do the trick.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

neeth

thnx man for you fast and great reply ;)
[

neeth

aid is for album, what is for caegories ?

tnx
[

kegobeer

That means changing the query a lot more.  Categories aren't stored in the pictures table, you have to query the albums and categories tables, looking for albums that are assigned to a certain category.


      $result = db_query("SELECT user_name, user_id, group_name, COUNT(*) AS numpics FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_USERS']}, {$CONFIG['TABLE_USERGROUPS']}, {$CONFIG['TABLE_CATEGORIES]}, {$CONFIG['TABLE_ALBUMS']} WHERE user_id = owner_id AND user_group = group_id AND group_id !='1' AND category='2' GROUP BY owner_id ORDER BY numpics DESC LIMIT 100");



I don't know if that will work.  You may need to have two separate queries, one to grab all the albums that are in a certain category, then another to pull the images and data.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots