forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: d.l.h on December 22, 2004, 06:26:48 pm

Title: "Add to favourites" in Image Navigation bar
Post by: d.l.h on December 22, 2004, 06:26:48 pm
I'd like to have the "add to favourites" link in the Navigation bar (where there are next picture, previous picturte, slideshow,...). How can this be done?

Greets
Martin
Title: Re: "Add to favourites" in Image Navigation bar
Post by: donnoman on December 23, 2004, 06:31:03 am
theme.php; $template_img_navbar;  find:  (This is using classic)
Code: [Select]
               <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{ECARD_TGT}" title="{ECARD_TITLE}"><img src="images/ecard.gif" width="16" height="16" border="0" align="absmiddle" alt="{ECARD_TITLE}"></a>
                </td>

add after it:
Code: [Select]
               <td align="center" valign="middle" class="navmenu" width="48">
                        {FAVORITE}
                </td>

displayimage.php; function html_img_nav_menu; find:
Code: [Select]
   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;

change to:
Code: [Select]
   global $CONFIG, $HTTP_SERVER_VARS, $HTTP_GET_VARS, $CURRENT_PIC_DATA, $PHP_SELF, $FAVPICS;
    global $album, $cat, $pos, $pic_count, $lang_img_nav_bar, $lang_picinfo, $lang_text_dir, $template_img_navbar;

same function; find:
Code: [Select]
   } else {
        $ecard_tgt = "javascript:alert('" . addslashes($lang_img_nav_bar['ecard_disabled_msg']) . "');";
        $ecard_title = $lang_img_nav_bar['ecard_disabled'];
    }

add after it:  (you are going to want to make this pretty after you get it working)
Code: [Select]
   
    if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
        $favorite = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . "\">" . $lang_picinfo['addFav'] . '</a>';
    } else {
        $favorite = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . "\">" . $lang_picinfo['remFav'] . '</a>';
    }

same function; find:
Code: [Select]
       '{THUMB_TITLE}' => $lang_img_nav_bar['thumb_title'],

Add after it:
Code: [Select]
       '{FAVORITE}' => $favorite,