Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: "Next" button not generating correct link  (Read 3166 times)

0 Members and 1 Guest are viewing this topic.

Shane

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 76
  • Choose Again
    • The Philmont Forum
"Next" button not generating correct link
« 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 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!
Logged

Shane

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 76
  • Choose Again
    • The Philmont Forum
Re: "Next" button not generating correct link
« Reply #1 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.