A new, object-oriented, better vesion of μForum
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
5.0 KiB

  1. <? require_once('./templates/overall_header.tpl.php'); ?>
  2. <script type="text/javascript">
  3. function confirm_action(c_name, url)
  4. {
  5. if (confirm(c_name))
  6. {
  7. document.location = url;
  8. }
  9. }
  10. </script>
  11. <div id="content">
  12. <?
  13. $items = 0;
  14. for ($i=0; $i<count($this->TPL['forums_list']); $i++)
  15. {
  16. if ($this->TPL['forums_list'][$i]['forum_id'] != null)
  17. {
  18. if ($i > 0)
  19. {
  20. if ($this->TPL['forums_list'][$i-1]['category_id'] != $this->TPL['forums_list'][$i]['category_id'])
  21. echo '</div><br><div class="forum_table">
  22. <div class="row">
  23. <div class="hc1">'.$this->TPL['forums_list'][$i]['category_name'].'</div>
  24. <div class="hc2" style="width: 80px">&nbsp;</div>
  25. <div class="hc3" style="width: 80px">&nbsp;</div>
  26. <div class="hc4">&nbsp;</div>
  27. </div>
  28. <div class="row">
  29. <div class="tc1 tab_desc">Forum name</div>
  30. <div class="tc2 tab_desc" style="width: 80px">Topics</div>
  31. <div class="tc3 tab_desc" style="width: 80px">Posts</div>
  32. <div class="tc4 tab_desc">Last Post</div>
  33. </div>';
  34. }
  35. else
  36. {
  37. echo '<div class="forum_table">
  38. <div class="row">
  39. <div class="hc1">'.$this->TPL['forums_list'][$i]['category_name'].'</div>
  40. <div class="hc2" style="width: 80px">&nbsp;</div>
  41. <div class="hc3" style="width: 80px">&nbsp;</div>
  42. <div class="hc4">&nbsp;</div>
  43. </div>
  44. <div class="row">
  45. <div class="tc1 tab_desc">Forum name</div>
  46. <div class="tc2 tab_desc" style="width: 80px">Topics</div>
  47. <div class="tc3 tab_desc" style="width: 80px">Posts</div>
  48. <div class="tc4 tab_desc">Last Post</div>
  49. </div>';
  50. }
  51. echo '<div class="row">'."\n";
  52. echo "\t\t\t".'<div class="tc1"><a href="index.php?mode=viewforum&amp;id='.$this->TPL['forums_list'][$i]['forum_id'].'" class="sect">'.$this->TPL['forums_list'][$i]['forum_name'].'</a><br><span class="fsmall">'.$this->TPL['forums_list'][$i]['forum_desc'].'</span></div>'."\n";
  53. echo "\t\t\t".'<div class="tc2" style="width: 80px">'.$this->TPL['forums_list'][$i]['topic_count'].'</div>'."\n";
  54. echo "\t\t\t".'<div class="tc3" style="width: 80px">'.$this->TPL['forums_list'][$i]['post_count'].'</div>'."\n";
  55. if ($this->TPL['forums_list'][$i]['lastpost_post_id'] != null)
  56. {
  57. $lastpost = '<span class="fsmall"><span style="font-weight: bold">'.$this->TPL['forums_list'][$i]['lastpost_date'].'</span><br><a href="index.php?mode=viewtopic&amp;id='.$this->TPL['forums_list'][$i]['lastpost_topic_id'].'#p'.$this->TPL['forums_list'][$i]['lastpost_post_id'].'" style="font-weight: bold">Topic #'.$this->TPL['forums_list'][$i]['lastpost_topic_id'].'</a>: ';
  58. if ($this->TPL['forums_list'][$i]['lastpost_user_id'] != null)
  59. $lastpost .= '<a href="index.php?mode=viewprofile&amp;id='.$this->TPL['forums_list'][$i]['lastpost_user_id'].'">'.$this->colorRank($this->TPL['forums_list'][$i]['lastpost_nick'], $this->TPL['forums_list'][$i]['lastpost_user_rank']).'</a>';
  60. else
  61. $lastpost .= 'Anonymous';
  62. $lastpost .= '</span>';
  63. }
  64. else
  65. {
  66. $lastpost = 'No posts';
  67. }
  68. echo "\t\t\t".'<div class="tc4">'.$lastpost.'</div>'."\n";
  69. echo "\t\t".'</div>'."\n";
  70. $items++;
  71. }
  72. }
  73. if ($items > 0)
  74. echo '</div>';
  75. else
  76. {
  77. echo '<div class="forum_table">
  78. <div class="row">
  79. <div class="hc1 hc4">Forum message</div>
  80. </div>
  81. <div class="row">
  82. <div class="tc1 tc4">No forums</div>
  83. </div>
  84. </div>';
  85. }
  86. ?>
  87. <br>
  88. <div class="forum_table">
  89. <div class="row">
  90. <div class="hc1 hc4">Statistics</div>
  91. </div>
  92. <div class="row">
  93. <div class="tc1 tc4" style="text-align: left">
  94. Our users have written <span style="font-weight: bold"><?= $this->TPL['posts_count']; ?></span> posts.<br>
  95. We have <span style="font-weight: bold"><?= $this->TPL['users_count']; ?></span> unique users.<br>
  96. Last registered user: <a href="index.php?mode=viewprofile&amp;id=<?= $this->TPL['last_user']['user_id']; ?>" style="font-weight: bold"><?= $this->TPL['last_user']['nick']; ?></a><br>
  97. Users ranks: <a href="index.php?mode=userlist&amp;rank=admin"><span class="fadmin">Admin</span></a> &bull; <a href="index.php?mode=userlist&amp;rank=mod"><span class="fmod">Mod</span></a> &bull; User<br>
  98. This forum is browsing by <span style="font-weight: bold"><?= $this->TPL['logged_users_count']; ?></span> logged users(list):<br>
  99. <?
  100. if ($this->TPL['logged_users_count'] == 0) echo 'none.';
  101. else
  102. for ($i=0; $i<count($this->TPL['logged_users']); $i++)
  103. {
  104. echo '<a href="index.php?mode=viewprofile&amp;id='.$this->TPL['logged_users'][$i]['user_id'].'">'.$this->colorRank($this->TPL['logged_users'][$i]['nick'], $this->TPL['logged_users'][$i]['rank']).'</a>';
  105. if ($i<count($this->TPL['logged_users'])-1)
  106. echo ',&nbsp;';
  107. }
  108. ?>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <? require_once('./templates/overall_footer.tpl.php'); ?>