forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: plancast on February 09, 2015, 12:48:29 pm

Title: Toprated images uploaded within last 24 hours
Post by: plancast on February 09, 2015, 12:48:29 pm
Hi,

Is there a way I can add another "Toprated" section of highest rated images uploaded within the last 24 hours?

Many thanks,

Chris
Title: Re: Toprated images uploaded within last 24 hours
Post by: allvip on February 09, 2015, 03:32:20 pm
Every album thumbnails page has a sort order button: by date, by title etc.
That can be added even for Top rated thumbnails.
Would that be OK?

The problem is that I do not remember were I saw that on the forum.
Maybe this:  Hidden features plugin for cpg1.5.x http://forum.coppermine-gallery.net/index.php/topic,77314.0.html (http://forum.coppermine-gallery.net/index.php/topic,77314.0.html)

Title: Re: Toprated images uploaded within last 24 hours
Post by: plancast on February 09, 2015, 04:46:31 pm
Hi Allvip,

Thanks for getting back to me.  I need to know where to put for instance in functions.inc.php there is:

        $query = "SELECT COUNT(*)
                FROM {$CONFIG['TABLE_PICTURES']} AS r
                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON a.aid = r.aid
                $RESTRICTEDWHERE
                AND approved = 'YES'
                AND r.votes >= '{$CONFIG['min_votes_for_rating']}'";

Can I put somewhere a "WHERE ctime < 24hours" sort of command.

I really hope I have made sense.

Thanks,

Chris

Title: Re: Toprated images uploaded within last 24 hours
Post by: Αndré on February 09, 2015, 08:20:25 pm
I suggest to create a new meta album via a plugin, so you don't need to edit core files after each upgrade. Have a look at this (http://forum.coppermine-gallery.net/index.php/topic,63706.0.html) plugin to get an idea how it works, or simply extend the plugin to your needs.

But you'll have an issue with such a meta album. Imagine a user currently browses your custom meta album with pictures that where uploaded almost 24 hours ago. While viewing the album, some of the pictures can get "too old" and your visitors probably get a weird error message if they try to open such an image. To be honest, I haven't checked that yet, but I worked a lot with meta albums some years ago and I think I got something like that while playing around with the meta album feature.
Title: Re: Toprated images uploaded within last 24 hours
Post by: netb on February 09, 2015, 08:24:13 pm
You could check these:

http://forum.coppermine-gallery.net/index.php/topic,74690.0.html
http://forum.coppermine-gallery.net/index.php/topic,63706.0.html