View file color of nickname/pages/color.php

File size: 6.19Kb
<?php

include_once '../sys/inc/start.php';

if(!empty($_GET['color'])) {
$probe_color = $_GET['color'];
}

$doc = new document(1);
$doc->title = __('Цвет ника');

if(@$_GET['action'] == 'stand') {
if(500 > $user->balls) {
$doc->err(__('У вас не хватает баллов требуеца 500 бал.'));
} else {

if(!empty($probe_color)) {
$doc->ret(__('Список цветов'), '?');
    $doc->ret(__('Личное меню'), '/menu.user.php');

    if (isset($_POST['save'])) {
$user->color = $probe_color;
mysql_query("UPDATE `users` SET `balls` = '".($user->balls-500)."', `color` = '".$user->color."'  WHERE `id` = '".$user->id."'");
$doc->msg('Цвет ника успешно изменён');
        exit;
    }

    if (isset($_POST['cancel'])) {
header('Location: ?action=stand' . SID);
        exit;
    }


    $form = new design();
    $form->assign('method', 'post');
$form->assign('action', '?action=stand&amp;color=' . urlencode($probe_color).'&amp;'.passgen());
    $elements = array();

$elements[] = array('type' => 'text', 'br' => 1, 'value' => __('Вы действительно хотите купить этот цвет ника?'));

$elements[] = array('type' => 'submit', 'br' => 0, 'info' => array('name' => 'save', 'value' => __('Купить')));
    $elements[] = array('type' => 'submit', 'br' => 0, 'info' => array('name' => 'cancel', 'value' => __('Отмена')));

    $form->assign('el', $elements);
    $form->display('input.form.tpl');
    exit;
}


$listing = new listing();
    $post = $listing->post();
$post->title = '<font color="#ff0000">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=1';
$post = $listing->post();
$post->title = '<font color="#008000">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=2';
$post = $listing->post();
$post->title = '<font color="#0000ff">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=3';

$post = $listing->post();
$post->title = '<font color="#ccced5">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=4';


$post = $listing->post();
$post->title = '<font color="#ffffff">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=5';
$post = $listing->post();
$post->title = '<font color="#000000">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=6';

$post = $listing->post();
$post->title = '<font color="#790185">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=7';

$post = $listing->post();
$post->title = '<font color="#fc45eb">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=8';

$post = $listing->post();
$post->title = '<font color="#D2691E">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=9';

$post = $listing->post();
$post->title = '<font color="#FFFF00">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=10';

$post = $listing->post();
$post->title = '<font color="#FFD700">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=11';

$post = $listing->post();
$post->title = '<font color="#FFA500">'.$user->login.'</font>';
$post->url = '?action=stand&amp;color=12';
$listing->display();

}
$doc->ret(__('Список цветов'), '?');
} elseif(@$_GET['action'] == 'gradient') {
if(1000 > $user->balls) {
$doc->err(__('У вас не хватает баллов требуеца 1000 бал.'));
} else {
if(!empty($probe_color)) {
$doc->ret(__('Список цветов'), '?');
$doc->ret(__('Личное меню'), '/menu.user.php');
if(isset($_POST['save'])) {
$user->color = $probe_color;
mysql_query("UPDATE `users` SET `balls` = '".($user->balls-1000)."', `color` = '".$user->color."'  WHERE `id` = '".$user->id."'");
$doc->msg('Цвет ника успешно изменён');
exit;
}

if(isset($_POST['cancel'])) {
header('Location: ?action=gradient'.SID);
exit;
}

$form = new design();
$form->assign('method', 'post');
$form->assign('action', '?action=gradient&amp;color='.urlencode($probe_color).'&amp;'.passgen());
$elements = array();

$elements[] = array('type' => 'text', 'br' =>1, 'value' => __('Вы действительно хотите купить этот цвет ника?'));

$elements[] = array('type' => 'submit', 'br' => 0, 'info' => array('name' => 'save', 'value' => __('Купить')));
$elements[] = array('type' => 'submit', 'br' => 0, 'info' => array('name' => 'cancel', 'value' => __('Отмена')));

$form->assign('el', $elements);
$form->display('input.form.tpl');
exit;
}


$listing = new listing();
$post = $listing->post();
$post->title = text::toOutput('[gradient from="#790185" to="#FFA500"]'.$user->login.'[/gradient]');
$post->url = '?action=gradient&amp;color=14';

$post = $listing->post();
$post->title = text::toOutput('[gradient from="#00ff00" to="#0000ff"]'.$user->login.'[/gradient]');
$post->url = '?action=gradient&amp;color=15';
$post = $listing->post();
$post->title = text::toOutput('[gradient from="#000000" to="#790185"]'.$user->login.'[/gradient]');
$post->url = '?action=gradient&amp;color=16';

$post = $listing->post();
$post->title = text::toOutput('[gradient from="#0000ff" to="#ff0000"]'.$user->login.'[/gradient]');
$post->url = '?action=gradient&amp;color=17';


$post = $listing->post();
$post->title = text::toOutput('[gradient from="#ff0000" to="#0000ff"]'.$user->login.'[/gradient]');
$post->url = '?action=gradient&amp;color=18';

$post = $listing->post();
$post->title = text::toOutput('[gradient from="#0000ff" to="#ffff00"]'.$user->login.'[/gradient]');
$post->url = '?action=gradient&amp;color=19';

$post = $listing->post();
$post->title = text::toOutput('[gradient from="#ffff00" to="#0000ff"]'.$user->login.'[/gradient]');
$post->url = '?action=gradient&amp;color=20';

$listing->display();
}
$doc->ret(__('Список цветов'), '?');
} else {
$listing = new listing();
$post = $listing->post();
$post->title = 'Обычные цвета 500 бал.';
$post->url = '?action=stand';

$post = $listing->post();
$post->title = 'Градиентовые цвета 1000 бал.';
$post->url = '?action=gradient';
$listing->display();
}
$doc->ret(__('Личное меню'), '/menu.user.php');