Смена стиля за сид-бонусы

Y

Yoko

Гость
За основу взято:
http://torrentpier.com/threads/Выбор-шаблона-из-профиля.371/#post-4274

-- usercp_bonus.php найти

PHP:
$user_password = $userdata['user_password'];

-- ниже вставить

PHP:
$submit = (isset($_POST['submit'])) ? $_POST['submit'] : '';
$templ = (isset($_POST['temp'])) ? $_POST['temp'] : '';
$tm = (isset($_POST['tm'])) ? $_POST['tm'] : '';
 
$temp = array();
$my_temp = '';
 
foreach ($bb_cfg['tpl_name'] as $row)
{
if ($row == $userdata['user_tpl']) $my_temp = $row;
$temp[$row] = $row;
}
 
$select_template = build_select('temp', $temp, $my_temp, null, null);
 
$template->assign_var('TEMP_SELECT', $select_template);

-- найти

PHP:
        $message .= $out;
 
    bb_die($message);
}

-- ниже вставить

PHP:
elseif ($submit && $template && $userdata['user_tpl'] != $templ)
{
if($userdata['user_points'] < 5000)
    {
        meta_refresh('index.php', 5);
bb_die($message);
    }
else
{
if (!in_array($templ, $bb_cfg['tpl_name']))
{
$message = 'такого шаблона нет';
$message .= $out;
bb_die($message);
}
else
{
DB()->query("UPDATE ". BB_USERS ." SET user_tpl = '$templ', user_points = user_points - 5000 WHERE user_id = $user_id");
 
cache_rm_user_sessions($user_id);
 
$message = "Стиль отображения на форуме успешно сменён на $templ";
$message .= $out;
bb_die($message);
}
}
}

-- найти

PHP:
'MY_BONUS'        => sprintf($lang['MY_BONUS'], $user_points),
--ниже вставить
PHP:
'TEMPC'        => ($user_points >= 5000) ? 'seed' : 'leech',
-- найти
HTML:
<!-- END bonus_upload -->

-- ниже вставить
HTML:
<tr class="row1 med">
 
<td class="tLeft">{TEMP_SELECT}</td>
<td><b class="{TEMPC}">5000</b></td>
<td style="width: 5%;"><input type="radio" name="tm" value="1" /></td>
</tr>
 

Zenden

Пользователь
запрос забыл
наверное в место usercp_viewporifle.php нужно usercp_bonus.php
Не рациональное использование встроенной системы сид понитов. Зачем шаблон трогать, если новые поля генерируются автоматически?
Имхо, код грязноват.
 

vitalix

Пользователь
Прошу помощи.
Ревизия : 491
ошибки :
Код:
Notice: Undefined index: user_tpl in /var/www/h0009478/data/www/vittrack.ru/includes/functions.php on line 1554
 
Warning: require(/var/www/h0009478/data/www/vittrack.ru/templates//tpl_config.php) [function.require]: failed to open stream: Нет такого файла или каталога in /var/www/h0009478/data/www/vittrack.ru/includes/functions.php on line 1569
 
Fatal error: require() [function.require]: Failed opening required '/var/www/h0009478/data/www/vittrack.ru/templates//tpl_config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/h0009478/data/www/vittrack.ru/includes/functions.php on line 1569
 
Сверху