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
WHERE user_id = owner_id AND user_group = group_id AND group_id !='1' and aid='20'
should do the trick.
thnx man for you fast and great reply ;)
aid is for album, what is for caegories ?
tnx
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.