Размер файла: 2.88Kb
<?php
//POWERED by ILI
// ICQ : 197042
//site: ili.wab.ru
// ilichat v4.0
error_reporting(0);
require_once"./includes/functions/gzip.php";
include('start.php');
include("config.php");
include("./includes/".$ver."/banned");
list($msec, $sec) = explode(chr(32), microtime());
$headtime = $sec + $msec;
$ref = rand(1000, 9999);
$my_title = "Fontcolor";
if(!isset($_COOKIE['theme'])) $_COOKIE['theme'] = 1;
include_once "themes/".intval($_COOKIE['theme'])."/index.php";
$id = $_SESSION['id'];
$password = $_SESSION['password'];
//AUTH
$q = mysql_query("SELECT color FROM `chat_users` WHERE `id` = '".$id."' AND `password` = '".md5($password)."';");
if(mysql_affected_rows() == 0)
{
echo "ошибка авторизации!<br/>\n";
include_once "themes/".intval($_COOKIE['theme'])."/foot.php";
exit();
}
//END AUTH
//INSTALL COLOR
if(isset($_POST['fcolor']))
{
if(preg_match("/[^a-z]+/",$_POST['fcolor'])) exit();
mysql_query("UPDATE `chat_users` SET `color` = '".$_POST['fcolor']."' WHERE `id` = '".$id."' AND `password` = '".md5($password)."';");
$fcolor = $_POST['fcolor'];
}
else{
$fcolor = mysql_result($q, 0);
}
//END INSTALL COLOR
//ONLINE
$online = time() + 60;
$update = mysql_query("UPDATE `chat_users` SET `time` = '".$online."', `place` = 0, `ip` = '".getenv('REMOTE_ADDR')."', `ua` = '".htmlspecialchars(getenv('HTTP_USER_AGENT'))."' WHERE `id` = '".$id."';");
//END ONLINE
if(!empty($fcolor))
{
echo "Текущий цвет <font color='".$fcolor."'><u>".$fcolor."</u></font><br/>\n";
}
echo "Выберите цвет:<br/>\n";
echo "<form action=\"fontcolor.php?".SID."&ver=html&ref=$ref\" method=\"post\">\n";
echo '<select name="fcolor" style="width: 80px; text-align: center;">
<option style="background-color: #FFFFFF" value="black" selected>Color</option>
<option style="background-color: darkred" value="darkred">Dark Red</option>
<option style="background-color: red" value="red">Red</option>
<option style="background-color: orange" value="orange">Orange</option>
<option style="background-color: brown" value="brown">Brown</option>
<option style="background-color: yellow" value="yellow">Yellow</option>
<option style="background-color: green" value="green">Green</option>
<option style="background-color: olive" value="olive">Olive</option>
<option style="background-color: cyan" value="cyan">Cyan</option>
<option style="background-color: blue" value="blue">Blue</option>
<option style="background-color: indigo" value="indigo">Indigo</option>
<option style="background-color: violet" value="violet">Violet</option>
</select><br/>';
echo "<input type=\"submit\" value=\"Сохранить\" /></form>\n";
echo "<br/><a href=\"my.php?".SID."&ver=html\">Личный Кабинет</a><br/>\n";
echo "<a href=\"menu.php?".SID."&ver=html\">Меню чата</a><br/>";
include_once "themes/".intval($_COOKIE['theme'])."/foot.php";
?>