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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[加强]游客不可浏览精华、被加分贴子

[复制链接]
lj80117 发表于 2005-4-11 00:29:55 | 显示全部楼层 |阅读模式
插件名称:[加强]游客不可浏览精华、被加分贴子
插件作者:老师
程序修改:funcn
功能描述:游客访问精华主题出现如附件1的提示,访问加分帖子出现如附件2提示!
适应版本:Discuz 2.5 sp1
安装难易:简单
效率影响:无
资源占用:极小
修改文件:viewthread.php
后台管理:无
版权声明:转载本插件请保持文档完整,如果觉得HACK不错请看过以后顶一顶!![/box]

编辑viewthread.php
一、游客不可浏览精华主题 BY Cnteacher
查找
  1.         if(!$thread = $db->fetch_array($query)) {
  2.                 showmessage('thread_nonexistence');
  3.         }
  4.         header("Location: {$boardurl}viewthread.php?tid=$thread[tid]&sid=$sid");
  5.         exit();
  6. } else {
  7.         showmessage('thread_nonexistence');
  8. }
复制代码

后面加入
  1. //对于精品贴子限制游客浏览-FreeDiscuz-Cnteacher
  2. if ($thread['digest'] && !$discuz_user){   
  3.     showmessage('本站精品贴限制流浪猪猪浏览!&nbsp;请您<a href="register.php"><b>注册</b></a>或者<a href="logging.php?action=login"><b>登陆</b></a>,支持我站的发展。<br><h4><font color=red>您的举手之劳是对我们莫大的鼓舞</font></h4>');
  4. }
  5. //精华限制完毕
复制代码

如果安装了“完全模仿D4的无权限友好提示区域”请加入下列代码,效果图如附件3
  1. //对于精品贴子限制游客浏览-FreeDiscuz-Cnteacher
  2. if ($thread['digest'] && !$discuz_user){   
  3.         showmessage('本站精华贴子一律限制游客浏览!&nbsp;请您注册或者登陆,支持本站的发展。<br><font color=red>您的举手之劳是对我们莫大的鼓舞</font>', NULL, 'NOPERM');
  4. }
  5. //精华限制完毕
复制代码

继续向下查找
  1.                 $post['message'] = postify($post['message'], $post['smileyoff'], $post['bbcodeoff'], $forum['allowsmilies'], $forum['allowhtml'], $forum['allowbbcode'], $forum['allowimgcode']);
复制代码

后面加入
  1. //加分贴限制游客浏览 by funcn
  2.                 if ($post['rate'] > 0 && !$discuz_user){
  3.                         $post['message'] = "本站加分贴限制游客浏览!&nbsp;请您<a href="register.php"><b>注册</b></a>或者<a href="logging.php?action=login"><b>登陆</b></a>,支持我站的发展。";
  4.                 }
  5. //end
复制代码








[ Last edited by lj80117 on 2005-5-3 at 19:25 ]
mmcatv 发表于 2005-4-11 00:46:10 | 显示全部楼层
唉~~~冷静哎,帮你顶顶吧,可怜的论坛~
回复

使用道具 举报

bingtaire 发表于 2005-4-11 09:38:46 | 显示全部楼层
这个功能不错啊,改动的还少。顶上
回复

使用道具 举报

chenqixac 发表于 2005-4-23 19:50:09 | 显示全部楼层
这个功能不错啊,我怎么搜索不到那个语句?
回复

使用道具 举报

freddy 发表于 2005-4-23 21:34:35 | 显示全部楼层
你搜索不到哪句?
回复

使用道具 举报

血刀 发表于 2005-5-3 13:24:06 | 显示全部楼层
if(!$thread = $db->fetch_array($query)) {
                showmessage('thread_nonexistence');
        }
        header("Location: {$boardurl}viewthread.php?tid=$thread[tid]&sid=$sid");
        exit();
} else {
        showmessage('thread_nonexistence');
}

找不到这句
回复

使用道具 举报

lianmong 发表于 2005-5-3 15:18:10 | 显示全部楼层
Originally posted by 血刀 at 2005-5-3 13:24

找不到这句


我也找不到,眼都找花啦!
这个插件真的很好!
回复

使用道具 举报

 楼主| lj80117 发表于 2005-5-3 19:26:08 | 显示全部楼层
缩小范围找,2.5SP1肯定能找到
回复

使用道具 举报

lianmong 发表于 2005-5-3 20:54:57 | 显示全部楼层
找了半天还是没找到一模一样的,我是加在这个后面的:
....................
..............

        $thread = $forum;
        $fid = $forum['fid'];
        if(@!include DISCUZ_ROOT.'./forumdata/cache/style_'.intval(!empty($forum['styleid']) ? $forum['styleid'] : $styleid).'.php') {
                        $styleid = $_DCACHE['settings']['styleid'];
                        $cachelost .= (@include DISCUZ_ROOT.'./forumdata/cache/style_'.$styleid.'.php') ? '' : ' style_'.$styleid;
        }
} else {
        showmessage('thread_nonexistence');
}

管用!看效果:http://www.123yx.com

谢谢楼主提供这么好的插件!

[ Last edited by lianmong on 2005-5-3 at 22:02 ]
回复

使用道具 举报

61551.com 发表于 2005-5-4 13:18:10 | 显示全部楼层
支持一下
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-21 19:29 , Processed in 0.114702 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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