心灵 发表于 2007-8-27 09:16:30

关于({完美五格}最新图片+主题+回复+精华+发贴)修改细节

刚看了下,几位朋友修改的插件,关于 最新五格调用版+横排美化(图片+最新主题+最新回复+社区精华+今日发贴)


只提供附件没有提供修改方案,下面我大体说下。

/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=&#39;img&#39; and ifcheck=&#39;1&#39;
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)&&(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=&#39;$pics=\"&#39;.$pics.&#39;\";&#39;;
$links=&#39;$links=\"&#39;.$links.&#39;\";&#39;;
$texts=&#39;$texts=\"&#39;.$texts.&#39;\";&#39;;

$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>&#39;$tdtime&#39; ORDER BY md.todaypost DESC limit 0,$listnum\");
$c_i=1;//初始化图片序号
while($members=$db->fetch_array($query)){
$memberposttoday.=\"<img src=&#39;$imgpath/top/c_\".$c_i.\".gif&#39; align=&#39;absmiddle&#39; width=&#39;11&#39; height=&#39;11&#39;> <a href=&#39;profile.php?action=show&uid=$members&#39;>$members</a> $members<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=date(\"Y-m-j g:i\",$threads);
$threads=substrs($threads,$listlength);
$newthreads.=\"<img src=&#39;$imgpath/top/c_\".$c_i.\".gif&#39; align=&#39;absmiddle&#39; width=&#39;11&#39; height=&#39;11&#39;> <a href=&#39;read.php?tid=$threads&#39; title=&#39;作者:$threads 时间:$threads&#39;>$threads</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=substrs($threads,$listlength);
$digestthreads.=\"<img src=&#39;$imgpath/top/c_\".$c_i.\".gif&#39; align=&#39;absmiddle&#39; width=&#39;11&#39; height=&#39;11&#39;> <a href=&#39;read.php?tid=$threads&#39; title=&#39;作者:$threads 浏览:$threads&#39;>$threads</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=date(\"Y-m-j g:i\",$threads);
$threads=substrs($threads,$listlength);
$replythreads.=\"<img src=&#39;$imgpath/top/c_\".$c_i.\".gif&#39; align=&#39;absmiddle&#39; width=&#39;11&#39; height=&#39;11&#39;> <a href=&#39;read.php?tid=$threads&#39; title=&#39;作者:$threads 回复:$threads&#39;>$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\\$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(&#39;<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=\"&#39;+ focus_width +&#39;\" height=\"&#39;+ swf_height +&#39;\">&#39;);
   document.write(&#39;<param name=\"allowScriptAccess\" value=\"sameDomain\"><param name=\"*****\" value=\"{$imgpath}/pixviewer.swf\"><param name=\"quality\" value=\"high\"><param name=\"bgcolor\" value=\"#F4FBFF\">&#39;);
   document.write(&#39;<param name=\"menu\" value=\"false\"><param name=wmode value=\"opaque\">&#39;);
   document.write(&#39;<param name=\"FlashVars\" value=\"pics=&#39;+pics+&#39;&links=&#39;+links+&#39;&borderwidth=&#39;+focus_width+&#39;&borderheight=&#39;+focus_height+&#39;\">&#39;);
   document.write(&#39;<embed src=\"{$imgpath}/pixviewer.swf\" wmode=\"opaque\" FlashVars=\"pics=&#39;+pics+&#39;&links=&#39;+links+&#39;&borderwidth=&#39;+focus_width+&#39;&borderheight=&#39;+focus_height+&#39;\" menu=\"false\" bgcolor=\"#F4FBFF\" quality=\"high\" width=\"&#39;+ focus_width +&#39;\" height=\"&#39;+ swf_height +&#39;\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />&#39;);
   document.write(&#39;</object>&#39;);
//-->
</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>
<!-- 主题排行结束 -->


到此,完毕。
页: [1]
查看完整版本: 关于({完美五格}最新图片+主题+回复+精华+发贴)修改细节