function usesubmit() { global $_G; $idtype = !empty($_GET['idtype']) ? $_GET['idtype'] : ''; if (!in_array($idtype, $this->idtypearray)) { showmessage(lang('magic/highlight', 'highlight_info_notype'), dreferer(), array(), array('showdialog' => 1, 'locationtime' => true)); } if (empty($_GET['id'])) { showmessage(lang('magic/highlight', 'highlight_info_nonexistence_' . $idtype)); } if ($idtype == 'tid') { $info = getpostinfo($_GET['id'], $idtype, array('fid', 'authorid', 'subject')); $this->_check($info['fid']); magicthreadmod($_GET['id']); C::t('forum_thread')->update($_GET['id'], array('highlight' => $_GET['highlight_color'], 'moderated' => 1)); $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 24; $expiration = TIMESTAMP + $this->parameters['expiration'] * 3600; updatemagicthreadlog($_GET['id'], $this->magic['magicid'], $expiration > 0 ? 'EHL' : 'HLT', $expiration); if ($info['authorid'] != $_G['uid']) { notification_add($info['authorid'], 'magic', lang('magic/highlight', 'highlight_notification'), array('tid' => $_GET['id'], 'subject' => $info['subject'], 'magicname' => $this->magic['name'])); } } elseif ($idtype == 'blogid') { $info = getpostinfo($_GET['id'], $idtype, array('uid', 'subject')); C::t('home_blogfield')->update($_GET['id'], array('magiccolor' => $_GET['highlight_color'])); if ($info['uid'] != $_G['uid']) { notification_add($info['uid'], 'magic', lang('magic/highlight', 'highlight_notification_blogid'), array('blogid' => $_GET['id'], 'subject' => $info['subject'], 'magicname' => $this->magic['name'])); } } usemagic($this->magic['magicid'], $this->magic['num']); updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, $idtype, $_GET['id']); showmessage(lang('magic/highlight', 'highlight_succeed_' . $idtype), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); }
function usesubmit() { global $_G; if (empty($_G['gp_tid'])) { showmessage(lang('magic/sofa', 'sofa_info_nonexistence')); } $thread = getpostinfo($_G['gp_tid'], 'tid', array('fid', 'authorid', 'dateline', 'subject')); $this->_check($thread); $firstsofa = DB::result_first("SELECT COUNT(*) FROM " . DB::table('forum_threadmod') . " WHERE magicid='" . $this->magic['magicid'] . "' AND tid='{$_G['gp_tid']}'"); if ($firstsofa >= 1) { showmessage(lang('magic/sofa', 'sofa_info_sofaexistence'), '', array(), array('login' => 1)); } $sofamessage = lang('magic/sofa', 'sofa_text', array('actor' => $_G['member']['username'], 'time' => dgmdate(TIMESTAMP), 'magicname' => $this->magic['name'])); $dateline = $thread['dateline'] + 1; insertpost(array('fid' => $thread['fid'], 'tid' => $_G['gp_tid'], 'first' => '0', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'dateline' => $dateline, 'message' => $sofamessage, 'useip' => $_G['clientip'], 'usesig' => '1')); DB::query("UPDATE " . DB::table('forum_thread') . " SET replies=replies+1, moderated='1' WHERE tid='{$_G['tid']}'", 'UNBUFFERED'); DB::query("UPDATE " . DB::table('forum_forum') . " SET posts=posts+1, todayposts=todayposts+1 WHERE fid='{$post['fid']}'", 'UNBUFFERED'); usemagic($this->magic['magicid'], $this->magic['num']); updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_G['gp_tid']); updatemagicthreadlog($_G['gp_tid'], $this->magic['magicid']); if ($thread['authorid'] != $_G['uid']) { notification_add($thread['authorid'], 'magic', lang('magic/sofa', 'sofa_notification'), array('tid' => $_G['gp_tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name'])); } showmessage(lang('magic/sofa', 'sofa_succeed'), dreferer(), array(), array('showdialog' => 1, 'locationtime' => 1)); }
function usesubmit() { global $_G; if (empty($_GET['tid'])) { showmessage(lang('magic/bump', 'bump_info_nonexistence')); } $thread = getpostinfo($_GET['tid'], 'tid', array('fid', 'authorid', 'subject')); $this->_check($thread['fid']); C::t('forum_thread')->update($_GET['tid'], array('moderated' => 1, 'lastpost' => TIMESTAMP)); usemagic($this->magic['magicid'], $this->magic['num']); updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_GET['tid']); updatemagicthreadlog($_GET['tid'], $this->magic['magicid'], 'BMP'); if ($thread['authorid'] != $_G['uid']) { notification_add($thread['authorid'], 'magic', lang('magic/bump', 'bump_notification'), array('tid' => $_GET['tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name'])); } showmessage(lang('magic/bump', 'bump_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); }
function usesubmit() { global $_G; if (empty($_G['gp_tid'])) { showmessage(lang('magic/bump', 'bump_info_nonexistence')); } $thread = getpostinfo($_G['gp_tid'], 'tid', array('fid', 'authorid', 'subject')); $this->_check($thread['fid']); DB::query("UPDATE " . DB::table('forum_thread') . " SET lastpost='" . TIMESTAMP . "', moderated='1' WHERE tid='{$_G['gp_tid']}'"); usemagic($this->magic['magicid'], $this->magic['num']); updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_G['gp_tid']); updatemagicthreadlog($_G['gp_tid'], $this->magic['magicid'], 'BMP'); if ($thread['authorid'] != $_G['uid']) { notification_add($thread['authorid'], 'magic', lang('magic/bump', 'bump_notification'), array('tid' => $_G['gp_tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name'])); } showmessage(lang('magic/bump', 'bump_succeed'), dreferer(), array(), array('showdialog' => 1, 'locationtime' => true)); }
function usesubmit() { global $_G; if (empty($_GET['tid'])) { showmessage(lang('magic/close', 'close_info_nonexistence')); } $thread = getpostinfo($_GET['tid'], 'tid', array('fid', 'authorid', 'subject')); $this->_check($thread); magicthreadmod($_GET['tid']); C::t('forum_thread')->update($_GET['tid'], array('closed' => 1, 'moderated' => 1)); $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 24; $expiration = TIMESTAMP + $this->parameters['expiration'] * 3600; usemagic($this->magic['magicid'], $this->magic['num']); updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_GET['tid']); updatemagicthreadlog($_GET['tid'], $this->magic['magicid'], $expiration > 0 ? 'ECL' : 'CLS', $expiration); if ($thread['authorid'] != $_G['uid']) { notification_add($thread['authorid'], 'magic', lang('magic/close', 'close_notification'), array('tid' => $_GET['tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name'])); } showmessage(lang('magic/close', 'close_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true)); }
function usesubmit() { global $_G; if (empty($_G['gp_tid'])) { showmessage(lang('magic/highlight', 'highlight_info_nonexistence')); } $thread = getpostinfo($_G['gp_tid'], 'tid', array('fid', 'authorid', 'subject')); $this->_check($thread['fid']); magicthreadmod($_G['gp_tid']); DB::query("UPDATE " . DB::table('forum_thread') . " SET highlight='{$_G['gp_highlight_color']}', moderated='1' WHERE tid='{$_G['gp_tid']}'"); $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 24; $expiration = TIMESTAMP + $this->parameters['expiration'] * 3600; usemagic($this->magic['magicid'], $this->magic['num']); updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_G['gp_tid']); updatemagicthreadlog($_G['gp_tid'], $this->magic['magicid'], 'HLT', $expiration); if ($thread['authorid'] != $_G['uid']) { notification_add($thread['authorid'], 'magic', lang('magic/stick', 'highlight_notification'), array('tid' => $_G['gp_tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name'])); } showmessage(lang('magic/highlight', 'highlight_succeed'), dreferer(), array(), array('showdialog' => 1, 'locationtime' => 1)); }
if (!substr(sprintf('%04b', $forum['allowpostspecial']), -$thread['special'], 1)) { showmessage('admin_move_nopermission'); } } $query = $db->query("SELECT postperm FROM {$tablepre}forumfields WHERE fid='{$moveto}'"); if ($forum = $db->fetch_array($query)) { if (!$forum['postperm'] && !$allowpost) { showmessage('group_nopermission'); } elseif ($forum['postperm'] && !forumperm($forum['postperm'])) { showmessage('post_forum_newthread_nopermission'); } } $db->query("UPDATE {$tablepre}threads SET fid='{$moveto}', moderated='1' WHERE tid='{$tid}'"); $db->query("UPDATE {$tablepre}posts SET fid='{$moveto}' WHERE tid='{$tid}'"); require_once DISCUZ_ROOT . './include/post.func.php'; updateforumcount($moveto); updateforumcount($thread['fid']); usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', $tid); updatemagicthreadlog($tid, $magicid, $magic['identifier']); showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $tid, $lang; require_once DISCUZ_ROOT . './include/forum.func.php'; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_tid'], 'tid', $tid, 'text'); magicshowsetting($lang['MVK_target'], '', '', '<select name="moveto">' . forumselect() . '</select>'); magicshowtype('', 'bottom'); }
} if (submitcheck('usesubmit')) { if (empty($pid)) { showmessage('magics_info_nonexistence'); } $post = getpostinfo($pid, 'pid', array('p.tid', 'p.fid', 'p.author', 'p.authorid', 'first', 'p.dateline', 'anonymous')); checkmagicperm($magicperm['forum'], $post['fid']); if ($post['authorid'] != $discuz_uid) { showmessage('magics_operation_nopermission'); } $thread = getpostinfo($post['tid'], 'tid', array('tid', 'subject', 'author', 'replies', 'lastposter')); if ($post['first']) { $author = ''; $lastposter = $thread['replies'] > 0 ? $thread['lastposter'] : ''; $db->query("UPDATE {$tablepre}posts SET anonymous='1' WHERE tid='{$post['tid']}' AND first='1'"); updatemagicthreadlog($post['tid'], $magicid, $magic['identifier'], '0', '1'); } else { $author = $thread['author']; $lastposter = ''; $db->query("UPDATE {$tablepre}posts SET anonymous='1' WHERE pid='{$pid}'"); } $query = $db->query("SELECT lastpost FROM {$tablepre}forums WHERE fid='{$post['fid']}'"); $forum['lastpost'] = explode("\t", $db->result($query, 0)); if ($post['dateline'] == $forum['lastpost'][2] && ($post['author'] == $forum['lastpost'][3] || $forum['lastpost'][3] == '' && $post['anonymous'])) { $lastpost = "{$thread['tid']}\t{$thread['subject']}\t{$timestamp}\t{$lastposter}"; $db->query("UPDATE {$tablepre}forums SET lastpost='{$lastpost}' WHERE fid='{$post['fid']}'", 'UNBUFFERED'); } $db->query("UPDATE {$tablepre}threads SET author='{$author}', lastposter='{$lastposter}', moderated='1' WHERE tid='{$post['tid']}'"); usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', '0', $pid); showmessage('magics_operation_succeed', 'magic.php?action=user');
This is NOT a freeware, use is subject to license terms $Id: magic_top.inc.php 19412 2009-08-29 01:48:51Z monkey $ */ if (!defined('IN_DISCUZ')) { exit('Access Denied'); } if (submitcheck('usesubmit')) { if (empty($tid)) { showmessage('magics_info_nonexistence'); } $post = getpostinfo($tid, 'tid', array('fid')); checkmagicperm($magicperm['forum'], $post['fid']); magicthreadmod($tid); $db->query("UPDATE {$tablepre}threads SET displayorder='1', moderated='1' WHERE tid='{$tid}'"); $expiration = $timestamp + 86400; usemagic($magicid, $magic['num']); updatemagiclog($magicid, '2', '1', '0', $tid); updatemagicthreadlog($tid, $magicid, $magic['identifier'], $expiration); if ($thread['authorid'] != $discuz_uid) { sendnotice($thread['authorid'], 'magic_thread', 'systempm'); } showmessage('magics_operation_succeed', '', 1); } function showmagic() { global $tid, $lang; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_tid'], 'tid', $tid, 'text'); magicshowtype('', 'bottom'); }