复制程式
function cvpicRead($url,$type='',$picwidth='',$picheight='',$ifthumb=''){
global $db_bbsurl,$db_picpath,$attachpath,$db_ftpweb,$code_num,$code_htm;
$code_num++;
$lower_url = strtolower($url);
substr($lower_url,0,4)!='http' && $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 = 'alt="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 = "<a rel='lightbox' href='$url' title=''><img src='$turl' border=Ɔ'></a>";
} else {
$wopen = !$wopen ? "if(this.width>screen.width-461)" : ''
$code = "<a rel='lightbox' href='$url' title=''><img src='$turl' border=Ɔ'></a>";
}
$code_htm[-1][$code_num]=$code;
if ($type) {
return $code;
} else {
return "<\twind_code_$code_num\t>";
}
}
2.打开read.php找到
复制程式
cvpic($a_url[0],1,$db_windpost['picwidth'],
大概在392行换成
复制程式
cvpicRead($a_url[0],1,$db_windpost['picwidth'],
3.打开read.htm 在最上面加上
复制程式
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.lightbox-0.4.js"></script>
<link rel="stylesheet" type="text/css" href="data/style/jquery.lightbox-0.4.css" media="screen" />
<script type="text/javascript">
$(function() {
$('a[rel*=lightbox]').lightBox();
});
</script>