Beispiel #1
0
 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));
 }
Beispiel #2
0
 function usesubmit()
 {
     global $_G;
     if (empty($_G['gp_tid'])) {
         showmessage(lang('magic/open', 'open_info_nonexistence'));
     }
     $thread = getpostinfo($_G['gp_tid'], 'tid', array('fid', 'authorid', 'subject'));
     $this->_check($thread);
     magicthreadmod($_G['gp_tid']);
     DB::query("UPDATE " . DB::table('forum_thread') . " SET closed='0', 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'], 'OPN');
     if ($thread['authorid'] != $_G['uid']) {
         notification_add($thread['authorid'], 'magic', lang('magic/open', 'open_notification'), array('tid' => $_G['gp_tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name']));
     }
     showmessage(lang('magic/open', 'open_succeed'), dreferer(), array(), array('showdialog' => 1, 'locationtime' => true));
 }
Beispiel #3
0
 function usesubmit()
 {
     global $_G;
     if (empty($_GET['tid'])) {
         showmessage(lang('magic/open', 'open_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' => 0, 'moderated' => 1));
     usemagic($this->magic['magicid'], $this->magic['num']);
     updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_GET['tid']);
     updatemagicthreadlog($_GET['tid'], $this->magic['magicid'], 'OPN');
     if ($thread['authorid'] != $_G['uid']) {
         notification_add($thread['authorid'], 'magic', lang('magic/open', 'open_notification'), array('tid' => $_GET['tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name']));
     }
     showmessage(lang('magic/open', 'open_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true));
 }
Beispiel #4
0
 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));
 }
Beispiel #6
0
 function usesubmit()
 {
     global $_G;
     if (empty($_GET['tid'])) {
         showmessage(lang('magic/jack', 'jack_info_nonexistence'));
     }
     $thread = getpostinfo($_GET['tid'], 'tid', array('fid', 'authorid', 'subject', 'lastpost'));
     $this->_check($thread['fid']);
     magicthreadmod($_GET['tid']);
     $this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 1;
     $magicnum = intval($_GET['magicnum']);
     if (empty($magicnum) || $magicnum > $this->magic['num']) {
         showmessage(lang('magic/jack', 'jack_num_not_enough'));
     }
     $expiration = ($thread['lastpost'] > TIMESTAMP ? $thread['lastpost'] : TIMESTAMP) + $this->parameters['expiration'] * $magicnum * 3600;
     C::t('forum_thread')->update($_GET['tid'], array('lastpost' => $expiration));
     usemagic($this->magic['magicid'], $this->magic['num'], $magicnum);
     updatemagiclog($this->magic['magicid'], '2', $magicnum, '0', 0, 'tid', $_GET['tid']);
     if ($thread['authorid'] != $_G['uid']) {
         notification_add($thread['authorid'], 'magic', lang('magic/jack', 'jack_notification'), array('tid' => $_GET['tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name']));
     }
     showmessage(lang('magic/jack', 'jack_succeed'), dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true));
 }
Beispiel #7
0
/*
	[Discuz!] (C)2001-2009 Comsenz Inc.
	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');