Файл: masteram_us/blogs/index.php
Строк: 54
<?php
require_once ('../shaxty.php');
check_login();
$title = 'Блоги';
$align = 'left';
unset($_SESSION['msg']);
unset($_SESSION['s']);
include_once (H.'shaxty/head.php');
if($level>=5){
if(isset($_GET['delblog'])) {
mysql_query("DELETE FROM `blogs` WHERE tip = 'msg' and id = '".check(intval($_GET['delblog']))."'");
mysql_query("DELETE FROM `blog_komm` where blog = '".check(intval($_GET['delblog']))."'");
header ('Location: ?');
}
}
echo $div4.'<b>Личное:</b>'.$div9;
echo '<dl></dl>';
if($level>=5)echo '<a href="odobr.php">Модерация блогов</a> ('.mysql_result(mysql_query("select COUNT(*) from `blogs` WHERE tip = 'msg' and html = 1;"),0).')<br />';
echo '<img src="img/ico_add_b.png" alt="*"/> <a href="add.php">Создать блог</a><br />';
echo '<img src="img/ico_my.png" alt="*"/> <a href="my.php">Мои блоги</a><br />';
echo '<dl></dl>';
echo $div4.'<b>Блоги:</b>'.$div9;
echo '<dl></dl>';
$q = mysql_query("select * from blog_razd order by pos;");
if (mysql_affected_rows() == 0)echo "Категорий нет!!!<br/>";
$p==1;
while($arr=mysql_fetch_array($q)) {
$g = mysql_fetch_array(mysql_query ("select count(id) as num from blog where refid='$arr[id]';"));
$numg = $g["num"];
$p++;
if(is_integer($p / 2)) echo '<div class="second_name">'; else echo $div2;
echo "<a href="cat.php?id=".$arr['id'].""><b>".$arr['name']."</b></a> (".$numg.")<br /><small>".$arr['about']."</small>$div9";
}
echo '<img src="img/folder.png" alt="*"/> <a href="cat.php">Категории</a> ('.mysql_result(mysql_query("select COUNT(*) from blogs where tip = 'cat';"),0).')<br />
<img src="img/folder_table.png" alt="*"/> <a href="all.php">Все блоги</a> ('.mysql_result(mysql_query("select COUNT(*) from `blogs` WHERE tip = 'msg' and html = 0;"),0).')<br />
<img src="img/folder_user.png" alt="*"/> <a href="all_us.php">Все блогеры</a> ('.mysql_result(mysql_query("select COUNT(*) from users where blogs > 0;"),0).')<br />
<img src="img/page_favourites.gif" alt="*"/> <a href="top.php?top=blogs">Лучшие блоги</a><br />
<img src="img/magnifier.png" alt="*"/> <a href="search.php">Поиск</a><br />
<img src="img/chart_16.gif" alt="*"/> <a href="stat.php">Статистика блога</a><br />';
echo '<dl></dl>';
echo $div4.'<img src="img/10_2.gif" alt=""/> <b>Последние записи:</b>'.$div9;
echo '<dl></dl>';
$q2 = mysql_query("select * from `blogs` where tip = 'msg' and html = 0 order by time desc limit 0, 3;");
$d==1;
while($a = mysql_fetch_array($q2)){
$d++;
if(is_integer($d / 2)) echo '<div class="second_name">'; else echo $div2;
$cat=mysql_fetch_array(mysql_query("select * from blogs where tip = 'cat' and `id` = '".$a['refid']."';"));
if($level>=5)$moders = "<a href="/blogs/edit.php?blog=".$a['id']."">[Ред.]</a>|<a href="?delblog=".$a['id']."">[Удал.]</a>";
echo "<img src="img/blog2.png" alt=""/> <b><a href="/blogs/".$a['id']."">".$a['name']."</a></b> (".times($a['time']).") $moders $div9".$a['about']."<br/><img src="img/next.gif" alt=""/> <a href="/blogs/".$a['id']."">Читать полностью</a><dt></dt>
<img src="img/comments.gif" alt=""/> <a href="".$a['id']."?komm">Комментарии</a>(".mysql_result(mysql_query("select count(*) as num from blog_komm where `blog` = '".$a['id']."'"),0).")
<br /><img src="img/p2.png" alt=""/> Категория: <a href="cat.php?id=".$cat['id']."">".$cat['name']."</a><br />
<img src="img/ico_inte.png" alt=""/> Автор: ".nik($a['user_id'])."<br />";
if ($a['klych'] != ''){
echo '<img src="img/tag.gif" alt=""/> ';
$record=split(",", $a['klych']);
$num=count($record);
if(!isset($s))$s=1;
$max=round(($num/10)+0.45);
for ($i=0;$i<$num;$i++){
$z++;
$adr=$record[$i];
if($z>0) $zp = ', '; else $zp = '';
echo '<a href="/blogs/search.php?s=key&msg='.$adr.'">'.$adr.'</a>'.$zp;
}
}
echo '<dl></dl>';
}
echo '<br />';
include_once (H.'shaxty/foot.php');
?>