幫連續撥放圖片加上"水印".....只是水印而已.....
測試用CPG版本:1.42
由於CPG版本:1.42的續撥撥放模式是採用Java語法來執行的,
其中的語法會強制改寫"護貝圖擋"的檔名,所以無法使用"護貝"
的方式來保護,因此加入了按右鍵即停止撥放的動作。
本次共修改2個檔案:
/include/themes.inc.php
/include/slideshow.inc.php
修改:/include/themes.inc.php
找到:
'{IMAGE}' =>'<img src="' . $start_img . '" name="SlideShow" class="image" /><br />',
用以下程式碼取代:
//幫續撥撥放圖片加上"水印"
'{IMAGE}' => "<img name=\"SlideShow\" style=\"background:url(" .$start_img . ") white no-repeat center; width:".$pic_size = GetImageSize (urldecode(($start_img))).$pic_size[0]."px;height:".$pic_size[1]."px\" border=\"0\" alt=\"\" /><br /><img src=\"images/watermark.gif\" border=\"0\" align=\"right\" style=\"display:none !important;display:inline;margin-top:-50px;margin-right:0px;width: 92px; height: 50px;\" />",
//幫續撥撥放圖片加上"水印"
其中:
watermark.gif 是你必須自己建立的水印圖檔。
display:inline;margin-top:-50px;margin-right:0px;width: 92px; height: 50px;
的
width: 92px; <---為水印圖檔的寬
height: 50px;<---為水印圖檔的高
margin-top:-50px;<---為水印圖檔的上下位置,必須是負數。減掉水印圖檔的高,則水印圖檔底部剛好和圖檔底部貼齊
margin-right:0px;<---為水印圖檔的左右位置,必須是正數。預設值0水印圖檔右側剛好和圖檔右側貼齊
修改:/include/slideshow.inc.php
在檔案的最下方加入:
<script language="JavaScript1.1">
function right(e) {
if (navigator.appName =='Netscape'&&
(e.which ==3|| e.which ==2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2|| event.button ==3)) {
endSlideShow();
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
</script>