PageRenderTime 35ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/forum.php

http://github.com/MightyGorgon/icy_phoenix
PHP | 464 lines | 349 code | 56 blank | 59 comment | 84 complexity | f110343bb8b6130af1ca26d395a4489d MD5 | raw file
Possible License(s): AGPL-1.0
  1. <?php
  2. /**
  3. *
  4. * @package Icy Phoenix
  5. * @version $Id$
  6. * @copyright (c) 2008 Icy Phoenix
  7. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  8. *
  9. */
  10. /**
  11. *
  12. * @Icy Phoenix is based on phpBB
  13. * @copyright (c) 2008 phpBB Group
  14. *
  15. */
  16. define('IN_ICYPHOENIX', true);
  17. if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
  18. if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
  19. include(IP_ROOT_PATH . 'common.' . PHP_EXT);
  20. include_once(IP_ROOT_PATH . 'includes/functions_groups.' . PHP_EXT);
  21. // Start session management
  22. $user->session_begin();
  23. $auth->acl($user->data);
  24. $user->setup();
  25. // End session management
  26. // Activity - BEGIN
  27. if (!empty($config['plugins']['activity']['enabled']))
  28. {
  29. include(IP_ROOT_PATH . PLUGINS_PATH . $config['plugins']['activity']['dir'] . 'includes/functions_amod_index.' . PHP_EXT);
  30. }
  31. // Activity - END
  32. // UPI2DB - BEGIN
  33. $mark_always_read = request_var('always_read', '');
  34. $mark_forum_id = request_var('forum_id', 0);
  35. if($user->data['upi2db_access'])
  36. {
  37. // Mighty Gorgon: are these two vars really needed? After a quick global search, they are not needed... so I comment them!
  38. /*
  39. $always_read_topics_string = explode(',', $user->data['upi2db_unread']['always_read']['topics']);
  40. $always_read_forums_string = explode(',', $user->data['upi2db_unread']['always_read']['forums']);
  41. */
  42. if (!empty($mark_always_read))
  43. {
  44. $mark_always_read_text = always_read_forum($mark_forum_id, $mark_always_read);
  45. $redirect_url = append_sid(CMS_PAGE_FORUM);
  46. meta_refresh(3, $redirect_url);
  47. $message = $mark_always_read_text . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid(CMS_PAGE_FORUM) . '">', '</a> ');
  48. message_die(GENERAL_MESSAGE, $message);
  49. }
  50. }
  51. // UPI2DB - END
  52. $cms_page['page_id'] = 'forum';
  53. $cms_page['page_nav'] = (!empty($cms_config_layouts[$cms_page['page_id']]['page_nav']) ? true : false);
  54. $cms_page['global_blocks'] = (!empty($cms_config_layouts[$cms_page['page_id']]['global_blocks']) ? true : false);
  55. $cms_auth_level = (isset($cms_config_layouts[$cms_page['page_id']]['view']) ? $cms_config_layouts[$cms_page['page_id']]['view'] : AUTH_ALL);
  56. check_page_auth($cms_page['page_id'], $cms_auth_level);
  57. $viewcat = (!empty($_GET[POST_CAT_URL]) ? intval($_GET[POST_CAT_URL]) : -1);
  58. $viewcat = (($viewcat <= 0) ? -1 : $viewcat);
  59. $viewcatkey = ($viewcat < 0) ? 'Root' : POST_CAT_URL . $viewcat;
  60. $mark_read = request_var('mark', '');
  61. // Handle marking posts
  62. if($mark_read == 'forums')
  63. {
  64. // Force last visit to max 60 days limit to avoid having too much unread topics
  65. if($user->data['session_logged_in'] && !$user->data['is_bot'])
  66. {
  67. if ($user->data['user_lastvisit'] < (time() - (LAST_LOGIN_DAYS_NEW_POSTS_RESET * 24 * 60 * 60)))
  68. {
  69. $user->data['user_lastvisit'] = time() - (LAST_LOGIN_DAYS_NEW_POSTS_RESET * 24 * 60 * 60);
  70. }
  71. }
  72. if ($viewcat < 0)
  73. {
  74. if($user->data['session_logged_in'] && !$user->data['is_bot'])
  75. {
  76. // UPI2DB - BEGIN
  77. if(!$user->data['upi2db_access'])
  78. {
  79. $user->set_cookie('f_all', time(), $user->cookie_expire);
  80. }
  81. else
  82. {
  83. marking_posts();
  84. }
  85. // UPI2DB - END
  86. }
  87. $redirect_url = append_sid(CMS_PAGE_FORUM);
  88. meta_refresh(3, $redirect_url);
  89. }
  90. else
  91. {
  92. if($user->data['session_logged_in'] && !$user->data['is_bot'])
  93. {
  94. // get the list of object authorized
  95. $keys = array();
  96. $keys = get_auth_keys($viewcatkey);
  97. // mark each forums
  98. for ($i = 0; $i < sizeof($keys['id']); $i++)
  99. {
  100. if ($tree['type'][$keys['idx'][$i]] == POST_FORUM_URL)
  101. {
  102. $forum_id = $tree['id'][$keys['idx'][$i]];
  103. $sql = "SELECT MAX(post_time) AS last_post FROM " . POSTS_TABLE . " WHERE forum_id = '" . $forum_id . "'";
  104. $result = $db->sql_query($sql);
  105. if ($row = $db->sql_fetchrow($result))
  106. {
  107. $tracking_forums = (isset($_COOKIE[$config['cookie_name'] . '_f'])) ? unserialize($_COOKIE[$config['cookie_name'] . '_f']) : array();
  108. $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_t'])) ? unserialize($_COOKIE[$config['cookie_name'] . '_t']) : array();
  109. if (((sizeof($tracking_forums) + sizeof($tracking_topics)) >= 150) && empty($tracking_forums[$forum_id]))
  110. {
  111. asort($tracking_forums);
  112. unset($tracking_forums[key($tracking_forums)]);
  113. }
  114. if ($row['last_post'] > $user->data['user_lastvisit'])
  115. {
  116. $tracking_forums[$forum_id] = time();
  117. $user->set_cookie('f', serialize($tracking_forums), $user->cookie_expire);
  118. }
  119. }
  120. }
  121. }
  122. }
  123. $redirect_url = append_sid(CMS_PAGE_FORUM . '?' . POST_CAT_URL . '=' . $viewcat);
  124. meta_refresh(3, $redirect_url);
  125. }
  126. $message = $lang['Forums_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid(CMS_PAGE_FORUM) . '">', '</a> ');
  127. message_die(GENERAL_MESSAGE, $message);
  128. }
  129. // End handle marking posts
  130. if (($config['display_viewonline'] == 2) || (($viewcat < 0) && ($config['display_viewonline'] == 1)))
  131. {
  132. define('SHOW_ONLINE_CHAT', true);
  133. define('SHOW_ONLINE', true);
  134. if (empty($config['max_topics']) || empty($config['max_posts']) || empty($config['max_users']) || empty($config['last_user_id']))
  135. {
  136. board_stats();
  137. }
  138. $total_topics = $config['max_topics'];
  139. $total_posts = $config['max_posts'];
  140. $total_users = $config['max_users'];
  141. $newest_user = $cache->obtain_newest_user();
  142. $l_total_post_s = $lang['Posted_articles_total'];
  143. if($total_users == 0)
  144. {
  145. $l_total_user_s = $lang['Registered_users_zero_total'];
  146. }
  147. elseif($total_users == 1)
  148. {
  149. $l_total_user_s = $lang['Registered_user_total'];
  150. }
  151. else
  152. {
  153. $l_total_user_s = $lang['Registered_users_total'];
  154. }
  155. // Last Visit - BEGIN
  156. $today_visitors = array();
  157. $today_visitors = $cache->obtain_today_visitors();
  158. $today_visitors['admins'] = '<b>' . $lang['Users_Admins'] . ':</b>&nbsp;' . (empty($today_visitors['admins']) ? $lang['None'] : $today_visitors['admins']);
  159. $today_visitors['mods'] = '<b>' . $lang['Users_Mods'] . ':</b>&nbsp;' . (empty($today_visitors['mods']) ? $lang['None'] : $today_visitors['mods']);
  160. $today_visitors['users'] = '<b>' . $lang['Users_Regs'] . ':</b>&nbsp;' . (empty($today_visitors['users']) ? $lang['None'] : $today_visitors['users']);
  161. $l_today_user_s = ($today_visitors['total_users']) ? (($today_visitors['total_users'] == 1)? $lang['User_today_total'] : $lang['Users_today_total']) : $lang['Users_today_zero_total'];
  162. $l_today_r_user_s = ($today_visitors['reg_visible']) ? (($today_visitors['reg_visible'] == 1) ? $lang['Reg_user_total'] : $lang['Reg_users_total']) : $lang['Reg_users_zero_total'];
  163. $l_today_h_user_s = ($today_visitors['reg_hidden']) ? (($today_visitors['reg_hidden'] == 1) ? $lang['Hidden_user_total'] : $lang['Hidden_users_total']) : $lang['Hidden_users_zero_total'];
  164. $l_today_g_user_s = ($today_visitors['total_guests']) ? (($today_visitors['total_guests'] == 1) ? $lang['Guest_user_total'] : $lang['Guest_users_total']) : $lang['Guest_users_zero_total'];
  165. $l_today_users = sprintf($l_today_user_s, $today_visitors['total_users']);
  166. $l_today_users .= sprintf($l_today_r_user_s, $today_visitors['reg_visible']);
  167. $l_today_users .= sprintf($l_today_h_user_s, $today_visitors['reg_hidden']);
  168. $l_today_users .= sprintf($l_today_g_user_s, $today_visitors['total_guests']);
  169. $l_today_text = ($today_visitors['last_hour']) ? sprintf($lang['Users_lasthour_explain'], $today_visitors['last_hour']) : $lang['Users_lasthour_none_explain'];
  170. // Last Visit - END
  171. // Birthday Box - BEGIN
  172. if ($config['index_birthday'])
  173. {
  174. $template->assign_vars(array('S_BIRTHDAYS' => true));
  175. $birthdays_list = array();
  176. @include_once(IP_ROOT_PATH . 'includes/functions_calendar.' . PHP_EXT);
  177. $birthdays_list = get_birthdays_list_full();
  178. }
  179. // Birthday Box - END
  180. }
  181. $avatar_img = user_get_avatar($user->data['user_id'], $user->data['user_level'], $user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_allowavatar']);
  182. // Check For Anonymous User
  183. if ($user->data['user_id'] != ANONYMOUS)
  184. {
  185. $username = colorize_username($user->data['user_id'], $user->data['username'], $user->data['user_color'], $user->data['user_active']);
  186. }
  187. else
  188. {
  189. $username = $lang['Guest'];
  190. $avatar_img = '<img src="' . $config['default_avatar_guests_url'] . '" alt="Avatar" />';
  191. }
  192. $link_self_img = '';
  193. $site_logo_height = '';
  194. $site_logo_width = '';
  195. if ($config['site_history'] && ((time() - (int) $config['cron_site_history_last_run']) > ONLINE_REFRESH))
  196. {
  197. $current_time = time();
  198. $minutes = gmdate('is', $current_time);
  199. $hour_now = $current_time - (60 * ($minutes[0] . $minutes[1])) - ($minutes[2] . $minutes[3]);
  200. // change the number late in the next line, to whatever timezone your forum is located, this need to be hard coded in the release of this mod, the number is 1
  201. $dato = create_date('H', $current_time, 1);
  202. $timetoday = $hour_now - (3600 * $dato);
  203. $sql = "SELECT COUNT(DISTINCT session_ip) as guests_today FROM " . SESSIONS_TABLE . " WHERE session_user_id = '" . ANONYMOUS . "' AND session_time >= " . $timetoday . " AND session_time < " . ($timetoday + 86399);
  204. $result = $db->sql_query($sql);
  205. $guest_count = $db->sql_fetchrow($result);
  206. $sql = "SELECT user_allow_viewonline, COUNT(*) as count FROM " . USERS_TABLE . " WHERE user_id <> '" . ANONYMOUS . "' AND user_session_time >= " . $timetoday . " AND user_session_time < " . ($timetoday + 86399) . " GROUP BY user_allow_viewonline";
  207. $result = $db->sql_query($sql);
  208. while ($reg_count = $db->sql_fetchrow ($result))
  209. {
  210. if ($reg_count['user_allow_viewonline'])
  211. {
  212. $today_visitors['reg_visible'] = $reg_count['count'];
  213. }
  214. else
  215. {
  216. $today_visitors['reg_hidden'] = $reg_count['count'];
  217. }
  218. }
  219. $db->sql_freeresult($result);
  220. $sql = "UPDATE " . SITE_HISTORY_TABLE . " SET reg = '" . $today_visitors['reg_visible'] . "', hidden = '" . $today_visitors['reg_hidden'] . "', guests = '" . $guest_count['guests_today'] . "' WHERE date = " . $hour_now;
  221. $result = $db->sql_query($sql);
  222. $affectedrows = $db->sql_affectedrows();
  223. if (!$result || !$affectedrows)
  224. {
  225. $sql = "INSERT IGNORE INTO " . SITE_HISTORY_TABLE . " (date, reg, hidden, guests)
  226. VALUES (" . $hour_now . ", '" . $today_visitors['reg_visible'] . "', '" . $today_visitors['reg_hidden'] . "', '" . $guest_count['guests_today'] . "')";
  227. $db->sql_query($sql);
  228. }
  229. if (isset($result))
  230. {
  231. $db->sql_freeresult($result);
  232. }
  233. set_config('cron_site_history_last_run', time());
  234. }
  235. // set the param of the mark read func
  236. $mark = ($viewcat == -1) ? '' : '&amp;' . POST_CAT_URL . '=' . $viewcat;
  237. if (!$config['board_disable'] || ($config['board_disable'] && ($user->data['user_level'] == ADMIN)))
  238. {
  239. $template->vars['S_TPL_FILENAME'] = 'index';
  240. }
  241. build_groups_list_template();
  242. //$template->assign_block_vars('google_ad', array());
  243. if ($user->data['session_logged_in'] && !$user->data['is_bot'])
  244. {
  245. $nav_server_url = create_server_url();
  246. $breadcrumbs['bottom_right_links'] = '<a href="' . $nav_server_url . append_sid(CMS_PAGE_FORUM . '?mark=forums') . '">' . $lang['Mark_all_forums'] . '</a>&nbsp;' . MENU_SEP_CHAR . '&nbsp;<a href="' . $nav_server_url . append_sid(CMS_PAGE_SEARCH . '?search_id=newposts') . '">' . $lang['Search_new'] . '</a>&nbsp;' . MENU_SEP_CHAR . '&nbsp;<a href="' . $nav_server_url . append_sid(CMS_PAGE_SEARCH . '?search_id=egosearch') . '">' . $lang['Search_your_posts'] . '</a>';
  247. }
  248. $forumindex_banner_element = get_ad('fix');
  249. $template->assign_vars(array(
  250. 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
  251. 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
  252. //'TOTAL_MALE' => sprintf($l_total_male, $total_male),
  253. //'TOTAL_FEMALE' => sprintf($l_total_female, $total_female),
  254. //'TOTAL_UNKNOWN' => sprintf($l_total_unknown, $total_unknown),
  255. 'NEWEST_USER' => sprintf($lang['Newest_user'], '', $newest_user, ''),
  256. 'FORUM_IMG' => $images['forum_nor_read'],
  257. 'FORUM_NEW_IMG' => $images['forum_nor_unread'],
  258. 'FORUM_CAT_IMG' => $images['forum_sub_read'],
  259. 'FORUM_NEW_CAT_IMG' => $images['forum_sub_unread'],
  260. 'FORUM_LOCKED_IMG' => $images['forum_nor_locked_read'],
  261. 'FORUM_LINK_IMG' => $images['forum_link'],
  262. // UPI2DB - BEGIN
  263. 'FOLDER_AR_BIG' => $images['forum_nor_ar'],
  264. // UPI2DB - END
  265. // Start add - Fully integrated shoutbox MOD
  266. 'U_SHOUTBOX' => append_sid('shoutbox.' . PHP_EXT),
  267. 'L_SHOUTBOX' => $lang['Shoutbox'],
  268. 'U_SHOUTBOX_MAX' => append_sid('shoutbox_max.' . PHP_EXT),
  269. // End add - Fully integrated shoutbox MOD
  270. 'AVATAR_IMG' => $avatar_img,
  271. 'STATS_IMG' => $images['stats_image'],
  272. 'BIRTHDAY_IMG' => $images['birthday_image'],
  273. 'CAT_BLOCK_IMG' => $images['category_block'],
  274. 'USER_NAME' => $username,
  275. 'TOTAL_TOPIC' => $total_topics,
  276. // Start add - Last visit MOD
  277. 'ADMINS_TODAY_LIST' => $today_visitors['admins'],
  278. 'MODS_TODAY_LIST' => $today_visitors['mods'],
  279. 'USERS_TODAY_LIST' => $today_visitors['users'],
  280. 'L_LEGEND' => $lang['legend'],
  281. 'L_USERS' => $lang['users'],
  282. 'L_USERS_LASTHOUR' => ($today_visitors['last_hour']) ? sprintf($lang['Users_lasthour_explain'], $today_visitors['last_hour']) : $lang['Users_lasthour_none_explain'],
  283. 'L_USERS_TODAY' => $l_today_users,
  284. // End add - Last visit MOD
  285. // BIRTHDAY - BEGIN
  286. 'L_WHOSBIRTHDAY_WEEK' => ($config['birthday_check_day'] >= 1) ? sprintf((($birthdays_list['xdays']) ? $lang['Birthday_week'] : $lang['Nobirthday_week']), $config['birthday_check_day']) . $birthdays_list['xdays'] : '',
  287. 'L_WHOSBIRTHDAY_TODAY' => ($birthdays_list['today']) ? $lang['Birthday_today'] . $birthdays_list['today'] : $lang['Nobirthday_today'],
  288. // BIRTHDAY - END
  289. 'L_FORUM' => $lang['Forum'],
  290. 'L_TOPICS' => $lang['Topics'],
  291. 'L_REPLIES' => $lang['Replies'],
  292. 'L_VIEWS' => $lang['Views'],
  293. 'L_POSTS' => $lang['Posts'],
  294. 'L_LASTPOST' => $lang['Last_Post'],
  295. 'L_NO_NEW_POSTS' => $lang['No_new_posts'],
  296. 'L_NEW_POSTS' => $lang['New_posts'],
  297. 'L_FORUM_NO_NEW_POSTS' => $lang['Forum_no_new_posts'],
  298. 'L_FORUM_NEW_POSTS' => $lang['Forum_new_posts'],
  299. 'L_CAT_NO_NEW_POSTS' => $lang['Cat_no_new_posts'],
  300. 'L_CAT_NEW_POSTS' => $lang['Cat_new_posts'],
  301. 'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
  302. 'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
  303. 'FORUMINDEX_BANNER_ELEMENT' => $forumindex_banner_element,
  304. 'L_LINKS' => $lang['Site_links'],
  305. 'U_LINKS' => append_sid('links.' . PHP_EXT),
  306. 'U_LINKS_JS' => 'links.js.' . PHP_EXT,
  307. 'U_SITE_LOGO' => $link_self_img,
  308. 'SITE_LOGO_WIDTH' => $site_logo_width,
  309. 'SITE_LOGO_HEIGHT' => $site_logo_height,
  310. 'L_MODERATOR' => $lang['Moderators'],
  311. 'L_FORUM_LOCKED' => $lang['Forum_is_locked'],
  312. 'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'],
  313. // UPI2DB - BEGIN
  314. 'L_AR_POSTS' => $lang['always_read_icon'],
  315. 'L_FORUM_AR' => $lang['always_read_icon'],
  316. // UPI2DB - END
  317. 'U_MARK_READ' => append_sid(CMS_PAGE_FORUM . '?mark=forums' . $mark)
  318. )
  319. );
  320. // Okay, let's build the index
  321. // Display the board statistics
  322. if (($config['display_viewonline'] == 2) || (($viewcat < 0) && ($config['display_viewonline'] == 1)))
  323. {
  324. $template->assign_vars(array('S_VIEWONLINE' => true));
  325. if ($config['index_last_msgs'] == 1)
  326. {
  327. $template->assign_block_vars('show_recent', array());
  328. $except_forums = build_exclusion_forums_list();
  329. if(!empty($config['last_msgs_x']))
  330. {
  331. $except_forums .= ',' . $config['last_msgs_x'];
  332. }
  333. $except_forums = str_replace(' ', '', $except_forums);
  334. $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
  335. FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
  336. WHERE t.forum_id NOT IN (" . $except_forums . ")
  337. AND t.topic_status <> 2
  338. AND p.post_id = t.topic_last_post_id
  339. AND p.poster_id = u.user_id
  340. ORDER BY p.post_id DESC
  341. LIMIT " . intval($config['last_msgs_n']);
  342. $result = $db->sql_query($sql);
  343. $number_recent_topics = $db->sql_numrows($result);
  344. $recent_topic_row = array();
  345. while ($row = $db->sql_fetchrow($result))
  346. {
  347. $recent_topic_row[] = $row;
  348. }
  349. for ($i = 0; $i < $number_recent_topics; $i++)
  350. {
  351. $template->assign_block_vars('show_recent.recent_topic_row', array(
  352. 'U_TITLE' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#p' . $recent_topic_row[$i]['post_id'],
  353. 'L_TITLE' => $recent_topic_row[$i]['topic_title'],
  354. 'U_POSTER' => append_sid(CMS_PAGE_PROFILE . '?mode=viewprofile&amp;' . POST_USERS_URL . '=' . $recent_topic_row[$i]['user_id']),
  355. 'S_POSTER' => $recent_topic_row[$i]['username'],
  356. 'S_POSTTIME' => create_date($config['default_dateformat'], $recent_topic_row[$i]['post_time'], $config['board_timezone'])
  357. )
  358. );
  359. }
  360. // Recent Topics - END
  361. }
  362. if ($config['show_random_quote'] == true)
  363. {
  364. $template->assign_block_vars('switch_show_random_quote', array());
  365. }
  366. if ($config['show_chat_online'] == true)
  367. {
  368. $template->assign_block_vars('switch_ac_online', array());
  369. }
  370. if ($config['index_top_posters'] == true)
  371. {
  372. if (!function_exists('top_posters'))
  373. {
  374. @include_once(IP_ROOT_PATH . 'includes/functions_users.' . PHP_EXT);
  375. }
  376. $template->assign_block_vars('top_posters', array(
  377. 'TOP_POSTERS' => top_posters(8, true, true, false),
  378. )
  379. );
  380. }
  381. }
  382. // Display the index
  383. $display = display_index($viewcatkey);
  384. // check shoutbox permissions and display only to authorized users
  385. $auth_level_req = ((isset($cms_config_layouts['shoutbox']['view']) && ($cms_config_layouts['shoutbox']['view'] != AUTH_CMS_ALL_NO_BOTS)) ? $cms_config_layouts['shoutbox']['view'] : AUTH_ALL);
  386. if ((!empty($config['index_shoutbox']) && (($user->data['user_level'] + 1) >= $auth_level_req) && $user->data['session_logged_in'] && !$user->data['is_bot']) || (!empty($config['index_shoutbox']) && ($user->data['user_level'] == ADMIN)))
  387. {
  388. $template->assign_vars(array('S_SHOUTBOX' => true));
  389. }
  390. if (!$display)
  391. {
  392. message_die(GENERAL_MESSAGE, $lang['No_forums']);
  393. }
  394. // Should the news banner be shown?
  395. if($config['xs_show_news'])
  396. {
  397. include(IP_ROOT_PATH . 'includes/xs_news.' . PHP_EXT);
  398. $template->assign_block_vars('switch_show_news', array());
  399. }
  400. $forumindex_banner_top = get_ad('fit');
  401. $forumindex_banner_bottom = get_ad('fib');
  402. $template->assign_vars(array(
  403. 'FORUMINDEX_BANNER_TOP' => $forumindex_banner_top,
  404. 'FORUMINDEX_BANNER_BOTTOM' => $forumindex_banner_bottom,
  405. )
  406. );
  407. full_page_generation('index_body.tpl', $lang['Forum'], '', '');
  408. ?>