I've successfully implemented this hack into Coppermine v1.4.18 -- the trick here is that "yourtemplate.php" apparently no longer exists. (It looks like the PREV / NEXT tab functionality is being built into the code, but hasn't yet debuted as the default or as a Config option.)
Open include/functions.inc.php and replace the full function as indicated in post #3 of this thread. Find:
function create_tabs($items, $curr_page, $total_pages, $template)
{
global $CONFIG, $lang_create_tabs;
// TO-DO: Need to add theme_create_tabs() to sample/theme.php
// Maybe this function create_tabs() should be moved to themes.inc.php and renamed theme_create_tabs()?
if (function_exists('theme_create_tabs')) {
return theme_create_tabs($items, $curr_page, $total_pages, $template);
}
// 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 = 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 {
$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);
}
}
return $tabs.$template['tab_trailer'];
}
... and replace with:
function create_tabs($items, $curr_page, $total_pages, $template)
{
global $CONFIG;
if (function_exists('theme_create_tabs')) {
theme_create_tabs($items, $curr_page, $total_pages, $template);
return;
}
$maxTab = $CONFIG['max_tabs'];
$tabs = sprintf($template['left_text'], $items, $total_pages);
if (($total_pages == 1)) return $tabs;
$tabs .= $template['tab_header'];
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;
}
//display prev page tab
if ($curr_page != ($start-1)) {
$tabs .= sprintf($template['inactive_prev_tab'], $curr_page-1, "Prev");
} else {
$tabs .= sprintf($template['active_prev_tab'], "Prev");
}
if ($curr_page == 1) {
$tabs .= sprintf($template['active_tab'], 1);
} else {
$tabs .= sprintf($template['inactive_tab'], 1, 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);
}
}
//display next page tab
if ($curr_page != $total_pages) {
$tabs .= sprintf($template['inactive_next_tab'], $curr_page+1, "Next");
} else {
$tabs .= sprintf($template['active_next_tab'], "Next");
}
return $tabs.$template['tab_trailer'];
}
Then, open includes/themes.inc.php and replace {PREV} with PREV and {NEXT} with NEXT (or however you want to style them) to get rid of the curly brackets.
Thanks, everyone!