示例#1
0
function task_apply($task = array())
{
    global $db, $tablepre, $discuz_uid, $discuz_user, $timestamp;
    require_once DISCUZ_ROOT . './include/tasks/' . $task['scriptname'] . '.inc.php';
    if (!isset($task['newbie'])) {
        task_condition();
    }
    $db->query("REPLACE INTO {$tablepre}mytasks (uid, username, taskid, csc, dateline)\r\n\t\tVALUES ('{$discuz_uid}', '{$discuz_user}', '{$task['taskid']}', '0\t{$timestamp}', '{$timestamp}')");
    $db->query("UPDATE {$tablepre}tasks SET applicants=applicants+1 WHERE taskid='{$task['taskid']}'", 'UNBUFFERED');
    $db->query("UPDATE {$tablepre}members SET prompt=prompt|2 WHERE uid='{$discuz_uid}'", 'UNBUFFERED');
    task_preprocess($task);
}
示例#2
0
function task_apply($task = array())
{
    global $db, $tablepre, $discuz_uid, $discuz_user, $timestamp;
    if (!isset($task['newbie'])) {
        require_once DISCUZ_ROOT . './include/tasks/' . $task['scriptname'] . '.inc.php';
        task_condition();
    }
    $db->query("REPLACE INTO {$tablepre}mytasks (uid, username, taskid, csc, dateline)\r\n\t\tVALUES ('{$discuz_uid}', '{$discuz_user}', '{$task['taskid']}', '0\t{$timestamp}', '{$timestamp}')");
    $db->query("UPDATE {$tablepre}tasks SET applicants=applicants+1 WHERE taskid='{$task['taskid']}'", 'UNBUFFERED');
    updateprompt('task', $discuz_uid, $db->result_first("SELECT COUNT(*) FROM {$tablepre}mytasks WHERE uid='{$discuz_uid}' AND status='0'"));
    if (!isset($task['newbie'])) {
        task_preprocess($task);
    }
}