Файл: sumerki.mobi/sumerki.mobi/library.php
Строк: 45
<?php
//////////////////////////////////////////////////////////////
//////////////////////Онлайн игра "Сумерки"///////////////////
//////////////////////Основатель: Mc Laren////////////////////
///////////////////Контакты: ICQ - 597687549//////////////////
/////////////////////Пример: Sumerki.Mobi/////////////////////
///////////Если ты это читаешь, значит скрипт слили :D////////
//////////////////////////////////////////////////////////////
define('PROTECTOR', 1);
$headmod = 'library';//фикс. места
$textl='Помощь по игре';
include('files/path.php');
include('files/db.php');
include('files/auth.php');
include('files/func.php');
include('files/core.php');
include('files/head.php');
include('files/zag.php');
echo '<div class="zagolovok"><div class="zagolovok1"> <div class="zagolovok2"><div class="zagolovok_right"></div><div class="zagolovok_left"></div><div class="ch_name">';
echo 'Помощь';
echo '</div><div class="clearFix"></div></div></div></div>';
function main()
{
$result = mysql_result(mysql_query("SELECT COUNT(*) FROM `library`"),0);
$whiel = mysql_query("SELECT id, title FROM `library`");
$lists = mysql_fetch_array($whiel);
if ($result == 0)
{ echo "--Статей нет--"; }
else{
do{
printf("<div class='button pad_bot_5 pad'><a href="library.php?id=%s&lb=list_library">    <img src='/theme/standart/images/galochka.png'/> %s</a></div>",$lists[id],$lists[title]);
} while($lists = mysql_fetch_array($whiel));
}
}
function library_info()
{
$id=intval($_GET['id']);
if(empty($id)){
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo "Не выбрана статья";
echo '</div></div></div></div></div></div></div></div></div>';
include($path.'files/down.php');
include($path.'files/meny.php');
exit;
}
$id=intval($_GET['id']);
$whiel = mysql_query("SELECT * FROM library WHERE id='$id'");
$sta=mysql_num_rows($whiel);
if($sta==0){
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo "Не выбрана статья";
echo '</div></div></div></div></div></div></div></div></div>';
include($path.'files/down.php');
include($path.'files/meny.php');
exit;
}
$lists = mysql_fetch_array($whiel);
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo "Название: <b>$lists[title]</b><br/><small>Дата добавления: <b>$lists[time]</b></small><br/>";
echo "<hr>";
echo "$lists[text]<br/>Автор: <b>$lists[author]</b>";
echo '</div></div></div></div></div></div></div></div></div>';
echo "<div class='button pad_bot_5 pad'><a href="library.php?">    <img src='/theme/standart/images/galochka.png'/> Вернуться</a></div>";
}
$lb = (isset($_GET['lb'])) ? $_GET['lb'] : NULL;
if($lb == "")
{main();}
elseif($lb == "list_library")
{library_info();}
include($path.'files/down.php');
include($path.'files/meny.php');
?>