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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖

[原創]第九貼-回覆後自動返回樓主,而不是自己的回覆!

[复制链接]
xjbl 发表于 2005-8-26 14:07:37 | 显示全部楼层
呵呵....纯支持了.
回复

使用道具 举报

 楼主| jimmyjimmyqqq 发表于 2005-8-26 14:38:20 | 显示全部楼层
原帖由 xjbl 于 2005-8-26 14:07 发表
呵呵....纯支持了.

哈哈謝謝支持,大大真好人,好過alan888的會員,不懂什麼是回覆,迫我加上hide!
回复

使用道具 举报

乄有點の拽ヤ 发表于 2005-8-26 15:00:31 | 显示全部楼层
这个有用
回复

使用道具 举报

lyxzz 发表于 2005-8-26 15:50:51 | 显示全部楼层
正合心意,顶上
回复

使用道具 举报

 楼主| jimmyjimmyqqq 发表于 2005-8-26 16:41:36 | 显示全部楼层
原帖由 lyxzz 于 2005-8-26 15:50 发表
正合心意,顶上

謝謝頂上!
回复

使用道具 举报

青春E族 发表于 2005-8-26 18:04:38 | 显示全部楼层
好东东啊,感谢楼主
回复

使用道具 举报

lhj8000 发表于 2005-9-25 21:38:39 | 显示全部楼层
汗 改了之后竟然不能恢复帖子了!!一回复显示一个空白页!!而且修改回去也行了,倒!!!高手帮忙看看!!

  1. <?php

  2. /*
  3. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4. :: [DISCUZ!]  Crossday Discuz! Board                                    ::
  5. :: (c) 2001-2005 Comsenz Technology Ltd (www.discuz.com)                ::
  6. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7. :: Author:  Crossday (tech@discuz.com) Cnteacher (cnteacher@discuz.com) ::
  8. :: Version: 2.5F   2004/10/01 05:15                                     ::
  9. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10. */
  11. //fix:  BY pk0909
  12. /*
  13. 1 子论坛新贴未影响父论坛
  14. */

  15. if(!defined('IN_DISCUZ')) {
  16.         exit('Access Denied');
  17. }

  18. $discuz_action = 12;

  19. if(!$discuz_uid && !((!$forum['replyperm'] && $allowpost) || ($forum['replyperm'] && strstr

  20. ($forum['replyperm'], "\t$groupid\t")))) {
  21.         header('Location: logging.php?action=login&referer='.rawurlencode("$PHP_SELF?

  22. action=$action&fid=$fid&tid=$tid&pid=$pid&repquote=$repquote"));
  23.         exit();
  24. } elseif(!$forum['allowreply']) {
  25.         if(!$forum['replyperm'] && !$allowpost) {
  26.                 showmessage('group_nopermission', NULL, 'HALTED');
  27.         } elseif($forum['replyperm'] && !strstr($forum['replyperm'], "\t$groupid\t")) {
  28.                 showmessage('post_forum_newreply_nopermission', NULL, 'HALTED');
  29.         }
  30. }

  31. if(empty($thread)) {
  32.         showmessage('thread_nonexistence');
  33. }

  34. if(!submitcheck('replysubmit')) {

  35.         if($repquote) {
  36.                 $query = $db->query("SELECT tid, fid, author, message, useip, dateline FROM

  37. $table_posts WHERE pid='$repquote'");
  38.                 $thaquote = $db->fetch_array($query);
  39.                 if($thaquote['tid'] != $tid) {
  40.                         showmessage('undefined_action', NULL, 'HALTED');
  41.                 }
  42.                 $quotefid = $thaquote['fid'];
  43.                 $message = $thaquote['message'];

  44.                 $time = gmdate("$dateformat $timeformat", $thaquote[dateline] + ($timeoffset *

  45. 3600));
  46.                 $message = preg_replace("/\[hide=?\d*\](.+?)\[\/hide\]/is", "[b]**** Hidden

  47. message by originally poster *****[/b]", $message);
  48.                 $message = preg_replace("/(\[quote])(.*)(\[\/quote])/siU", "", $message);
  49.                 $message = cutstr(dhtmlspecialchars($message), 200);

  50.                 $thaquote['useip'] = substr($thaquote['useip'], 0, strrpos($thaquote['useip'],

  51. '.')).'.x';
  52.                 $thaquote['author'] = $thaquote['author'] ? "[i]$thaquote[author][/i]" : "[i]

  53. Guest[/i] from $thaquote[useip]";
  54.                 $message = preg_replace("/\n{2}\[ Last edited by .+? on .+? at .+? \]$/s", '',

  55. $message);
  56.                 $message = "[quote]Originally posted by $thaquote[author] at $time:\n$message

  57. [/quote]\n";
  58.         }
  59.        
  60.         $multiattach = $allowpostattach && $attach_replypost ? array_fill

  61. (1,$attach_replypost,'1'):0;

  62.         include template('post_newreply');

  63. } else {

  64.         if($subject == '' && $message == '') {
  65.                 showmessage('post_sm_isnull');
  66.         }

  67.         if($post_invalid = checkpost()) {
  68.                 showmessage($post_invalid);
  69.         }

  70.         if(checkflood()) {
  71.                 showmessage('post_flood_ctrl');
  72.         }

  73.         if($thread['closed'] && !$ismoderator) {
  74.                 showmessage('post_thread_closed');
  75.         }

  76.         $lastnotifytime = $timestamp - 86400;
  77.         $emails = $comma = '';
  78.         $query = $db->query("SELECT email FROM $table_subscriptions WHERE uid<>'$discuz_uid' AND

  79. tid='$tid' AND lastnotify<'$lastnotifytime'");
  80.         while($subs = $db->fetch_array($query)) {
  81.                 $emails .= $comma.$subs['email'];
  82.                 $comma = ', ';
  83.         }
  84.         if($emails) {
  85.                 sendmail($emails, 'email_notify_subject', 'email_notify_message');
  86.                 $db->query("UPDATE $table_subscriptions SET lastnotify=$timestamp WHERE

  87. tid='$tid' AND lastnotify<'$lastnotifytime'", 'UNBUFFERED');
  88.         }
  89.         if($emailnotify && $discuz_uid) {
  90.                 $db->query("INSERT INTO $table_subscriptions (uid, email, tid)
  91.                                 VALUES ('$discuz_uid', '$email', '$tid')", 'SILENT');
  92.         }

  93.         $paid = $last_attach_type = $aid = $tmark ='';
  94.         if($allowpostattach) {
  95.                 $post_attaches = attach_upload();
  96.                 if(is_array($post_attaches) && count($post_attaches) && $allowpostattach) {
  97.                         foreach( $post_attaches as $v) {
  98.                                 $db->query("INSERT INTO $table_attachments (tid, uid

  99. ,creditsrequire, filename, filetype, filesize, attachment, dateline, downloads)
  100.                                 VALUES ('$tid', '$discuz_uid', '$v[creditsrequire]', '$v

  101. [filename]', '$v[filetype]', '$v[filesize]', '$v[attachment]', '$timestamp', '0')");
  102.                                 $v['aid'] = $db->insert_id();
  103.                                 $aid .= $tmark.''.$v['aid'];
  104.                                 $tmark = ' ,';
  105.                                 $last_attach_type = fileext($v['filename'])."\t".$v['filetype'];
  106.                                 $paid ++;
  107.                         }
  108.                 }
  109.         }
  110.         unset($post_attaches);

  111.         $bbcodeoff = checkbbcodes($message, $bbcodeoff);
  112.         $smileyoff = checksmilies($message, $smileyoff);

  113.         $db->query("INSERT INTO $table_posts (fid, tid, aid, author, authorid, subject, dateline,

  114. message, useip, usesig, bbcodeoff, smileyoff, parseurloff)
  115.                         VALUES ('$fid', '$tid', '$paid', '$discuz_user', '$discuz_uid',

  116. '$subject', '$timestamp', '$message', '$onlineip', '$usesig', '$bbcodeoff', '$smileyoff',

  117. '$parseurloff')");
  118.         $pid = $db->insert_id();
  119.         if($aid) {
  120.                 $db->query("UPDATE $table_attachments SET pid='$pid' WHERE aid in ($aid)",

  121. 'UNBUFFERED');
  122.                 $db->query("UPDATE $table_threads SET lastposter='$discuz_user',

  123. lastpost='$timestamp', replies=replies+1, attachment='".attachtype($last_attach_type, 'id')."'

  124. WHERE tid='$tid' AND fid='$fid'", 'UNBUFFERED');
  125.         } else {
  126.                 $db->query("UPDATE $table_threads SET lastposter='$discuz_user',

  127. lastpost='$timestamp', replies=replies+1 WHERE tid='$tid' AND fid='$fid'", 'UNBUFFERED');
  128.         }

  129.         //后台金钱设置 by 地狱死神
  130. if($bankstatus>=0) {
  131. updatemember('+', $discuz_uid, $replycredits, $replymoney);
  132. }else{
  133. updatemember('+', $discuz_uid, $replycredits);
  134. }
  135. //后台金钱设置 by 地狱死神

  136.         $db->query("UPDATE $table_forums SET lastpost='".addslashes($thread

  137. ['subject'])."\t$timestamp\t$discuz_user', posts=posts+1 WHERE fid='$fid'", 'UNBUFFERED');
  138.         if ($forum['fup'] && $forum['type'] == 'sub' && !$forum['viewperm']) {
  139.                 $db->query("UPDATE $table_forums SET lastpost='".addslashes($thread

  140. ['subject'])."\t$timestamp\t$discuz_user'  WHERE fid='$forum[fup]'", 'UNBUFFERED');
  141.         }
  142.         @$topicpages = ceil(($thread['replies'] + 2) / $ppp);
  143.         showmessage('post_reply_succeed', "viewthread.php?tid=$tid");
  144. ?>
复制代码
回复

使用道具 举报

5025488.net 发表于 2005-9-25 23:59:40 | 显示全部楼层
真的是简短而实用啊
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-22 03:06 , Processed in 0.023026 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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