请选择 进入手机版 | 继续访问电脑版
设为首页收藏本站

Discuz! 官方站

 找回密码
 立即注册

QQ登录

只需一步,快速开始

Discuz! X 最新研发动态 通过这个窗口,关注跟踪我们的研发进展 Discuz! 开发技术文库 - 给官方提建议

Discuz! X2 正式版下载 帮助网站实现一站式服务  商业支持服务咨询 下载 - 安装 - 常见问题 - 转换 - 讨论 - 购买

2012站长年会开启报名 限量船票免费发放 年会“船票”每日审核名单公布 - Discuz!NT3.6发布 漫游引入QQ空间游戏 -一骑新区横扫三国-5d6d免费论坛

查看: 8511|回复: 32

[修改] 首页四格(帖子类型定时轮流变换+发帖之星+财富,悍匪,宠物排行榜) [复制链接]

King

站长

Rank: 6Rank: 6

UID
849735
积分
1347
帖子
503
威望
48
在线时间
109 小时
注册时间
2007-11-1
发表于 2007-11-23 21:54:23 |显示全部楼层
先说明一下, 四格显示的作者不是我, 我这个也是下载7瑞的, 然后全部是自己改的, 因为我的论坛里面有几位会员想要, 所以放出来, 大家喜欢的可以参考一下.

注意: 因为该插件是很多局限性的, 建议对程序有所了解的会员加以修改来符合自己论坛的要求..

之所以改成这样, 我的想法是这样的, 因为既然做成折叠版的, 用户很少去把鼠标移到那块, 所以就做成了每隔一定的时间轮流显示不同类型的帖子出来, 然后, 如果你装了无心宠物,又装了最新版的社区银行还有黑道生涯,你就可以给出几个排行榜出来,之所以要给出排行榜,是因为考虑到会员对排行这些东西很敏感, 大家都喜欢自己的名字出现在排行榜上面, 也就出现了会员之间的互相竞争, 这样有利于社区的人气的发展....

另: 我去掉了天气显示, 换了自己喜欢的名人名言或者经验句子下去, 大家不喜欢的可以随时更改include/geyan-7ree.txt,

还有, 本人显示的是最新帖子,最新回复,以及随机抽取不同的精华帖子作为3格轮换显示. 大家也可以随时修改自己的, 打开

演示图:

4ge.gif


演示网站:

http://www.nzyule.com


安装方法:

需要改动的文件:
# /index.php
# /discuz.htm

1. 将upload目录下的所有文件上传到论坛的根目录下

2. 打开 index.php,  查找:
  1. $rsshead = $rssstatus
复制代码
在之上加:
  1. //------ plm 缓存修改首页四格开始 ------
  2. @include DISCUZ_ROOT.'./index_four.php';
  3. //------ plm 缓存修改首页四格结束 ------
复制代码
3, 打开 templates/default/discuz.htm

查找:
  1. <!--{loop $catlist $key $cat}-->
复制代码
在其上加:
  1. <!-- 首页四格 -->
  2. <style>
  3. .bfg_ntopa{
  4. float:left;
  5. clear:right;
  6.         font-weight: bold;      
  7.         
  8.         margin: 2px 2px 0px 2px;
  9.         text-align: center;
  10.         line-height: 18px;
  11.         BORDER-RIGHT: #cccccc 1px solid;
  12.                 BORDER-LEFT: #cccccc 1px solid;
  13.         vertical-align:bottom;
  14. }
  15. .bfg_ntopb {
  16.         float:left;
  17.         clear:right;
  18.         BORDER-RIGHT: #cccccc 1px solid;
  19.                 BORDER-BOTTOM:#cccccc 1px solid;
  20.         BORDER-LEFT: #cccccc 1px solid;
  21.         
  22.         margin: 2px 2px 0px 2px;
  23.         text-align: center;
  24.         vertical-align : middle;
  25.         line-height: 18px;

  26. }
  27. </style>
  28. <script language="javascript">
  29. function view(id) {
  30.         for (i=0;i<3;i++) {
  31.                 document.getElementById('d'+i).style.display = 'none';
  32.                 document.getElementById('c'+ i).className='bfg_ntopb';
  33.         }
  34.         document.getElementById('d'+ id).style.display = 'block';
  35.         document.getElementById('c'+id).className='bfg_ntopa';

  36.         clearTimeout(show_view);
  37. }
  38. function interval_view() {
  39.         if (document.getElementById('d0').style.display == 'none' && document.getElementById('d1').style.display == 'none' && document.getElementById('d2').style.display == 'none') {
  40.                 document.getElementById('d0').style.display = 'block';
  41.         } else {
  42.                 for (i=0;i<3;i++) {
  43.                         if (document.getElementById('d'+i).style.display == 'block') {
  44.                                 next_i = i+1;
  45.                                 if (next_i > 2) {
  46.                                         next_i = 0;
  47.                                  }
  48.                                 break;
  49.                         }
  50.                 }
  51.                 for (i=0;i<3;i++) {
  52.                         document.getElementById('d'+i).style.display = 'none';
  53.                         document.getElementById('c'+i).className='bfg_ntopb';
  54.                 }
  55.                 document.getElementById('d'+ next_i).style.display = 'block';
  56.                 document.getElementById('c'+next_i).className='bfg_ntopa';
  57.         }       
  58.         show_view = setTimeout("interval_view()", 7000);
  59.         show_view2 = setTimeout("interval_view2()", 2000);

  60. }

  61. function recall_show_view() {
  62.         show_view = setTimeout("interval_view()", 7000);       
  63. }



  64. function view2(id) {
  65.         for (i=0;i<3;i++) {
  66.                 document.getElementById('e'+i).style.display = 'none';
  67.                 document.getElementById('b'+ i).className='bfg_ntopb';
  68.         }
  69.         document.getElementById('e'+ id).style.display = 'block';
  70.         document.getElementById('b'+id).className='bfg_ntopa';

  71.         clearTimeout(show_view);
  72. }
  73. function interval_view2() {
  74.         if (document.getElementById('e0').style.display == 'none' && document.getElementById('e1').style.display == 'none' && document.getElementById('e2').style.display == 'none') {
  75.                 document.getElementById('e0').style.display = 'block';
  76.         } else {
  77.                 for (i=0;i<3;i++) {
  78.                         if (document.getElementById('e'+i).style.display == 'block') {
  79.                                 next_i = i+1;
  80.                                 if (next_i > 2) {
  81.                                         next_i = 0;
  82.                                  }
  83.                                 break;
  84.                         }
  85.                 }
  86.                 for (i=0;i<3;i++) {
  87.                         document.getElementById('e'+i).style.display = 'none';
  88.                         document.getElementById('b'+i).className='bfg_ntopb';
  89.                 }
  90.                 document.getElementById('e'+ next_i).style.display = 'block';
  91.                 document.getElementById('b'+next_i).className='bfg_ntopa';
  92.         }

  93. }

  94. window.onload = interval_view;

  95. </script>
  96. <div class="mainbox forumlist">
  97.                                 <span class="headactions">
  98.                                 <!--{if $cat['moderators']}-->{lang forum_category_modedby}: $cat[moderators]<!--{/if}-->
  99.                                 <img id="category_$cat[fid]_img" src="{IMGDIR}/collapsed_no.gif" title="{lang spread}" alt="{lang spread}" onclick="toggle_collapse('category_$cat[fid]');" />
  100.                         </span>
  101.                        
  102.                                 <h3>◇ $geyanline_7ree ◆</h3>

  103.                 <table cellspacing="0" cellpadding="0"  id="category_$cat[fid]" summary="category$cat[fid]" cellspacing="0" cellpadding="0" style="$collapse['category_'.$cat[fid]]">
  104.                                 <thead class="category">
  105.                                         <tr>
  106.                                                 <td width="25%" align="center" style="border-right:#CCCCCC solid; border-width:1px;"><b>精彩贴图</b></td>
  107.                         <td width="30%" align="center" style="border-right:#CCCCCC solid; border-width:1px;"><table align="center" cellpadding="0" cellspacing="0" border="0"><tr>
  108.                                 <td align="center" class="bfg_ntopa" id="c0" onMouseOver="javascript:view(0);" onMouseOut="javascript:recall_show_view();"><img src="images/common/newspost.gif" align="absmiddle" />最新话题</td>
  109.                                 <td align="center" class="bfg_ntopb" id="c1" onMouseOver="javascript:view(1);" onMouseOut="javascript:recall_show_view();"><img src="images/common/newsreply.gif" align="absmiddle" />最新回复</td>

  110.                                 <td align="center" class="bfg_ntopb" id="c2" onMouseOver="javascript:view(2);" onMouseOut="javascript:recall_show_view();"><img src="images/common/hotpost.gif" align="absmiddle" />推荐精华</td>
  111.                         </tr></table></td>
  112.                         <td width="23%" align="center" style="border-right:#CCCCCC solid; border-width:1px;"><b>≡ 社区超男(超女) ≡</b></td>
  113.                         <td width="22%" align="center" style="border-right:#CCCCCC solid; border-width:1px;"><table align="center" cellpadding="0" cellspacing="0" border="0"><tr>
  114.                                 <td align="center" class="bfg_ntopa" id="b0" onMouseOver="javascript:view2(0);" onMouseOut="javascript:recall_show_view();">财富排行</td>
  115.                                 <td align="center" class="bfg_ntopb" id="b1" onMouseOver="javascript:view2(1);" onMouseOut="javascript:recall_show_view();">悍匪排行</td>
  116.                                 <td align="center" class="bfg_ntopb" id="b2" onMouseOver="javascript:view2(2);" onMouseOut="javascript:recall_show_view();">宠物排名</td>
  117.                         </tr></table></td>

  118.                 </tr>
  119.                 </thead>
  120.                 <tr>

  121.                         <td align="center"><script src="pic.php" type="text/javascript"></script></td>
  122.                         <td style="border-left:#CCCCCC solid; border-right:#CCCCCC solid;border-width:1px" valign=top>                               
  123.                
  124.                               <ul id="d0" style="display:block" class=table>                       
  125.       <!--{loop $new_post_threadlist $nthread}-->


  126.                                                                                                               <li><cite style="float:right"><a href="space.php?uid={$nthread[authorid]}" title="查看{$nthread[author]}的个人空间" target="_blank">{$nthread[author]}</a></cite><img src="images/common/list.gif" border="0" /> [<a href="redirect.php?tid=$nthread[tid]&goto=lastpost#lastpost" title="转入查看最后回复的内容">新帖</a>] <a href="viewthread.php?tid=$nthread[tid]"  $nthread['highlight']  title='最新帖子 {LF}所在论坛: $nthread[forumname]{LF}主题标题: $nthread[subject] {LF}主题作者: $nthread[author]{LF}发表时间: $nthread[date]{LF}浏览次数: $nthread[views] 次 {LF}回复次数: $nthread[replies] 次{LF}最后回复: $nthread[lastreplytime]{LF}{lang lastpost}: $nthread[lastposter]'>$nthread[view_subject]</a></li>
  127.         <!--{/loop}-->                                                                               </ul>                       
  128.                         <ul id="d1" style="display:none" class=table>
  129.       <!--{loop $new_reply_threadlist $nthread}-->
  130.                                                                                                               <li><cite style="float:right">{$nthread[lastposter]}</cite><img src="images/common/list.gif" border="0" /> [<a href="redirect.php?tid=$nthread[tid]&goto=lastpost#lastpost" title="转入查看最后回复的内容">回复</a>] <a href="viewthread.php?tid=$nthread[tid]"  $nthread['highlight']  title='最新帖子 {LF}所在论坛: $nthread[forumname]{LF}主题标题: $nthread[subject] {LF}主题作者: $nthread[author]{LF}发表时间: $nthread[date]{LF}浏览次数: $nthread[views] 次 {LF}回复次数: $nthread[replies] 次{LF}最后回复: $nthread[lastreplytime]{LF}{lang lastpost}: $nthread[lastposter]'>$nthread[view_subject]</a></li>
  131.         <!--{/loop}-->

  132.                         </ul>
  133.                         <ul id="d2" style="display:none" class=table>
  134.       <!--{loop $new_hot_threadlist $nthread}-->

  135.                                                                                                       <li><cite style="float:right"><a href="space.php?uid={$nthread[authorid]}" title="查看{$nthread[author]}的个人空间" target="_blank">{$nthread[author]}</a></cite><img src="images/common/list.gif" border="0" /> [<a href="redirect.php?tid=$nthread[tid]&goto=lastpost#lastpost" title="转入查看最后回复的内容">精华</a>] <a href="viewthread.php?tid=$nthread[tid]"  $nthread['highlight']  title='最新帖子 {LF}所在论坛: $nthread[forumname]{LF}主题标题: $nthread[subject] {LF}主题作者: $nthread[author]{LF}发表时间: $nthread[date]{LF}浏览次数: $nthread[views] 次 {LF}回复次数: $nthread[replies] 次{LF}最后回复: $nthread[lastreplytime]{LF}{lang lastpost}: $nthread[lastposter]'>$nthread[view_subject]</a></li>
  136.         <!--{/loop}-->

  137.                           
  138. </ul>                </td>                       
  139.                 <td valign="top">  <b><font color={$mem_star[color]}>{$mem_star[grouptitle]}</font></b><table width='100%'><tr><td style='border-width:0px;'>姓名:<a href='space.php?uid=1752'><b>{$mem_star[bestmem]}</b></a>
  140. UID  :<b>{$mem_star[uid]}</b>
  141. 积分:{$mem_star[credits]}
  142. 精华:{$mem_star[digestposts]} 篇
  143. 今日发帖:<font color=red><b>{$mem_star[bestmemposts]}</b></font>
  144. 总发帖量:{$mem_star[posts]}
  145. 在线时间:{$mem_star[oltime]} h
  146.   来自:{$mem_star[location]}</td><td style='border-width:0px;'> <img src="{$mem_star[avatar]}" width=62 height=81 align=center>
  147. {eval showstars($mem_star['stars']);}</td></tr></table></td>

  148.                 <td valign="top" style="border-left:#CCCCCC solid; border-right:#CCCCCC solid;border-width:1px">
  149.                 <ul id="e0" style="display:block" class=table>       
  150. <!--{loop $richer_list $richer}-->
  151.                                                                                                       <li><cite style="float:right">{$richer[total_money]}刀</cite><img src="images/common/list.gif" border="0" /> <a href="space.php?uid={$richer[uid]}" title="查看{$richer[username]}的个人空间" target="_blank">{$richer[username]}</a></li>
  152.                                                                                                                                 <!--{/loop}-->
  153.                 </ul>
  154.                 <ul id="e1" style="display:none" class=table>       
  155. <!--{loop $robber_list $robber}-->


  156.                                                                                                       <li><cite style="float:right">抢{$robber[rob_times]}次/{$robber[rob_amount]}刀</cite><img src="images/common/list.gif" border="0" /> <a href="space.php?uid={$robber[uid]}" title="查看{$robber[username]}的个人空间" target="_blank">{$robber[username]}</a></li>
  157.                                                                                                                                 <!--{/loop}-->

  158.                 </ul>
  159.                 <ul id="e2" style="display:none" class=table>       
  160. <!--{loop $pettoplist $pettopinfo}-->
  161.                                                                                                       <li><cite style="float:right">$pettopinfo[mypetjob]转/$pettopinfo[mypetlevel]级</cite><img src="images/common/list.gif" border="0" /> <a href="pet.php?index=viewpet&username=$pettopinfo[usernameenc]">$pettopinfo[petname]</a></li>
  162.                                                 <!--{/loop}-->
  163.                 </ul>
  164.                   </td>
  165.   </tr>
  166. </table>
  167. </div>
  168. <!-- 首页四格代码结束 -->
复制代码
最后, 更新缓存即可~~

要修改图片显示的, 请打开根目录下的pic.php修改, 里面有说明, 记得要修改啊..因为pic.php里面是显示我的论坛的版块的图片

再最后, 有问题请跟帖回复...

[ 本帖最后由 Ricky_Yahoo 于 2007-12-9 20:07 编辑 ]

首页四格(帖子类型轮流变换+发帖之星+财富,悍匪,宠物排行榜)).rar

24.35 KB, 下载次数: 617

最后更新日期: 11月23日7:30

Rank: 8Rank: 8

UID
748351
积分
3486
帖子
3287
威望
24
在线时间
0 小时
注册时间
2007-7-9
发表于 2007-11-23 21:55:12 |显示全部楼层
····················

[ 本帖最后由 PcBeta.Com 于 2007-11-23 21:57 编辑 ]

使用道具 举报

King

站长

Rank: 6Rank: 6

UID
849735
积分
1347
帖子
503
威望
48
在线时间
109 小时
注册时间
2007-11-1
发表于 2007-11-23 22:00:32 |显示全部楼层
呵呵。。不知道为什么我发的帖子被说成含有什么文字不能发布..后来搞了一下。。原来是我的代码里面有个"会员自 x 拍" 所以给禁止发布...所以LSD你看到是半段的。。后来我去掉了,可以发布了。。。

使用道具 举报

Rank: 2

UID
773100
积分
177
帖子
216
威望
0
在线时间
1 小时
注册时间
2007-8-3
发表于 2007-11-23 22:29:19 |显示全部楼层
支持。。。收藏先

使用道具 举报

Rank: 4

UID
612459
积分
697
帖子
617
威望
1
在线时间
40 小时
注册时间
2007-1-9
发表于 2007-11-23 23:19:37 |显示全部楼层
一个要求,怎么屏蔽某些板块的帖子不要被五格调用啊。
[url=http://www.xjsonic.com/?fromuser=%B9%DC%C0%ED%D4%B1]E乐论坛[/url]

使用道具 举报

Rank: 2

UID
215754
积分
171
帖子
206
威望
0
在线时间
0 小时
注册时间
2005-6-30
发表于 2007-11-23 23:27:18 |显示全部楼层
宠物没有装.
怎么把宠物改成虚拟形象和去掉社区超女超男这一栏

使用道具 举报

Rank: 3Rank: 3

UID
197668
积分
281
帖子
70
威望
0
在线时间
26 小时
注册时间
2005-5-9
发表于 2007-11-23 23:46:17 |显示全部楼层
支持,强烈支持,可否给出那些排行榜的单独调用代码,我想插到我的论坛里去,谢谢了。

使用道具 举报

Rank: 6Rank: 6

UID
193169
积分
1273
帖子
1568
威望
0
在线时间
0 小时
注册时间
2005-4-24
发表于 2007-11-23 23:54:56 |显示全部楼层
所有的n格图片显示都把图片切成了一半,不知这个怎么改变!
个人开站,实惠、稳定才是硬道理!至强四核服务器先使用后付费
联系方式:13598871563      QQ:330599776

使用道具 举报

Rank: 6Rank: 6

UID
193169
积分
1273
帖子
1568
威望
0
在线时间
0 小时
注册时间
2005-4-24
发表于 2007-11-23 23:57:01 |显示全部楼层
我只想要最新贴、回复贴、精华贴的变换!后边我不想要,应该怎么修改!
个人开站,实惠、稳定才是硬道理!至强四核服务器先使用后付费
联系方式:13598871563      QQ:330599776

使用道具 举报

Forum Legend

Administrator

Rank: 8Rank: 8

UID
442277
积分
4155
帖子
4643
威望
2
在线时间
7 小时
注册时间
2006-9-16
发表于 2007-11-24 00:12:34 |显示全部楼层
不错--顶了,等装完插件就换

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

fastpost

手机版|Archiver|北京康盛新创科技有限责任公司 ( 京ICP证110024号|京网文[2011]0019-007号 )  

GMT+8, 2012-2-13 12:50 , Processed in 0.133074 second(s), 16 queries , Memcache On.

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部