Файл: region_clean/znak/danet.php
Строк: 59
<?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">";
}
if (!is_numeric($_GET['usid'])) { header('Location: index.php?isset=403'); }
$simpat = mysql_fetch_array(mysql_query("SELECT `id`,`user`,`simpati` FROM `users` WHERE `id`='$id'"));
$sim = $simpat['simpati'];
$tekt = time();
$ri = mysql_query("SELECT * FROM `users` WHERE $tekt < simpatia");
$i = 1;
while($ai = mysql_fetch_assoc($ri))
{
$totime = $ai['simpatia'] - $tekt;
}
if ($totime == 0) {
mysql_query("UPDATE `users` SET `simpatia`='0', `simpati`='0' WHERE `id`='$id' LIMIT 1");
}
if ($sim == 5) {
echo 'Симпатии закончились. Через час будут еще.<br/>
<a href="danet.php?'.$ses.'&usid='.$usid.'">(Обновить)</a><br/>';
include_once '../foot.php';
exit;
}
$wtime = 60;
$totime = $wtime;
$wtime = $wtime * 60 + time();
$wtime = intval($wtime);
$komu = mysql_fetch_array(mysql_query("SELECT `id`,`user`,`simpati` FROM `users` WHERE `id`='".(int)$usid."'"));
$simpat = mysql_fetch_array(mysql_query("SELECT `id`,`user`,`simpati` FROM `users` WHERE `id`='$id'"));
$sim = $simpat['simpati'];
if (mysql_query("UPDATE `users` SET simpati=`simpati`+'1', `simpatia`='$wtime' WHERE id='$id'") &&
mysql_query("UPDATE `users` SET yousimpati=`yousimpati`+'1' WHERE `id`='".(int)$usid."'")) {
echo '<b>'.col_n($komu['user']).'</b> получит уведомление о твоей симпатии и, возможно ответит взаимностью)<br/>
У тебя симпатий осталось: <b>'.(4-$sim).'</b><br/>';
include_once '../foot.php';
/////////////////
$fromid = mysql_fetch_array(mysql_query("SELECT `user` FROM `users` WHERE `id`='$id'"));
$fromus = $fromid['user'];
$adm = mysql_query ("SELECT `id`,`user` FROM `users` WHERE user='".(int)$usid."'");
$z = mysql_fetch_array ($adm);
$data = date("d-M-Y [H:i]");
$kol = rand(0,99999999);
$time = time();
$topic = "Оставлена симпатия.";
$message = "Пользователь <b>" . $fromus . "</b> оставил свою симпатию в знакомствах к твоему фото :)";
mysql_query("Insert into zapiski set klu4='".$kol."', idwho ='1', message = '".$message."', towhom = '".$id."', idtowhom = '".$usid."', time = '".$time."', readd = '0', topic = '".$topic."', date='".$data."'");
//////////////////
} else {
die ('Произошла ошибка...');
}
include_once 'foot.php';
?>