Ответить в теме

За основу взято:

http://torrentpier.com/threads/Выбор-шаблона-из-профиля.371/#post-4274

 

-- usercp_bonus.php найти

 

[php]$user_password = $userdata['user_password'];[/php]

 

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

 

[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]

 

-- найти

 

[PHP]        $message .= $out;

 

    bb_die($message);

}[/PHP]

 

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

 

[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]

 

-- найти

 

[php]

'MY_BONUS'        => sprintf($lang['MY_BONUS'], $user_points),

[/php]

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

[php]

'TEMPC'        => ($user_points >= 5000) ? 'seed' : 'leech',

[/php]

-- найти

[html]

<!-- END bonus_upload -->

[/html]

 

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

[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>

[/html]


Сверху