Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 概念型插件:主题置顶新方式之随机置顶For Discuz!5.x

[复制链接]
僭燮水 发表于 2007-5-30 14:54:43 | 显示全部楼层 |阅读模式
为庆祝2007年度插件大赛,俺特意制作了这个个概念型插件(这个名词是我瞎想滴

同志们加分啦

说明本插件是让随机置顶的主题 随机显示在主题列表页的第一页

比较懒的朋友可以下载rank.zip直接覆盖,不过不建议这么做
手动修改过程在二楼

[ 本帖最后由 小水水 于 2007-5-30 15:08 编辑 ]

评分

5

查看全部评分

 楼主| 僭燮水 发表于 2007-5-30 14:54:48 | 显示全部楼层
你有没有发现自己很少去看置顶主题,同样的论坛的常驻会员们也很少去看置顶主题,总是直接就滚轮或者拖过去了
所以,现在推出第四种置顶方式,提供置顶主题的浏览量,或许你也可以放置广告帖



1在文件include/moderation.inc.php中
查找
  1.                                 showmessage('undefined_action');
复制代码

替换为
  1.                                 if($operation != 'stick' || $level != 4){
  2.                                         showmessage('undefined_action');
  3.                                 }
复制代码


2在文件templates\default\topicadmin_moderate.htm中
查找
  1.                         <input class="radio" type="radio" name="level" value="3" $stickcheck[3] onclick="$('expirationarea').disabled=0"> <img src="{IMGDIR}/pin_3.gif" alt="" /> $threadsticky[0]</td>
复制代码

替换为
  1.                         <input class="radio" type="radio" name="level" value="3" $stickcheck[3] onclick="$('expirationarea').disabled=0"> <img src="{IMGDIR}/pin_3.gif" alt="" /> $threadsticky[0]
  2.                         <input class="radio" type="radio" name="level" value="4" $stickcheck[4] onclick="$('expirationarea').disabled=0"> <img src="{IMGDIR}/pin_1.gif" alt="" /> 随机置顶</td>
复制代码


3在文件forumdisplay.php中
查找
  1. $threadlist = array();
复制代码
替换为
  1. $threadlist = $threadotherlist = array();
复制代码


查找
  1.         if($thread['displayorder'] > 0) {
复制代码

替换为
  1.         if($thread['displayorder'] > 0 && $thread['displayorder'] < 4) {
复制代码


查找
  1.         $threadlist[] = $thread;
复制代码
替换为
  1.         if($thread['displayorder'] != 4) {
  2.                 $threadlist[] = $thread;
  3.         }else{
  4.                 $threadotherlist[] = $thread;
  5.         }
复制代码


查找
  1. $separatepos = $separatepos ? $separatepos + 1 : ($announcement ? 1 : 0);
复制代码

在上面加入
  1. function insert_in_array($itemone, $insertnum ,$arraylist){
  2.         for($key=0;$key<count($arraylist);$key++) {
  3.                 if($key == $insertnum){
  4.                         $newarraylist[] = $itemone;
  5.                 }
  6.                 $newarraylist[] = $arraylist[$key];
  7.         }
  8.         if($insertnum == count($arraylist)){
  9.                 $newarraylist[] = $itemone;
  10.         }
  11.         return $newarraylist;
  12. }

  13. foreach($threadotherlist as $key => $threadother) {
  14.         $threadlist = insert_in_array($threadother, mt_rand($separatepos, count($threadlist)), $threadlist);
  15. }
复制代码
回复

使用道具 举报

 楼主| 僭燮水 发表于 2007-5-30 14:54:53 | 显示全部楼层
继续站
回复

使用道具 举报

yaney 发表于 2007-5-30 14:58:23 | 显示全部楼层
板凳~~~~~~~~~~~~~~
回复

使用道具 举报

戏水 发表于 2007-5-30 14:58:40 | 显示全部楼层
随喜                    。
回复

使用道具 举报

安笛 发表于 2007-5-30 15:00:23 | 显示全部楼层
回复

使用道具 举报

网点 发表于 2007-5-30 15:03:35 | 显示全部楼层
新概念???
回复

使用道具 举报

rextsang 发表于 2007-5-30 18:18:36 | 显示全部楼层
水水大人我來支持你,謝囉
回复

使用道具 举报

wuhu911 发表于 2007-5-30 21:48:50 | 显示全部楼层
:) :) :)
回复

使用道具 举报

hxx_36 发表于 2007-5-30 21:53:37 | 显示全部楼层
支持个
MJJ看签名
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-4-19 23:28 , Processed in 0.689597 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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