topicadmin_stamp.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_stamp.php 33825 2013-08-19 08:32:40Z nemohou $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. if(!$_G['group']['allowstampthread']) {
  12. showmessage('no_privilege_stampthread');
  13. }
  14. loadcache('stamps');
  15. if(!submitcheck('modsubmit')) {
  16. include template('forum/topicadmin_action');
  17. } else {
  18. $modaction = $_GET['stamp'] !== '' ? 'SPA' : 'SPD';
  19. $_GET['stamp'] = $_GET['stamp'] !== '' ? $_GET['stamp'] : -1;
  20. $reason = checkreasonpm();
  21. C::t('forum_thread')->update($_G['tid'], array('moderated'=>1, 'stamp'=>$_GET['stamp']));
  22. if($modaction == 'SPA' && $_G['cache']['stamps'][$_GET['stamp']]['icon']) {
  23. C::t('forum_thread')->update($_G['tid'], array('icon'=>$_G['cache']['stamps'][$_GET['stamp']]['icon']));
  24. C::t('forum_threadhidelog')->delete_by_tid($_G['tid']);
  25. } elseif($modaction == 'SPD' && $_G['cache']['stamps'][$thread['stamp']]['icon'] == $thread['icon']) {
  26. C::t('forum_thread')->update($_G['tid'], array('icon'=>-1));
  27. }
  28. C::t('common_member_secwhite')->add($thread['authorid']);
  29. $resultarray = array(
  30. 'redirect' => "forum.php?mod=viewthread&tid=$_G[tid]&page=$page",
  31. 'reasonpm' => ($sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'notictype' => 'post', 'item' => $_GET['stamp'] !== '' ? 'reason_stamp_update' : 'reason_stamp_delete') : array()),
  32. 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, 'stamp' => $_G['cache']['stamps'][$stamp]['text']),
  33. 'modaction' => $modaction,
  34. 'modlog' => $thread
  35. );
  36. $modpostsnum = 1;
  37. updatemodlog($_G['tid'], $modaction, 0, 0, '', $modaction == 'SPA' ? $_GET['stamp'] : 0);
  38. }
  39. ?>