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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

【定时发布】功能修改方法现公布!

[复制链接]
guophoon 发表于 2008-9-18 09:19:02 | 显示全部楼层 |阅读模式

因为本人需要,需要昨晚花了1个半小时(非计算机专业,从没学过php,研究代码,比葫芦画瓢),搞定了定时发布功能(而且只有版主以上权限方可使用)。
现将修改方法公布如下,如果有朋友需要可以,参照修改(注意备份源文件):

1、修改\templates\default\post_newthread.htm
约150在<!--{if $tagstatus}-->之上添加如下代码:


  1. <!--新增定时发布开始-->
  2. <!--{if $forum['ismoderator']}-->
  3. <script type="text/javascript" src="include/javascript/calendar.js"></script>
  4.   <tr>
  5.    <th><label for="post_time">{lang post_time}</label></th>
  6.    <td>
  7.     <input size="45" type="input" id="post_time" name="post_time" readonly value="{echo date('Y-m-d H:i');}" tabindex="200" onclick="showcalendar(event, this, true)" />&nbsp;
  8.     <em class="tips">{lang post_comment}</em>
  9.    </td>
  10.   </tr>
  11.   <!--{/if}-->
  12. <!--新增定时发布结束 -->

复制代码


2、修改\include\newthread.inc.php
约297行($subscribed = !empty($emailnotify) && $discuz_uid ? 1 : 0;)之下添加新行,添加代码


  1. //以下新增定时发布修改
  2. if($post_time){
  3. $timestamp = @strtotime($post_time);
  4. }
  5. //以下新增定时发布修改结束
复制代码


3、\forumdisplay.php
276行,where后添加 $timestamp>t.dateline and
即:将
  1. WHERE t.fid='$fid' $filteradd AND $displayorderadd
复制代码

修改为:
  1. WHERE $timestamp>t.dateline and t.fid='$fid' $filteradd AND $displayorderadd
复制代码


4、修改templates\default\templates.lang.php
页面底部“);”上添加:

  1.   'post_comment' => '(如果您想定时发布,请修改。<strong>时间要晚于当前时间!</strong>)',
  2. 'post_time' => '发布时间(<font color=#ff0000>默认即时发布</font>)',
复制代码




------------------------------------------
希望对需要的人有所帮助,目前只限于非特殊话题的发布。

如果有用,请帮忙做上本站连接,谢谢~~~

壹壹英语论坛:http://www.yeeyi.net/bbs

[ 本帖最后由 guophoon 于 2008-9-18 02:28 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
阔少 发表于 2008-9-18 09:26:25 | 显示全部楼层
很有用啊,顶个
回复

使用道具 举报

阔少 发表于 2008-9-18 09:27:08 | 显示全部楼层
这个在首页多格能不能隐藏?
回复

使用道具 举报

 楼主| guophoon 发表于 2008-9-18 09:30:00 | 显示全部楼层
首页多格,恐怕不行
多格是怎末调用的?

修改很简单,只用修改相关SQL查询语句,
增加 $timestamp>t.dateline(注:t.dateline中的t.修改根据实际情况修改)
即可

[ 本帖最后由 guophoon 于 2008-9-18 02:31 编辑 ]
回复

使用道具 举报

mmmmmm147258369 发表于 2008-9-18 09:31:08 | 显示全部楼层
這個要頂!

問題同上 ……  (::39::)
回复

使用道具 举报

阔少 发表于 2008-9-18 09:32:07 | 显示全部楼层
楼主完善一下,修改一个在首页多格最新主题不显示定时发布帖子的.....
回复

使用道具 举报

 楼主| guophoon 发表于 2008-9-18 09:34:44 | 显示全部楼层
可是 我不明白多格,多格文件给我传一份
回复

使用道具 举报

阔少 发表于 2008-9-18 10:07:53 | 显示全部楼层
我用的是这个,麻烦给研究一下
https://discuz.dismall.com/thread-948686-1-1.html
回复

使用道具 举报

urna 发表于 2008-9-19 21:18:29 | 显示全部楼层
如果能让普通会员也能定时发帖就好了~
回复

使用道具 举报

619962744 发表于 2008-9-19 21:20:40 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-2 09:39 , Processed in 0.128075 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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