|
刚看了下,几位朋友修改的插件,关于 最新五格调用版+横排美化(图片+最新主题+最新回复+社区精华+今日发贴)
只提供附件没有提供修改方案,下面我大体说下。
/image 无须担心,直接上传就可以。
/template/wind 包含index.htm thread_children.htm
如果你没有修改过index.htm,并使用wind风格,那么无须看以下操作 直接上传就可以。若不是请往下看。
打开你的template/风格/index.htm
查找:
Copy code
<!--<?php 第一行了。
添加:
Copy code
//首页调用开始
//幻灯图开始
$cachepics=R_P.\"data/bbscache/index_toppics.php\";//幻灯图片缓存文件
$cachepicstime=300;//幻灯图片缓存自动更新时间,单位秒
if (($timestamp-@filemtime($cachepics)>=$cachepicstime)){
$query=$db->query(\"SELECT tm.tid,tm.fid,tm.subject,t.attachurl FROM pw_threads tm
LEFT JOIN pw_attachs t ON t.tid = tm.tid
WHERE t.type='img' and ifcheck='1'
ORDER BY postdate DESC
LIMIT 60
\");//LIMIT 30 可以根据需要调整,我这里是估算每个主题有6张图片的情况下。
$imgcontent=\"<?php\\n\";
$pics=$links=$texts=\"\";
$rs_i=0;
while ($imginfo = $db->fetch_array($query) and $rs_i<6) {//i只调用6张图片
if(($rs_tid!=$imginfo[tid])&&(eregi(\"\\.(jpg)$\",$imginfo[attachurl]))){
$pics.=$db_bbsurl.\"/\".$attachpath.\"/\".$imginfo[attachurl].\"|\";
$links.=$db_bbsurl.\"/read.php?tid=\".$imginfo[tid].\"|\";
$texts.=$imginfo[subject].\"|\";
$rs_i++;//同一主题的只要最后上传的那张图片
}
$rs_tid=$imginfo[tid];
}
$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=60;//主题排行自动更新时间,单位秒
if (($timestamp-@filemtime($cachelist)>=$cachelisttime)){
$listnum=10;//主题显示个数
$listlength=26;//主题标题长度
$memberposttoday=$newthreads=$digestthreads=$replythreads=\"\";
//会员当日发帖排行开始
$query=$db->query(\"SELECT m.uid,m.username,md.todaypost FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) WHERE md.lastpost>'$tdtime' ORDER BY md.todaypost DESC limit 0,$listnum\");
$c_i=1;//初始化图片序号
while($members=$db->fetch_array($query)){
$memberposttoday.=\"<img src='$imgpath/top/c_\".$c_i.\".gif' align='absmiddle' width='11' height='11'> <a href='profile.php?action=show&uid=$members[uid]'>$members[username]</a> $members[todaypost]<br />\";
$c_i++;
}
unset($members);
unset($c_i);
//会员当日发帖排行结束
//最新发表主题开始
$query = $db->query(\"SELECT tid,author,subject,postdate FROM pw_threads order by postdate desc limit 0,$listnum\");
$c_i=1;//初始化图片序号
while($threads=$db->fetch_array($query)){
$threads[postdate]=date(\"Y-m-j g:i\",$threads[postdate]);
$threads[subject]=substrs($threads[subject],$listlength);
$newthreads.=\"<img src='$imgpath/top/c_\".$c_i.\".gif' align='absmiddle' width='11' height='11'> <a href='read.php?tid=$threads[tid]' title='作者threads[author] 时间threads[postdate]'>$threads[subject]</a><br />\";
$c_i++;
}
unset($threads);
unset($c_i);
//最新发表主题结束
//社区精华主题开始
$query = $db->query(\"SELECT tid,author,subject,hits FROM pw_threads where digest > 0 order by postdate desc limit 0,$listnum\");
$c_i=1;//初始化图片序号
while($threads=$db->fetch_array($query)){
$threads[subject]=substrs($threads[subject],$listlength);
$digestthreads.=\"<img src='$imgpath/top/c_\".$c_i.\".gif' align='absmiddle' width='11' height='11'> <a href='read.php?tid=$threads[tid]' title='作者threads[author] 浏览threads[hits]'>$threads[subject]</a><br />\";
$c_i++;
}
unset($threads);
unset($c_i);
//社区精华主题结束
//最新回复主题开始
$query = $db->query(\"SELECT tid,author,subject,replies,lastpost FROM pw_threads order by lastpost desc limit 0,$listnum\");
$c_i=1;//初始化图片序号
while($threads=$db->fetch_array($query)){
$threads[lastpost]=date(\"Y-m-j g:i\",$threads[lastpost]);
$threads[subject]=substrs($threads[subject],$listlength);
$replythreads.=\"<img src='$imgpath/top/c_\".$c_i.\".gif' align='absmiddle' width='11' height='11'> <a href='read.php?tid=$threads[tid]' title='作者threads[author] 回复threads[lastpost]'>$threads[subject]</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\\$replythreads=\\\"$replythreads\\\";\\n\\$membersmoney=\\\"$membersmoney\\\";\\n\\$membersrvrc=\\\"$membersrvrc\\\";\\n\\$memberscredit=\\\"$memberscredit\\\";\\n\\$membersvalue=\\\"$membersvalue\\\";\\n\\$membersonlinetime=\\\"$membersonlinetime\\\";\\n\\$membersdigests=\\\"$membersdigests\\\";\\n?>\");
}
@require_once($cachelist);
//会员排行+主题排行结束
//首页调用结束
查找:127行,查到</table></div>
添加:
Copy code
<!-- 主题排行开始 -->
<div class=\"t\">
<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">
<tr class=\"tr3 tac\">
<td width=\"18%\"><span class=\"b\" style=\"color:#FF6699\">社区最新图片</span></td>
<td width=\"22%\"><span class=\"b\" style=\"color:#669900\">最新发表主题</span></td>
<td width=\"22%\"><span class=\"b\" style=\"color:#0066FF\">最新回复主题</span></td>
<td width=\"22%\"><span class=\"b\" style=\"color:#FF9933\">社区精华主题</span></td>
<td width=\"16%\"><span class=\"b\" style=\"color:#FF3300\">今日发贴排行</span></td>
</tr>
<tr class=\"tr3\">
<td align=\"center\">
<script type=\"text/javascript\">
<!--
var focus_width=165
var focus_height=140
var swf_height = focus_height
var swf_height = focus_height
var pics=\"$pics\"
var links=\"$links\"
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=\"'+ focus_width +'\" height=\"'+ swf_height +'\">');
document.write('<param name=\"allowScriptAccess\" value=\"sameDomain\"><param name=\"*****\" value=\"{$imgpath}/pixviewer.swf\"><param name=\"quality\" value=\"high\"><param name=\"bgcolor\" value=\"#F4FBFF\">');
document.write('<param name=\"menu\" value=\"false\"><param name=wmode value=\"opaque\">');
document.write('<param name=\"FlashVars\" value=\"pics='+pics+'&links='+links+'&borderwidth='+focus_width+'&borderheight='+focus_height+'\">');
document.write('<embed src=\"{$imgpath}/pixviewer.swf\" wmode=\"opaque\" FlashVars=\"pics='+pics+'&links='+links+'&borderwidth='+focus_width+'&borderheight='+focus_height+'\" menu=\"false\" bgcolor=\"#F4FBFF\" quality=\"high\" width=\"'+ focus_width +'\" height=\"'+ swf_height +'\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />');
document.write('</object>');
//-->
</script>
</td>
<td class=\"f_two\" style=\"vertical-align:top;\">$newthreads</td>
<td style=\"vertical-align:top;\">$replythreads</td>
<td class=\"f_two\" style=\"vertical-align:top;\">$digestthreads</td>
<td style=\"vertical-align:top;\">$memberposttoday</td>
</tr>
</table>
</div>
<!-- 主题排行结束 -->
到此,完毕。 |
|