coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Walkinman on February 20, 2006, 06:45:02 PM

Title: Assistance with modification nav bar add to lightbox
Post by: Walkinman 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:

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
Title: Re: Assistance with modification nav bar add to lightbox
Post by: Walkinman 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