/**
* includes file or executes code
*/
function execute($filename, $code, $handle)
{
$this->cur_tpl = $filename;
global $lang, $bb_cfg;
$L =& $lang;
$V =& $this->vars;
if ($bb_cfg['xs_add_comments'] && $handle)
{
echo '<!-- template ', $this->files[$handle], ' start -->';
}
if ($filename)
{
include($filename);
}
else
{
eval($code);
}
if ($bb_cfg['xs_add_comments'] && $handle)
{
echo '<!-- template ', $this->files[$handle], ' end -->';
}
}
case 'vip':
if (($cost = $bb_cfg['seed_points_ex']['vip']["$bonus_count"]) && $seed_points >= $cost)
{
$user_vip_exp = mktime(0, 0, 0, date("m") , date("d")+31, date("Y"));
$user_vip_coment = $lang['CASHE_VIP'];
DB()->query("UPDATE ". BB_BT_USERS ."
SET user_vip = '2', user_vip_exp = $user_vip_exp, user_vip_coment = '$user_vip_coment', seed_points = seed_points - $cost
WHERE user_id = $user_id");
$err = sprintf($lang['SUCCESSFULLY_EXCHANGED_VIP'], $cost) . $return;
}
else
message_die(GENERAL_ERROR, $lang['POINTS_NOT_ENOUGH'] . $return);
break;
Так все-таки когда же случится сие значимое событие?потому что адаптировать нужно, а не сувать тупо код с тп1)))
P.S. сид поинты чуть позже будут добавлены в движок, потерпите))
// Get SUMMARIZED user's dlstat
DB()->query("
INSERT INTO ". NEW_BB_BT_LAST_USERSTAT ."
(user_id, up_add, down_add, release_add, bonus_add, speed_up, speed_down)
SELECT
user_id, SUM(up_add), SUM(down_add), SUM(release_add), SUM(bonus_add), SUM(speed_up), SUM(speed_down)
FROM ". NEW_BB_BT_LAST_TORSTAT ."
GROUP BY user_id
");
// Update TOTAL user's dlstat
DB()->query("
UPDATE
". BB_BT_USERS ." u,
". NEW_BB_BT_LAST_USERSTAT ." ub
SET
u.u_up_total = u.u_up_total + ub.up_add,
u.u_down_total = u.u_down_total + ub.down_add,
u.u_up_release = u.u_up_release + ub.release_add,
u.u_up_bonus = u.u_up_bonus + ub.bonus_add
WHERE u.user_id = ub.user_id
");
// Get SUMMARIZED user's dlstat
DB()->query("
INSERT INTO ".NEW_BB_BT_LAST_USERSTAT."
(user_id, topics_count, up_add, down_add, release_add, bonus_add, seed_points_raw, speed_up, speed_down)
SELECT
user_id, SUM(seeder), SUM(up_add), SUM(down_add), SUM(release_add), SUM(bonus_add), ((SUM(seed_time_add)*{$bb_cfg['seed_points_per_hour']})/(3600*SUM(seeder))), SUM(speed_up), SUM(speed_down)
FROM ".NEW_BB_BT_LAST_TORSTAT."
GROUP BY user_id
");
// Update TOTAL user's dlstat
DB()->query("
UPDATE
". BB_BT_USERS ." u,
". NEW_BB_BT_LAST_USERSTAT ." ub
SET
u.u_up_total = u.u_up_total + ub.up_add,
u.u_down_total = u.u_down_total + ub.down_add,
u.u_up_release = u.u_up_release + ub.release_add,
u.u_up_bonus = u.u_up_bonus + ub.bonus_add,
u.seed_points = u.seed_points + (". get_bonus_sql_case ($bb_cfg['seed_points_f'], 'ub.topics_count', 'ub.seed_points_raw') .")
WHERE u.user_id = ub.user_id
");