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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 隐藏时效 for dz4X by lu5266

[复制链接]
laifuer 发表于 2006-7-30 22:48:33 | 显示全部楼层
这个要顶
回复

使用道具 举报

HY清风 发表于 2006-7-31 00:52:33 | 显示全部楼层
这个非常不错!
回复

使用道具 举报

 楼主| lu5266 发表于 2006-7-31 11:03:25 | 显示全部楼层
^_^
回复

使用道具 举报

good2002 发表于 2006-8-1 12:36:53 | 显示全部楼层
支持 一下:)
回复

使用道具 举报

 楼主| lu5266 发表于 2006-8-1 20:14:01 | 显示全部楼层
up
回复

使用道具 举报

haohao036 发表于 2006-8-1 23:23:08 | 显示全部楼层
加了附件隐藏怎么改.

  1.                 if(preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", $message)) {
  2.                         if(stristr($message, '[hide]')) {
  3.                                 global $language;
  4.                                 include_once language('misc');

  5.                                 //$query = $db->query("SELECT pid FROM {$tablepre}posts WHERE tid='$tid' AND authorid='$discuz_uid' LIMIT 1");
  6.                                 //if($GLOBALS['forum']['ismoderator'] || $db->result($query, 0)) {
  7.                                 global $isposted;
  8.                                 if(!isset($isposted)) {
  9.                                         $query = $db->query("SELECT pid FROM {$tablepre}posts WHERE tid='$tid' AND authorid='$discuz_uid' LIMIT 1");
  10.                                         $isposted = $db->result($query, 0);
  11.                                         }
  12.                                 if($GLOBALS['forum']['ismoderator'] || $isposted) {

  13.         $message = preg_replace("/\[hide\]\s*(.+?)\s*\[\/hide\]/is",  
  14.                                 "<span style="altbg2"><fieldset style="margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all" align="center"><legend><span class="smalltxt"><strong>私密信息:</strong></span></legend></span><br>\\1</fieldset>",
  15.                                 $message);
  16.                                 $ishide = FALSE;
  17.                         } else {
  18.                                 $GLOBALS['show_attach']=0;
  19.                                 $message = preg_replace("/\[hide\](.+?)\[\/hide\]/is",
  20.                                 "<span style="altbg2"><fieldset style="margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all" align="center"><legend><span class="smalltxt"><strong>私密信息:</strong></span></legend></span><br>您尚未在本主题回复,内容已经隐藏。</fieldset>",$message);
  21.                                 $ishide = TRUE;
  22.                                 }
  23.                         }
  24.                         $message = preg_replace("/\[hide=(\d+)\]\s*(.+?)\s*\[\/hide\]/ies", "creditshide(\\1,'\\2')", $message);
  25.                 }
  26.         }
复制代码
回复

使用道具 举报

 楼主| lu5266 发表于 2006-8-2 01:51:25 | 显示全部楼层
原帖由 haohao036 于 2006-8-1 23:23 发表
加了附件隐藏怎么改.

                if(preg_match("/\.+?\/is", $message)) {
                        if(stristr($message, '')) {
                                global $language;
                                include_once language('misc');

                                //$query = $db->query ...


这个啊

我没弄那个
代码那么多啊

你给那个贴的地址
看下
回复

使用道具 举报

haohao036 发表于 2006-8-3 23:44:28 | 显示全部楼层
回复

使用道具 举报

 楼主| lu5266 发表于 2006-8-4 00:05:18 | 显示全部楼层
原帖由 haohao036 于 2006-8-3 23:44 发表
https://discuz.dismall.com/viewthread.php?tid=214335&highlight=%B8%BD%BC%FE

地址送上..


我没法测试

你先备分

再测试

有问题的话
把语法错误贴出来

用下面替换你贴出来的的代码

      
  1. if(preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", $message)) {
  2.         
  3.             // 隐藏时效 by lu5266 (www.5466.ik8.com)                       
  4.                         $efftime = $start = $end = 0;
  5.                         $start = strpos($message ,'[time]') + 6;
  6.                         $end = strpos($message ,'[/time]');
  7.                         if($end > $start && $start > 6) {
  8.                                 $hidetime = substr($message,$start,$end-$start);
  9.                                 $message = str_replace('[time]'.$hidetime.'[/time]', '', $message);               
  10.                                 $efftime = $hidetime * 3600  + strtotime($GLOBALS[post]['dateline']) - $GLOBALS[timestamp];                       
  11.                                 if($efftime > 0) {
  12.                                         $date = floor($efftime/86400);
  13.                                         $hour = floor($efftime%86400/3600);
  14.                                         $minute = floor($efftime%86400%3600/60);
  15.                                         $enddate = gmdate("$GLOBALS[dateformat] $GLOBALS[timeformat]", $hidetime * 3600  + strtotime($GLOBALS[post]['dateline']) + $GLOBALS[timeoffset] * 3600);
  16.                                         $effdate = "时效: <b><font color=blue>$hidetime</font></b>小时,  开始: <b><font color=blue>".$GLOBALS[post]['dateline']."</font></b>, 结束: <b><font color=blue>$enddate</font></b>,  剩下: <b><font color=blue>$date</font></b> 天 <b><font color=blue>$hour</font></b> 小时 <b><font color=blue>$minute</font></b> 分";
  17.                                         $effdate = "<fieldset style="padding: 1em; width=90%" align="center"><legend>[限时隐藏] ->本内容需[跟帖回复]或者[隐藏时效已过]方可浏览</legend><br>$effdate<br></fieldset>";
  18.                                 }
  19.                         }         
  20.                         if(stristr($message, '[hide]')) {
  21.                                 global $language,$isposted;
  22.                                 include_once language('misc');
  23.                                 if(!isset($isposted)) {
  24.                                         $query = $db->query("SELECT pid FROM {$tablepre}posts WHERE tid='$tid' AND authorid='$discuz_uid' LIMIT 1");
  25.                                         $isposted = $db->result($query, 0);
  26.                                 }
  27.                                 if($GLOBALS['forum']['ismoderator'] || $isposted || ($end > $start && $efftime <= 0 && $start > 6)) {
  28.                                 $message = preg_replace("/\[hide\]\s*(.+?)\s*\[\/hide\]/is","<span style="altbg2"><fieldset style="margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all" align="center"><legend><span class="smalltxt"><strong>[限时隐藏失效] ->本内容[你已跟帖回复]或者[隐藏时效已过]</strong></span></legend></span>\\1<br></fieldset>",$message);
  29.                                         $ishide = FALSE;
  30.                                 }else if($end > $start && $efftime > 0 && $start > 6) {
  31.                                         $message = preg_replace("/\[hide\](.+?)\[\/hide\]/is", $effdate, $message);                               
  32.                                 }  else {
  33.                                         $GLOBALS['show_attach']=0;
  34.                                         $message = preg_replace("/\[hide\](.+?)\[\/hide\]/is", "<span style="altbg2"><fieldset style="margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all" align="center"><legend><span class="smalltxt"><strong>[永久隐藏]</strong></span></legend></span>本内容需[跟帖回复]方可浏览<br></fieldset>",$message);
  35.                                         $ishide = TRUE;
  36.                                 }
  37.                         }
  38.                         $message = preg_replace("/\[hide=(\d+)\]\s*(.+?)\s*\[\/hide\]/ies", "creditshide(\\1,'\\2')", $message);
  39.                 }
  40.         }
复制代码
回复

使用道具 举报

M55 发表于 2006-8-4 02:31:36 | 显示全部楼层

OK!已经安装好了!可以提供测试!

测试地址:http://www.shux.cn/shux1/forum-30-1.html

使用愉快!
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-26 19:55 , Processed in 0.244868 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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