Get list of file names for Most Viewed and Top Rated Get list of file names for Most Viewed and Top Rated
 

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

Get list of file names for Most Viewed and Top Rated

Started by Gizmo, October 06, 2005, 04:10:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gizmo

Hi,

I've been asked to create a collage of my youth lacrosse photos to be shown on the local television station this winter to announce signups for the spring leagues. Instead of searching through >2400 photos, is there a way to get a filename listing of the Most Viewed and Top Rated photos which I can use to create the collage. I'm assuming this will come from the database and I'm not a SQL person but have no problems poking around with a little guidance.

My photo site link is http://www.bullseyephotos.com/coppermine/index.php. Also, I'd like to thank everyone at Coppermine for a great product. I've used the help and support features of this site extensively and this is the first time I've had to post for help in over 9 months.  ???

Thanks for any assistance you may lend.

Cheers,

Billy
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

Nibbler

You can run some queries in phpmyadmin, for example

SELECT filepath, filename FROM cpg_pictures ORDER by hits DESC
SELECT filepath, filename FROM cpg_pictures ORDER by pic_rating DESC, votes DESC

Replace cpg_ with the prefix you chose during installation.

Stramm

I'm always to slow ;)


<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');
pageheader("SQL");

$result db_query("SELECT votes, filename FROM {$CONFIG['TABLE_PICTURES']} ORDER BY votes DESC LIMIT 100");
starttable("100%""List",1);
while(
$row mysql_fetch_array($result)){
echo "<tr><td>".$row['filename']."</td><td>".$row['votes']."</td></tr>";
}
mysql_free_result($result);
endtable();
pagefooter();
?>



save as eg votes.php and save it in cpg main dir. Open it...

Gizmo

Hi Stramm,

Thanks! This is great and very reusable... so well worth the wait. I'll modify it to work with Most Viewed as well and then I'll be all set to go. I'm in the process of redoing the site and have a lot more photos from other sports to add and I'll make sure the parents and kids come in to vote for the most popular photos and the winners will get free photos (this will encourge participation and save me a bunch of work selecting photos).

Thanks to you as well Nibbler. I tried your method and it works too but if I don't have to run phpmyadmin, that's a plus since I made a nasty mistake once. Like I said earlier though, use the help and support forum and you can fix almost anything in Coppermine.

Cheers to you both!  :D

Billy
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision