Файл: blog.php
Строк: 118
<?php
require_once 'inc/bd.php';
require_once 'inc/fun.php';
####
$id = num($_GET['id']);
$row = mysql_fetch_array(mysql_query("select * from `text` where `id` = '".$id."'"));
$title = html($row['name']);
$description = $title.','.html($row['tags']);
require_once 'inc/v.php';
####
if(empty($_COOKIE[$id])) {mysql_query("UPDATE `text` SET `unikal` = `unikal` + 1 WHERE`id` = '$id'");}
setcookie($id, 1, time() + 259200);
####
if (!empty($row))
{
if($row['checked']==1){
$cat = num($row['cat_id']);
$news = num($row['news']);
$golos = num($row['golos']);
$comment = num($row['comment']);
$catnames = mysql_fetch_assoc(mysql_query("SELECT * FROM `cat` WHERE `id`='$cat'"));
$catname = html($catnames['name']);
$date = $row['date'];
$kol = num($row['kol']);
$bad = num($row['bad']);
$good = num($row['good']);
$unikal = num($row['unikal']);
$name = html($row['name']);
$tags = html($row['tags']);
$comm = num($row['comm']);
$text = html($row['text']);
$text = nl2br($text);
$text = adminbb(parsebb(smiles($text)));
}else{$text="Статья на модерации";}
####
$nname = mysql_fetch_assoc(mysql_query("SELECT * FROM `comment` WHERE `text_id` = '$id' ORDER BY `id` DESC LIMIT 1"));
$user = antirek(html($nname['user']));
if ($user == $adminlogin) {$user = '<span style="color:#900">'.$user.' (УКДПЕ)</span>';}
if (!empty($news)){$div = '<div class="info">';}else{$div = '<div class="menu">';}
####
if (!empty($tags)){echo '<div class="rmenu">Метки: ';
$alltags = count(explode(',', rtrim($tags)));
$tags = explode(',', rtrim($tags));
echo '<a href="'.$home.'/tag.php?t='.$tags[0].'"><strong>'.$tags[0].'</strong></a>';
for($i = 1; $i <= $alltags - 1; $i++) {echo ', <a href="'.$home.'/tag.php?t='.$tags[$i].'"><strong>'.$tags[$i].'</strong></a> ';}
echo '</div>';}
else {echo '<div class="rmenu">Меток нет!</div>';}
echo $div;
if(!empty($row['user'])) echo '<b>Эту статью написал <a href="'.$home.'/profile/?u='.html($row['user']).'">'.html($row['user']).'</a><br/>Категория: <a href="'.$home.'/cat/'.$cat.'">'.$catname.'</a></b><br /><br/>';//кто добавил статью
echo '<strong>'.$name.'</strong><br />'.$text.'<br />';
###if(!empty($row['user'])) echo 'Добавил: <a href="'.$home.'/profile/?u='.html($row['user']).'">'.html($row['user']).'</a><br/>';//кто добавил статью
echo '</div>';
####
echo '<div class="amenu">';
if ($comment !== 1){
echo '<span style="color:#248cff">•</span> <a href="'.$home.'/say/'.$id.'">Добавить комментарий</a><br />';
echo '<span style="color:#248cff">•</span> <a href="'.$home.'/comment/'.$id.'">Все комментарии</a> ('.$comm.')';
if (!empty($user)) {$lcom = ' | <span class="small">'.$user.'</small><br/>';} else {$lcom = '<br />';}
echo $lcom;
}
$PW = "http://anonymouse.org/cgi-bin/anon-www.cgi/http://profiwm.ru/feeds/sl101k.php?uli=".$id;
function likes($url, $start, $end) {
$code = file_get_contents($url);
preg_match('/'.preg_quote($start,
'/').'(.*)'.preg_quote($end, '/').'/Us', $code, $match);
return $match[1];
}
echo'<a href="http://profiwm.ru/feeds/ukdpe.php?ulink='.$id.'"><img src="http://profiwm.ru/images/PW-mini1.png" alt="repost" align="middle" /></a> '.likes($PW,'|','>').'<br/>';
echo '<span class="small">';
if ($golos !== 1){
if (empty($_COOKIE['vote'.$id]))
{
echo '<span style="color:#248cff">•</span> Выскажись: <a href="'.$home.'/raiting.php?id='.$id.'&r=1">Заебись!</a> | <a href="'.$home.'/raiting.php?id='.$id.'&r=2">Хуйня!</a><br/>';
}
else
{
echo '<span style="color:#248cff">•</span> Сказали заебись: <span style="color:#090">'.$good.'</span> / Сказали хуйня: <span style="color:#900">'.$bad.'</span><br/>';
}
}
echo '<span style="color:#248cff">•</span> Добавлено: '.$date.'<br />
<span style="color:#248cff">•</span> Последний просмотр: '.$row['last'].'<br />
<span style="color:#248cff">•</span> Прочитали: '.$unikal.'<br />
<span style="color:#248cff">•</span> Раздел: <a href="'.$home.'/cat/'.$cat.'">'.$catname.'</a><br />
<span style="color:#248cff">•</span> Скачать как: <a href="'.$home.'/load.php?mod=txt&id='.$id.'">TXT</a> | <a href="'.$home.'/load.php?mod=htm&id='.$id.'">HTM</a><br />';
//if(!empty($row['user'])) echo 'Добавил: <a href="'.$home.'/profile/?u='.html($row['user']).'">'.html($row['user']).'</a><br/>';
echo '- - - - - -<br />
Ссылка: <input name="ss" size="15" value="'.$home.'/blog/'.$id.'" /><br />
BB Код: <input name="bb" size="15" value="[url='.$home.'/blog/'.$id.']'.$name.'[/url]" /><br />
HTML : <input name="html" size="15" value="<a href="'.$home.'/blog/'.$id.'">'.$name.'</a>" /><br />
';
echo '</div>';
####
$last = date("d.m.Y G:i");
mysql_query("UPDATE `text` SET `last` = '$last' WHERE `id` = '$id'");
mysql_query("UPDATE `text` SET `kol` = `kol` + 1 WHERE`id` = '$id'");
####
}
else{echo '<div class="err">Нет такой статьи!</div>';}
####
require_once 'inc/n.php';
?>