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: "Add to favourites" in Image Navigation bar  (Read 3734 times)

0 Members and 1 Guest are viewing this topic.

d.l.h

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
    • http://www.d-l-h.net
"Add to favourites" in Image Navigation bar
« 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
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: "Add to favourites" in Image Navigation bar
« Reply #1 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,

Logged
Pages: [1]   Go Up
 

Page created in 0.044 seconds with 19 queries.