Файл: l2ps_v5/podarok_not.php
Строк: 122
<?php
include_once("files/zag.php");
include_once("files/ini.php");
$polz=mysql_query("SELECT * FROM `users` WHERE `udata0`='$log' AND `udata1`='$pas' LIMIT 1");
if(mysql_num_rows($polz)==0){
header ("Location: index.php?error");
}else{
function smiles($string){
$dir = opendir ("pic/smiles");
while ($file = readdir ($dir)) {
if (ereg (".gif$", "$file")){
$file2=str_replace(".gif","",$file);
$string=str_replace(":$file2",'<img src="pic/smiles/'.$file.'" alt="">',$string);
}}
closedir ($dir);
return $string; }
$result = mysql_result(mysql_query("SELECT COUNT(*) FROM `podarok_ok` WHERE usr = '$nicks'"),0);
if ($result == 0)
{
echo "У персонажа <b>$nicks</b> нет подарков!<br/>";
}
else {
if(empty($startan)) $startan = 0;
$startan=intval($startan);
if($startan<0) $startan=0; $num_msgs_an=5;
$qi = mysql_query("SELECT * FROM `podarok_ok` WHERE `usr` = '$nicks' ORDER by `nick` DESC LIMIT $startan,$num_msgs_an");
while($msg=mysql_fetch_array($qi))
{
$from = strip_tags($msg['nick']);
$froms = strip_tags($msg['times']);
$froms2 = strip_tags($msg['podarok']);
$froms3 = $msg[coment];
$coment = strip_tags($msg['froms3']);
$froms3 = smiles($froms3);
$req = mysql_query("SELECT * FROM `users` WHERE `udata0` = '$from'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto=="0"){
echo'Нет такого персонажа!';
include ("files/down.php");
exit;
}
$usdata = mysql_fetch_array($req);
$req = mysql_query("SELECT `prava`,`udata91` FROM `users` WHERE `udata0` = '$from'");
$pic = mysql_fetch_array($req);
echo "От: ";
if ($usdata['udata91']==0)echo "<img src='/l2pic/status/on.gif' alt='' class='icon'/>";
else if ($usdata['udata91']==1)echo "<img src='/l2pic/status/gotov_boltat.png' alt='' class='icon'/>";
else if ($usdata['udata91']==2)echo "<img src='/l2pic/status/zaniat.png' alt='' class='icon'/>";
else if ($usdata['udata91']==3)echo "<img src='/l2pic/status/boleu.png' alt='' class='icon'/>";
else if ($usdata['udata91']==4)echo "<img src='/l2pic/status/depressia.png' alt='' class='icon'/>";
else if ($usdata['udata91']==5)echo "<img src='/l2pic/status/dumau.png' alt='' class='icon'/>";
else if ($usdata['udata91']==6)echo "<img src='/l2pic/status/kuru.png' alt='' class='icon'/>";
else if ($usdata['udata91']==7)echo "<img src='/l2pic/status/kushau.png' alt='' class='icon'/>";
else if ($usdata['udata91']==8)echo "<img src='/l2pic/status/love.png' alt='' class='icon'/>";
else if ($usdata['udata91']==9)echo "<img src='/l2pic/status/tv.png' alt='' class='icon'/>";
else if ($usdata['udata91']==10)echo "<img src='/l2pic/status/music.png' alt='' class='icon'/>";
else if ($usdata['udata91']==11)echo "<img src='/l2pic/status/vanna.png' alt='' class='icon'/>";
else if ($usdata['udata91']==12)echo "<img src='/l2pic/status/tualet.png' alt='' class='icon'/>";
else if ($usdata['udata91']==13)echo "<img src='/l2pic/status/sex.png' alt='' class='icon'/>";
else if ($usdata['udata91']==14)echo "<img src='/l2pic/status/igrau.png' alt='' class='icon'/>";
else if ($usdata['udata91']==15)echo "<img src='/l2pic/status/pivo.png' alt='' class='icon'/>";
else if ($usdata['udata91']==16)echo "<img src='/l2pic/status/sonni.png' alt='' class='icon'/>";
////////
else if ($usdata['udata91']==17)echo "<img src='/l2pic/status/1.png' alt='' class='icon'/>";
else if ($usdata['udata91']==18)echo "<img src='/l2pic/status/12.png' alt='' class='icon'/>";
else if ($usdata['udata91']==19)echo "<img src='/l2pic/status/13.png' alt='' class='icon'/>";
else if ($usdata['udata91']==20)echo "<img src='/l2pic/status/14.png' alt='' class='icon'/>";
else if ($usdata['udata91']==21)echo "<img src='/l2pic/status/18.png' alt='' class='icon'/>";
else if ($usdata['udata91']==22)echo "<img src='/l2pic/status/19.png' alt='' class='icon'/>";
else if ($usdata['udata91']==23)echo "<img src='/l2pic/status/31.png' alt='' class='icon'/>";
else if ($usdata['udata91']==24)echo "<img src='/l2pic/status/7.png' alt='' class='icon'/>";
echo " <a href="search.php?nick=$from&go=go">$from</a>";
echo "<br><small>$froms</small><br>";
$qp=mysql_query("SELECT * FROM `porarky` WHERE `id` = '$froms2' LIMIT 1");
$p = mysql_fetch_array($qp);
echo"<img src='$p[url]' />";
echo "<br><small>$froms3</small><br>";
echo '<div class="bts"></div>';
}}
$q = mysql_query("SELECT COUNT(`usr`) FROM `podarok_ok` WHERE usr = '$nicks'");
$kol = mysql_result($q, 0);
echo "- - -<br/>";
echo "<a href="podarky">Подарить</a></b></br/>";
if($startan!= 0) $page2left = ' <a href= podarok_not.php?nicks='.$nicks.'&startan='. ($startan - 5) .'&page='.($page-1).'>'. ($page - 1) .'</a> | ';
if(empty($page)){$page=1;}
if($kol > $startan + 5) $page2right = ' | <a href= podarok_not.php?nicks='.$nicks.'&startan='. ($startan + 5) .'&page='. ($page+1) .'>'. ($page + 1) .'</a>';
echo $page2left.'<b>('.$page.')</b>'.$page1right.$page2right.'<br/>';
if ($startan != 0) {echo '<a href="podarok_not.php?nicks='.$nicks.'&startan='.($startan - 5).'&page='.($page-1).'">Назад</a> ';}
if ($kol > $startan + 5) {echo ' <a href="podarok_not.php?nicks='.$nicks.'&startan='.($startan + 5).'&page='.($page+1).'">Далее</a>';}
}
include ("files/down.php");
?>