topicadmin_live.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: topicadmin_live.php 32028 2012-10-31 10:12:22Z zhangjie $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. if(!$_G['group']['allowlivethread']) {
  12. showmessage('no_privilege_livethread');
  13. }
  14. if(!submitcheck('modsubmit')) {
  15. include template('forum/topicadmin_action');
  16. } else {
  17. $modaction = $_GET['live'] ? 'LIV' : 'LIC';
  18. $reason = checkreasonpm();
  19. $expiration = $_GET['expirationlive'] ? dintval($_GET['expirationlive']) : 0;
  20. if($modaction == 'LIV') {
  21. C::t('forum_forumfield')->update($_G['fid'], array('livetid' => $_G['tid']));
  22. } elseif($modaction == 'LIC') {
  23. if($_G['tid'] != $_G['forum']['livetid']) {
  24. showmessage('topicadmin_live_noset_error');
  25. }
  26. C::t('forum_forumfield')->update($_G['fid'], array('livetid' => 0));
  27. }
  28. $resultarray = array(
  29. 'redirect' => "forum.php?mod=viewthread&tid=$_G[tid]&page=$page",
  30. 'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'notictype' => 'post', 'item' => $_GET['live'] ? 'reason_live_update' : 'reason_live_cancle') : array()),
  31. 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason),
  32. 'modaction' => $modaction,
  33. 'modlog' => $thread
  34. );
  35. $modpostsnum = 1;
  36. updatemodlog($_G['tid'], $modaction, $expiration, 0, '', $modaction == 'LIV' ? 1 : 0);
  37. }
  38. ?>