News:

CRITICAL UPGRADE CPG RELEASE 1.6.30
Version 1.6.30 removes a serious security issue that could allow unauthorized access to modify your site. Upgrade as soon as possible.

Main Menu

"Add to favourites" in Image Navigation bar

Started by d.l.h, December 22, 2004, 06:26:48 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

d.l.h

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

donnoman

theme.php; $template_img_navbar;  find:  (This is using classic)

               <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:

               <td align="center" valign="middle" class="navmenu" width="48">
                       {FAVORITE}
               </td>


displayimage.php; function html_img_nav_menu; find:

   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:

   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:

   } 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)

   
   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:

       '{THUMB_TITLE}' => $lang_img_nav_bar['thumb_title'],


Add after it:

       '{FAVORITE}' => $favorite,