Файл: modules/phpcodes/index.php
Строк: 18
<?php
$title = 'Полезные PHP коды';
include_once($_SERVER["DOCUMENT_ROOT"].'/style/head.php');
?>
<div class="title">Полезные PHP коды</div>
<div class="section">Коды: <a href="/phpcodes/new">Новые</a> | <a href="/phpcodes/rating">Рейтинговые</a> | <a href="/phpcodes/search">Поиск</a> | <a href="/phpcodes/my">Мои</a></div>
<?
$folder = $db->query("SELECT * FROM `phpcodes_folders`");
while($f = $folder->fetch_assoc()){
?>
<div class="section"><a href="/phpcodes/folder/<?=$f['id']?>"><?=htmlspecialchars($f['name'])?></a> (<?=$db->query("SELECT `id` FROM `phpcodes_codes` WHERE `folder`='".$f['id']."'")->num_rows?><?
if($db->query("SELECT `id` FROM `phpcodes_codes` WHERE `time`>=".time()."-86400 AND `folder`='".$f['id']."'")->num_rows!=0){
?><font color="red">+<?=$db->query("SELECT `id` FROM `phpcodes_codes` WHERE `time`>=".time()."-86400 AND `folder`='".$f['id']."'")->num_rows?></font><?}?>)
<?
if($user['level']>=3){
?>
<a href="/phpcodes/folder/<?=$f['id']?>/edit">[Ред.]</a> | <a href="/phpcodes/folder/<?=$f['id']?>/del">[Уд.]</a>
<?
}
?>
</div>
<?
}
if($db->query("SELECT `id` FROM `phpcodes_folders`")->num_rows==0){
?>
<div class="error">Папок нет.</div>
<?
}
?>
<?
if($user['level']>=3){
?>
<div class="nvg"><a href="/phpcodes/new_folder">Создать папку</a></div>
<?
}
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>