Advanced search  

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

Pages: [1]   Go Down

Author Topic: [req] Permanent $prev and $next functions  (Read 3254 times)

0 Members and 1 Guest are viewing this topic.

Lombi

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 25
  • Never lick a gift horse in the mouth.
    • Surreal Art Prints
[req] Permanent $prev and $next functions
« on: September 27, 2004, 06:29:52 pm »

The previous and next functions in displayimage.php is probably the simplest thing i saw in coppemine as of yet :)

This is what I'm talking about:
Code: [Select]
function html_img_nav_menu()
{
    global $CONFIG, $HTTP_SERVER_VARS, $HTTP_GET_VARS, $CURRENT_PIC_DATA, $PHP_SELF;
    global $album, $cat, $pos, $pic_count, $lang_img_nav_bar, $lang_text_dir, $template_img_navbar;

    $cat_link = is_numeric($album) ? '' : '&cat=' . $cat;

    $human_pos = $pos + 1;
    $page = ceil(($pos + 1) / ($CONFIG['thumbrows'] * $CONFIG['thumbcols']));
    $pid = $CURRENT_PIC_DATA['pid'];

    if ($pos > 0) {
        $prev = $pos - 1;
        $prev_tgt = "$PHP_SELF?album=$album$cat_link&pos=$prev";
        $prev_title = $lang_img_nav_bar['prev_title'];
    } else {
        $prev_tgt = "javascript:;";
        $prev_title = "";
    }
    if ($pos < ($pic_count -1)) {
        $next = $pos + 1;
        $next_tgt = "$PHP_SELF?album=$album$cat_link&pos=$next";
        $next_title = $lang_img_nav_bar['next_title'];
    } else {
        $next_tgt = "javascript:;";
        $next_title = "";
    }

The function just adds and subtracts a number from the picture "default positioning" and that's kinda it.
As now an amazing mod_rewrite hack and a constant pid hack are available I was wondering if anyone knows how to rewrite this function to look at the album and do the same result (linking to the same images and in the same order), only this time with PIDs...

I am trying to accomplish something similar myself but I'm aware that here are some amazingly talented programmers who can do the job much better/faster than me :P

If you're looking for a challenge than this might be an interesting goal ;D
Logged
While you are looking at some surreal art prints or just some surrealistic art you might get yourself some windows xp boot screens.

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: [req] Permanent $prev and $next functions
« Reply #1 on: September 27, 2004, 06:33:16 pm »

Moving this to requests board.
Logged
Pages: [1]   Go Up
 

Page created in 0.028 seconds with 20 queries.