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: Quick q about content on the main page  (Read 6191 times)

0 Members and 1 Guest are viewing this topic.

fran86

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Quick q about content on the main page
« 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Quick q about content on the main page
« Reply #1 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)
Logged

fran86

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Re: Quick q about content on the main page
« Reply #2 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.
Logged

fran86

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Quick q about content on the main page
« Reply #3 on: August 15, 2014, 11:33:49 am »

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

fran86

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Quick q about content on the main page
« Reply #4 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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Quick q about content on the main page
« Reply #5 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.
Logged

fran86

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Re: Quick q about content on the main page
« Reply #6 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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Quick q about content on the main page
« Reply #7 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
Logged

fran86

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Quick q about content on the main page
« Reply #8 on: August 15, 2014, 01:15:40 pm »

Perfect! Thankyou! :)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Quick q about content on the main page
« Reply #9 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 21 queries.