$db->query("DELETE FROM {$tablepre}rewardlog WHERE tid='{$tid}' and answererid='{$post['authorid']}'"); $db->query("UPDATE {$tablepre}rewardlog SET answererid='{$post['authorid']}' WHERE tid='{$tid}' and authorid='{$thread['authorid']}'"); $thread['price'] = '-' . $thread['price']; $db->query("UPDATE {$tablepre}threads SET price='{$thread['price']}' WHERE tid='{$tid}'"); $db->query("UPDATE {$tablepre}posts SET dateline={$thread['dateline']}+1 WHERE pid='{$pid}'"); $thread['dateline'] = gmdate("{$dateformat} {$timeformat}", $thread['dateline'] + $timeoffset * 3600); if ($discuz_uid != $thread['authorid']) { sendpm($thread['authorid'], 'reward_question_subject', 'reward_question_message', $discuz_uid, $discuz_user); } sendpm($post['authorid'], 'reward_bestanswer_subject', 'reward_bestanswer_message', $discuz_uid, $discuz_user); showmessage('reward_completion', $forward); } elseif ($action == 'activityapplies') { $allowjoinactivity = 1; if ($supe['status'] && $forum['status'] == 2 && $thread['sgid']) { require_once DISCUZ_ROOT . './include/supesite.func.php'; $allowjoinactivity = supe_circlepermission($thread['sgid']); } if (!$discuz_uid || !$allowjoinactivity) { showmessage('undefined_action', NULL, 'HALTED'); } if (submitcheck('activitysubmit')) { $expiration = $db->result_first("SELECT expiration FROM {$tablepre}activities WHERE tid='{$tid}'"); if ($expiration && $expiration < $timestamp - date('Z')) { showmessage('activity_stop'); } $query = $db->query("SELECT applyid FROM {$tablepre}activityapplies WHERE tid='{$tid}' and username='******'"); if ($db->num_rows($query)) { showmessage('activity_repeat_apply', "viewthread.php?tid={$tid}&extra={$extra}"); } $payvalue = intval($payvalue); $payment = $payment ? $payvalue : -1;
$db->query("UPDATE {$tablepre}debates SET affirmpoint='{$affirmpoint}', negapoint='{$negapoint}', endtime='{$endtime}', umpire='{$umpire}' WHERE tid='{$tid}' AND uid='{$discuz_uid}'"); } $optiondata = array(); if ($forum['threadtypes']['special'][$typeid] && $checkoption) { $optiondata = threadtype_validator($typeoption); } if ($forum['threadtypes']['special'][$typeid] && $optiondata && is_array($optiondata)) { foreach ($optiondata as $optionid => $value) { $db->query("UPDATE {$tablepre}typeoptionvars SET value='{$value}' WHERE tid='{$tid}' AND optionid='{$optionid}'"); } } $sgidadd = ''; if ($iscircle && $sgid) { $sgidadd = ', sgid=0'; require_once DISCUZ_ROOT . './include/supesite.func.php'; if (supe_circlepermission($sgid)) { $sgidadd = ", sgid='{$sgid}'"; } } $db->query("UPDATE {$tablepre}threads SET iconid='{$iconid}', typeid='{$typeid}', subject='{$subject}', readperm='{$readperm}', price='{$price}' {$authoradd} {$polladd} {$sgidadd} " . ($auditstatuson && $audit == 1 ? ",displayorder='0', moderated='1'" : '') . " WHERE tid='{$tid}'", 'UNBUFFERED'); if ($tagstatus) { $tags = str_replace(array(chr(0xa3) . chr(0xac), chr(0xa1) . chr(0x41), chr(0xef) . chr(0xbc) . chr(0x8c)), ',', censor($tags)); if (strexists($tags, ',')) { $tagarray = array_unique(explode(',', $tags)); } else { $tags = str_replace(array(chr(0xa1) . chr(0xa1), chr(0xa1) . chr(0x40), chr(0xe3) . chr(0x80) . chr(0x80)), ' ', $tags); $tagarray = array_unique(explode(' ', $tags)); } $threadtagsnew = array(); $tagcount = 0; foreach ($tagarray as $tagname) {