Файл: region_clean/invite.php
Строк: 119
<?
#######################################
## Mod By KoT (borispol) [76-75-072] ##
#######################################
require_once "start.php";
require_once "sid.php";
header("Cache-Control: no-cache");
$ver = empty($ver) || ($ver != 'wml' && !file_exists('css/'.$ver.'.css')) ? 'xhtml' : $ver;
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 (isset($rm)) $takep2="&rm=$rm&ref=$ref";
else $takep2="&ref=$ref";
$us = $row['user'];
$fr = $row['friends'];
$mod = isset($_GET['mod']) ? $_GET['mod'] : NULL;
switch($mod) {
default:
$us = $row['user'];
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="friendslist" title="Твои друзья">n
<p align="center">n";
} 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 $fsize1;
$num = mysql_result(mysql_query ("select count(id) from users where `invite` = '".$id."';"), 0);
echo "<div class = 'c4'>Мои рефералы:</div><br/>";
if ($num == 0) {
echo '<br/>Надо активнее работать:)<br/><br/>';
} else {
if (!isset($s)) $s = 0;
$mx = round(($num/10)+0.45);
if ($s > $mx) $s = $mx;
if ($s == 0) $s = 1;
$ot = (($s - 1) * 10) + 1;
$do = $s * 10;
if ($do > $num) $do = $num;
$o = $ot-1;
$n = $ot;
if ($do == 0) $n = $o;
echo "Показывает $n-$do из $num<br/>n";
echo '-------<br />';
$o = intval($o);
$do = intval($do);
$r = mysql_query("SELECT id, user FROM users WHERE invite ='".$id."' ORDER BY id DESC LIMIT $o,$do");
for ($i = $ot; $i <= $do; $i++) {
$arr = mysql_fetch_array($r);
echo ($i).") <a href="info.php?$ses&nk=".$arr['id']."&ref=$ref">".col_n($arr['user'])."</a><br/>";
}
$next = $s + 1;
$prev = $s - 1;
if ($num > $do) {
$ot = (($next-1)*10)+1;
$do = $next * 10;
if ($do > $num) $do = $num;
echo "<br/><a href="invite.php?$ses&s=$next&ref=$ref">>>$ot-$do>></a><br/>n";
}
if ($s > 1) {
$ot = (($prev - 1) * 10) + 1;
$do = $prev * 10;
echo "<a href="invite.php?$ses&s=$prev&ref=$ref"><<$ot-$do<<</a><br/>n";
}
}
echo "<div class = 'd1'><a href="invite.php?$ses&mod=add&nk=$nk&ref=$ref"><b>Пригласить друга</b></a><br/>n
<a href ="cabinet.php?$ses&ref=$ref">← Личный кабинет</a><br/>n
<a href ="enter.php?$ses&ref=$ref">← Прихожая</a></div>n";
echo $fsize2;
include_once "foot.php";
mysql_close($link);
exit;
break;
case 'add':
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n";
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="add" title="Пригласить друга">n
<p align="center" mode="wrap">n";
} 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 $fsize1;
echo "Чтобы пригласить своих друзей ты можешь воспользоваться своей персональной ссылкой:<br/>n
http://".$_SERVER['HTTP_HOST']."/?inv=$id<br/>n
<br/>n
Скопировать ссылку:<br/>n";
echo $fsize2;
echo "<input size="25" value="http://".$_SERVER['HTTP_HOST']."/?inv=$id" /><br/>n";
echo $fsize1;
echo "<br/><div class = 'd1'><a href="invite.php?$ses$takep2">Мои рефералы</a></div>n";
if (isset($rm)) echo "<div class = 'd1'><a href="chat.php?$ses&rm=$rm$takep">В чат</a></div>";
echo $fsize2;
include_once "foot.php";
mysql_close($link);
exit;
break;
}
?>