Файл: region_clean/select.php
Строк: 178
<?
#######################################
## Mod By KoT (borispol) [76-75-072] ##
#######################################
require_once "start.php";
require_once "sid.php";
header("Cache-Control: no-cache");
if ($ver == "wml")header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else header("Content-Type:text/html; charset=UTF-8");
require_once "inc.php";
$link = connect_db();
list($row, $id, $ps, $fsize1, $fsize2) = check_login($link);
require_once "version.php";
ob_start();
switch($mod) {
case 'avatars':
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>
<card id="cabinet" title="Аватары">
<p>";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Аватары</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="left">";
}
$path = "avatars";
$col = 6;
$ras1 = ".gif";
$ras2 = "";
$ras3 = "";
$d = opendir("$path");
if (!$list) $list = 1;
$n = 1;
while(($k = readdir($d)) !== false) {
if ($k == '.' or $k == '..' or $k == "index.php") continue;
$n++;
}
closedir($d);
$num = ($n/$col);
if ($num !== (int)$num) {
$foo = (int)$num;
$fo = ($foo + 1);
} else {
$fo = $num;
}
if (!is_numeric($list)) { header("Location: index.php?isset=403"); die; }
for ($i = 1; $i <= $fo; $i++) {}
if ($list == "") {
$c = 0;
} else {
$c = ($col*($list-1));
}
$d = opendir("$path");
$la = "-1";
echo $fsize1;
echo 'Аватар для <b>' . $row['user'] . '</b><br/>';
echo $divide;
echo 'Ты можешь установить любой из этих аватаров в качестве личного в анкете, просто щелкни на понравившейся картинке.<br/>';
echo $divide;
echo $fsize2;
while(($e = readdir($d)) !== false) {
if ($e == '.' or $e == '..') continue;
$la = $la + 1;
if ($la > $c-1 and $la < $c + $col){
$e1 = str_replace("$ras1","",$e);
$e1 = str_replace("$ras2","",$e1);
$e1 = str_replace("$ras3","",$e1);
#if($par[2]==1)$foto="$id.gif"; //Загрузка фото в формате gif
#if($par[2]==2)$foto="$id.jpg"; //Загрузка фото в формате jpg
#if($par[2]==3)$foto="$id.png"; //Загрузка фото в формате png
if ($mode == 1) {
$ee = strtr($e1,$tran);
} else {
$ee = $e1;
}
$laa = $la + 1;
echo "<a href="select.php?mod=addavatars&$ses&num=$e1"><img src="fr4.php?a=$e1" alt="$e1"/></a><br/> ";
}
}
for ($i = 0; $i <= $fo; $i++)
if ($list == "$path") {
$c = 0;
} else {
$c = ($col*($list-1));
}
$lis = $list + 1;
$lis1 = $list - 1;
echo '<br/>';
if ($lis1 < 1) {
echo $fsize1;
echo "<<пред.";
echo $fsize2;
} else {
echo $fsize1;
echo "<a href="select.php?list=$lis1&$ses&mod=avatars"><<пред. </a>";
echo $fsize2;
}
if ($lis == "$i") {
echo $fsize1;
echo "| след.>><br/>";
echo $fsize2;
} else {
echo $fsize1;
echo "| <a href="select.php?list=$lis&$ses&mod=avatars">след.>></a><br/>";
echo $fsize2;
}
if ($ver != "wml") echo "<form method="POST" action="select.php?$ses&mod=avatars&ref=$ref" name="auth">n";
echo $fsize1;
echo 'Перейти к:<br/>';
echo $fsize2;
echo '<input name="list" format="*N" size="3"/><br/>';
echo $fsize1;
echo 'странице<br/>';
echo $fsize2;
if ($ver == "wml") {
echo $fsize1;
echo "<anchor title="go">Пошёл<go href="select.php?$ses&&mod=avatars&ref=$ref" method="post">
<postfield name="list" value="$(list)"/>
</go></anchor>";
echo $fsize2;
echo '<br/>';
} else {
echo '<input type="submit" class="ibutton" value="Пошёл" name="enter"><br/>';
}
$allpage = $i - 1;
echo '<br/>';
echo $fsize1;
echo $divide;
echo "Аватаров:<b> $n</b><br/>Страницa:<b> $list/$allpage</b><br/>";
echo $fsize2;
closedir($d);
break;
case 'addavatars':
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>
<card id="cabinet" title="Аватары">
<p align="center">";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Аватары</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="center">";
}
if (($num >= 0) and ($num <= 270) and ($num != "")) {
$num = intval($num);
$foto = $id.".gif";
if (file_exists ("avatars/$foto")) { unlink ("avatars/$foto"); }
@Copy("avatars/$num.gif", "loadavatars/".basename($foto));
if (!is_numeric($id)) { header("Location: index.php?isset=403"); die; }
$foto = mysql_real_escape_string(check($foto));
mysql_query ("Update users set myavatar='".$foto."' where id ='".$id."'");
echo $fsize1;
echo 'Твой Аватар успешно установлен!<br/>';
echo $fsize2;
echo "<img src="fr4.php?usid=$id" alt="avatar"/><br/>";
} else {
echo $fsize1;
echo 'Произошла ошибка при установке аватара!<br/>';
echo $fsize2;
}
break;
case 'smile':
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>
<card id="cabinet" title="Личный смайл">
<p align="center">";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Личный смайл</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="left">";
}
$path = "mysmile";
$col = 6;
$ras1 = ".gif";
$ras2 = ".jpg";
$ras3 = ".png";
$d = opendir("$path");
if (!$list) $list = 1;
$n = 1;
while(($k = readdir($d)) !== false) {
if ($k == '.' or $k == '..' or $k == "index.php") continue;
$n++;
}
closedir($d);
$num = ($n/$col);
if ($num!==(int)$num) {
$foo = (int) $num;
$fo = ($foo + 1);
} else {
$fo = $num;
}
if (!is_numeric($list)) { header("Location: index.php?isset=403"); die; }
for ($i = 1; $i <= $fo; $i++) {/*echo "<a href="1.php?list=$i">$i</a>|";*/}
if ($list == "") {
$c = 0;
} else {
$c = ($col*($list-1));
}
$d = opendir("$path");
$la = -1;
echo $fsize1;
echo 'Смайл для <b>' . $row['user'] . '</b><br/>';
echo $divide;
echo 'Ты можешь установить любой из этих смайлов в качестве личного смайла, просто щелкни на понравившейся картинке!<br/>
Вывод личного смайла происходит по набору команды .my.<br/>';
echo $divide;
echo $fsize2;
while(($e = readdir($d)) !== false) {
if ($e == '.' or $e == '..') continue;
$la = $la + 1;
if ($la > $c-1 and $la < $c + $col) {
$e1 = str_replace("$ras1","",$e);
$e1 = str_replace("$ras2","",$e1);
$e1 = str_replace("$ras3","",$e1);
if ($mode == 1) {
$ee = strtr($e1,$tran);
} else {
$ee = $e1;
}
$laa = $la + 1;
echo "<a href="select.php?mod=addsmiles&$ses&num=$e1"><img src="fr5.php?a=$e1" alt="$e1"/></a><br/> ";
}
}
for ($i = 0; $i <= $fo; $i++)
if ($list == "") {
$c = 0;
} else {
$c = ($col*($list-1));
}
$lis = $list + 1;
$lis1 = $list - 1;
echo '<br/>';
if ($lis1 < 1) {
echo $fsize1;
echo "<<пред.";
echo $fsize2;
} else {
echo $fsize1;
echo "<a href="select.php?list=$lis1&$ses&mod=smile"><<пред.</a>";
echo $fsize2;
}
if ($lis == "$i") {
echo $fsize1;
echo "| след.>><br/>";
echo $fsize2;
} else {
echo $fsize1;
echo "| <a href="select.php?list=$lis&$ses&mod=smile">след.>></a><br/>";
echo $fsize2;
}
if ($ver != "wml") echo "<form method="POST" action="select.php?$ses&mod=smile&ref=$ref" name="auth">n";
echo $fsize1;
echo 'Перейти к:<br/>';
echo $fsize2;
echo '<input name="list" format="*N" size="3"/><br/>';
echo $fsize1;
echo 'странице<br/>';
echo $fsize2;
if ($ver == "wml") {
echo $fsize1;
echo "<anchor title="go">Пошёл<go href="select.php?$ses&mod=smile&ref=$ref" method="post">
<postfield name="list" value="$(list)"/>
</go></anchor>";
echo $fsize2;
echo '<br/>';
} else {
echo '<input type="submit" class="ibutton" value="Пошёл" name="enter"><br/>';
}
$allpage = $i - 1;
echo '<br/>';
echo $fsize1;
echo $divide;
echo "Смайлов:<b> $n</b><br/>Страницa:<b> $list/$allpage</b><br/>";
echo $fsize2;
closedir($d);
break;
case 'addsmiles':
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>
<card id="cabinet" title="Личный смайл">
<p align="center">";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Личный смайл</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="left">";
}
if (($num >= 0) && ($num <= 270) && ($num != '')) {
$foto = $id.".gif";
if (file_exists("mysmile/$foto")) {
unlink("mysmile/$foto");
}
@Copy("mysmile/$num.gif", "loadsmile/".basename($foto));
@mysql_query ("Update users set mysmile='".check($foto)."' where id ='".$id."'");
echo $fsize1;
echo 'Твой Смайл успешно установлен!<br/>';
echo $fsize2;
echo "<img src="fr5.php?usid=$id" alt="smiles"/><br/>";
} else {
echo $fsize1;
echo 'Произошла ошибка при установке личного смайла!<br/>';
echo $fsize2;
}
break;
}
echo $fsize1;
echo $divide;
echo "<div class = 'd1'>
<a href="cabinet.php?$ses&ref=$ref">Личный кабинет</a><br/>
<a href="enter.php?$ses&ref=$ref">Прихожая</a></div>n";
echo $fsize2;
include_once "foot.php";
ob_end_flush();
?>