Просмотр файла forum/post.php

Размер файла: 3.03Kb
  1. <?php
  2. require_once ("../includes/start.php");
  3. require_once ("../includes/functions.php");
  4. require_once ("../includes/header.php");
  5. include_once ("../themes/".$config['themes']."/index.php");
  6. include_once ("../includes/db.php");
  7.  
  8. $id = (int)$_GET['id'];
  9. $pid = (int)$_GET['pid'];
  10. if($id){
  11. $check = mysql_fetch_array(mysql_query("SELECT * FROM `posts` WHERE `id` = '$pid'"));
  12. if (!empty($check)){
  13. $posts = mysql_query("SELECT * FROM `posts` WHERE `id` = '$pid'");
  14. $post = mysql_fetch_array($posts);
  15. $thms = mysql_query("SELECT * FROM `theme` WHERE `id` = '".$post['theme']."'");
  16. $thm = mysql_fetch_array($thms);
  17. echo '<div class=b> '.$thm['name'].'</div>';
  18. $balls = file(BASEDIR."local/profil/".$post['author'].".prof");
  19. $balls = explode(":||:",$balls[0]);
  20. $ava = file(BASEDIR."local/profil/".$post['author'].".prof");
  21. $avv = explode(":||:",$ava[0]);
  22. if($avv[43]!="" && $avv[43]!="noavatar.gif"){
  23. echo "<div class=b><table><tr><td width='32'><img src='".$config['home']."/".$avv[43]."' alt=''> ";}else{
  24. echo "<div class=b><table><tr><td width='32'><img src='".$config['home']."/images/avators/noavatar.gif' alt=''> "; }
  25. echo "</td><td width='100%'>";
  26. $filename = "".BASEDIR."local/profil/".$post['author'].".prof";
  27. if (file_exists($filename)) {
  28. echo " <a href='".$config['home']."/pages/anketa.php?uz=".$post['author']."&amp;".SID."'><b>";
  29. if ($balls[65]) {echo "".$balls['65']."</b></a>";
  30. }else{echo "".$post['author']."</b></a>";}
  31. }else{echo "<b>".$post['author']."</b>";}
  32. echo " ".user_title($post['author'])." ".user_online($post['author'])." (".date_fixed($post['time']).")<br>\n";
  33. if ($post['author'] != $log){
  34. if (is_user()) {
  35. if ($thm['status'] != '1'){
  36. echo '<a href="'.$config['home'].'/forum/say/'.$post['id'].'&amp;'.SID.'">[отв]</a>';
  37. echo '<a href="'.$config['home'].'/forum/cyt/'.$post['id'].'&amp;'.SID.'">[цит]</a>';
  38. echo '<a href="'.$config['home'].'/pages/privat.php?action=submit&amp;uz='.$post['author'].'&amp;'.SID.'">[лс]</a>';
  39. }}}
  40. echo "</td></tr></table></div>\n";
  41. if($post['cyt'] != NULL){
  42. echo "<div class=cyt>";
  43. echo antimat(smiles(bb_code($post['cyt'])))."</div><br>\n";}
  44. echo "<div>\n";
  45. echo antimat(smiles(bb_code($post['msg'])))."<br>\n";
  46.  
  47. echo "</div>\n";
  48. $filek = mysql_result(mysql_query("SELECT COUNT(*) FROM `posts` WHERE `theme` = '".$post['theme']."'"),0)-1;
  49. $start = floor($filek/ $config['forumpost'])*$config['forumpost'];
  50. echo "<div class=b>\n";
  51.  
  52. echo "<img src='".$config['home']."/images/img/reload.gif' alt=''> <a href='".$config['home']."/forum/?act=posts&amp;id=".$post['theme']."&amp;start=".$start."'>Вернуться в тему</a><br>\n";
  53. echo "</div>\n";
  54. }else{ echo "<br> <img src='".$config['home']."/images/img/close.gif' alt=''> Ошибка! Данного сообщения не существует!<br>\n";}
  55. }else{ echo "<br> <img src='".$config['home']."/images/img/close.gif' alt=''> Ошибка! Данной темы не существует!<br>\n";}
  56.  
  57. echo '<a href="http://7je.ru">ByForum 1.5 DEMO</a>';
  58.  
  59. include_once ("../themes/".$config['themes']."/foot.php");
  60. ?>