coppermine-gallery.com/forum

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)

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