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: movink link "add to favorites"  (Read 7501 times)

0 Members and 1 Guest are viewing this topic.

alanpalan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
movink link "add to favorites"
« on: November 12, 2007, 10:00:00 am »

I'd like to move link "add favorites" to some more visible place (see attached jpeg). How can I do this? Thanks!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: movink link "add to favorites"
« Reply #1 on: November 12, 2007, 03:16:00 pm »

Related thread: adding pictures to favorites.
Moving thread accordingly.
Logged

alanpalan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: movink link "add to favorites"
« Reply #2 on: November 12, 2007, 04:29:45 pm »

This is a different question.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: movink link "add to favorites"
« Reply #3 on: November 12, 2007, 05:31:26 pm »

I'm aware of this, that's why it is OK that you started a new thread. I just posted a moderator comment that explained why I moved your new thread and what your original question used to be as a reference. I'm just too busy to come up with the actual answer, so this thread is open for other supporters to look into.
Logged

alanpalan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: movink link "add to favorites"
« Reply #4 on: November 13, 2007, 04:02:01 pm »

Ok, thanks. I hope somebody will answer me :)
Logged

alanpalan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: movink link "add to favorites"
« Reply #5 on: November 17, 2007, 02:19:49 pm »

Still nobody knows?
Logged

pressurecooker

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 35
    • Environmental Articles
Re: movink link "add to favorites" [a solution]
« Reply #6 on: April 16, 2008, 02:33:19 pm »

I am aware this is an old post but as I have find other similar posts linking to this post, I hope it is OK to reply here.
I was having the same problem and I think I have had some success. However, please treat it as a test only and consider everything before using it online.

1. Open theme.php and find the function called theme_html_picture(). The start of it looks something like:
Code: [Select]
function theme_html_picture()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER;
After the changes it should be like this. Note that I added $FAVPICS to the list:
Code: [Select]
function theme_html_picture()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $FAVPICS, $USER;

2. Find the variable called $params;
3. Before that variable insert this:
Code: [Select]
$ref = $REFERER ? "&ref=$REFERER" : '';
    if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
        $myFave[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . $ref . "\" >" . $lang_picinfo['addFav'] . '</a>';
    } else {
        $myFave[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid']  . $ref . "\" >" . $lang_picinfo['remFav'] . '</a>';
    }
4. Edit the $params
Old code:
Code: [Select]
$params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        '{PICINFO}' => $CURRENT_PIC_DATA['info'],
        );
New code:
Code: [Select]
$params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        '{PICINFO}' => $CURRENT_PIC_DATA['info'],
        '{FAVES}' => $myFave[$lang_picinfo['addFavPhrase']],
        );
5. Scroll up and find "// HTML template for intermediate image display"
6. Depending on what you want, insert the {FAVES} where you like. My code looks like this:
Code: [Select]
$template_display_media = <<<EOT
        <tr>
                <td align="center" valign="top" class="display_media" nowrap="nowrap">
                        <table cellspacing="2" cellpadding="0" class="imageborder">
                                <tr>
                                        <td align="center">
                                                {FAVES}<br>{IMAGE}<br>
{PICINFO}<br>{ADMIN_MENU}<br>
                                        </td>
                                </tr>
                        </table>
Now the Add/Remove favs will be at the top of the image. If you want it right below the image, obviously, add the {FAVES} after the {IMAGE}

Now I am left with a single problem. I would like to have my Add/Remove favourites near the "Return to the thumbnails" icon. I know that this involves touching the themes.ini.php but still... maybe somebody could help me with that. Thanks
Logged
Join the green campaign - Environmental Articles
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 19 queries.