Файл: world-faces.ru/world-faces.ru/fermer/fermers.php
Строк: 52
<?php
include_once '../i.php';
$set['title']='Моя ферма!';
verh();
err();
aut();
if(mysql_result(mysql_query("SELECT count(id) FROM `my_apps` where `id_us` = '".$us['id']."' and `id_app` = '1'"),0)==0){
pdo();
$app = DB::$dbs->queryFetch("SELECT * FROM `apps` where `id` = ? limit 1",array(1));
function ret($type){
$type = str_replace('И','и',$type);
$type = str_replace('а','ы',$type);
$type = str_replace('П','п',$type);
$type = str_replace('ие','ия',$type);
return $type;
}
echo '<div class="title" align="center">Запуск '.ret($app['type']).' | <a href="/play">закрыть</a></div>';
echo '<div class="prof"><img src="'.$app['img'].'" align="middle" alt="'.$app['name'].'"/><b>'.$app['name'].'</b><br/>'.$app['opis'].'</div>';
echo '<div class="app">Запустили уже <b>'.DB::$dbs->querySingle("SELECT count(id) FROM `my_apps` where `id_app` = '1'").'</b> человек! <a href="?add"><input type="submit" value="Запустить '.$app['name'].'!"/></a></div>';
if(isset($_GET['add'])){
DB::$dbs->query("INSERT INTO `my_apps` set `id_us` = ?, `id_app` = ?",array($us['id'],1));
$text = 'запустил'.(($us['pol']==0)?'а':'').' приложение <b>[url='.$app['src'].']"'.$app['name'].'"[/url]</b>!';
DB::$dbs->query("INSERT INTO `lenta_saita` set `user` = ?, `time` = ?,`action` = ?",array($us['nick'],time(),$text));
header('location:'.$app['src'].'');
}
niz(); exit;
}
echo '<center><img src="/fermer/img/neighbors.gif" /> </center>';
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user`"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($k_post==0){
echo " <td class='p_t'>n";
echo "Нет результатовn";
echo " </td>n";
}
$q=mysql_query("SELECT * FROM `user` ORDER BY `fermer_oput` DESC LIMIT $start, $set[p_str]");
while ($ank = mysql_fetch_array($q)){
include "inc/fermer_level.php";
echo "<div class='p_t'>n";
if($ank['id']!=$user['id'])
echo "<a href='fermers_gr.php?id=$ank[id]'>$ank[nick]</a>".online($ank['id'])."n";
else
echo "<b>$ank[nick]</b> ".online($ank['id'])."n";
echo "</div>n";
echo "<div class='p_m'>";
echo "Уровень: ".$level."";
echo "</div>";
}
if ($k_page>1)str("?",$k_page,$page);
echo "<div class='foot'>";
echo "« <a href='index.php'>Назад</a><br/>";
echo "« <a href='my.php'>На ферму</a><br/>";
echo "</div>";
include_once '../sys/inc/tfoot.php';
?>