7.3版本首页五格【最新图片,主题,回复,精华,发帖排行】
修改方法
打开 风格文件index.htm--修改风格目录/template/wind/read.htm
<!--<?php print <<<EOT
-->
替换成
<!--<?php
//首页调用开始
//默认只显示开放、正规板块,不显示隐藏、投票、认证板块
//幻灯图开始
$cachepics=R_P.\"data/bbscache/index_toppics111.php\";//幻灯图片缓存文件
$cachepicstime=60;//幻灯图片缓存自动更新时间,单位秒
//下一句设置要显示的板块类型,forum开放板块,former正规板块,hidden隐藏板块
$showforum=\"(pf.f_type = forum or pf.f_type = former)\";
if (($timestamp-@filemtime($cachepics)>=$cachepicstime)){
$query=$db->query(\"SELECT pt.tid,pt.fid,pt.subject,pa.attachurl FROM pw_threads pt
,pw_attachs pa,pw_forums pf where pt.tid = pa.tid and pt.fid = pf.fid and pa.type=img and pt.ifcheck=1 and \".$showforum.\" and pf.password =
ORDER BY pt.postdate DESC
LIMIT 60
\"); //可以根据需要调整,我这里是估算每个主题有10张图片的情况下。
$imgcontent=\"<?php\\n\";
$pics=$links=$texts=\"\";
$rs_i=0;
while ($imginfo = $db->fetch_array($query) and $rs_i<5) {//只调用6个主题的图片
if(($rs_tid!=$imginfo)&&(eregi(\"\\.(jpg)$\",$imginfo))){
$pics.=$db_bbsurl.\"/\".$attachpath.\"/\".$imginfo.\"|\";
$links.=$db_bbsurl.\"/read.php?tid=\".$imginfo.\"|\";
$texts.=$imginfo.\"|\";
$rs_i++;//同一主题的只要最后上传的那张图片
}
$rs_tid=$imginfo;
}
$pics=substr($pics,0,-1);
$links=substr($links,0,-1);
$texts=substr($texts,0,-1);
$pics=$pics=\".$pics.\";;
$links=$links=\".$links.\";;
$texts=$texts=\".$texts.\";;
$imgcontent = $imgcontent.$pics.\"\\n\".$links.\"\\n\".$texts.\"\\n?>\";
writeover($cachepics,$imgcontent);
}
@require_once($cachepics);
//幻灯图结束
//会员排行+主题排行开始
$cachelist=R_P.\"data/bbscache/index_toplist.php\";//主题排行缓存文件
$cachelisttime=5;//主题排行自动更新时间,单位秒
//下一句设置要显示的板块类型,forum开放板块,former正规板块,hidden隐藏板块
$showforum=\"(pf.f_type = forum or pf.f_type = former)\";
if(($timestamp-@filemtime($cachelist)>=$cachelisttime)){
$listnum=10;//主题显示个数
$listlength=30;//主题标题长度
$listnum1=10;//会员在线时间排行显示个数
$memberonline=$memberposttoday=$newthreads=$hitsthreads=$replythreads=\"\";
//会员当日发帖排行开始
$query=$db->query(\"SELECT m.username,md.todaypost,md.postnum,md.monthpost FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) WHERE md.lastpost>$tdtime ORDER BY md.todaypost DESC limit 0,$listnum\");
while($members=$db->fetch_array($query)){
$memberposttoday.=\"<a href=profile.php?action=show&uid=$members title=></span></div><span><a href=profile.php?action=show&username=$members title=总发帖数:$members帖 \\n本月发贴数:$members帖\\n今日发贴数:$members帖>$members</a></span></a>($members)<br />\";
}
unset($members);
//会员当日发帖排行结束
//最新发表主题开始
$query = $db->query(\"SELECT pt.tid,pt.author,pt.subject,pt.postdate,pt.hits,pt.titlefont FROM pw_threads pt LEFT JOIN pw_forums pf USING(fid) where pt.ifcheck=1 and \".$showforum.\" and pf.password =order by pt.postdate desc limit 0,$listnum\");
while($threads=$db->fetch_array($query)){
$threads=get_date($threads);
$threads=substrs($threads,$listlength);
//以下调用原主题的颜色样式
if ($threads){
$titledetail=explode(\"~\",$threads);
if($titledetail)$threads=\"<font color=$titledetail>$threads</font>\";
if($titledetail)$threads=\"<b>$threads</b>\";
if($titledetail)$threads=\"<i>$threads</i>\";
if($titledetail)$threads=\"<u>$threads</u>\";
}
//以上调用原主题的颜色样式
$newthreads.=\"<a href=read.php?tid=$threads title=主题:$threads\\n作者:$threads\\n时间:$threads\\n浏览:$threads 次\\n>$threads</a><br />\";
$c_i++;
}
unset($threads);
unset($c_i);
//最新发表主题结束
//社区精华主题开始
$query = $db->query(\"SELECT pt.tid,pt.author,pt.subject,pt.postdate,pt.lastpost,pt.lastposter,pt.hits,pt.replies,pt.titlefont FROM pw_threads pt LEFT JOIN pw_forums pf USING(fid) where pt.ifcheck=1 and pt.digest > 0 and \".$showforum.\" and pf.password =order by pt.postdate desc limit 0,$listnum\");
while($threads=$db->fetch_array($query)){
$threads=get_date($threads);
$threads=get_date($threads);
$threads=substrs($threads,$listlength);
//以下调用原主题的颜色样式
if ($threads){
$titledetail=explode(\"~\",$threads);
if($titledetail)$threads=\"<font color=$titledetail>$threads</font>\";
if($titledetail)$threads=\"<b>$threads</b>\";
if($titledetail)$threads=\"<i>$threads</i>\";
if($titledetail)$threads=\"<u>$threads</u>\";
}
//以上调用原主题的颜色样式
$digestthreads.=\"<a href=read.php?tid=$threads title=主题标题:$threads\\n主题作者:$threads\\n发表时间:$threads\\n浏览次数:$threads 次\\n最新回复:$threads\\n回复时间:$threads\\n回复次数:$threads 次\\n>$threads</a><br />\";
$c_i++;
}
unset($threads);
unset($c_i);
//社区精华主题结束
//最新回复主题开始
$query = $db->query(\"SELECT pt.tid,pt.author,pt.subject,pt.postdate,pt.lastpost,pt.lastposter,pt.hits,pt.replies,pt.titlefont FROM pw_threads pt LEFT JOIN pw_forums pf USING(fid) where pt.ifcheck = 1 and pt.replies > 0 and \".$showforum.\" and pf.password =order by lastpost desc limit 0,$listnum\");
while($threads=$db->fetch_array($query)){
$threads=get_date($threads);
$threads=get_date($threads);
$threads=substrs($threads,$listlength);
//以下调用原主题的颜色样式
if ($threads){
$titledetail=explode(\"~\",$threads);
if($titledetail)$threads=\"<font color=$titledetail>$threads</font>\";
if($titledetail)$threads=\"<b>$threads</b>\";
if($titledetail)$threads=\"<i>$threads</i>\";
if($titledetail)$threads=\"<u>$threads</u>\";
}
//以上调用原主题的颜色样式
$replythreads.=\"<a href=read.php?tid=$threads&page=e#a title=主题标题:$threads\\n主题作者:$threads\\n发表时间:$threads\\n浏览次数:$threads 次\\n最新回复:$threads\\n回复时间:$threads\\n回复次数:$threads 次\\n>$threads</a><br />\";
$c_i++;
}
unset($threads);
unset($c_i);
//最新回复主题结束
@writeover($cachelist,\"<?php\\n\\$memberonline=\\\"$memberonline\\\";\\n\\$memberposttoday=\\\"$memberposttoday\\\";\\n\\$newthreads=\\\"$newthreads\\\";\\n\\$digestthreads=\\\"$digestthreads\\\";\\n\\$activitythreads=\\\"$activitythreads\\\";\\n\\$replythreads=\\\"$replythreads\\\";\\n\\$randtreads=\\\"$randtreads\\\";\\n?>\");
}
@require_once($cachelist);
//会员排行+主题排行结束
//首页调用结束
print <<<EOT
-->
<br>
继续查找
</table>
</div>
<!--
EOT;
}print <<<EOT
-->
在下面添加
<!-- 主题排行开始 -->
<div class=\"t\">
<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">
<tr class=\"tr3 tac h\">
<td width=\"21%\">最新图片</td>
<td width=\"21%\">最新主题</td>
<td width=\"21%\">最新回复</td>
<td width=\"21%\">精华主题</td>
<td width=\"16%\">今日发帖排行</td>
</tr>
<tr class=\"tr3\">
<td align=\"center\"><script type=\"text/javascript\">
<!--
var swf_width=310
var swf_height=190
var config=3|0xffffff|0xFF0000|50|0xffffff|0x0099ff|0x000000
var files=$pics
var links=$links
var texts=$texts
document.write(<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"+ swf_width +\" height=\"+ swf_height +\">);
document.write(<param name=\"movie\" value=\"{$imgpath}/focus.swf\" />);
document.write(<param name=\"quality\" value=\"high\" />);
document.write(<param name=\"menu\" value=\"false\" />);
document.write(<param name=wmode value=\"opaque\" />);
document.write(<param name=\"FlashVars\" value=\"config=+config+&bcastr_flie=+files+&bcastr_link=+links+&bcastr_title=+texts+\" />);
document.write(<embed src=\"{$imgpath}/focus2.swf\" wmode=\"opaque\" FlashVars=\"config=+config+&bcastr_flie=+files+&bcastr_link=+links+&bcastr_title=+texts+& menu=\"false\" quality=\"high\" width=\"+ swf_width +\" height=\"+ swf_height +\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />);
document.write(</object>);//-->
</script>
</td>
<td width=\"21%\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr valign=\"top\">
<td width=\"24\" style=\"padding:0;border-top:0px;\"><img src=\"images/list.gif\" border=\"0\" /></td>
<td background=\"images/listbg.gif\" style=\"line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y\" width=\"100%\">
$newthreads
</td>
</tr>
</table>
</td>
<td width=\"21%\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr valign=\"top\">
<td width=\"24\" style=\"padding:0;border-top:0px;\"><img src=\"images/list.gif\" border=\"0\" /></td>
<td background=\"images/listbg.gif\" style=\"line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y\" width=\"100%\">
$replythreads
</td>
</tr>
</table>
</td>
<td width=\"21%\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr valign=\"top\">
<td width=\"24\" style=\"padding:0;border-top:0px;\"><img src=\"images/list.gif\" border=\"0\" /></td>
<td background=\"images/listbg.gif\" style=\"line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y\" width=\"100%\">
$digestthreads
</td>
</tr>
</table></td>
<td width=\"16%\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr valign=\"top\">
<td width=\"24\" style=\"padding:0;border-top:0px;\"><img src=\"images/list.gif\" border=\"0\" /></td>
<td background=\"images/listbg.gif\" style=\"line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y\" width=\"100%\">
$memberposttoday
</td>
</tr>
</table></td>
</tr>
</table>
</div>
<!-- 主题排行结束 -->
经常有人说图片不显示
解决办法
后台-核心设置-安全与优化-速度优化-清除页面冗余内容-关闭
这个版本的不会出现刷新页面后不显示内容的情况,另外就是主题长度或者不要其中某一项排行的自行解决
附懒人包
页:
[1]