add 'previous' and 'next' to page tabs. - Page 2 add 'previous' and 'next' to page tabs. - Page 2
 

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

Main Menu

add 'previous' and 'next' to page tabs.

Started by yoshikiwei, July 22, 2004, 07:26:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hein Traag

Has someone managed to put the next and forward above the thumbnails yet ? Or is that something which can't be done nicely ?

steverobbins

It works a treat!  Thanks for this mod, I've been thinking about how to make this work for a while.

Live example at http://www.steverobbins.co.uk/gallery/thumbnails.php?album=2&page=23

Cheers,
Steve.

xpurtwitness

yikes!  i just made the changes, and i'm getting major errors.  http://stedfast.net/gallery

any thoughts?

modtang

Thanks for this hack. I wanted to add something like this and it was so simple to do. Much appreciated.  ;D

As for those errors, I'm gonna take a stab at it and say you're only replacing the one line in functions and not the WHOLE function.

Quotein functions.inc.php, find the function
function create_tabs($items, $curr_page, $total_pages, $template)
replace the WHOLE function with...

The whole function starts at the above code and ends at
        return $tabs.$template['tab_trailer'];
}

xpurtwitness

wonderful!  i thought it was weird that there wasn't an ending described.  so it seems to work.  however, i don't see the current page number highlighted...  well it seems it is technically a different color, but i think i need a bigger contrast.  what element will i need to change the assigned color for?

xpurtwitness

well i think i have it...the tableb_compact class.  however, it also influences the descriptions on the main page...

modtang

#26
How does it influence the description? I didn't notice any change with my gallery. You were right though. Under

.tableb_compact

change

background: #515b67;

to whatever you want it to be.

Working example: http://carminegiovinazzo.net/gallery/

Quote from: Hein on May 11, 2005, 05:38:27 PM
Has someone managed to put the next and forward above the thumbnails yet ? Or is that something which can't be done nicely ?

Isn't this what the filmstrip does?

pious

I must have done something wrong.  I was successful at adding the PREV/NEXT to my page, but now I've lost the numbers.  What did I do wrong?  Or, better yet, how can I get the numbers back and still have the PREV/NEXT on each page?

Please advise.   :-\\

snork13

#28
Quote from: pious on August 17, 2005, 04:22:04 PM
I must have done something wrong.  I was successful at adding the PREV/NEXT to my page, but now I've lost the numbers.  What did I do wrong?  Or, better yet, how can I get the numbers back and still have the PREV/NEXT on each page?

Please advise.   :-\\

i would try it again from your backup file, if you don't get that time, post what you've done so far.

-snork

below is the theme.php part, should help!

    $theme_thumb_tab_tmpl = $template_tab_display;

    if ($mode == 'thumb') {
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['pic_on_page']));
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . '&page=%d'));
        $theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . '&page=%d'));
        $theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . '&page=%d'));
    } else {
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
        $theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
        $theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
    }

PKfanSteph

I made the changes and am getting the error:

QuoteParse error: parse error, unexpected T_STRING in /usr/local/psa/home/vhosts/playthrume.com/httpdocs/photos/include/functions.inc.php on line 202

Any ideas?  I'm using a modified version of the Digital Red theme.

yoshikiwei

Quote from: pious on August 17, 2005, 04:22:04 PM
I must have done something wrong.  I was successful at adding the PREV/NEXT to my page, but now I've lost the numbers.  What did I do wrong?  Or, better yet, how can I get the numbers back and still have the PREV/NEXT on each page?

Please advise.   :-\\

Yes I would recommend that you do a backup from the old files and try the mod all over again.

yoshikiwei

Quote from: PKfanSteph on August 18, 2005, 08:34:56 AM
I made the changes and am getting the error:

QuoteParse error: parse error, unexpected T_STRING in /usr/local/psa/home/vhosts/playthrume.com/httpdocs/photos/include/functions.inc.php on line 202

Any ideas?  I'm using a modified version of the Digital Red theme.

What's on line 202 of your functions.inc.php ?

xplicit

Anybody did this for the userlist aswell?

I'll try myself and post the code here if I succeed   :D
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

xplicit

#33
Ok well shame on me for asking it was too easy.....

find in usermgr.php:

$tab_tmpl = array('left_text' => '<td width="100%%" align="left" valign="middle" class="tableh1_compact" style="white-space: nowrap"><b>' . $lang_usermgr_php['u_user_on_p_pages'] . '</b></td>' . "\n",
        'tab_header' => '',
        'tab_trailer' => '',
        'active_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%d</b></td>',
        'inactive_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="' . $PHP_SELF . '?page=%d&sort=' . $sort . '"<b>%d</b></a></td>' . "\n"
        );


replace by:

$tab_tmpl = array('left_text' => '<td width="100%%" align="left" valign="middle" class="tableh1_compact" style="white-space: nowrap"><b>' . $lang_usermgr_php['u_user_on_p_pages'] . '</b></td>' . "\n",
'tab_header' => '',
'tab_trailer' => '',
'active_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%d</b></td>',
'inactive_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="' . $PHP_SELF . '?page=%d&sort=' . $sort . '"<b>%d</b></a></td>' . "\n",
'active_next_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%s</b></td>',
'inactive_next_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="' . $PHP_SELF . '?page=%d&sort=' . $sort . '"<b>%s</b></a></td>',
'active_prev_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%s</b></td>',
'inactive_prev_tab' => '<td><img src="images/spacer.gif" width="1" height="1"></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="' . $PHP_SELF . '?page=%d&sort=' . $sort . '"<b>%s</b></a></td>',
);
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

PKfanSteph

Quote from: modtang on July 18, 2005, 03:02:53 PM

Quote from: Hein on May 11, 2005, 05:38:27 PM
Has someone managed to put the next and forward above the thumbnails yet ? Or is that something which can't be done nicely ?

Isn't this what the filmstrip does?


I like this next/previous part, but my biggest problem is users who just look at the thumbnails page and don't go to the full size image until they see something they like.  My image views count always decreases after the initial page of thumbnails.   Adding the filmstrip doesn't help in this case.  I still would prefer the numbers AND the next / previous links both above and below the thumbnails.  Picky, aren't I?  ;).  Just a personal preference, I suppose.

sion3000

#35
EDIT: Sorry just managed to fix this. I didnt edit enough of the code in the functions.inc.php finaly got it working. Great hack.
If anyone gets notices when they are not in debug mode for this hack check that the last thing after the final bit of code it /** or something simelar.
Keep up good work everyone.!!!


Hello

I have added the new previous and next into my code. But i am now getting notices appear. My seeting for "Show notices in debug" is shwitched off + im not even running in debug mode. Is there any way of turning off these notices off in normal mode ?

My lines ive got problems with:

Notice: Undefined index: max_tabs in /files/home2/sion3000/include/functions.inc.php on line 267
Notice: Undefined variable: template in /files/home2/sion3000/include/functions.inc.php on line 269
Notice: Undefined variable: items in /files/home2/sion3000/include/functions.inc.php on line 269
Notice: Undefined variable: total_pages in /files/home2/sion3000/include/functions.inc.php on line 269
Notice: Undefined variable: total_pages in /files/home2/sion3000/include/functions.inc.php on line 270
Notice: Undefined variable: template in /files/home2/sion3000/include/functions.inc.php on line 272
Notice: Undefined variable: curr_page in /files/home2/sion3000/include/functions.inc.php on line 273
Notice: Undefined variable: template in /files/home2/sion3000/include/functions.inc.php on line 276
Notice: Undefined variable: total_pages in /files/home2/sion3000/include/functions.inc.php on line 278
Notice: Undefined variable: total_pages in /files/home2/sion3000/include/functions.inc.php on line 284
Notice: Undefined variable: total_pages in /files/home2/sion3000/include/functions.inc.php on line 293
Notice: Undefined variable: template in /files/home2/sion3000/include/functions.inc.php on line 300

Any sugestions anyone ?

I have a while back upgraded from 1.2 --> 1.33 without any problems + have the pay pal shop hack in my theme.

Thanks

Sion

Oh my site is www.coolshots.co.uk

thanks

Joachim Müller

turn off notices if they don't mean anything to you.

COS@RIN

For all you 1.4x people.

This seems to work fantastically in the beta version now.

One of the Dev Team must have sorted it, however all the code posted by Yoshikiwei is allready in the file codes except the first alteration in themes.php. The only thing to remember is that if you have used the classic template as your base then the thems.php file is in the includes folder and called themes.inc.php

Thanks DEV team for a fantastic gallery.


COSARIN

AWJunkies

Yep works perfect for 1.4.3

Most of the editing is already done with theme.inc.php, very easy mod takes 2 minutes if that.

CypherBit