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]   Go Down

Author Topic: need a plugin to view all the page number.  (Read 4320 times)

0 Members and 1 Guest are viewing this topic.

fotovagu

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
need a plugin to view all the page number.
« on: October 12, 2006, 10:57:34 pm »

i have lot of pages in my albums. is there any plugin to view all the page numbers in a dropdown menu, like they have in phpBB?
« Last Edit: October 14, 2006, 06:42:13 am by Paver »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: need a plugin to view all the page number.
« Reply #1 on: October 13, 2006, 03:23:16 pm »

no
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: need a plugin to view all the page number.
« Reply #2 on: October 13, 2006, 09:38:06 pm »

This sounds like it could be done with a theme customization (maybe the "create_tabs" function).  I don't know what phpBB does, so if you have a link to show this, that would be helpful.
Logged

fotovagu

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: need a plugin to view all the page number.
« Reply #3 on: October 13, 2006, 11:39:14 pm »

http://www.rlcforum.mv/forum/viewtopic.php?t=10

got to  page  [  ]    ... thing   :)
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: need a plugin to view all the page number.
« Reply #4 on: October 14, 2006, 06:41:11 am »

Here's a theme customization that should do what you want.

Add the following function to themes/yourtheme/theme.php:
Code: [Select]
function theme_create_tabs($items, $curr_page, $total_pages, $template)
{
        global $CONFIG, $lang_create_tabs;

        // Code for future: to implement 'previous' and 'next' tabs
        // Everything is set - just need to put in correct place and use correct prev & next page numbers
        // $tabs .= strtr( sprintf($template['inactive_prev_tab'],#PREV_PAGE_NUMBER#) , array('{PREV}' => $lang_create_tabs['previous']) );
        // $tabs .= strtr( sprintf($template['inactive_next_tab'],#NEXT_PAGE_NUMBER#) , array('{NEXT}' => $lang_create_tabs['next']) );

        $maxTab = $CONFIG['max_tabs'];

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

        $tabs = '';
        $tabs .= $template['tab_header'];
        if ($curr_page == 1) {
                $tabs .= sprintf($template['active_tab'], 1);
        } else {
                $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;
        }

        $tabs_dropdown = '<td class="navmenu" style="white-space: nowrap">Go to page <select onChange="if (this.options[this.selectedIndex].value != -1) { window.location.href = this.options[this.selectedIndex].value; }">';
        for ($page = 1; $page <= $total_pages; $page++) {
                if (preg_match('#href="(.*)"#siU', sprintf($template['inactive_tab'], $page, $page) , $matches)) {
                        $tabs_dropdown .= '<option value="' . $matches[1] . '"'
                                . ($page == $curr_page ? ' selected="selected"' : '') . '>' . $page .'</option>';
                }
        }
        $tabs_dropdown .= '</select><img src="images/spacer.gif" width="4" height="1" alt="" /></td>';

        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);
                }
        }
        return $tabs_left.$tabs_dropdown.$tabs.$template['tab_trailer'];
}

Moving this thread to the themes support board.
Logged

fotovagu

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: need a plugin to view all the page number.
« Reply #5 on: March 27, 2007, 09:29:29 am »

hi i know its been a long time since your post. i tried the above modification to my theme.php, when i apply that i dont see any page numbers.

could you please tell me where exactly i have to put these codes in the theme.php? im using hardwired theme

thank you inadvance  :)
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 16 queries.