$welcomtitle = addslashes(replacesitevar($welcomtitle)); $welcomemsgtxt = addslashes(replacesitevar($welcomemsgtxt)); if ($welcomemsg == 1) { sendpm($uid, $welcomtitle, $welcomemsgtxt, 0); } elseif ($welcomemsg == 2) { sendmail("{$username} <{$email}>", $welcomtitle, $welcomemsgtxt); } } if ($fromuid) { updatecredits($fromuid, $creditspolicy['promotion_register']); dsetcookie('promotion', ''); } if ($taskon && $newbietask && ($task = $db->fetch_first("SELECT * FROM {$tablepre}tasks WHERE taskid='{$newbietask}' AND available='2'"))) { require_once DISCUZ_ROOT . './include/task.func.php'; $task['newbie'] = 1; task_apply($task); } else { $newbietask = 0; } require_once DISCUZ_ROOT . './include/cache.func.php'; $_DCACHE['settings']['totalmembers']++; updatesettings(); dsetcookie('loginuser', ''); dsetcookie('activationauth', '', -86400 * 365); if (!empty($inajax)) { $msgforward = unserialize($msgforward); $mrefreshtime = intval($msgforward['refreshtime']) * 1000; $message = 1; if ($regverify != 1) { include template('register'); }
function task_newfunction_autoapply() { global $db, $tablepre, $discuz_uid; $query = $db->query("SELECT * FROM {$tablepre}tasks WHERE newbietask='2' AND available='2'"); $tprompt = FALSE; while ($t = $db->fetch_array($query)) { $t['newbie'] = 1; if (!$db->result_first("SELECT COUNT(*) FROM {$tablepre}mytasks WHERE uid='{$discuz_uid}' AND taskid='{$t['taskid']}'")) { task_apply($t); $tprompt = TRUE; } } $tprompt && updateprompt('task', $discuz_uid, $db->result_first("SELECT COUNT(*) FROM {$tablepre}mytasks WHERE uid='{$discuz_uid}' AND status='0'")); }