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

Размер файла: 5.35Kb
  1. <?php
  2. #-----------------------------------------------------#
  3. # ********* ROTORCMS ********* #
  4. # Made by : VANTUZ #
  5. # E-mail : visavi.net@mail.ru #
  6. # Site : http://pizdec.ru #
  7. # WAP-Site : http://visavi.net #
  8. # ICQ : 36-44-66 #
  9. # Вы не имеете право вносить изменения в код скрипта #
  10. # для его дальнейшего распространения #
  11. #-----------------------------------------------------#
  12. require_once ('../includes/start.php');
  13. require_once ('../includes/functions.php');
  14. require_once ('../includes/header.php');
  15. include_once ('../themes/' . $config['themes'] . '/index.php');
  16.  
  17. if (isset($_GET['start'])) {
  18. $start = abs(intval($_GET['start']));
  19. } else {
  20. $start = 0;
  21. }
  22. if (isset($_GET['act'])) {
  23. $act = check($_GET['act']);
  24. } else {
  25. $act = 'themes';
  26. }
  27.  
  28. switch ($act):
  29. # ###########################################################################################
  30. # # Последние темы ##
  31. # ###########################################################################################
  32. case "themes":
  33. show_title('site.png', 'Список последних тем');
  34. $config['newtitle'] = 'Список последних тем';
  35.  
  36. $total = DB :: $dbh -> querySingle("SELECT count(*) FROM topics;");
  37.  
  38. if ($total > 0) {
  39. if ($total > 100) {
  40. $total = 100;
  41. }
  42. if ($start >= $total) {
  43. $start = 0;
  44. }
  45.  
  46. $querytopic = DB :: $dbh -> query("SELECT `topics`.*, `forums_title` FROM `topics` LEFT JOIN `forums` ON `topics`.`topics_forums_id`=`forums`.`forums_id` ORDER BY `topics_last_time` DESC LIMIT " . $start . ", " . $config['forumtem'] . ";");
  47.  
  48. while ($data = $querytopic -> fetch()) {
  49. echo '<div class="b">';
  50.  
  51. if ($data['topics_locked'] == 1) {
  52. echo '<img src="../images/img/lock.gif" alt="image" /> ';
  53. } elseif ($data['topics_closed'] == 1) {
  54. echo '<img src="../images/img/closed.gif" alt="image" /> ';
  55. } else {
  56. echo '<img src="../images/img/forums.gif" alt="image" /> ';
  57. }
  58.  
  59. echo '<b><a href="topic.php?tid=' . $data['topics_id'] . '&amp;' . SID . '">' . $data['topics_title'] . '</a></b> (' . $data['topics_posts'] . ')</div>';
  60. echo '<div>Страницы: ';
  61. forum_navigation('topic.php?tid=' . $data['topics_id'] . '&amp;', $config['forumpost'], $data['topics_posts']);
  62. echo 'Форум: <a href="forum.php?fid=' . $data['topics_forums_id'] . '&amp;' . SID . '">' . $data['forums_title'] . '</a><br />';
  63. echo 'Автор: ' . nickname($data['topics_author']) . ' / Посл.: ' . nickname($data['topics_last_user']) . ' (' . date_fixed($data['topics_last_time']) . ')</div>';
  64. }
  65.  
  66. page_strnavigation('new.php?act=themes&amp;', $config['forumtem'], $start, $total);
  67. } else {
  68. show_error('Созданных тем еще нет!');
  69. }
  70. break;
  71. # ###########################################################################################
  72. # # Последние сообщения ##
  73. # ###########################################################################################
  74. case "posts":
  75. show_title('site.png', 'Список последних сообщений');
  76. $config['newtitle'] = 'Список последних сообщений';
  77.  
  78. $total = DB :: $dbh -> querySingle("SELECT count(*) FROM `posts`;");
  79.  
  80. if ($total > 0) {
  81. if ($total > 100) {
  82. $total = 100;
  83. }
  84. if ($start >= $total) {
  85. $start = 0;
  86. }
  87.  
  88. $querypost = DB :: $dbh -> query("SELECT `posts`.*, `topics_title`, `topics_posts` FROM `posts` LEFT JOIN `topics` ON `posts`.`posts_topics_id`=`topics`.`topics_id` ORDER BY `posts_time` DESC LIMIT " . $start . ", " . $config['forumpost'] . ";");
  89.  
  90. while ($data = $querypost -> fetch()) {
  91. echo '<div class="b">';
  92.  
  93. echo '<img src="../images/img/forums.gif" alt="image" /> <b><a href="topic.php?act=viewpost&amp;tid=' . $data['posts_topics_id'] . '&amp;id=' . $data['posts_id'] . '&amp;' . SID . '">' . $data['topics_title'] . '</a></b> (' . $data['topics_posts'] . ')</div>';
  94.  
  95. echo '<div>' . bb_code($data['posts_text']) . '<br />';
  96.  
  97. echo 'Написал: <a href="../pages/anketa.php?uz=' . $data['posts_user'] . '&amp;' . SID . '">' . nickname($data['posts_user']) . '</a> ' . user_title($data['posts_user']) . user_online($data['posts_user']) . ' <small>(' . date_fixed($data['posts_time']) . ')</small><br />';
  98.  
  99. if (is_admin() || empty($config['anonymity'])) {
  100. echo '<span class="data">(' . $data['posts_brow'] . ', ' . $data['posts_ip'] . ')</span>';
  101. }
  102.  
  103. echo '</div>';
  104. }
  105.  
  106. page_strnavigation('new.php?act=posts&amp;', $config['forumpost'], $start, $total);
  107. } else {
  108. show_error('Сообщений еще нет!');
  109. }
  110. break;
  111.  
  112. default:
  113. header("location: new.php?" . SID);
  114. exit;
  115. endswitch;
  116.  
  117. echo '<img src="../images/img/reload.gif" alt="image" /> <a href="index.php?' . SID . '">К форумам</a><br />';
  118. echo '<img src="../images/img/homepage.gif" alt="image" /> <a href="../index.php?' . SID . '">На главную</a>';
  119.  
  120. include_once ('../themes/' . $config['themes'] . '/foot.php');
  121.  
  122. ?>