forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: peterlustig on October 26, 2010, 03:41:20 pm

Title: Automatic redirection to first album page within a category
Post by: peterlustig on October 26, 2010, 03:41:20 pm
Dear all,

having migrated from 1.4.27 to 1.5.8 (also only with your help...) and having had a realm look on the features and built of the new coppermine, I have to say: THANK YOU! Looks and feels really good!

However, I still have some bugs/minor problems which I'd like to report (I am using Firefox 3.5), here's the second one:

2. Automatic redirection to first album page within a category
When having chosen an album on e.g. the third page of a category (e.g. album France in category Regions > Europe > France) and then clicking on the category again (i.e. "Europe") in order to view other albums, the album list start again on the first page of all albums of this category. As far as I can remember this was different in cpg 1.4.27, i.e. clicking on the category lead to the previously activated third page of the category "Europe". Is there any way to change the currently implemented behaviour?

Thanks a lot in advance for any help!

Best, Peter
Title: Re: Automatic redirection to first album page within a category
Post by: Αndré on October 29, 2010, 12:03:03 pm
Please post a link to your gallery so we can reproduce what you're talking about.
Title: Re: Automatic redirection to first album page within a category
Post by: peterlustig on October 29, 2010, 02:00:32 pm
Ich schicke Dir eine PN
Title: Re: Automatic redirection to first album page within a category
Post by: Αndré on October 29, 2010, 02:15:09 pm
Sending PMs has been disabled for regular users. Please post it here.
Title: Re: Automatic redirection to first album page within a category
Post by: peterlustig on October 29, 2010, 03:02:13 pm
Sorry for switching to German -- didn't pay attention.

My website is strictly private, I don't want to share a link to it on the www. I sent a private message to you before I read this, you once provided me with your email (you already helped me some time ago). In case this is not welcome, pls just ignore it. Don't want to hassle you.
Title: Re: Automatic redirection to first album page within a category
Post by: Αndré on October 29, 2010, 03:57:01 pm
As far as I can remember this was different in cpg 1.4.27, i.e. clicking on the category lead to the previously activated third page of the category "Europe".
For the record: it has been stored in the data cookie (value 'lap') in cpg1.4.x. I don't know why it has been removed or if it was intended at all.
Title: Re: Automatic redirection to first album page within a category
Post by: Αndré on October 29, 2010, 04:14:09 pm
It has been removed in r4578 (http://coppermine.svn.sourceforge.net/viewvc/coppermine/trunk/cpg1.5.x/index.php?r1=4245&r2=4578).

Please try the following. Open index.php, find
Code: [Select]
    /**
    * See if $page has been passed in GET
    */
    if (isset($page)) {
        $PAGE = max($page, 1);
    } else {
        $PAGE = 1;
    }
and replace with
Code: [Select]
    /**
    * See if $page has been passed in GET
    */
    if (isset($page)) {
        $PAGE = max($page, 1);
        $USER['lap'] = $PAGE;
    } elseif (isset($USER['lap'])) {
        $PAGE = max((int)$USER['lap'], 1);
    } else {
        $PAGE = 1;
    }

Not tested. Please report if it works or if any unexpected behavior occurs.
Title: Re: Automatic redirection to first album page within a category
Post by: peterlustig on November 01, 2010, 01:05:27 pm
Great, thanks a lot, this has done the job.

Thanks! Peter