Chinaz.com - 中国站长站

匿名投稿 投稿指南 RSS订阅 站长资讯通告:
搜索: 您的位置主页>精华转载>技术专题>阅读资讯:PHPWind5.3中设置鼠标滚轮自由缩放论坛图片教程

PHPWind5.3中设置鼠标滚轮自由缩放论坛图片教程

2007-07-26 08:57:36 来源:PHPWind中文网 作者:霓虹陌路 【 评论:0

修改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>

修改require\下的文件bbscode.php:

找到代码:

以下为引用的内容:

function cvpic($url,$type='',$picwidth='',$picheight=''){
    global $db_bbsurl,$picpath,$attachpath,$code_num,$code_htm;
    $code_num++;

    $lower_url=strtolower($url);
    if(substr($lower_url,0,4)!='http' && !$type)$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);
    }
    if($picwidth || $picheight){
        $onload = "onload=\"";
        $picwidth  && $onload .= "if(this.width>'$picwidth')this.width='$picwidth';";
        $picheight && $onload .= "if(this.height>'$picheight')this.height='$picheight';";
        $onload .= "\"";
        $code="<img src=\"$url\" border=\"0\" onclick=\"if(this.width>=$picwidth) window.open('$url');\" $onload>";
    } else{
        $code="<img src=\"$url\" border=\"0\" onclick=\"if(this.width>screen.width-461) window.open('$url');\">";
    }
    $code_htm[-1][$code_num]=$code;

    if($type){
        return $code;
    } else{
        return "<\twind_code_$code_num\t>";
    }
}

用以下代码替换:

以下为引用的内容:

function cvpic($url,$type='',$picwidth='',$picheight=''){
global $db_bbsurl,$picpath,$attachpath,$code_num,$code_htm; {
$code_num++;
if(strtolower(substr($url,0,4)) != 'http' && !$type)$url=$db_bbsurl.$url; 
if($picwidth && $picheight){ 
$code = "<img src='$url' border=0 onmousewheel=\"return bbimg(this)\" onclick=\"if(this.width>=$picwidth) window.open('$url');\" onload=\"if(this.width > $picwidth)this.width = $picwidth;if(this.height > $picheight) this.height = $picheight;\">";} else{ 
$code = "<img src='$url' border=0 onmousewheel=\"return bbimg(this)\" onclick=\"if(this.width>screen.width-461) window.open('$url');\" onload=\"if(this.width>screen.width-460)this.width=screen.width-460;\">";
}

$code_htm[-1][$code_num]=$code;
if($type){
return $code;
} else{ 
return "<\twind_code_$code_num\t>";
}
}



Tags:PHPWind   滚轮   缩放   图片  
责任编辑:阿小
  • 请文明参与讨论,禁止漫骂攻击。 用户名:新注册) 密码: 匿名:
    评论总数: [ 查看全部 ] 网友评论
    关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助