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: Assistance with modification nav bar add to lightbox  (Read 3314 times)

0 Members and 1 Guest are viewing this topic.

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Assistance with modification nav bar add to lightbox
« on: February 20, 2006, 06:45:02 pm »

Hey folks,

A few weeks back I got some help tweaking my theme so that the "add to lightbox" button/option will appear in the Image Navigation Bar. Now, I'd like to modify that so that Nibblers modification regarding referrers will work. Here's the code as I changed it, from my theme.php:

Code: [Select]
function theme_html_img_nav_menu()
{
    global $CONFIG, $HTTP_SERVER_VARS, $HTTP_GET_VARS, $CURRENT_PIC_DATA, $PHP_SELF, $FAVPICS;  $REFERER;
    global $album, $cat, $pos, $pic_count, $lang_img_nav_bar, $lang_picinfo, $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'];

    $start = 0;
        $start_tgt = "{$_SERVER['PHP_SELF']}?album=$album$cat_link&pos=$start";
        $start_title = $lang_img_nav_bar['go_album_start'];
        $meta_nav .= "<link rel=\"start\" href=\"$start_tgt\" title=\"$start_title\" />
        ";
        $end = $pic_count - 1;
        $end_tgt = "{$_SERVER['PHP_SELF']}?album=$album$cat_link&amp;pos=$end";
        $end_title = $lang_img_nav_bar['go_album_end'];
        $meta_nav .= "<link rel=\"last\" href=\"$end_tgt\" title=\"$end_title\" />
        ";

    if ($pos > 0) {
        $prev = $pos - 1;
        $prev_tgt = "{$_SERVER['PHP_SELF']}?album=$album$cat_link&amp;pos=$prev";
        $prev_title = $lang_img_nav_bar['prev_title'];
                                $meta_nav .= "<link rel=\"prev\" href=\"$prev_tgt\" title=\"$prev_title\" />
                                ";
    } else {
        $prev_tgt = "javascript:;";
        $prev_title = "";
    }

    if ($pos < ($pic_count -1)) {
        $next = $pos + 1;
        $next_tgt = "{$_SERVER['PHP_SELF']}?album=$album$cat_link&amp;pos=$next";
        $next_title = $lang_img_nav_bar['next_title'];
                                $meta_nav .= "<link rel=\"next\" href=\"$next_tgt\" title=\"$next_title\"/>
                                ";
    } else {
        $next_tgt = "javascript:;";
        $next_title = "";
    }

    if (USER_CAN_SEND_ECARDS) {
        $ecard_tgt = "ecard.php?album=$album$cat_link&amp;pid=$pid&amp;pos=$pos";
        $ecard_title = $lang_img_nav_bar['ecard_title'];
    } else {
        template_extract_block($template_img_navbar, 'ecard_button'); // added to remove button if cannot send ecard
        /*$ecard_tgt = "javascript:alert('" . addslashes($lang_img_nav_bar['ecard_disabled_msg']) . "');";
        $ecard_title = $lang_img_nav_bar['ecard_disabled'];*/
    }

$ref = $REFERER ? "&amp;ref=$REFERER" : '';
if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
        $favorite = '<a href=addfav.php?pid=' . $CURRENT_PIC_DATA['pid'] . $ref . ' ><img src="images/addlight.jpg" align="middle" border="0" alt="" title="'. $lang_picinfo['addFav'] . '" /></a>';
    } else {
        $favorite = '<a href=addfav.php?pid=' . $CURRENT_PIC_DATA['pid'] . $ref . ' ><img src="images/remlight.jpg" align="middle" border="0" alt="" title="'. $lang_picinfo['remFav'] . '" /></a>';
    }


I also made the changes in addfav.php as he suggested in the "bugs" forum.

If someone could help me out with what I'm doing wrong, or why this isn't working for me, that'd be great.

Thank you.

Cheers

Carl
« Last Edit: February 20, 2006, 07:37:27 pm by Nibbler »
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Assistance with modification nav bar add to lightbox
« Reply #1 on: February 20, 2006, 07:11:49 pm »

Hey folks,

I fixed it. I had a ; when I should've had a , after $FAVPICS, in the 2nd line.

Everything's working fine now.

You can delete or mark this thread solved, as you see fit.

Thank you.

Cheers

Carl
Logged
Pages: [1]   Go Up
 

Page created in 0.014 seconds with 15 queries.