Файл: youtube/index.php
Строк: 70
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
$diz -> head('Видео с YouTube');
$diz -> title('Видео с YouTube');
if ($aut == true) {
$nst = $db -> dbcount('COUNT(`id`)','youtube','`time` > '.(time()-86400).'');
if ($ns==0)$ns=NULL;
else $nst='+ '.$nst;
$m_st = $db -> dbcount('count(`id`)','youtube',"`user` = '".$ya['id']."'");
echo '<div class="but_razdel">
<a class="button_razdel" href="new_video.php">Новые <span class="count">'.$nst.'</span></a>
<a class="button_razdel" href="my_video.php?id='.$ya['id'].'">Мои <span class="count">'.$m_st.'</span></a>
<a class="button_razdel" href="poisk.php">Поиск</a>
</div>';
}
$for = $db -> query("SELECT `id`,`name` FROM `youtube_cat`");
if ($for -> num_rows > 0) {
$count=$for -> num_rows;
$num = isset($ya['num']) ? $ya['num'] : 10;
$total = intval(($count - 1) / $num) + 1;
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] < 1 )
{
$page = 1;
} elseif($_GET['page'] > $total)
{ $page = $total;
} else $page = (int)$_GET['page'];
$start = $page * $num - $num;
$for = $db -> query("SELECT `id`,`name` FROM `youtube_cat` ORDER BY `id` ASC LIMIT ".$start.",".$num);
while ($assoc = $for -> fetch_assoc()) {
$nst2 = $db -> dbcount('COUNT(`id`)','youtube','`time` > '.(time()-86400).' and `razdel`='.$assoc['id'].'');
if ($nst2==0)$nst2=NULL;
else $nst2='<span class="chet">+'.$nst2.'</span>';
if($ya['level']>3){
$admin = '<a href="./func.php?id='.$assoc['id'].'&mode=delr">[Удалить]</a> | <a href="./func.php?id='.$assoc['id'].'&mode=redraz">[Изменить]</a>';}
$st = $db -> dbcount('COUNT(`id`)','youtube','`razdel`='.$assoc['id'].'');
echo '<a href="razdel.php?id='.$assoc['id'].'" class="mail">
<table width=100%><tr valign="top"><td width=5%>'.$diz -> img('load/video.png').'</td>
<td>'.$assoc['name'].' <span class="count"/>'.$st.''.$nst2.'</span><br/>'.$admin.'</td></tr></table></a>';
}
$act = '?';
echo ''.$func -> pagenav($act,$page,$total).'';
}else echo '<div class="fon">Разделы ещё не созданы</div>';
if ($aut == true) {
echo '<div class="levo"><a href="./new.php" class="levo_tuch">'.$diz -> img('load/video.png').' Добавить видео</a></div>';
if($ya['level']>3){echo '<div class="levo"><a href="./func.php?mode=new" class="levo_tuch">'.$diz -> img('book/edit.png').' Создать раздел</a></div>';}
}
echo '<div class="levo"><a href="/index.php" class="levo_tuch">'.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
?>