Quick q about content on the main page Quick q about content on the main page
 

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

Quick q about content on the main page

Started by fran86, August 15, 2014, 01:08:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fran86

Is it possible to have last created albums instead of last updated albums? - I find myself adding photos to very old albums, and it looks as if I have a gallery that hasn't been updated in a while (even though the dates underneath). I would still like to have the most recent stuff first.

Αndré

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

Quote from: Αndré on February 11, 2010, 03:34:53 PM
  • newalb: New albums (differs from 'lastalb', as it uses chosen album thumbnail as thumbnail and also its upload time instead of the upload time of the latest file)

fran86


fran86

Sorry, it's a plugin. I'll install it first, that might help. :)

fran86

Third reply; sorry.

I installed it. It's showing up with no titles and albums that I have created last year (that I added to today). I might not be working with the latest coppermine?

Αndré

If I remember correctly you need to set an album thumbnail. If you set "random thumbnail", the album won't appear in the list.

fran86

Quote from: Αndré on August 15, 2014, 11:58:36 AM
If I remember correctly you need to set an album thumbnail. If you set "random thumbnail", the album won't appear in the list.

Yes, that fixed it :) How do I add the title? People don't know what album they're clicking on?

Αndré

For some reason it works out of the box in my live gallery, but I get the same result like you in my testbed (probably related to the gallery settings). However, we can fix this in the plugin code.

Open codebase.php, find
            $query = "SELECT p.*, alb_hits AS hits  FROM {$CONFIG['TABLE_PICTURES']} AS p
                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid
                $RESTRICTEDWHERE
                AND approved = 'YES'
                AND p.pid = r.thumb
                ORDER BY ctime DESC
                {$meta['limit']}";
            $result = cpg_db_query($query);
            $rowset = cpg_db_fetch_rowset($result);
            mysql_free_result($result);

            build_caption($rowset, array('ctime'));
            break;

        case 'randalb': // Random albums

and replace with
            $query = "SELECT p.*, alb_hits AS hits, r.title as title  FROM {$CONFIG['TABLE_PICTURES']} AS p
                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid
                $RESTRICTEDWHERE
                AND approved = 'YES'
                AND p.pid = r.thumb
                ORDER BY ctime DESC
                {$meta['limit']}";
            $result = cpg_db_query($query);
            $rowset = cpg_db_fetch_rowset($result);
            mysql_free_result($result);

            build_caption($rowset, array('ctime', 'title'));
            break;

        case 'randalb': // Random albums

fran86


Αndré

Please
Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
tag your thread as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.