예제 #1
0
    $thread = getpostinfo($post['tid'], 'tid', array('tid', 'subject', 'author', 'replies', 'lastposter'));
    if ($post['first']) {
        $lastposter = $thread['replies'] > 0 ? $thread['lastposter'] : $author;
        $db->query("UPDATE {$tablepre}posts SET anonymous='0' WHERE tid='{$post['tid']}' AND first='1'");
        updatemagicthreadlog($post['tid'], $magicid, $magic['identifier'], '0', '1');
    } else {
        $lastposter = $author;
        $author = $thread['author'];
        $db->query("UPDATE {$tablepre}posts SET anonymous='0' WHERE pid='{$pid}'");
    }
    $query = $db->query("SELECT lastpost FROM {$tablepre}forums WHERE fid='{$post['fid']}'");
    $forum['lastpost'] = explode("\t", $db->result($query, 0));
    if ($thread['subject'] == $forum['lastpost'][1] && ($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);
    if ($thread['authorid'] != $discuz_uid) {
        sendnotice($thread['authorid'], 'magic_thread_anonymous', 'systempm');
    }
    showmessage('magics_operation_succeed', '', 1);
}
function showmagic()
{
    global $pid, $lang;
    magicshowtype($lang['option'], 'top');
    magicshowsetting($lang['target_pid'], 'pid', $pid, 'text');
    magicshowtype('', 'bottom');
}
예제 #2
0
		$alist = array_diff($awardplist, $del);
		$plist = implodeids($alist);
		$ratetimes = ceil($credit / 5);
		$db->query("UPDATE {$tablepre}posts SET rate=rate+($credit), ratetimes=ratetimes+$ratetimes WHERE pid IN($plist)");
		foreach($alist as $id => $aquery) {
			$db->query("INSERT INTO {$tablepre}ratelog (pid, uid, username, extcredits, dateline, score, reason)
				VALUES ('$aquery', '$discuz_uid', '$discuz_user', '$credittype', '$timestamp', '$credit', '$rate_msg')", 'UNBUFFERED');
		}
	}

	if($sendmsg){
		$thread = $db->fetch_first("SELECT tid, subject FROM {$tablepre}posts WHERE tid='$tid' AND first='1'");
		$awardmsg = "$credit ".$extcredits[$credittype]['title'];
		eval("\$message = addslashes(\"".$scriptlang['dps_postawards']['pm_message']."\");");
		foreach(array_unique($awardulist) as $user){
			sendnotice($user, $message, 'systempm', 0, array(), 0);
		}
	}
	showmessage('dps_postawards:success', dreferer());
}

$creditselect = '<select name="credittype">';
foreach($extcredits as $id => $credit) {
	$creditselect .= '<option value="'.$id.'">'.$credit['title'].'</option>';
}
$creditselect .= '</select>';

include template('dps_postawards:postawards');

?>
예제 #3
0
		if(!$order['offline'] || $order['credit']) {
			if($db->result_first("SELECT COUNT(score) FROM {$tablepre}tradecomments WHERE raterid='$discuz_uid' AND type='$type'") < $ec_credit['maxcreditspermonth']) {
				updateusercredit($uid, $type ? 'sellercredit' : 'buyercredit', $level);
			}
		}

		if($type == 0) {
			$ratestatus = $order['ratestatus'] == 2 ? 3 : 1;
		} else {
			$ratestatus = $order['ratestatus'] == 1 ? 3 : 2;
		}

		$db->query("UPDATE {$tablepre}tradelog SET ratestatus='$ratestatus' WHERE orderid='$order[orderid]'");

		if($ratestatus != 3) {
			sendnotice($order[$rateeid], 'eccredit', 'threads');
		}

		showmessage('eccredit_succeed');

	}

} elseif($action == 'explain' && $id) {

	$id = intval($id);
	if(!submitcheck('explainsubmit', 1)) {
		include template('ec_explain');
	} else {
		$comment = $db->fetch_first("SELECT explanation, dateline FROM {$tablepre}tradecomments WHERE id='$id' AND rateeid='$discuz_uid'");
		if(!$comment) {
			showmessage('eccredit_nofound');
예제 #4
0
function sendreasonpm($var, $item)
{
    global ${$var};
    ${$var}['subject'] = strtr(${$var}['subject'], array_flip(get_html_translation_table(HTML_ENTITIES)));
    ${$var}['dateline'] = gmdate($GLOBALS['_DCACHE']['settings']['dateformat'] . ' ' . $GLOBALS['_DCACHE']['settings']['timeformat'], ${$var}['dateline'] + $GLOBALS['timeoffset'] * 3600);
    if (!empty(${$var}['authorid']) && ${$var}['authorid'] != $GLOBALS['discuz_uid']) {
        sendnotice(${$var}['authorid'], $item, 'systempm');
    }
}
예제 #5
0
					foreach($fids as $f) {
						updateforumcount($f);
					}
				}
				updatemodworks('MOD', $threadsmod);
				updatemodlog($tids, 'MOD');

			}
		}

		if($pmlist) {
			$reason = dhtmlspecialchars($reason);
			foreach($pmlist as $pm) {
				$threadsubject = $pm['thread'];
				$tid = intval($pm['tid']);
				sendnotice($pm['authorid'], $pm['act'], 'systempm');
			}
		}

		showmessage('modcp_mod_succeed', "{$cpscript}?action=$action&op=$op&filter=$filter&fid=$fid");

	}

	$modcount = $db->result_first("SELECT COUNT(*) FROM {$tablepre}threads WHERE ".($modfidsadd ? " $modfidsadd AND " : '')." displayorder='$pstat'");
	$multipage = multi($modcount, $tpp, $page, "{$cpscript}?action=$action&op=$op&filter=$filter&fid=$fid");

	if($modcount) {

		$query = $db->query("SELECT t.tid, t.fid, t.author, t.sortid, t.authorid, t.subject as tsubject, t.dateline, t.attachment,
			p.pid, p.message, p.useip, p.attachment
			FROM {$tablepre}threads t
예제 #6
0
					showmessage('credits_transfer_send_nonexistence');
				} elseif($member['uid'] == $discuz_uid) {
					showmessage('credits_transfer_self');
				}

				$creditsarray[$creditstrans] = -$amount;
				updatecredits($discuz_uid, $creditsarray);
				$db->query("UPDATE {$tablepre}members SET extcredits$creditstrans=extcredits$creditstrans+'$netamount' WHERE uid='$member[uid]'");
				$db->query("INSERT INTO {$tablepre}creditslog (uid, fromto, sendcredits, receivecredits, send, receive, dateline, operation)
					VALUES ('$discuz_uid', '".addslashes($member['username'])."', '$creditstrans', '$creditstrans', '$amount', '0', '$timestamp', 'TFR'),
					('$member[uid]', '$discuz_user', '$creditstrans', '$creditstrans', '0', '$netamount', '$timestamp', 'RCV')");

				if(!empty($transfermessage)) {
					$transfermessage = stripslashes($transfermessage);
					$transfertime = gmdate($GLOBALS['_DCACHE']['settings']['dateformat'].' '.$GLOBALS['_DCACHE']['settings']['timeformat'], $timestamp + $timeoffset * 3600);
					sendnotice($member['uid'], 'transfer', 'systempm');
				}

				showmessage('credits_transaction_succeed', '', 1);
			}
		} else {
			showmessage('action_closed', NULL, 'HALTED');
		}

	} elseif(submitcheck('exchangesubmit')) {

		if(($exchangestatus || $outextcredits) && $outextcredits[$tocredits] || $extcredits[$fromcredits]['ratio'] && $extcredits[$tocredits]['ratio']) {
			if(!submitcheck('confirm')) {

				$outexange = strexists($tocredits, '|');
				if($outexange) {
예제 #7
0
							$buddyarray = uc_friend_ls($discuz_uid, 1, $buddynum, $buddynum, 3);
							foreach($buddyarray as $buddy) {
								if($buddyid[0] == $buddy['friendid']) {
									$manyoufriend = TRUE;
									break;
								}
							}
							if($manyoufriend) {
								manyoulog('friend', $discuz_uid, 'add', $buddyid[0]);
								manyoulog('friend', $buddyid[0], 'add', $discuz_uid);
							}
						}
						if($ucappopen['UCHOME']) {
							sendnotice($buddyid[0], 'buddy_new_uch', 'friend');
						} else {
							sendnotice($buddyid[0], 'buddy_new', 'friend');
						}
						if($prompts['newbietask'] && $newbietaskid && $newbietasks[$newbietaskid]['scriptname'] == 'addbuddy') {
							require_once DISCUZ_ROOT.'./include/task.func.php';
							task_newbie_complete();
						}
					} else {
						showmessage('buddy_add_ignore');
					}
				} else {
					showmessage('username_nonexistence');
				}
			}
		}

		showmessage('buddy_update_succeed', 'my.php?item=buddylist'.$extratype);
예제 #8
0
            showtablefooter();
            showformfooter();
            showtagfooter('div');
        }
    } else {
        $numvalidate = 0;
        if ($validate) {
            $orderids = $comma = '';
            $confirmdate = gmdate($_DCACHE['settings']['dateformat'] . ' ' . $_DCACHE['settings']['timeformat'], $timestamp + $_DCACHE['settings']['timeoffset'] * 3600);
            $query = $db->query("SELECT * FROM {$tablepre}orders WHERE orderid IN ('" . implode('\',\'', $validate) . "') AND status='1'");
            while ($order = $db->fetch_array($query)) {
                $db->query("UPDATE {$tablepre}members SET extcredits{$creditstrans}=extcredits{$creditstrans}+'{$order['amount']}' WHERE uid='{$order['uid']}'");
                $orderids .= "{$comma}'{$order['orderid']}'";
                $comma = ',';
                $submitdate = gmdate($_DCACHE['settings']['dateformat'] . ' ' . $_DCACHE['settings']['timeformat'], $order['submitdate'] + $_DCACHE['settings']['timeoffset'] * 3600);
                sendnotice($order['uid'], 'addfunds', 'systempm');
            }
            if ($numvalidate = $db->num_rows($query)) {
                $db->query("UPDATE {$tablepre}orders SET status='3', admin='{$discuz_user}', confirmdate='{$timestamp}' WHERE orderid IN ({$orderids})");
            }
        }
        cpmsg('orders_validate_succeed', "{$BASESCRIPT}?action=ec&operation=orders&searchsubmit=yes&orderstatus={$orderstatus}&orderid={$orderid}&users={$users}&buyer={$buyer}&admin={$admin}&sstarttime={$sstarttime}&sendtime={$sendtime}&cstarttime={$cstarttime}&cendtime={$cendtime}", 'succeed');
    }
} elseif ($operation == 'credit') {
    $defaultrank = array(1 => 4, 2 => 11, 3 => 41, 4 => 91, 5 => 151, 6 => 251, 7 => 501, 8 => 1001, 9 => 2001, 10 => 5001, 11 => 10001, 12 => 20001, 13 => 50001, 14 => 100001, 15 => 200001);
    if (!submitcheck('creditsubmit')) {
        $ec_credit = $db->result_first("SELECT value FROM {$tablepre}settings WHERE variable='ec_credit'");
        $ec_credit = $ec_credit ? unserialize($ec_credit) : array('maxcreditspermonth' => '6', 'rank' => $defaultrank);
        shownav('extended', 'nav_ec');
        showsubmenu('nav_ec', array(array('nav_ec_config', 'settings&operation=ec', 0), array('nav_ec_alipay', 'ec&operation=alipay', 0), array('nav_ec_tenpay', 'ec&operation=tenpay', 0), array('nav_ec_credit', 'ec&operation=ec_credit', 1), array('nav_ec_orders', 'ec&operation=orders', 0), array('nav_ec_tradelog', 'tradelog', 0)));
        showtips('ec_credit_tips');
예제 #9
0
	require_once DISCUZ_ROOT.'./include/tasks/'.$task['scriptname'].'.inc.php';
	$result = task_csc($task);
	if($result === TRUE) {

		if($task['reward']) {
			require_once DISCUZ_ROOT.'./include/task.func.php';
			$rewards = task_reward($task);
			if($task['reward'] == 'magic') {
				$magicname = $db->result_first("SELECT name FROM {$tablepre}magics WHERE magicid='$task[prize]'");
			} elseif($task['reward'] == 'medal') {
				$medalname = $db->result_first("SELECT name FROM {$tablepre}medals WHERE medalid='$task[prize]'");
			} elseif($task['reward'] == 'group') {
				$grouptitle = $db->result_first("SELECT grouptitle FROM {$tablepre}usergroups WHERE groupid='$task[prize]'");
			}
			sendnotice($discuz_uid, 'task_reward_'.$task['reward'], 'systempm');
		}

		task_sufprocess();

		$db->query("UPDATE {$tablepre}mytasks SET status='1', csc='100', dateline='$timestamp' WHERE uid='$discuz_uid' AND taskid='$id'");
		$db->query("UPDATE {$tablepre}tasks SET achievers=achievers+1 WHERE taskid='$id'", 'UNBUFFERED');

		if(!$db->result_first("SELECT COUNT(*) FROM {$tablepre}mytasks WHERE uid='$discuz_uid' AND status='0'")) {
			updateprompt('task', $discuz_uid, 0);
		}

		if($inajax) {
			taskmessage('100', $task['reward'] ? 'task_reward_'.$task['reward'] : 'task_completed');
		} else {
			showmessage('task_completed', 'task.php?item=done');
예제 #10
0
function add_feed($arg, $data, $template = '')
{
    global $tablepre, $db, $timestamp;
    $type = 'default';
    $fid = 0;
    $typeid = 0;
    $sortid = 0;
    $appid = '';
    $uid = 0;
    $username = '';
    extract($arg, EXTR_OVERWRITE);
    if (empty($data['title'])) {
        return false;
    }
    if ($uid && in_array($type, array('thread_views', 'thread_replies', 'thread_rate', 'post_rate', 'user_credit', 'user_threads', 'user_posts', 'user_digest'))) {
        include language('notice');
        $title_template = $language[$type];
        $body_template = $language[$type];
        $noticemsg['title'] = transval($title_template, $data['title']);
        $noticemsg['body'] = transval($body_template, $data['body']);
        $message = $noticemsg['title'];
        if ($noticemsg['body']) {
            $message .= '<br /><br />' . $noticemsg['body'];
        }
        if (in_array($type, array('thread_views', 'thread_replies', 'thread_rate', 'post_rate'))) {
            sendnotice($uid, $message, 'threads');
        } else {
            sendnotice($uid, $message, 'systempm');
        }
    }
    $db->query("INSERT INTO {$tablepre}feeds (type, fid, typeid, sortid, appid, uid, username, data, template, dateline)\r\n\t\t\t\tVALUES ('{$type}', '{$fid}', '{$typeid}', '{$sortid}', '{$appid}', '{$uid}', '{$username}', '" . addslashes(serialize($data)) . "', '" . addslashes(serialize($template)) . "', '{$timestamp}')");
    return $db->insert_id();
}
예제 #11
0
			$uidarray = array();
			$ids = implode('\',\'', $applyidarray);
			$query=$db->query("SELECT a.uid FROM {$tablepre}activityapplies a RIGHT JOIN {$tablepre}members m USING(uid) WHERE a.applyid IN ('$ids')");
			while($uid = $db->fetch_array($query)) {
				$uidarray[] = $uid['uid'];
			}
			$activity_subject = $thread['subject'];
			if($operation == 'delete') {
				$db->query("DELETE FROM {$tablepre}activityapplies WHERE applyid IN ('$ids')", 'UNBUFFERED');

				sendnotice(implode(',', $uidarray), 'activity_delete', 'threads');
				showmessage('activity_delete_completion', "viewthread.php?tid=$tid&do=viewapplylist");
			} else {
				$db->query("UPDATE {$tablepre}activityapplies SET verified=1 WHERE applyid IN ('$ids')", 'UNBUFFERED');

				sendnotice(implode(',', $uidarray), 'activity_apply', 'threads');
				showmessage('activity_auditing_completion', "viewthread.php?tid=$tid&do=viewapplylist");
			}
		}
	}

} elseif($action == 'activityexport') {

	$activity = $db->fetch_first("SELECT a.*, p.message FROM {$tablepre}activities a LEFT JOIN {$tablepre}posts p ON p.tid=a.tid AND p.first='1' WHERE a.tid='$tid'");
	if(!$activity || $thread['special'] != 4 || $thread['authorid'] != $discuz_uid && !$alloweditactivity) {
		showmessage('undefined_action');
	}

	$activity['starttimefrom'] = dgmdate("$dateformat $timeformat", $activity['starttimefrom'] + $timeoffset * 3600, 0);
	$activity['starttimeto'] = $activity['starttimeto'] ? dgmdate("$dateformat $timeformat", $activity['starttimeto'] + $timeoffset * 3600, 0) : 0;
	$activity['expiration'] = $activity['expiration'] ? dgmdate("$dateformat $timeformat", $activity['expiration'] + $timeoffset * 3600, 0) : 0;
예제 #12
0
			if(!$magicnum || $magicnum < 0) {
				showmessage('magics_num_invalid');
			} elseif($magic['num'] < $magicnum) {
				showmessage('magics_amount_no_enough');
			}

			if(${'extcredits'.$creditstransextra[3]} < $magicprice) {
				showmessage('magics_credits_no_enough');
			}

			getmagic($magic['magicid'], $magicnum, $magicweight, $totalweight, $discuz_uid, $maxmagicsweight);

			$totalcredit = floor($magicprice * (1 - $creditstax));
			$db->query("UPDATE {$tablepre}members SET extcredits$creditstransextra[3]=extcredits$creditstransextra[3]+'$totalcredit' WHERE uid='$magic[uid]'");
			$db->query("UPDATE {$tablepre}members SET extcredits$creditstransextra[3]=extcredits$creditstransextra[3]+(-'$magicprice') WHERE uid='$discuz_uid'");
			sendnotice($magic['uid'], 'magics_sell', 'systempm');

			updatemagiclog($magic['magicid'], '5', $magicnum, $magic['price'], '0', $discuz_uid);
			marketmagicnum($magic['mid'], $magic['num'], $magicnum);
			showmessage('magics_succeed', 'magic.php?action=market');

		}

		if(submitcheck('downsubmit')) {

			if($magic['num'] < $magicnum || $magicnum < 0) {
				showmessage('magics_amount_no_enough');
			}

			$magic['weight'] = $magic['weight'] * $magicnum;
			getmagic($magic['magicid'], $magicnum, $magic['weight'], $totalweight, $discuz_uid, $maxmagicsweight);
예제 #13
0
function givemagic($username, $magicid, $magicnum, $totalnum, $totalprice, $givemessage)
{
    global $db, $tablepre, $discuz_uid, $discuz_user, $creditstrans, $creditstransextra, $magicarray;
    $member = $db->fetch_first("SELECT m.uid, m.username, u.maxmagicsweight FROM {$tablepre}members m LEFT JOIN {$tablepre}usergroups u ON u.groupid=m.groupid WHERE m.username='******'");
    if (!$member) {
        showmessage('magics_target_nonexistence');
    } elseif ($member['uid'] == $discuz_uid) {
        showmessage('magics_give_myself');
    }
    $totalweight = getmagicweight($member['uid'], $magicarray);
    $magicweight = $magicarray[$magicid]['weight'] * $magicnum;
    getmagic($magicid, $magicnum, $magicweight, $totalweight, $member['uid'], $member['maxmagicsweight']);
    sendnotice($member['uid'], 'magics_receive', 'systempm');
    updatemagiclog($magicid, '3', $magicnum, $magicarray[$magicid]['price'], '0', '0', $member['uid']);
    if (empty($totalprice)) {
        usemagic($magicid, $totalnum, $magicnum);
        showmessage('magics_give_succeed', '', 1);
    }
}
예제 #14
0
         if ($ac == 'q') {
             sendnotice($nauthorid, 'repquote_noticeauthor', 'threads');
         } elseif ($ac == 'r') {
             sendnotice($nauthorid, 'reppost_noticeauthor', 'threads');
         }
     }
 }
 $uidarray = array();
 $query = $db->query("SELECT uid FROM {$tablepre}favoritethreads WHERE tid='{$tid}'");
 while ($favthread = $db->fetch_array($query)) {
     if ($favthread['uid'] !== $discuz_uid && (!$nauthorid || $nauthorid != $favthread['uid'])) {
         $uidarray[] = $favthread['uid'];
     }
 }
 if ($discuz_uid && !empty($uidarray)) {
     sendnotice(implode(',', $uidarray), 'favoritethreads_notice', 'threads', $tid, array('user' => !$isanonymous ? $discuz_userss : '<i>Anonymous</i>', 'maxusers' => 5));
     $db->query("UPDATE {$tablepre}favoritethreads SET newreplies=newreplies+1, dateline='{$timestamp}' WHERE uid IN (" . implodeids($uidarray) . ") AND tid='{$tid}'", 'UNBUFFERED');
 }
 if ($discuz_uid) {
     $stataction = '';
     if ($attentionon) {
         $stataction = 'attentionon';
         $db->query("REPLACE INTO {$tablepre}favoritethreads (tid, uid, dateline) VALUES ('{$tid}', '{$discuz_uid}', '{$timestamp}')", 'UNBUFFERED');
     }
     if ($attentionoff) {
         $stataction = 'attentionoff';
         $db->query("DELETE FROM {$tablepre}favoritethreads WHERE tid='{$tid}' AND uid='{$discuz_uid}'", 'UNBUFFERED');
     }
     if ($stataction) {
         write_statlog('', 'item=attention&action=newreply_' . $stataction, '', '', 'my.php');
     }
예제 #15
0
function task_newbie_complete()
{
    global $db, $tablepre, $discuz_uid, $timestamp, $task, $newbietasks, $newbietaskid, $currenttaskcsc, $nextnewbietaskid, $magicname, $medalname, $grouptitle, $rewards;
    require_once DISCUZ_ROOT . './include/tasks/newbie_' . $newbietasks[$newbietaskid]['scriptname'] . '.inc.php';
    $task = $db->fetch_first("SELECT * FROM {$tablepre}tasks WHERE taskid='{$newbietaskid}' AND available='2'");
    $currenttaskcsc = 0;
    if (task_csc($task) === TRUE) {
        $currenttaskcsc = 100;
        if ($task['reward']) {
            $rewards = task_reward($task);
            if ($task['reward'] == 'magic') {
                $magicname = $db->result_first("SELECT name FROM {$tablepre}magics WHERE magicid='{$task['prize']}'");
            } elseif ($task['reward'] == 'medal') {
                $medalname = $db->result_first("SELECT name FROM {$tablepre}medals WHERE medalid='{$task['prize']}'");
            } elseif ($task['reward'] == 'group') {
                $grouptitle = $db->result_first("SELECT grouptitle FROM {$tablepre}usergroups WHERE groupid='{$task['prize']}'");
            }
            sendnotice($discuz_uid, 'task_reward_' . $task['reward'], 'systempm');
        }
        $db->query("UPDATE {$tablepre}mytasks SET status='1', csc='100', dateline='{$timestamp}' WHERE uid='{$discuz_uid}' AND taskid='{$newbietaskid}'");
        $db->query("UPDATE {$tablepre}tasks SET achievers=achievers+1 WHERE taskid='{$newbietaskid}'", 'UNBUFFERED');
        $nextnewbietaskid = intval($db->result_first("SELECT t.taskid FROM {$tablepre}tasks t LEFT JOIN {$tablepre}mytasks mt ON mt.taskid=t.taskid AND mt.uid='{$discuz_uid}' WHERE mt.taskid IS NULL AND t.available='2' AND t.newbietask='1' ORDER BY t.newbietask DESC LIMIT 1"));
        if ($nextnewbietaskid) {
            $nexttask = $db->fetch_first("SELECT * FROM {$tablepre}tasks WHERE taskid='{$nextnewbietaskid}' AND available='2'");
            $nexttask['newbie'] = 1;
            task_apply($nexttask);
            $db->query("UPDATE {$tablepre}members SET newbietaskid='{$nextnewbietaskid}' WHERE uid='{$discuz_uid}'", 'UNBUFFERED');
        } else {
            $db->query("UPDATE {$tablepre}members SET prompt=prompt^8, newbietaskid='0' WHERE uid='{$discuz_uid}'", 'UNBUFFERED');
        }
        $taskmsg = $newbietasks['task'][$newbietaskid]['scriptname'];
        if (!$nextnewbietaskid) {
            $taskmsg .= '_complete';
        }
        write_statlog('', 'action=newbie&from=' . $taskmsg, '', '', 'task.php');
    }
}
예제 #16
0
/*
	[Discuz!] (C)2001-2009 Comsenz Inc.
	This is NOT a freeware, use is subject to license terms

	$Id: magic_up.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');
    }
    $thread = getpostinfo($tid, 'tid', array('fid'));
    checkmagicperm($magicperm['forum'], $thread['fid']);
    $db->query("UPDATE {$tablepre}threads SET lastpost='{$timestamp}', moderated='1' WHERE tid='{$tid}'");
    usemagic($magicid, $magic['num']);
    updatemagiclog($magicid, '2', '1', '0', $tid);
    updatemagicthreadlog($tid, $magicid, $magic['identifier']);
    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');
}
예제 #17
0
		} elseif($offlinestatus == STATUS_TRADE_SUCCESS) {
			if($creditstransextra[5] != -1 && $tradelog['basecredit']) {
				$netcredit = round($tradelog['number'] * $tradelog['basecredit'] * (1 - $creditstax));
				updatecredits($tradelog['sellerid'], array($creditstransextra[5] => $netcredit));
			} else {
				$netcredit = 0;
			}
			$db->query("UPDATE {$tablepre}trades SET lastbuyer='$tradelog[buyer]', lastupdate='$timestamp', totalitems=totalitems+'$tradelog[number]', tradesum=tradesum+'$tradelog[price]', credittradesum=credittradesum+'$netcredit' WHERE tid='$tradelog[tid]' AND pid='$tradelog[pid]'", 'UNBUFFERED');
			$itemsubject = $tradelog['subject'];
			sendnotice($tradelog['sellerid'], 'trade_success', 'threads');
			sendnotice($tradelog['buyerid'], 'trade_success', 'threads');
		} elseif($offlinestatus == STATUS_REFUND_CLOSE) {
			$db->query("UPDATE {$tablepre}trades SET amount=amount+'$tradelog[number]' WHERE tid='$tradelog[tid]' AND pid='$tradelog[pid]'", 'UNBUFFERED');
			$itemsubject = $tradelog['subject'];
			sendnotice($tradelog['sellerid'], 'trade_fefund_success', 'threads');
			sendnotice($tradelog['buyerid'], 'trade_fefund_success', 'threads');
			if($creditstransextra[5] != -1 && $tradelog['basecredit']) {
				updatecredits($tradelog['buyerid'], array($creditstransextra[5] => $tradelog['number'] * $tradelog['basecredit']));
			}
		}

		$message = trim($message);
		if($message) {
			$message = daddslashes(stripslashes($tradelog['message'])."\t\t\t".$discuz_uid."\t".$discuz_userss."\t".$timestamp."\t".nl2br(strip_tags(substr($message, 0, 200))), 1);
		} else {
			$message = daddslashes($tradelog['message'], 1);
		}

		$db->query("UPDATE {$tablepre}tradelog SET status='$offlinestatus', lastupdate='$timestamp', message='$message' WHERE orderid='$orderid'");
		showmessage('trade_orderstatus_updated', 'trade.php?orderid='.$orderid);
	}