Advanced search  

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]

Pages: [1]   Go Down

Author Topic: TopRated Images of a certain single album  (Read 31883 times)

0 Members and 1 Guest are viewing this topic.

wiren

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
TopRated Images of a certain single album
« 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...

gtroll

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 618
    • CPG-Nuke
TopRated Images of a certain single album
« Reply #1 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

wiren

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
TopRated Images of a certain single album
« Reply #2 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.

Mhafweet

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: TopRated Images of a certain single album
« Reply #3 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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: TopRated Images of a certain single album
« Reply #4 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.