|
鼠标滚轮控制帖子里图片变大变小,鼠标单击图片在新窗口打开。有待完善,隐约感觉不够完备。已知的问题:修改后,读贴页面里有些地方文字字体会变大。
修改方法:
1、修改template\\wind\\下的文件header.htm:
查找: -
- <html xmlns="http://www.w3.org/1999/xhtml">
复制代码
在下面添加: -
- <!--鼠标滚轮缩放图片需要的代码-->
- <script>
- function bbimg(o)
- {
- var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+%;
- return false;
- }
- </script>
复制代码
2、修改require\\下的文件bbscode.php,
找到代码:
-
- function cvpic($url,$type=,$picwidth=,$picheight=,$ifthumb=) {
- global $db_bbsurl,$db_picpath,$attachpath,$db_ftpweb,$code_num,$code_htm;
- $code_num++;
- $lower_url = strtolower($url);
- strncmp($lower_url,http,4)!=0 && $url = "$db_bbsurl/$url";
- if (strpos($lower_url,login)!==false && (strpos($lower_url,action=quit)!==false || strpos($lower_url,action-quit)!==false)) {
- $url = preg_replace(/login/i,log in,$url);
- }
- $url = str_replace(array("",""),,$url);
- $turl = $url;
- $wopen = 0;
- $alt = ;
- if ($ifthumb) {
- if ($db_ftpweb && !strpos($url,$attachpath)!==false) {
- $picurlpath = $db_ftpweb;
- } else{
- $picurlpath = $attachpath;
- }
- if (strpos($url,$picurlpath)!==false) {
- $wopen = 1;
- $alt = title="Click Here To EnLarge";
- $turl = str_replace($picurlpath,"$picurlpath/thumb",$url);
- }
- }
- if ($picwidth || $picheight) {
- $wopen = !$wopen ? "if(this.width>=$picwidth)" : ;
- $onload = onload=";
- $picwidth && $onload .= "if(this.width>$picwidth)this.width=$picwidth;";
- $picheight && $onload .= "if(this.height>$picheight)this.height=$picheight;";
- $onload .= ";
- $code = "<img src=\\"$turl\\" border=\\"0\\" onclick=\\"$wopen window.open($url);\\" $onload $alt>";
- } else{
- $wopen = !$wopen ? "if(this.width>screen.width-461)" : ;
- $code = "<img src=\\"$turl\\" border=\\"0\\" onclick=\\"$wopen window.open($url);\\" $alt>";
- }
- $code_htm[-1][$code_num]=$code;
- if ($type) {
- return $code;
- } else {
- return "<\\twind_code_$code_num\\t>";
- }
- }
复制代码
整体替换为:
|
|