[req] Permanent $prev and $next functions [req] Permanent $prev and $next functions
 

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]

Main Menu

[req] Permanent $prev and $next functions

Started by Lombi, September 27, 2004, 06:29:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lombi

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:
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
While you are looking at some surreal art prints or just some surrealistic art you might get yourself some windows xp boot screens.

Tranz