News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

TopRated Images of a certain single album

Started by wiren, October 19, 2003, 12:22:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wiren

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...

gtroll

It's actually pretty easy open block-center-Top_rate_pictures_thumb.php
change:
$result = sql_query("SELECT pid, filepath,filename, pic_rating FROM cpg_pictures ORDER BY pic_rating desc LIMIT $length", $dbi);
to
$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
$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

wiren

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.

Mhafweet

Does this piece of code still work in Coppermine 1.4.13? If so, where do I insert it?

Joachim Müller

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.