Automatic redirection to first album page within a category Automatic redirection to first album page within a category
 

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

Automatic redirection to first album page within a category

Started by peterlustig, October 26, 2010, 03:41:20 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

peterlustig

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

Αndré

Please post a link to your gallery so we can reproduce what you're talking about.

peterlustig


Αndré

Sending PMs has been disabled for regular users. Please post it here.

peterlustig

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.

Αndré

Quote from: peterlustig on October 26, 2010, 03:41:20 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.

Αndré

It has been removed in r4578.

Please try the following. Open index.php, find
    /**
    * See if $page has been passed in GET
    */
    if (isset($page)) {
        $PAGE = max($page, 1);
    } else {
        $PAGE = 1;
    }

and replace with
    /**
    * 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.

peterlustig

Great, thanks a lot, this has done the job.

Thanks! Peter