Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins
November 20, 2009, 11:55:03 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Private messages disabled
Caused by the massive abuse of the PM system in the past, the sending of personal messages has been disabled for all regular users on the Coppermine forum.
[more]
   Home   Help Search Board rules Login Register  
Pages: 1 2 3 [4]   Go Down
  Print  
Author Topic: add 'previous' and 'next' to page tabs.  (Read 34413 times)
0 Members and 1 Guest are viewing this topic.
net
Coppermine regular visitor
**
Posts: 88


« Reply #60 on: August 25, 2008, 08: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
****
Gender: Male
Posts: 1015



WWW
« Reply #61 on: August 28, 2008, 02:47:32 am »

@net

solution given in your other post here.
Logged

Did you read the manual first?Huh 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

Posts: 7


« Reply #62 on: September 02, 2008, 10: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
****
Gender: Male
United States United States

Posts: 1604


Paul Van Rompay


« Reply #63 on: December 15, 2008, 10: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
***
Gender: Male
Italy Italy

Posts: 537



WWW
« Reply #64 on: February 09, 2009, 02: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:
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, 04:11:21 pm by Ludo » Logged
Pages: 1 2 3 [4]   Go Up
  Print  
 
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.035 seconds with 17 queries.