http://www.icyphoenix.com/viewtopic...&p=28334#p28334
But I want to protect my album images and needed the watermark to show if I anyone used the links on other sites and I did not want anyone to know where my album pics where stored on my server
the add on above links directly to the folder on your server...
I have made this small piece of code work so that any image using the direct image link will show the picture with your watermark intact (if you are using one) Also if the image is clicked on it will direct the user back to your gallery where you are showing the image..(as long as it is set to public use else they will have to register..maybe a good thing but no image will show if it is set to registered or above for viewing)
Anyway here is the code... this is still using the tpl code from the above add-on with some small changes and a quick edit of showpage.php..
OPEN album_showpage.php
FIND
'U_PIC_FULL_URL' => $server_path . ALBUM_UPLOAD_PATH . $thispic['pic_filename'],
AFTER ADD
'U_PIC_FULL_HTTP' => 'http://' . $board_config['server_name'] . $board_config['script_path'] . 'album_showpage.' . $phpEx . '?' . pic_id . '=' . $pic_id,
'U_PIC_FULL_IMG' => '[url=http://' . $board_config['server_name'] . $board_config['script_path'] . 'album_showpage.' . $phpEx . '?' . pic_id . '=' . $pic_id . ']' . '[img]' . $server_path . 'album_pic.' . $phpEx . '?' . pic_id . '=' . $pic_id . '[/img]' . '[/url]',
'U_PIC_FULL_HTML' => '<a href=http://' . $board_config['server_name'] . $board_config['script_path'] . 'album_showpage.' . $phpEx . '?' . pic_id . '=' . $pic_id . '>' . '<img src=' . $server_path . 'album_pic.' . $phpEx . '?' . pic_id . '=' . $pic_id . ' width=250' . '/>' . '</a>',
L_DIRECT_LINKS => $lang['Direct_Links'],
L_PHOTO_LINKS => $lang['Photo_Links'],
L_FORUM_CODE => $lang['Forum_Links'],
L_HTML_CODE => $lang['Html_Links'],
'U_PIC_FULL_IMG' => '[url=http://' . $board_config['server_name'] . $board_config['script_path'] . 'album_showpage.' . $phpEx . '?' . pic_id . '=' . $pic_id . ']' . '[img]' . $server_path . 'album_pic.' . $phpEx . '?' . pic_id . '=' . $pic_id . '[/img]' . '[/url]',
'U_PIC_FULL_HTML' => '<a href=http://' . $board_config['server_name'] . $board_config['script_path'] . 'album_showpage.' . $phpEx . '?' . pic_id . '=' . $pic_id . '>' . '<img src=' . $server_path . 'album_pic.' . $phpEx . '?' . pic_id . '=' . $pic_id . ' width=250' . '/>' . '</a>',
L_DIRECT_LINKS => $lang['Direct_Links'],
L_PHOTO_LINKS => $lang['Photo_Links'],
L_FORUM_CODE => $lang['Forum_Links'],
L_HTML_CODE => $lang['Html_Links'],
OPEN templates/mg_themes/album_showpage_body.tpl
FIND
AFTER ADD
{IMG_THL}{IMG_THC}<span class="forumlink">{L_DIRECT_LINKS}</span>{IMG_THR}
<table cellspacing="1" cellpadding="2" border="0" align="center" class="forumlinenb" width="100%">
<tr align="center">
<td align="right" width="30%"><span class="gensmall">{L_PHOTO_LINKS}</span></td>
<td align="left"><input type="text" readonly onClick="this.select();" value="{U_PIC_FULL_HTTP}" size="65" style="background-color: #EFEFEF;" /></td>
</tr>
<tr>
<td align="right"><span class="gensmall">{L_FORUM_CODE}</span></td>
<td align="left"><input type="text" readonly onClick="this.select();" value="{U_PIC_FULL_IMG}" size="65" style="background-color: #EFEFEF;" /></td>
</tr>
<tr>
<td align="right"><span class="gensmall">{L_HTML_CODE}</span></td>
<td align="left"><input type="text" readonly onClick="this.select();" value="{U_PIC_FULL_HTML}" size="65" style="background-color: #EFEFEF;" /></td>
</tr>
</table>
{IMG_TFL}{IMG_TFC}{IMG_TFR}
<table cellspacing="1" cellpadding="2" border="0" align="center" class="forumlinenb" width="100%">
<tr align="center">
<td align="right" width="30%"><span class="gensmall">{L_PHOTO_LINKS}</span></td>
<td align="left"><input type="text" readonly onClick="this.select();" value="{U_PIC_FULL_HTTP}" size="65" style="background-color: #EFEFEF;" /></td>
</tr>
<tr>
<td align="right"><span class="gensmall">{L_FORUM_CODE}</span></td>
<td align="left"><input type="text" readonly onClick="this.select();" value="{U_PIC_FULL_IMG}" size="65" style="background-color: #EFEFEF;" /></td>
</tr>
<tr>
<td align="right"><span class="gensmall">{L_HTML_CODE}</span></td>
<td align="left"><input type="text" readonly onClick="this.select();" value="{U_PIC_FULL_HTML}" size="65" style="background-color: #EFEFEF;" /></td>
</tr>
</table>
{IMG_TFL}{IMG_TFC}{IMG_TFR}
OPEN language/your language file/lang_album_main.php
FIND
$lang['Pic_RDF'] = 'RSS Feed 1.0';
$lang['Pic_RSS'] = 'RSS Feed 2.0';
$lang['Pic_RSS'] = 'RSS Feed 2.0';
AFTER ADD
$lang['Direct_Links'] = 'Direct Photo Links';
$lang['Photo_Links'] = 'Direct Photo Links';
$lang['Forum_Links'] = 'Forum Code';
$lang['Html_Links'] = 'Html Code';
$lang['Photo_Links'] = 'Direct Photo Links';
$lang['Forum_Links'] = 'Forum Code';
$lang['Html_Links'] = 'Html Code';
On the html code I have added an image width of 250 in case other sites do not shrink images this can be removed by not including
in this line
'U_PIC_FULL_HTML' => '<a href=http://' . $board_config['server_name'] . $board_config['script_path'] . 'album_showpage.' . $phpEx . '?' . pic_id . '=' . $pic_id . '>' . '<img src=' . $server_path . 'album_pic.' . $phpEx . '?' . pic_id . '=' . $pic_id . ' width=250' . '/>' . '</a>',
Thats it obviously you can change the html code to however it fits your sit but now if your members link your album photos to other sites at least the watermark is present and your album pic files are safer..
here is an example using the bbcode tag..see that water mark is showing
Any problems...please let me know..
Enjoy