找回密码
 注册
查看: 3832|回复: 9
收起左侧

7.3版本首页五格【最新图片,主题,回复,精华,发帖排行】

[复制链接]

5314

主题

8320

帖子

1万

积分

管理员

出售国内外虚拟空间

Rank: 10Rank: 10Rank: 10

积分
14665
帖子
8320
精华
67
体力
14665 点
蓝豆
2391 点
注册时间
2007-6-8

终身成就奖LY官方团队会员身份ID卡

发表于 2009-4-17 00:37:45 | 显示全部楼层 |阅读模式
12.jpg


修改方法
打开 风格文件index.htm--修改风格目录/template/wind/read.htm
  1. <!--<?php print <<<EOT
  2. -->
复制代码
替换成
  1. <!--<?php
  2. //首页调用开始
  3. //默认只显示开放、正规板块,不显示隐藏、投票、认证板块
  4. //幻灯图开始
  5. $cachepics=R_P."data/bbscache/index_toppics111.php";//幻灯图片缓存文件
  6. $cachepicstime=60;//幻灯图片缓存自动更新时间,单位秒
  7. //下一句设置要显示的板块类型,forum开放板块,former正规板块,hidden隐藏板块
  8. $showforum="(pf.f_type = forum or pf.f_type = former)";
  9. if (($timestamp-@filemtime($cachepics)>=$cachepicstime)){
  10. $query=$db->query("SELECT pt.tid,pt.fid,pt.subject,pa.attachurl FROM pw_threads pt
  11. ,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 =  
  12. ORDER BY pt.postdate DESC
  13. LIMIT 60
  14. "); //可以根据需要调整,我这里是估算每个主题有10张图片的情况下。
  15. $imgcontent="<?php\\n";
  16. $pics=$links=$texts="";
  17. $rs_i=0;
  18. while ($imginfo = $db->fetch_array($query) and $rs_i<5) {//只调用6个主题的图片
  19. if(($rs_tid!=$imginfo[tid])&&(eregi("\\.(jpg)$",$imginfo[attachurl]))){
  20. $pics.=$db_bbsurl."/".$attachpath."/".$imginfo[attachurl]."|";
  21. $links.=$db_bbsurl."/read.php?tid=".$imginfo[tid]."|";
  22. $texts.=$imginfo[subject]."|";
  23. $rs_i++;//同一主题的只要最后上传的那张图片
  24. }
  25. $rs_tid=$imginfo[tid];
  26. }
  27. $pics=substr($pics,0,-1);
  28. $links=substr($links,0,-1);
  29. $texts=substr($texts,0,-1);
  30. $pics=$pics=".$pics.";;
  31. $links=$links=".$links.";;
  32. $texts=$texts=".$texts.";;
  33. $imgcontent = $imgcontent.$pics."\\n".$links."\\n".$texts."\\n?>";
  34. writeover($cachepics,$imgcontent);
  35. }
  36. @require_once($cachepics);
  37. //幻灯图结束
  38. //会员排行+主题排行开始
  39. $cachelist=R_P."data/bbscache/index_toplist.php";//主题排行缓存文件
  40. $cachelisttime=5;//主题排行自动更新时间,单位秒
  41. //下一句设置要显示的板块类型,forum开放板块,former正规板块,hidden隐藏板块
  42. $showforum="(pf.f_type = forum or pf.f_type = former)";
  43. if(($timestamp-@filemtime($cachelist)>=$cachelisttime)){
  44. $listnum=10;//主题显示个数
  45. $listlength=30;//主题标题长度
  46. $listnum1=10;//会员在线时间排行显示个数
  47. $memberonline=$memberposttoday=$newthreads=$hitsthreads=$replythreads="";
  48. //会员当日发帖排行开始
  49. $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");
  50. while($members=$db->fetch_array($query)){
  51. $memberposttoday.="<a href=profile.php?action=show&uid=$members[uid] title=></span></div><span><a href=profile.php?action=show&username=$members[username] title=总发帖数:$members[postnum]帖 \\n本月发贴数:$members[monthpost]帖\\n今日发贴数:$members[todaypost]帖>$members[username]</a></span></a>($members[todaypost])<br />";
  52. }
  53. unset($members);
  54. //会员当日发帖排行结束
  55. //最新发表主题开始
  56. $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");
  57. while($threads=$db->fetch_array($query)){
  58. $threads[postdate]=get_date($threads[postdate]);
  59. $threads[subject]=substrs($threads[subject],$listlength);
  60. //以下调用原主题的颜色样式
  61. if ($threads[titlefont]){
  62. $titledetail=explode("~",$threads[titlefont]);
  63. if($titledetail[0])$threads[subject]="<font color=$titledetail[0]>$threads[subject]</font>";
  64. if($titledetail[1])$threads[subject]="<b>$threads[subject]</b>";
  65. if($titledetail[2])$threads[subject]="<i>$threads[subject]</i>";
  66. if($titledetail[3])$threads[subject]="<u>$threads[subject]</u>";
  67. }
  68. //以上调用原主题的颜色样式
  69. $newthreads.="<a href=read.php?tid=$threads[tid] title=主题:$threads[subject]\\n作者:$threads[author]\\n时间:$threads[postdate]\\n浏览:$threads[hits] 次\\n>$threads[subject]</a><br />";
  70. $c_i++;
  71. }
  72. unset($threads);
  73. unset($c_i);
  74. //最新发表主题结束
  75. //社区精华主题开始
  76. $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");
  77. while($threads=$db->fetch_array($query)){
  78. $threads[postdate]=get_date($threads[postdate]);
  79. $threads[lastpost]=get_date($threads[lastpost]);
  80. $threads[subject]=substrs($threads[subject],$listlength);
  81. //以下调用原主题的颜色样式
  82. if ($threads[titlefont]){
  83. $titledetail=explode("~",$threads[titlefont]);
  84. if($titledetail[0])$threads[subject]="<font color=$titledetail[0]>$threads[subject]</font>";
  85. if($titledetail[1])$threads[subject]="<b>$threads[subject]</b>";
  86. if($titledetail[2])$threads[subject]="<i>$threads[subject]</i>";
  87. if($titledetail[3])$threads[subject]="<u>$threads[subject]</u>";
  88. }
  89. //以上调用原主题的颜色样式
  90. $digestthreads.="<a href=read.php?tid=$threads[tid] title=主题标题:$threads[subject]\\n主题作者:$threads[author]\\n发表时间:$threads[postdate]\\n浏览次数:$threads[hits] 次\\n最新回复:$threads[lastposter]\\n回复时间:$threads[lastpost]\\n回复次数:$threads[replies] 次\\n>$threads[subject]</a><br />";
  91. $c_i++;
  92. }
  93. unset($threads);
  94. unset($c_i);
  95. //社区精华主题结束
  96. //最新回复主题开始
  97. $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");
  98. while($threads=$db->fetch_array($query)){
  99. $threads[postdate]=get_date($threads[postdate]);
  100. $threads[lastpost]=get_date($threads[lastpost]);
  101. $threads[subject]=substrs($threads[subject],$listlength);
  102. //以下调用原主题的颜色样式
  103. if ($threads[titlefont]){
  104. $titledetail=explode("~",$threads[titlefont]);
  105. if($titledetail[0])$threads[subject]="<font color=$titledetail[0]>$threads[subject]</font>";
  106. if($titledetail[1])$threads[subject]="<b>$threads[subject]</b>";
  107. if($titledetail[2])$threads[subject]="<i>$threads[subject]</i>";
  108. if($titledetail[3])$threads[subject]="<u>$threads[subject]</u>";
  109. }
  110. //以上调用原主题的颜色样式
  111. $replythreads.="<a href=read.php?tid=$threads[tid]&page=e#a title=主题标题:$threads[subject]\\n主题作者:$threads[author]\\n发表时间:$threads[postdate]\\n浏览次数:$threads[hits] 次\\n最新回复:$threads[lastposter]\\n回复时间:$threads[lastpost]\\n回复次数:$threads[replies] 次\\n>$threads[subject]</a><br />";
  112. $c_i++;
  113. }
  114. unset($threads);
  115. unset($c_i);
  116. //最新回复主题结束
  117. @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?>");
  118. }
  119. @require_once($cachelist);
  120. //会员排行+主题排行结束
  121. //首页调用结束
  122. print <<<EOT
  123. -->
  124. <br>
复制代码

继续查找
  1. </table>
  2. </div>
  3. <!--
  4. EOT;
  5. }print <<<EOT
  6. -->
复制代码

在下面添加
  1. <!-- 主题排行开始 -->
  2. <div class="t">
  3. <table cellspacing="0" cellpadding="0" width="100%">
  4. <tr class="tr3 tac h">
  5. <td width="21%">最新图片</td>
  6. <td width="21%">最新主题</td>
  7. <td width="21%">最新回复</td>
  8. <td width="21%">精华主题</td>
  9. <td width="16%">今日发帖排行</td>
  10. </tr>
  11. <tr class="tr3">
  12. <td align="center"><script type="text/javascript">
  13. <!--
  14. var swf_width=310
  15. var swf_height=190
  16. var config=3|0xffffff|0xFF0000|50|0xffffff|0x0099ff|0x000000
  17. var files=$pics
  18. var links=$links
  19. var texts=$texts
  20. 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 +">);
  21. document.write(<param name="movie" value="{$imgpath}/focus.swf" />);
  22. document.write(<param name="quality" value="high" />);
  23. document.write(<param name="menu" value="false" />);
  24. document.write(<param name=wmode value="opaque" />);
  25. document.write(<param name="FlashVars" value="config=+config+&bcastr_flie=+files+&bcastr_link=+links+&bcastr_title=+texts+" />);
  26. 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" />);
  27. document.write(</object>);//-->
  28. </script>
  29. </td>
  30. <td width="21%"><table border="0" cellpadding="0" cellspacing="0" width="100%">
  31. <tr valign="top">
  32. <td width="24" style="padding:0;border-top:0px;"><img src="images/list.gif" border="0" /></td>
  33. <td background="images/listbg.gif" style="line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y" width="100%">
  34. $newthreads
  35. </td>
  36. </tr>
  37. </table>
  38. </td>
  39. <td width="21%"><table border="0" cellpadding="0" cellspacing="0" width="100%">
  40. <tr valign="top">
  41. <td width="24" style="padding:0;border-top:0px;"><img src="images/list.gif" border="0" /></td>
  42. <td background="images/listbg.gif" style="line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y" width="100%">
  43. $replythreads
  44. </td>
  45. </tr>
  46. </table>
  47. </td>
  48. <td width="21%"><table border="0" cellpadding="0" cellspacing="0" width="100%">
  49. <tr valign="top">
  50. <td width="24" style="padding:0;border-top:0px;"><img src="images/list.gif" border="0" /></td>
  51. <td background="images/listbg.gif" style="line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y" width="100%">
  52. $digestthreads
  53. </td>
  54. </tr>
  55. </table></td>
  56. <td width="16%"><table border="0" cellpadding="0" cellspacing="0" width="100%">
  57. <tr valign="top">
  58. <td width="24" style="padding:0;border-top:0px;"><img src="images/list.gif" border="0" /></td>
  59. <td background="images/listbg.gif" style="line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y" width="100%">
  60. $memberposttoday
  61. </td>
  62. </tr>
  63. </table></td>
  64. </tr>
  65. </table>
  66. </div>
  67. <!-- 主题排行结束 -->
复制代码

经常有人说图片不显示
解决办法
后台-核心设置-安全与优化-速度优化-清除页面冗余内容-关闭

这个版本的不会出现刷新页面后不显示内容的情况,另外就是主题长度或者不要其中某一项排行的自行解决
附懒人包

首页五格.rar

25 KB, 下载次数: 13, 下载积分: 体力 -1 点

出售国内或美国高性能虚拟空间,高速VPS以及服务器! 同时承接各种类型的网站制作,网站维护,支付宝交易安全放心!    联系QQ:6102031
懒得打字嘛,点击右侧快捷回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

网站公告上一条 /2 下一条

GMT+8, 2024-5-19 13:27 , Processed in 0.109375 second(s), 27 queries , Gzip On.

© 2006-2022 Powered by Discuz! X3.4

快速回复 返回顶部 返回列表