"Next" button not generating correct link "Next" button not generating correct link
 

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

"Next" button not generating correct link

Started by Shane, December 21, 2008, 03:25:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Shane

I hope I have posted this in the correct forum.  I apologize if I have not.

Site: http://shaneandpamela.com/cpg
CPG version 1.4.19

I have applied the hack found here to my gallery in order to add "PREV" and "NEXT" buttons to my page tabs.

The hack works PERFECTLY, EXCEPT when page tabs are generated on the gallery home page (when there are more albums in a gallery than config is set to show on the home page).  You can see this at the site listed above.  I currently have config set to show two albums per category on the main page.

On every other gallery page the page tabs appear, the NEXT button works correctly and links to the next page of the category, album, etc.

On the main page, the NEXT button gives me this link:  http://www.shaneandpamela.com/cpg/{LINK}

This error occurs in every theme I have installed in this gallery.

Can someone point me to the fix for this?  I've been through the sample theme/theme.php to see if there is another mention of the {NEXT} and {PREV} buttons other than those mentioned in the // Template used for tabbed display portion of the theme.php file, but I cannot find any other mention that would seem to fix this problem.  Please remember I know about as much coding as I know brain surgery.

Thanks for any help!

Shane

Fixed it.  Had to add two additional lines not mentioned in the original hack:

In yourtheme.php, find:
$theme_alb_list_tab_tmpl['left_text'] = strtr($theme_alb_list_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_album_list['album_on_page']));
    $theme_alb_list_tab_tmpl['inactive_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));


after these lines, add:
$theme_alb_list_tab_tmpl['inactive_next_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
    $theme_alb_list_tab_tmpl['inactive_prev_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));


If you cannot find the lines above, copy the // Function to display first level Albums of a category from sample theme/theme.php into yourtheme/theme.php and then modify as such.