forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Shane on December 21, 2008, 03:25:49 pm

Title: "Next" button not generating correct link
Post by: Shane on December 21, 2008, 03:25:49 pm
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 (http://forum.coppermine-gallery.net/index.php/topic,8166.40.html) 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: 
Code: [Select]
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!
Title: Re: "Next" button not generating correct link
Post by: Shane on December 21, 2008, 04:27:13 pm
Fixed it.  Had to add two additional lines not mentioned in the original hack:

In yourtheme.php, find:
Code: [Select]
$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:
Code: [Select]
$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.