movink link "add to favorites" movink link "add to favorites"
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

movink link "add to favorites"

Started by alanpalan, November 12, 2007, 10:00:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alanpalan

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

Joachim Müller


alanpalan


Joachim Müller

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.

alanpalan

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

alanpalan


pressurecooker

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:
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:
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:
$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:
$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:
$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:
$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
Join the green campaign - Environmental Articles