本文整理汇总了PHP中updatecredits函数的典型用法代码示例。如果您正苦于以下问题:PHP updatecredits函数的具体用法?PHP updatecredits怎么用?PHP updatecredits使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updatecredits函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: task_reward_credit
function task_reward_credit($extcreditid, $credits)
{
global $db, $tablepre, $discuz_uid, $timestamp;
$creditsarray[$extcreditid] = $credits;
updatecredits($discuz_uid, $creditsarray);
$db->query("INSERT INTO {$tablepre}creditslog (uid, fromto, sendcredits, receivecredits, send, receive, dateline, operation) VALUES ('{$discuz_uid}', 'TASK REWARD', '{$extcreditid}', '{$extcreditid}', '0', '{$credits}', '{$timestamp}', 'RCV')");
}
示例2: template
}
include template('rate');
} else {
checkreasonpm();
if (!empty($logidarray)) {
if ($sendreasonpm) {
$ratescore = $slash = '';
}
$query = $db->query("SELECT * FROM {$tablepre}ratelog WHERE pid='{$pid}'");
$rate = $ratetimes = 0;
$logs = array();
while ($ratelog = $db->fetch_array($query)) {
if (in_array($ratelog['uid'] . ' ' . $ratelog['extcredits'] . ' ' . $ratelog['dateline'], $logidarray)) {
$rate += $ratelog['score'] = -$ratelog['score'];
$ratetimes += ceil(max(abs($rating['min']), abs($rating['max'])) / 5);
updatecredits($post['authorid'], array($ratelog['extcredits'] => $ratelog['score']));
$db->query("DELETE FROM {$tablepre}ratelog WHERE pid='{$pid}' AND uid='{$ratelog['uid']}' AND extcredits='{$ratelog['extcredits']}' AND dateline='{$ratelog['dateline']}'", 'UNBUFFERED');
$logs[] = dhtmlspecialchars("{$timestamp}\t{$discuz_userss}\t{$adminid}\t{$post['author']}\t{$ratelog['extcredits']}\t{$ratelog['score']}\t{$tid}\t{$thread['subject']}\t{$reason}\tD");
if ($sendreasonpm) {
$ratescore .= $slash . $extcredits[$ratelog['extcredits']]['title'] . ' ' . ($ratelog['score'] > 0 ? '+' . $ratelog['score'] : $ratelog['score']) . ' ' . $extcredits[$ratelog['extcredits']]['unit'];
$slash = ' / ';
}
}
}
writelog('ratelog', $logs);
if ($sendreasonpm) {
sendreasonpm('post', 'rate_removereason');
}
$db->query("UPDATE {$tablepre}posts SET rate=rate+({$rate}), ratetimes=ratetimes-{$ratetimes} WHERE pid='{$pid}'");
if ($post['first']) {
$threadrate = @intval(@($post['rate'] + $rate) / abs($post['rate'] + $rate));
示例3: abs
//check credit limit
if(!empty($allow['ratealllimit']) && abs($credit * count($awardulist)) > $allow['ratealllimit']) {
showmessage('dps_postawards:msg_credit_all_limit');
}
// if use user's credit, updatecredits
if($selfcreditmode) {
$usercredit = $db->result_first("SELECT $extcredit FROM {$tablepre}members WHERE uid='$discuz_uid'");
if($usercredit < $credit * count($awardulist)) {
showmessage('dps_postawards:msg_over_user_credit');
}
$updatecredits[$credittype]= -1 * abs($credit) * count($awardulist);
updatecredits($discuz_uid, $updatecredits);
}
updatecredits($uidlist, array($credittype => $credit));
if($ratemode){
if(!$raterange) {
showmessage('group_nopermission', NULL, 'NOPERM');
} elseif ($modratelimit && $adminid == 3 && !$forum['ismoderator']) {
showmessage('thread_rate_moderator_invalid', NULL, 'HALTED');
}
foreach($raterange as $id => $rating) {
$maxratetoday[$id] = $rating['mrpd'];
}
$query = $db->query("SELECT extcredits, SUM(ABS(score)) AS todayrate FROM {$tablepre}ratelog
WHERE uid='$discuz_uid' AND dateline>=$timestamp-86400
GROUP BY extcredits");
while($rate = $db->fetch_array($query)) {
示例4: showmessage
$forum = $db->fetch_first("SELECT f.viewperm, f.getattachperm, f.getattachcredits, a.allowgetattach FROM {$tablepre}forumfields f\r\n\t\tLEFT JOIN {$tablepre}access a ON a.uid='{$discuz_uid}' AND a.fid=f.fid\r\n\t\tWHERE f.fid='{$thread['fid']}'");
if (!$ispaid && !$forum['allowgetattach']) {
if (!$forum['getattachperm'] && !$allowgetattach) {
showmessage('group_nopermission', NULL, 'NOPERM');
} elseif ($forum['getattachperm'] && !forumperm($forum['getattachperm']) || $forum['viewperm'] && !forumperm($forum['viewperm'])) {
showmessage('attachment_forum_nopermission', NULL, 'NOPERM');
}
}
$range = 0;
if ($readmod == 4 && !empty($_SERVER['HTTP_RANGE'])) {
list($range) = explode('-', str_replace('bytes=', '', $_SERVER['HTTP_RANGE']));
}
if (!$isimage) {
$getattachcredits = $forum['getattachcredits'] ? unserialize($forum['getattachcredits']) : $creditspolicy['getattach'];
checklowerlimit($getattachcredits, -1);
$range < 1024 && updatecredits($discuz_uid, $getattachcredits, -1);
}
if (empty($noupdate)) {
if ($delayviewcount == 2 || $delayviewcount == 3) {
$logfile = './forumdata/cache/cache_attachviews.log';
if (substr($timestamp, -1) == '0') {
require_once DISCUZ_ROOT . './include/misc.func.php';
updateviews('attachments', 'aid', 'downloads', $logfile);
}
if (@($fp = fopen(DISCUZ_ROOT . $logfile, 'a'))) {
fwrite($fp, "{$aid}\n");
fclose($fp);
} elseif ($adminid == 1) {
showmessage('view_log_invalid');
}
} else {
示例5: array
}
}
}
}
$tradeaid = 0;
if ($attachment) {
$searcharray = $pregarray = $replacearray = array();
foreach ($attachments as $key => $attach) {
$db->query("INSERT INTO {$tablepre}attachments (tid, pid, dateline, readperm, price, filename, description, filetype, filesize, attachment, downloads, isimage, uid, thumb, remote, width)\r\n\t\t\t\tVALUES ('{$tid}', '{$pid}', '{$timestamp}', '{$attach['perm']}', '{$attach['price']}', '{$attach['name']}', '{$attach['description']}', '{$attach['type']}', '{$attach['size']}', '{$attach['attachment']}', '0', '{$attach['isimage']}', '{$attach['uid']}', '{$attach['thumb']}', '{$attach['remote']}', '{$attach['width']}')");
$searcharray[] = '[local]' . $localid[$key] . '[/local]';
$pregarray[] = '/\\[localimg=(\\d{1,3}),(\\d{1,3})\\]' . $localid[$key] . '\\[\\/localimg\\]/is';
$replacearray[] = '[attach]' . $db->insert_id() . '[/attach]';
}
$message = str_replace($searcharray, $replacearray, preg_replace($pregarray, $replacearray, $message));
$db->query("UPDATE {$tablepre}posts SET message='{$message}' WHERE pid='{$pid}'");
updatecredits($discuz_uid, $postattachcredits, count($attachments));
}
if ($swfupload) {
updateswfattach();
}
if ($modnewthreads) {
$db->query("UPDATE {$tablepre}forums SET todayposts=todayposts+1 WHERE fid='{$fid}'", 'UNBUFFERED');
showmessage('post_newthread_mod_succeed', "forumdisplay.php?fid={$fid}");
} else {
$feed = array('icon' => '', 'title_template' => '', 'title_data' => array(), 'body_template' => '', 'body_data' => array(), 'title_data' => array(), 'images' => array());
if ($addfeed && $forum['allowfeed']) {
if ($special == 0) {
$feed['icon'] = 'thread';
$feed['title_template'] = 'feed_thread_title';
$feed['body_template'] = 'feed_thread_message';
$feed['body_data'] = array('subject' => "<a href=\"{$boardurl}viewthread.php?tid={$tid}\">{$subject}</a>", 'message' => cutstr(strip_tags(preg_replace(array("/\\[hide=?\\d*\\].+?\\[\\/hide\\]/is", "/\\[.+?\\]/is"), array('', ''), $message)), 150));
示例6: AND
$sqltxtsrch .= $andor;
$sqltxtsrch .= "tr.subject LIKE '%{$text}%'";
}
}
$sqlsrch .= " AND ({$sqltxtsrch})";
}
if ($srchuid) {
$sqlsrch .= " AND tr.sellerid IN ({$srchuid})";
}
if (!empty($srchfrom)) {
$searchfrom = ($before ? '<=' : '>=') . ($timestamp - $srchfrom);
$sqlsrch .= " AND tr.dateline{$searchfrom}";
}
$keywords = str_replace('%', '+', $srchtxt) . (trim($srchuname) ? '+' . str_replace('%', '+', $srchuname) : '');
$expiration = $timestamp + $cachelife_text;
}
$threads = $tids = 0;
$query = $db->query("SELECT tr.tid, tr.pid, t.closed {$sqlsrch} ORDER BY tr.pid DESC LIMIT {$maxsearchresults}");
while ($post = $db->fetch_array($query)) {
if ($thread['closed'] <= 1) {
$tids .= ',' . $post['pid'];
$threads++;
}
}
$db->free_result($query);
$db->query("INSERT INTO {$tablepre}searchindex (keywords, searchstring, useip, uid, dateline, expiration, threads, tids)\r\n\t\t\t\tVALUES ('{$keywords}', '{$searchstring}', '{$onlineip}', '{$discuz_uid}', '{$timestamp}', '{$expiration}', '{$threads}', '{$tids}')");
$searchid = $db->insert_id();
updatecredits($discuz_uid, $creditspolicy['search'], -1);
}
showmessage('search_redirect', "search.php?searchid={$searchid}&srchtype=trade&orderby={$orderby}&ascdesc={$ascdesc}&searchsubmit=yes");
}
示例7: updatecredits
}
if (!$outexange) {
$creditsarray[$fromcredits] = -$netamount;
$creditsarray[$tocredits] = $amount;
updatecredits($discuz_uid, $creditsarray);
} else {
if (!array_key_exists($fromcredits, $outextcredits[$tocredits]['creditsrc'])) {
showmessage('extcredits_dataerror', NULL, 'HALTED');
}
list($toappid, $tocredits) = explode('|', $tocredits);
$ucresult = uc_credit_exchange_request($discuz_uid, $fromcredits, $tocredits, $toappid, $amount);
if (!$ucresult) {
showmessage('extcredits_dataerror', NULL, 'HALTED');
}
$creditsarray[$fromcredits] = -$netamount;
updatecredits($discuz_uid, $creditsarray);
$netamount = $amount;
$amount = $tocredits = 0;
}
$db->query("INSERT INTO {$tablepre}creditslog (uid, fromto, sendcredits, receivecredits, send, receive, dateline, operation)\r\n\t\t\t\t\tVALUES ('{$discuz_uid}', '{$discuz_user}', '{$fromcredits}', '{$tocredits}', '{$netamount}', '{$amount}', '{$timestamp}', 'EXC')");
showmessage('credits_transaction_succeed', '', 1);
}
} else {
showmessage('action_closed', NULL, 'HALTED');
}
} elseif (submitcheck('addfundssubmit')) {
if ($ec_ratio) {
if (!submitcheck('confirm')) {
$price = round($addfundamount / $ec_ratio * 100 / 100, 1);
include template('memcp_credits_action');
} else {
示例8: WHERE
} else {
$sql = "value LIKE '%{$option['value']}%'";
}
$sqlsrch .= $or . "(optionid='{$optionid}' AND {$sql}) ";
$or = 'OR ';
}
}
}
$threads = $tids = 0;
$query = $db->query("SELECT tid, sortid FROM {$tablepre}typeoptionvars WHERE (expiration='0' OR expiration>'{$timestamp}') " . ($sqlsrch ? 'AND ' . $sqlsrch : '') . "");
while ($post = $db->fetch_array($query)) {
if ($post['sortid'] == $selectsortid) {
$tids .= ',' . $post['tid'];
}
}
$db->free_result($query);
if ($fids) {
$query = $db->query("SELECT tid, closed FROM {$tablepre}threads WHERE tid IN ({$tids}) AND fid IN ({$fids}) LIMIT {$maxsearchresults}");
while ($post = $db->fetch_array($query)) {
if ($thread['closed'] <= 1) {
$tids .= ',' . $post['tid'];
$threads++;
}
}
}
$db->query("INSERT INTO {$tablepre}searchindex (keywords, searchstring, useip, uid, dateline, expiration, threads, threadsortid, tids)\r\n\t\t\t\tVALUES ('{$keywords}', '{$searchstring}', '{$onlineip}', '{$discuz_uid}', '{$timestamp}', '{$expiration}', '{$threads}', '{$selectsortid}', '{$tids}')");
$searchid = $db->insert_id();
!($exempt & 2) && updatecredits($discuz_uid, $creditspolicy['search'], -1);
}
showmessage('search_redirect', "search.php?searchid={$searchid}&srchtype=threadsort&sortid={$selectsortid}&searchsubmit=yes");
}
示例9: elseif
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'stick') {
$db->query("UPDATE {$tablepre}threads SET displayorder='$stick_level' WHERE $tidsadd");
if($globalstick) {
updatecache('globalstick');
}
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'adddigest') {
$query = $db->query("SELECT tid, authorid, digest FROM {$tablepre}threads WHERE $tidsadd");
while($thread = $db->fetch_array($query)) {
updatecredits($thread['authorid'], $creditspolicy['digest'], $digest_level - $thread['digest'], 'digestposts=digestposts-1');
}
$db->query("UPDATE {$tablepre}threads SET digest='$digest_level' WHERE $tidsadd");
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'addstatus') {
$db->query("UPDATE {$tablepre}threads SET closed='$status' WHERE $tidsadd");
eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");
} elseif($operation == 'supe_pushsetting' && $supe['status']) {
$db->query("UPDATE {$tablepre}threads SET supe_pushstatus='$supe_pushstatus' WHERE $tidsadd");
示例10: exit
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if ($creditspolicy['promotion_visit']) {
$uidarray = $userarray = array();
$query = $db->query("SELECT * FROM {$tablepre}promotions");
while ($promotion = $db->fetch_array($query)) {
if ($promotion['uid']) {
$uidarray[] = $promotion['uid'];
} elseif ($promotion['username']) {
$userarray[] = addslashes($promotion['username']);
}
}
if ($uidarray || $userarray) {
if ($userarray) {
$query = $db->query("SELECT uid FROM {$tablepre}members WHERE username IN ('" . implode('\',\'', $userarray) . "')");
while ($member = $db->fetch_array($query)) {
$uidarray[] = $member['uid'];
}
}
$countarray = array();
foreach (array_count_values($uidarray) as $uid => $count) {
$countarray[$count][] = $uid;
}
foreach ($countarray as $count => $uids) {
updatecredits(implode('\',\'', $uids), $creditspolicy['promotion_visit'], $count);
}
$db->query("DELETE FROM {$tablepre}promotions");
}
}
示例11: updateswfattach
function updateswfattach()
{
global $db, $tablepre, $attachsave, $attachdir, $discuz_uid, $postattachcredits, $tid, $pid, $swfattachnew, $swfattachdel, $allowsetattachperm, $maxprice, $updateswfattach, $watermarkstatus;
$imageexists = 0;
$swfattachnew = (array) $swfattachnew;
$query = $db->query("SELECT * FROM {$tablepre}attachments WHERE tid='0' AND pid='0' AND uid='{$discuz_uid}'");
if ($db->num_rows($query) && $updateswfattach) {
$swfattachcount = 0;
$delaids = array();
while ($swfattach = $db->fetch_array($query)) {
if (in_array($swfattach['aid'], $swfattachdel)) {
dunlink($swfattach['attachment'], $swfattach['thumb']);
$delaids[] = $swfattach['aid'];
continue;
}
$extension = strtolower(fileext($swfattach['filename']));
$attach_basename = basename($swfattach['attachment']);
$attach_src = $attachdir . '/' . $swfattach['attachment'];
if ($attachsave) {
switch ($attachsave) {
case 1:
$attach_subdir = 'forumid_' . $GLOBALS['fid'];
break;
case 2:
$attach_subdir = 'ext_' . $extension;
break;
case 3:
$attach_subdir = 'month_' . date('ym');
break;
case 4:
$attach_subdir = 'day_' . date('ymd');
break;
}
$attach_descdir = $attachdir . '/' . $attach_subdir;
$swfattachnew[$swfattach['aid']]['attachment'] = $attach_subdir . '/' . $attach_basename;
} else {
$attach_descdir = $attachdir;
$swfattachnew[$swfattach['aid']]['attachment'] = $attach_basename;
}
$swfattachnew[$swfattach['aid']]['thumb'] = $swfattach['thumb'];
$attach_desc = $attach_descdir . '/' . $attach_basename;
if ($swfattach['isimage'] && $watermarkstatus) {
require_once DISCUZ_ROOT . './include/image.class.php';
$image = new Image($attach_src, $swfattach);
if ($image->imagecreatefromfunc && $image->imagefunc) {
$image->Watermark();
$swfattach = $image->attach;
}
}
if (!is_dir($attach_descdir)) {
@mkdir($attach_descdir, 0777);
@fclose(fopen($attach_descdir . '/index.htm', 'w'));
}
if ($swfattach['thumb'] == 1) {
if (!@rename($attach_src . '.thumb.jpg', $attach_desc . '.thumb.jpg') && @copy($attach_src . '.thumb.jpg', $attach_desc . '.thumb.jpg')) {
@unlink($attach_src . '.thumb.jpg');
}
}
if (!@rename($attach_src, $attach_desc) && @copy($attach_src, $attach_desc)) {
@unlink($attach_src);
}
if ($swfattach['isimage']) {
$imageexists = 1;
}
$attachnew = $swfattachnew[$swfattach['aid']];
$attachnew['remote'] = ftpupload($attach_desc, $attachnew);
$attachnew['perm'] = $allowsetattachperm ? $attachnew['perm'] : 0;
$attachnew['description'] = cutstr(dhtmlspecialchars($attachnew['description']), 100);
$attachnew['price'] = $maxprice ? intval($attachnew['price']) <= $maxprice ? intval($attachnew['price']) : $maxprice : 0;
$db->query("UPDATE {$tablepre}attachments SET tid='{$tid}', pid='{$pid}', attachment='{$attachnew['attachment']}', description='{$attachnew['description']}', readperm='{$attachnew['readperm']}', price='{$attachnew['price']}', remote='{$attachnew['remote']}' WHERE aid='{$swfattach['aid']}'");
$swfattachcount++;
}
if ($delaids) {
$db->query("DELETE FROM {$tablepre}attachments WHERE aid IN (" . implodeids($delaids) . ")", 'UNBUFFERED');
}
$attachment = $imageexists ? 2 : 1;
if ($swfattachcount) {
$db->query("UPDATE {$tablepre}threads SET attachment='{$attachment}' WHERE tid='{$tid}'", 'UNBUFFERED');
$db->query("UPDATE {$tablepre}posts SET attachment='{$attachment}' WHERE pid='{$pid}'", 'UNBUFFERED');
updatecredits($discuz_uid, $postattachcredits, $swfattachcount);
}
}
}
示例12: updateviews
if (substr($timestamp, -1) == '0') {
require_once DISCUZ_ROOT . './include/misc.func.php';
updateviews('attachments', 'aid', 'downloads', $logfile);
}
if (@($fp = fopen(DISCUZ_ROOT . $logfile, 'a'))) {
fwrite($fp, "{$aid}\n");
fclose($fp);
} elseif ($adminid == 1) {
showmessage('view_log_invalid');
}
} else {
$db->query("UPDATE {$tablepre}attachments SET downloads=downloads+'1' WHERE aid='{$aid}'", 'UNBUFFERED');
}
}
if (!$isimage) {
updatecredits($discuz_uid, $getattachcredits, -1);
}
ob_end_clean();
//dheader('Cache-control: max-age=31536000');
//dheader('Expires: '.gmdate('D, d M Y H:i:s', $timestamp + 31536000).' GMT');
if ($attach['remote'] && !$ftp['hideurl']) {
dheader('location:' . $ftp['attachurl'] . '/' . $attach['attachment']);
}
$filesize = filesize($filename);
$attach['filename'] = '"' . (strtolower($charset) == 'utf-8' && strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? urlencode($attach['filename']) : $attach['filename']) . '"';
dheader('Date: ' . gmdate('D, d M Y H:i:s', $attach['dateline']) . ' GMT');
dheader('Last-Modified: ' . gmdate('D, d M Y H:i:s', $attach['dateline']) . ' GMT');
dheader('Content-Encoding: none');
if ($isimage && !empty($noupdate)) {
dheader('Content-Disposition: inline; filename=' . $attach['filename']);
} else {
示例13: foreach
$stickmodify = 0;
foreach ($threadlist as $thread) {
$stickmodify = (in_array($thread['displayorder'], array(2, 3)) || in_array($level, array(2, 3))) && $level != $thread['displayorder'] ? 1 : $stickmodify;
}
if ($globalstick && $stickmodify) {
require_once DISCUZ_ROOT . './include/cache.func.php';
updatecache('globalstick');
}
$modaction = $level ? $expiration ? 'EST' : 'STK' : 'UST';
$db->query("UPDATE {$tablepre}threadsmod SET status='0' WHERE tid IN ({$moderatetids}) AND action IN ('STK', 'UST', 'EST', 'UES')", 'UNBUTTERED');
} elseif ($operation == 'digest') {
$db->query("UPDATE {$tablepre}threads SET digest='{$level}', moderated='1' WHERE tid IN ({$moderatetids})");
foreach ($threadlist as $thread) {
if ($thread['digest'] != $level) {
$digestpostsadd = $thread['digest'] > 0 && $level == 0 || $thread['digest'] == 0 && $level > 0 ? 'digestposts=digestposts' . ($level == 0 ? '-' : '+') . '1' : '';
updatecredits($thread['authorid'], $digestcredits, $level - $thread['digest'], $digestpostsadd);
}
}
$modaction = $level ? $expiration ? 'EDI' : 'DIG' : 'UDG';
$db->query("UPDATE {$tablepre}threadsmod SET status='0' WHERE tid IN ({$moderatetids}) AND action IN ('DIG', 'UDI', 'EDI', 'UED')", 'UNBUTTERED');
}
} elseif ($operation == 'close') {
$modaction = empty($close) ? $expiration ? 'EOP' : 'OPN' : ($expiration ? 'ECL' : 'CLS');
$close = $modaction == 'ECL' || $modaction == 'CLS' ? 1 : 0;
$db->query("UPDATE {$tablepre}threads SET closed='{$close}', moderated='1' WHERE tid IN ({$moderatetids})");
$db->query("UPDATE {$tablepre}threadsmod SET status='0' WHERE tid IN ({$moderatetids}) AND action IN ('CLS','OPN', 'ECL', 'UCL', 'EOP', 'UEO')", 'UNBUTTERED');
} elseif ($operation == 'move') {
$toforum = $db->fetch_first("SELECT fid, name, modnewposts, allowpostspecial FROM {$tablepre}forums WHERE fid='{$moveto}' AND status>0 AND type<>'group'");
if (!$toforum) {
showmessage('admin_move_invalid');
} elseif ($fid == $toforum['fid']) {
示例14: template
if(!submitcheck('paysubmit')) {
include template('pay');
} else {
$updateauthor = true;
if($maxincperthread > 0) {
if(($db->result_first("SELECT SUM(netamount) FROM {$tablepre}paymentlog WHERE tid='$tid'")) > $maxincperthread) {
$updateauthor = false;
}
}
if($updateauthor) {
updatecredits($thread['authorid'], array($creditstransextra[1] => $thread['netprice']));
}
updatecredits($discuz_uid, array($creditstransextra[1] => $thread['price']), -1);
$db->query("INSERT INTO {$tablepre}paymentlog (uid, tid, authorid, dateline, amount, netamount)
VALUES ('$discuz_uid', '$tid', '$thread[authorid]', '$timestamp', '$thread[price]', '$thread[netprice]')");
showmessage('thread_pay_succeed', "viewthread.php?tid=$tid");
}
} elseif($action == 'viewpayments') {
$discuz_action = 82;
$loglist = array();
$query = $db->query("SELECT p.*, m.username FROM {$tablepre}paymentlog p
LEFT JOIN {$tablepre}members m USING (uid)
WHERE tid='$tid' ORDER BY dateline");
示例15: while
$db->query("DELETE FROM {$tablepre}rewardlog WHERE tid='{$tid}'", 'UNBUFFERED');
}
$thread_attachment = $post_attachment = 0;
$query = $db->query("SELECT pid, attachment, thumb, remote FROM {$tablepre}attachments WHERE tid='{$tid}'");
while ($attach = $db->fetch_array($query)) {
if ($attach['pid'] == $pid) {
$post_attachment++;
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
} else {
$thread_attachment = 1;
}
}
if ($post_attachment) {
$db->query("DELETE FROM {$tablepre}attachments WHERE pid='{$pid}'", 'UNBUFFEREED');
$db->query("DELETE FROM {$tablepre}attachmentfields WHERE pid='{$pid}'", 'UNBUFFERED');
updatecredits($orig['authorid'], $postattachcredits, -$post_attachment);
}
$db->query("DELETE FROM {$tablepre}posts WHERE pid='{$pid}'");
if ($thread['special'] == 2) {
$db->query("DELETE FROM {$tablepre}trades WHERE pid='{$pid}'");
}
if ($isfirstpost) {
$forumadd = 'threads=threads-\'1\', posts=posts-\'1\'';
$tablearray = array('threadsmod', 'relatedthreads', 'threads', 'debates', 'debateposts', 'polloptions', 'polls', 'typeoptionvars');
foreach ($tablearray as $table) {
$db->query("DELETE FROM {$tablepre}{$table} WHERE tid='{$tid}'", 'UNBUFFERED');
}
if ($globalstick && in_array($thread['displayorder'], array(2, 3))) {
require_once DISCUZ_ROOT . './include/cache.func.php';
updatecache('globalstick');
}