coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: alanpalan on November 12, 2007, 10:00:00 AM

Title: movink link "add to favorites"
Post by: alanpalan 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!
Title: Re: movink link "add to favorites"
Post by: Joachim Müller on November 12, 2007, 03:16:00 PM
Related thread: adding pictures to favorites (http://forum.coppermine-gallery.net/index.php?topic=48178.0).
Moving thread accordingly.
Title: Re: movink link "add to favorites"
Post by: alanpalan on November 12, 2007, 04:29:45 PM
This is a different question.
Title: Re: movink link "add to favorites"
Post by: Joachim Müller 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.
Title: Re: movink link "add to favorites"
Post by: alanpalan on November 13, 2007, 04:02:01 PM
Ok, thanks. I hope somebody will answer me :)
Title: Re: movink link "add to favorites"
Post by: alanpalan on November 17, 2007, 02:19:49 PM
Still nobody knows?
Title: Re: movink link "add to favorites" [a solution]
Post by: pressurecooker 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:
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