在上一篇
幫圖片加上"護貝" 後,現在來幫中級圖片也加上"護貝" 吧......^^"
測試用CPG版本:1.42
修改:/include/themes.inc.php
找到:
$pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
在下面一行加入:
//中級圖片加上護貝
if (($winsizeX > $winsizeY) or ($winsizeX == $winsizeY))
{
$wx = 0;
$hy = 0;
$wx = round(($winsizeX/($winsizeX/$CONFIG['picture_width'])));
$hy = round(($winsizeY/($winsizeX/$CONFIG['picture_width'])));
}else{
$wx = 0;
$hy = 0;
$wx = round(($winsizeX/($winsizeY/$CONFIG['picture_width'])));
$hy = round(($winsizeY/($winsizeY/$CONFIG['picture_width'])));
}
//中級圖片加上護貝結束
找到:
$pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
用以下程式碼取代:
//中級圖片加上護貝
$pic_html .= "<img src=\"images/watermark.gif\" style=\"background:url(" .$picture_url . ") white no-repeat center; width:".$wx."px;height:".$hy."px\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']} \" /><br />\n";
找到:
$pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
用以下程式碼取代:
//中級圖片加上護貝
$pic_html = "<img src=\"images/watermark.gif\" style=\"background:url(" .$picture_url . ") white no-repeat center; width:".$CURRENT_PIC_DATA['pwidth']."px;height:".$CURRENT_PIC_DATA['pheight']."px\" border=\"0\" alt=\"\" /><br />\n";