Файл: accmarket.net/fraction/news.php
Строк: 42
<?php
define('_ON_CMS', 1);
require_once '../includes/start.php';
require_once '../includes/function.php';
require_once '../includes/header.php';
$fr=$_GET['f'];
$q = mysql_query("SELECT * FROM `fractions` WHERE `id`='".check(mysql_real_escape_string($fr))."'");
$f = mysql_fetch_array($q);
$ucount = mysql_result(mysql_query("SELECT COUNT(*) FROM `fractions_users` WHERE `uid`='".$use_id."' AND `fid`='".$f['id']."';"), 0);
if($game==0 OR $level==0 OR $f['id']=='' OR $ucount==0 OR $ban!=0){
header('Location: ../index.php');
}
echo '<div class="top"><img src="../images/fr.png" alt="" /> Фракция <u>'.$f['name'].'</u> | Новости</div>';
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `fractions_news` WHERE `fid`='".$f['id']."';"), 0);
$PAGINGS = new PAGINGS($elem, "SELECT * FROM `fractions_news` WHERE `fid`='".$f['id']."' ORDER BY `id` DESC");
if($PAGINGS->count_get > 0)
{
while($row = mysql_fetch_array($PAGINGS->get))
{
$q1 = mysql_query("SELECT * FROM `users` WHERE `id`='".check(mysql_real_escape_string($row['uid']))."'");
$f1 = mysql_fetch_array($q1);
echo '<div class="conts">';
echo '<b>' . $row['news'] . '</b> ['.dates($row['time']).']<br />' . smiles(tags($row['text'])) . '<br/>';
echo 'Автор: '.rasa($f1['rasa']).' <a href="../p/anketa.php?id='.$f1['id'].'"><span class="'.crasa($f1['rasa']).'">'.$f1['login'].'</span></a>';
echo '</div>';
++$i;
}
if($count>$elem)echo $PAGINGS->Links('?f='.$fr.'&'); // вывод меню навигации в аргументе указывать адрес страницы
}
else
{
div('Новостей нет!','conts');
}
echo '<div class="conts"><a href="fraction.php?f='.$f['id'].'"><<Назад</a></div>';
div('<a href="../">В игру</a>','conts');
require_once '../includes/footer.php';
?>