forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 plugins => Topic started by: fran86 on August 15, 2014, 01:08:19 am

Title: Quick q about content on the main page
Post by: fran86 on August 15, 2014, 01:08:19 am
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.
Title: Re: Quick q about content on the main page
Post by: Αndré on August 15, 2014, 10:52:20 am
http://forum.coppermine-gallery.net/index.php/topic,63706.0.html

  • 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)
Title: Re: Re: Quick q about content on the main page
Post by: fran86 on August 15, 2014, 11:32:28 am
http://forum.coppermine-gallery.net/index.php/topic,63706.0.html

Thankyou. I have tried this but it doesn't seem to work. There is nothing that shows up/no group of albums.
Title: Re: Quick q about content on the main page
Post by: fran86 on August 15, 2014, 11:33:49 am
Sorry, it's a plugin. I'll install it first, that might help. :)
Title: Re: Quick q about content on the main page
Post by: fran86 on August 15, 2014, 11:39:13 am
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?
Title: Re: Quick q about content on the main page
Post by: Α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.
Title: Re: Re: Quick q about content on the main page
Post by: fran86 on August 15, 2014, 12:25:10 pm
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?
Title: Re: Quick q about content on the main page
Post by: Αndré on August 15, 2014, 12:52:18 pm
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
Code: [Select]
            $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
Code: [Select]
            $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
Title: Re: Quick q about content on the main page
Post by: fran86 on August 15, 2014, 01:15:40 pm
Perfect! Thankyou! :)
Title: Re: Quick q about content on the main page
Post by: Αndré on August 15, 2014, 01:23:37 pm
Please
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.