Файл: region_clean/znak/igra.php
Строк: 82
<?php
#######################################
## 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";
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="send" title="Знакомства">n
<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">";
}
echo '<div class="c4">Игра <b>[Да-Нет]</b>, просто кликни по понравившейся фотке :)</div><br/>';
if (!is_numeric($_GET['sex']))
{
header('Location: ../index.php?isset=403');
}
elseif ($_GET['sex'] == 1)
{
$sex = str_replace(1, 'М', $sex);
}
elseif ($_GET['sex'] == 2)
{
$sex = str_replace(2, 'Ж', $sex);
}
elseif ($_GET['sex'] != 1 || $_GET['sex'] != 2)
{
echo 'А не пошел бы ты на хуй умник?<br/>';
include_once '../foot.php';
exit;
}
$num = mysql_num_rows(mysql_query("SELECT `id`, `user`, `sex`, `birth`, `img` FROM `users` WHERE `img`!=''"));
if (!isset($s)) $s = 0;
$mx = round(($num/3) + 0.45);
if ($s > $mx) $s = $mx;
if ($s == 0) $s = 1;
$ot = (($s - 1) * 3) + 1;
$do = $s * 3;
if ($do > $num) $do = $num;
$o = $ot - 1;
$n = $ot;
if ($do == 0) $n = $o;
$o = (int)$o;
$do = (int)$do;
$print = mysql_query("SELECT `id`, `user`, `sex`, `birth`, `img` FROM `users` WHERE `img`!='' AND `sex`='".check($sex)."' ORDER BY `simpati` DESC LIMIT $o,$do");
for ($i = $ot; $i <= $do; $i++) {
$data = mysql_fetch_array($print);
$usid = $data['id'];
$nick = $data['user'];
$birth = $data['birth'];
$sex = $data['sex'];
$img = $data['img'];
########################
$birth = explode("-",$birth);
$d = $birth[0];
$m = $birth[1];
$g = $birth[2];
if ($d != NULL and $m != NULL and $g != NULL) {
if ($m == 1);
elseif ($m == 2);
elseif ($m == 3);
elseif ($m == 4);
elseif ($m == 5);
elseif ($m == 6);
elseif ($m == 7);
elseif ($m == 8);
elseif ($m == 9);
elseif ($m == 10);
elseif ($m == 11);
elseif ($m == 12);
$birth = date("Y")-$g;
if (date("n") < $m) $birth = $birth-1;
elseif (date("n") == $m and date("j") < $d) $birth = $birth-1;
}
########################
settype($usid, 'integer');
$ras = explode(".", $img);
$type = $ras[1];
if ($_GET['s'] > $do) {
echo 'Дальше нету юзеров с фотками!<br/>';
} else {
echo '<img align="center" src="../photos/'.$usid.'.'.$type.'" alt="." width="100" height="100"/><br/>
<img src="../icon/love.gif" alt="."/>
<a href="danet.php?'.$ses.'&usid='.$usid.'"><b>'.col_n($nick).'</b></a> ('.$birth.')<br/><b>-----</b><br/>';
}
}
$next = $s + 1;
$prev = $s - 1;
if ($num > $do) {
$ot = (($next - 1) * 3) + 1;
$do = $next * 3;
if ($do > $num) $do = $num;
echo $fsize1;
if ($row['sex'] == 'М')
{
echo '<a href="igra.php?'.$ses.'&s='.$next.'&sex=2">Дальше</a><br/>';
} else {
echo '<a href="igra.php?'.$ses.'&s='.$next.'&sex=1">Дальше</a><br/>';
}
}
if ($s > 1) {
$ot = (($prev - 1) * 3) + 1;
$do = $prev * 3;
echo $fsize1;
if ($row['sex'] == 'М')
{
echo '<a href="igra.php?'.$ses.'&s='.$prev.'&sex=2">Назад</a><br/>';
} else {
echo '<a href="igra.php?'.$ses.'&s='.$prev.'&sex=1">Назад</a><br/>';
}
}
echo '<br/><div class="d1"><a href="../enter.php?'.$ses.'&ref='.$ref.'">Прихожая</a></div>';
include_once '../foot.php';
?>