N
NewLife
Гость
$bb_cfg['maths_bonus'] = 30;
function index_data()
{
require(AJAX_DIR .'index_data.php');
}
function mathsBonus(){
global $userdata, $bb_cfg;
DB()->query("UPDATE `bb_users` SET `user_points` = `user_points`+{$bb_cfg['maths_bonus']} WHERE `user_id` = {$userdata['user_id']}");
$this->response['name'] = $userdata['username'];
$this->response['bonus'] = $bb_cfg['maths_bonus'];
}
'change_tor_status' => array('user'),
'mathsBonus' => array('user'),
Спасибо огромноеАрхив в корень.
в config.php
ajax.phpPHP:$bb_cfg['maths_bonus'] = 30;
после
вставитьКод:function index_data() { require(AJAX_DIR .'index_data.php'); }
вверху послеPHP:function mathsBonus(){ global $userdata, $bb_cfg; DB()->query("UPDATE `bb_users` SET `user_points` = `user_points`+{$bb_cfg['maths_bonus']} WHERE `user_id` = {$userdata['user_id']}"); $this->response['name'] = $userdata['username']; $this->response['bonus'] = $bb_cfg['maths_bonus']; }
вставитьКод:'change_tor_status' => array('user'),
PHP:'mathsBonus' => array('user'),
Пример: