View file forum/forum/post.php

File size: 3.17Kb
<?php
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";
require_once"../template/db.php";
include_once"fnc.php";

$id = (int)$_GET['id'];
$pid = (int)$_GET['pid'];
if($id){
$check = mysql_fetch_array(mysql_query("SELECT * FROM `posts` WHERE `id` = '$pid'"));
if (trim($check)){
$posts = mysql_query("SELECT * FROM `posts` WHERE `id` = '$pid'");
$post = mysql_fetch_array($posts);
$thms = mysql_query("SELECT * FROM `theme` WHERE `id` = '".$post['theme']."'");
$thm = mysql_fetch_array($thms);
echo '<div class=b> '.$thm['name'].'</div>';
$balls = file(BASEDIR."local/profil/$post[author].prof");
$balls = explode(":||:",$balls[0]);
$ava = file(BASEDIR."local/profil/$post[author].prof");
$avv = explode(":||:",$ava[0]);
if($avv[43]!="" && $avv[43]!="noavatar.gif"){
echo "<div class=b><table><tr><td width='32'><img src='".$config_home."/".$avv[43]."' alt=''> ";}else{
echo "<div class=b><table><tr><td width='32'><img src='".$config_home."/images/avators/noavatar.gif' alt=''> "; }
echo "</td><td width='100%'>";
$filename = "".BASEDIR."local/profil/$post[author].prof";
if (file_exists($filename)) {
echo " <a href='".$config_home."/pages/anketa.php?uz=".$post['author']."'><b>";
if ($balls[65]) {echo "".$balls['65']."</b></a>";
}else{echo "".$post['author']."</b></a>";}
}else{echo "<b>".$post['author']."</b>";}
echo " ".user_title($post[author])." ".user_online($post[author])." (".date_fixed($post[time]).")<br>\n";
if ($post[author] != $log){
if($provpar==md5($_SESSION['par']) && $provlog==$_SESSION['log']) {
if ($theme['status'] != '1'){
echo '<a href="'.$config_home.'/forum/say/'.$post['id'].'">[отв]</a>';
echo '<a href="'.$config_home.'/forum/cyt/'.$post['id'].'">[цит]</a>';
echo '<a href="'.$config_home.'/pages/privat.php?action=submit&uz='.$post['author'].'">[лс]</a>';}}}
echo "</td></tr></table></div>\n";
if($post['cyt'] != NULL){
echo "<div class=cyt>";
echo antimat(smiles(bb_code(check2($post['cyt']))))."</div><br>\n";}
echo "<div>\n";
echo antimat(smiles(bb_code(check2($post['msg']))))."<br>\n";

echo "</div>\n";
$filek = mysql_result(mysql_query("SELECT COUNT(*) FROM `posts` WHERE `theme` = '".$post['theme']."'"),0)-1;
$start = floor($filek/ $config_forumpost)*$config_forumpost;
echo "<div class=b>\n";

echo "<img src='".$config_home."/images/img/reload.gif' alt=''> <a href='".$config_home."/forum/posts/".$post['theme']."/".$start."'>Вернуться в тему</a><br>\n";
echo "</div>\n";
}else{ echo "<br> <img src='".$config_home."/images/img/close.gif' alt=''> Ошибка! Данного сообщения не существует!<br>\n";}
}else{ echo "<br> <img src='".$config_home."/images/img/close.gif' alt=''> Ошибка! Данной темы не существует!<br>\n";}
include_once"../themes/$config_themes/foot.php";
?>