Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.29 KB | None | 0 0
  1. <?php
  2. /*-------------------------------------------------------+
  3. | PHP-Fusion Content Management System
  4. | Copyright (C) 2002 - 2011 Nick Jones
  5. | http://www.php-fusion.co.uk/
  6. +--------------------------------------------------------+
  7. | Filename: index.php
  8. | Author: Nick Jones (Digitanium)
  9. +--------------------------------------------------------+
  10. | This program is released as free software under the
  11. | Affero GPL license. You can redistribute it and/or
  12. | modify it under the terms of this license which you
  13. | can read by viewing the included agpl.txt or online
  14. | at www.gnu.org/licenses/agpl.html. Removal of this
  15. | copyright header is strictly prohibited without
  16. | written permission from the original author(s).
  17. +--------------------------------------------------------*/
  18. require_once "../maincore.php";
  19. require_once THEMES."templates/header.php";
  20. include LOCALE.LOCALESET."forum/main.php";
  21.  
  22. if (!isset($lastvisited) || !isnum($lastvisited)) { $lastvisited = time(); }
  23.  
  24. add_to_title($locale['global_200'].$locale['400']);
  25.  
  26. opentable($locale['400']);
  27. echo "<!--pre_forum_idx--><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_idx_table'>\n";
  28.  
  29. $forum_list = ""; $current_cat = "";
  30. $result = dbquery(
  31. "SELECT f.*, f2.forum_name AS forum_cat_name, u.user_id, u.user_name, u.user_status
  32. FROM ".DB_FORUMS." f
  33. LEFT JOIN ".DB_FORUMS." f2 ON f.forum_cat = f2.forum_id
  34. LEFT JOIN ".DB_USERS." u ON f.forum_lastuser = u.user_id
  35. WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0'
  36. GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC"
  37. );
  38. if (dbrows($result) != 0) {
  39. while ($data = dbarray($result)) {
  40. if ($data['forum_cat_name'] != $current_cat) {
  41. $current_cat = $data['forum_cat_name'];
  42. echo "<tr>\n<td colspan='2' class='forum-caption forum_cat_name'><!--forum_cat_name-->".$data['forum_cat_name']."</td>\n";
  43. echo "<td align='center' width='1%' class='forum-caption' style='white-space:nowrap'>".$locale['402']."</td>\n";
  44. echo "<td align='center' width='1%' class='forum-caption' style='white-space:nowrap'>".$locale['403']."</td>\n";
  45. echo "<td width='1%' class='forum-caption' style='white-space:nowrap'>".$locale['404']."</td>\n";
  46. echo "</tr>\n";
  47. }
  48. $moderators = "";
  49. if ($data['forum_moderators']) {
  50. $mod_groups = explode(".", $data['forum_moderators']);
  51. foreach ($mod_groups as $mod_group) {
  52. if ($moderators) $moderators .= ", ";
  53. $moderators .= $mod_group<101 ? "<a href='".BASEDIR."profile.php?group_id=".$mod_group."'>".getgroupname($mod_group)."</a>" : getgroupname($mod_group);
  54. }
  55. }
  56. $forum_match = "\|".$data['forum_lastpost']."\|".$data['forum_id'];
  57. if ($data['forum_lastpost'] > $lastvisited) {
  58. if (iMEMBER && ($data['forum_lastuser'] == $userdata['user_id'] || preg_match("({$forum_match}\.|{$forum_match}$)", $userdata['user_threads']))) {
  59. $fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
  60. } else {
  61. $fim = "<img src='".get_image("foldernew")."' alt='".$locale['560']."' />";
  62. }
  63. } else {
  64. $fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
  65. }
  66. echo "<tr>\n";
  67. echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>$fim</td>\n";
  68. echo "<td class='tbl1 forum_name'><!--forum_name--><a href='viewforum.php?forum_id=".$data['forum_id']."'>".$data['forum_name']."</a><br />\n";
  69. if ($data['forum_description'] || $moderators) {
  70. echo "<span class='small'>".nl2br(parseubb($data['forum_description'])).($data['forum_description'] && $moderators ? "<br />\n" : "");
  71. echo ($moderators ? "<strong>".$locale['411']."</strong>".$moderators."</span>\n" : "</span>\n")."\n";
  72. }
  73. echo "</td>\n";
  74. echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_threadcount']."</td>\n";
  75. echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>".$data['forum_postcount']."</td>\n";
  76. echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";
  77. if ($data['forum_lastpost'] == 0) {
  78. echo $locale['405']."</td>\n</tr>\n";
  79. } else {
  80. echo showdate("forumdate", $data['forum_lastpost'])."<br />\n";
  81. echo "<span class='small'>".$locale['406'].profile_link($data['forum_lastuser'], $data['user_name'], $data['user_status'])."</span></td>\n";
  82. echo "</tr>\n";
  83. }
  84. }
  85. } else {
  86. echo "<tr>\n<td colspan='5' class='tbl1'>".$locale['407']."</td>\n</tr>\n";
  87. }
  88. echo "</table><!--sub_forum_idx_table-->\n<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
  89. echo "<td class='forum'><br />\n";
  90. echo "<img src='".get_image("foldernew")."' alt='".$locale['560']."' style='vertical-align:middle;' /> - ".$locale['409']."<br />\n";
  91. echo "<img src='".get_image("folder")."' alt='".$locale['561']."' style='vertical-align:middle;' /> - ".$locale['410']."\n";
  92. echo "</td><td align='right' valign='bottom' class='forum'>\n";
  93. echo "<form name='searchform' method='get' action='".BASEDIR."search.php?stype=forums'>\n";
  94. echo "<input type='hidden' name='stype' value='forums' />\n";
  95. echo "<input type='text' name='stext' class='textbox' style='width:150px' />\n";
  96. echo "<input type='submit' name='search' value='".$locale['550']."' class='button' />\n";
  97. echo "</form>\n</td>\n</tr>\n</table><!--sub_forum_idx-->\n";
  98. closetable();
  99.  
  100. require_once THEMES."templates/footer.php";
  101. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement