forum.coppermine-gallery.net

Support => Older/other versions => cpg1.1d PHPnuke Support (deprecated) => Topic started by: wiren on October 19, 2003, 12:22:37 pm

Title: TopRated Images of a certain single album
Post by: wiren on October 19, 2003, 12:22:37 pm
We are running a ported coppermine 1.1d into a nuked site and we started a photo contest dedicated to Modena and its surroundings, building a single album where users and visitors can upload pictures.

What we would like to have is a central block or a page or else where you could see the top rated images of just that album and not of the whole site.  

Do you know of a quick and simple way to hack this (we are not so good with php-mysql I am not even a technician...)?

This might well become handy in much other cases, in my opinion. Maybe we could build a separate system where you can see last comments on a certain album, see the most clicked ones of the very same album, just like you do with all pictures of the coppermine but limited to one album (or maybe cathegory).

Thank you for your attention...
Title: TopRated Images of a certain single album
Post by: gtroll on October 20, 2003, 07:16:38 am
It's actually pretty easy open block-center-Top_rate_pictures_thumb.php
change:
Code: [Select]
$result = sql_query("SELECT pid, filepath,filename, pic_rating FROM cpg_pictures ORDER BY pic_rating desc LIMIT $length", $dbi);
to
Code: [Select]
$result = sql_query("SELECT pid, filepath,filename, pic_rating FROM cpg_pictures WHERE aid==0 ORDER BY pic_rating desc LIMIT $length", $dbi);
change zero to the number of the album you want show... save that file as a new name upload it and enable it!
This same thing could be done with the other blocks I've used this same method to exclude albums from the block too by using aid != 0
You can also do this
Code: [Select]
$result = sql_query("SELECT pid, filepath,filename, pic_rating FROM cpg_pictures WHERE aid==0 AND votes >10 ORDER BY pic_rating desc LIMIT $length", $dbi); to limit you pics to the more voted upon
Title: TopRated Images of a certain single album
Post by: wiren on October 25, 2003, 07:40:20 pm
Thank you very much, Scott.

And what if I would like to show them into the album's main page, after the last inserted ones?

This way I could have the last inserted ones and, before of after them, the top rated... Can I somehow do that?

Thanks again.
Title: Re: TopRated Images of a certain single album
Post by: Mhafweet on October 04, 2007, 04:48:25 pm
Does this piece of code still work in Coppermine 1.4.13? If so, where do I insert it?
Title: Re: TopRated Images of a certain single album
Post by: Joachim Müller on October 04, 2007, 06:03:33 pm
This is the totally outdated and unsupported, deprecated, ancient nuke support board. The threads here exist only for reference. No support given here. Post your questions on the board that actually deals with your version of PHP. Locking.