Пример #1
0
 }
 if ($MG['add_limit']) {
     $last = $db->get_one("SELECT addtime FROM {$table} WHERE {$sql} ORDER BY itemid DESC");
     if ($last && $DT_TIME - $last['addtime'] < $MG['add_limit']) {
         dalert(lang($L['add_limit'], array($MG['add_limit'])));
     }
 }
 $msg = captcha($captcha, $need_captcha, true);
 if ($msg) {
     dalert($msg);
 }
 $msg = question($answer, $need_question, true);
 if ($msg) {
     dalert($msg);
 }
 if ($do->pass($post)) {
     $CAT = get_cat($post['catid']);
     if (!$CAT || !check_group($_groupid, $CAT['group_add'])) {
         dalert(lang($L['group_add'], array($CAT['catname'])));
     }
     $post['addtime'] = $post['level'] = $post['fee'] = 0;
     $post['style'] = $post['template'] = $post['note'] = '';
     $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add'];
     $post['status'] = get_status(3, $need_check);
     $post['hits'] = 0;
     $post['username'] = $_username;
     if ($could_color && $color && $_credit > $MOD['credit_color']) {
         $post['style'] = $color;
         credit_add($_username, -$MOD['credit_color']);
         credit_record($_username, -$MOD['credit_color'], 'system', $L['title_color'], '[' . $MOD['name'] . ']' . $post['title']);
     }