Advanced search  

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]

Pages: 1 2 3 [4]   Go Down

Author Topic: add 'previous' and 'next' to page tabs.  (Read 81179 times)

0 Members and 1 Guest are viewing this topic.

net

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: add 'previous' and 'next' to page tabs.
« Reply #60 on: August 25, 2008, 09:56:39 am »

Anyone who has successfully added this hack to theme "chaoticsoul" http://forum.coppermine-gallery.net/index.php/topic,39753.0.html

I've tried to but i cannot get it to work, any ideas?

Thanks.
Logged

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: add 'previous' and 'next' to page tabs.
« Reply #61 on: August 28, 2008, 03:47:32 am »

@net

solution given in your other post here.
Logged
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

Oli_Pavitt

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: add 'previous' and 'next' to page tabs.
« Reply #62 on: September 02, 2008, 11:22:14 am »

Guys have this code working apart from the front page when the URL reads http://www.mysite.co.uk/pictures/index.php. If the URL reads http://www.mysite.co.uk/pictures//index.php?cat=2&page=1 then the code works.

Anyone know how to get the code to work when its running as just the index.php address?

Coppermine Photo Gallery 1.4.18
Edited: functions.inc.php as per 1st page.

Have not edited my themes.inc.php as adding the changes noted causes the add on to fail.

Hope you can help, Oli
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: add 'previous' and 'next' to page tabs.
« Reply #63 on: December 15, 2008, 11:10:03 am »

FYI: Previous and next tabs, plus a dropdown list of all pages has been added to the upcoming 1.5 version.  You can check out the code using Subversion (SVN), but it's still alpha so don't use 1.5 on production sites.  You can look at what was done in $template_tab_display and function theme_create_tabs in the sample theme and see if it works in 1.4.x.  I haven't tested that and don't plan to as we are all working hard on 1.5.

This is just a notice.  I will not be providing any support as this is a "No Support" board.
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: add 'previous' and 'next' to page tabs.
« Reply #64 on: February 09, 2009, 03:52:45 pm »

I've read the whole thread and there seems to be a bit of mess about how to accomplish previous and next tabs.
As of today (CPG 1.4.20), the one and only edit needed is to copy and paste the following function just before the end of themes/your_theme/theme.php:
Code: [Select]
function theme_create_tabs($items, $curr_page, $total_pages, $template)
{
        global $CONFIG, $lang_create_tabs;

        $maxTab = $CONFIG['max_tabs'];

        $tabs = sprintf($template['left_text'], $items, $total_pages);
        if (($total_pages == 1)) return $tabs;

        $tabs .= $template['tab_header'];
        if ($curr_page == 1) {
                $tabs .= sprintf($template['active_tab'], 1);
        } else {
                if ($curr_page > 1) $tabs .= strtr( sprintf($template['inactive_prev_tab'], $curr_page-1) , array('{PREV}' => $lang_create_tabs['previous']) );         
                $tabs .= sprintf($template['inactive_tab'], 1, 1);
        }
        if ($total_pages > $maxTab){
                $start = max(2, $curr_page - floor(($maxTab -2)/2));
                $start = min($start, $total_pages - $maxTab +2);
                $end = $start + $maxTab -3;
        } else {
                $start = 2;
                $end = $total_pages-1;
        }
        for ($page = $start ; $page <= $end; $page++) {
                if ($page == $curr_page) {
                        $tabs .= sprintf($template['active_tab'], $page);
                } else {
                        $tabs .= sprintf($template['inactive_tab'], $page, $page);
                }
        }
        if ($total_pages > 1) {
                if ($curr_page == $total_pages) {
                        $tabs .= sprintf($template['active_tab'], $total_pages);
                } else {
                        $tabs .= sprintf($template['inactive_tab'], $total_pages, $total_pages);
                        $tabs .= strtr( sprintf($template['inactive_next_tab'], $curr_page+1) , array('{NEXT}' => $lang_create_tabs['next']) );                       
                }
        }
        return $tabs.$template['tab_trailer'];
}
I'm using this mod in my gallery without any trouble, so far.
« Last Edit: February 10, 2009, 05:11:21 pm by Ludo »
Logged
Pages: 1 2 3 [4]   Go Up
 

Page created in 0.022 seconds with 20 queries.