Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. /**
  3. *
  4. * @package Board3 Portal v2 - news1
  5. * @copyright (c) Board3 Group ( www.board3.de )
  6. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  7. *
  8. */
  9.  
  10. /**
  11. * @ignore
  12. */
  13. if (!defined('IN_PHPBB'))
  14. {
  15. exit;
  16. }
  17.  
  18. /**
  19. * @package news1
  20. */
  21. class portal_news1_module
  22. {
  23. /**
  24. * Allowed columns: Just sum up your options (Exp: left + right = 10)
  25. * top 1
  26. * left 2
  27. * center 4
  28. * right 8
  29. * bottom 16
  30. */
  31. public $columns = 21;
  32.  
  33. /**
  34. * Default modulename
  35. */
  36. public $name = 'LATEST_NEWS1';
  37.  
  38. /**
  39. * Default module-image:
  40. * file must be in "{T_THEME_PATH}/images/portal/"
  41. */
  42. public $image_src = '';
  43.  
  44. /**
  45. * module-language file
  46. * file must be in "language/{$user->lang}/mods/portal/"
  47. */
  48. public $language = 'portal_news1_module';
  49.  
  50. public function get_template_center($module_id)
  51. {
  52. global $config, $template, $db, $user, $auth, $cache, $phpEx, $phpbb_root_path;
  53.  
  54. $news = request_var('news', -1);
  55. $news = ($news > $config['board3_news1_length_' . $module_id] -1) ? -1 : $news;
  56. $user->add_lang('viewforum');
  57. $start = request_var('np', 0);
  58. $start = ($start < 0) ? 0 : $start;
  59.  
  60. // Fetch news from portal/includes/functions.php with check if "read full" is requested.
  61. $portal_news_length = ($news < 0) ? $config['board3_news1_length_' . $module_id] : 0;
  62. $fetch_news = phpbb_fetch_posts($module_id, $config['board3_news1_forum_' . $module_id], $config['board3_news1_permissions_' . $module_id], $config['board3_number_of_news1_' . $module_id], $portal_news_length, 0, ($config['board3_show_all_news1_' . $module_id]) ? 'news_all' : 'news', $start, $config['board3_news1_exclude_' . $module_id]);
  63.  
  64.  
  65. // Any news present? If not terminate it here.
  66. if (sizeof($fetch_news) == 0)
  67. {
  68. $template->assign_block_vars('news_row', array(
  69. 'S_NO_TOPICS' => true,
  70. 'S_NOT_LAST' => false,
  71. ));
  72. }
  73. else
  74. {
  75. // Count number of posts for news archive, considering if permission check is dis- or enabled.
  76. if ($config['board3_news1_archive_' . $module_id])
  77. {
  78. $permissions = $config['board3_news1_permissions_' . $module_id];
  79. $forum_from = $config['board3_news1_forum_' . $module_id];
  80.  
  81. $forum_from = (strpos($forum_from, ',') !== false) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());
  82.  
  83. $str_where = '';
  84.  
  85. if($permissions == true)
  86. {
  87. $disallow_access = array_unique(array_keys($auth->acl_getf('!f_read', true)));
  88. }
  89. else
  90. {
  91. $disallow_access = array();
  92. }
  93.  
  94. if($config['board3_news1_exclude_' . $module_id] == true)
  95. {
  96. $disallow_access = array_merge($disallow_access, $forum_from);
  97. $forum_from = array();
  98. }
  99.  
  100. if(sizeof($forum_from))
  101. {
  102. $disallow_access = array_diff($forum_from, $disallow_access);
  103. if(!sizeof($disallow_access))
  104. {
  105. return array();
  106. }
  107.  
  108. foreach($disallow_access as $acc_id)
  109. {
  110. $acc_id = (int) $acc_id;
  111. $str_where .= "forum_id = $acc_id OR ";
  112. }
  113. }
  114. else
  115. {
  116. foreach($disallow_access as $acc_id)
  117. {
  118. $acc_id = (int) $acc_id;
  119. $str_where .= "forum_id <> $acc_id AND ";
  120. }
  121. }
  122.  
  123. $str_where = (strlen($str_where) > 0) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
  124.  
  125. $topic_type = ($config['board3_show_all_news1_' . $module_id]) ? '(topic_type <> ' . POST_ANNOUNCE . ') AND (topic_type <> ' . POST_GLOBAL . ')' : 'topic_type = ' . POST_NORMAL;
  126.  
  127. $sql = 'SELECT COUNT(topic_id) AS num_topics
  128. FROM ' . TOPICS_TABLE . '
  129. WHERE ' . $topic_type . '
  130. AND topic_approved = 1
  131. AND topic_moved_id = 0
  132. ' . $str_where;
  133. $result = $db->sql_query($sql);
  134. $total_news = (int) $db->sql_fetchfield('num_topics');
  135. $db->sql_freeresult($result);
  136. }
  137.  
  138. $topic_tracking_info = get_portal_tracking_info($fetch_news);
  139.  
  140. if($news < 0)
  141. // Show the news overview
  142. {
  143. $count = $fetch_news['topic_count'];
  144. for ($i = 0; $i < $count; $i++)
  145. {
  146. if(isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true)
  147. {
  148. $open_bracket = '[ ';
  149. $close_bracket = ' ]';
  150. $read_full = $user->lang['READ_FULL'];
  151. }
  152. else
  153. {
  154. $open_bracket = '';
  155. $close_bracket = '';
  156. $read_full = '';
  157. }
  158. // unread?
  159. $forum_id = $fetch_news[$i]['forum_id'];
  160. $topic_id = $fetch_news[$i]['topic_id'];
  161. $unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
  162.  
  163. $read_full_url = (isset($_GET['np'])) ? 'np='. $start . '&amp;news=' . $i . '#n' . $i : 'news=' . $i . '#n' . $i;
  164. $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&amp;t=' . $topic_id);
  165. if ($config['board3_news1_archive_' . $module_id])
  166. {
  167. $pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $config['board3_number_of_news1_' . $module_id], $start, ($config['board3_show_all_news1_' . $module_id]) ? 'news_all' : 'news');
  168. }
  169.  
  170. $replies = ($auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies'];
  171. $folder_img = $folder_alt = $topic_type = $folder = $folder_new = '';
  172. switch ($fetch_news[$i]['topic_type'])
  173. {
  174. case POST_STICKY:
  175. $folder = 'sticky_read';
  176. $folder_new = 'sticky_unread';
  177. break;
  178. case POST_ANNOUNCE:
  179. $folder = 'announce_read';
  180. $folder_new = 'announce_unread';
  181. break;
  182. default:
  183. $folder = 'topic_read';
  184. $folder_new = 'topic_unread';
  185. if ($config['hot_threshold'] && $replies >= $config['hot_threshold'] && $fetch_news[$i]['topic_status'] != ITEM_LOCKED)
  186. {
  187. $folder .= '_hot';
  188. $folder_new .= '_hot';
  189. }
  190. break;
  191. }
  192.  
  193. if ($fetch_news[$i]['topic_status'] == ITEM_LOCKED)
  194. {
  195. $folder .= '_locked';
  196. $folder_new .= '_locked';
  197. }
  198. if ($fetch_news[$i]['topic_posted'])
  199. {
  200. $folder .= '_mine';
  201. $folder_new .= '_mine';
  202. }
  203.  
  204. $folder_img = ($unread_topic) ? $folder_new : $folder;
  205. $folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($fetch_news[$i]['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
  206.  
  207. // Grab icons
  208. $icons = $cache->obtain_icons();
  209.  
  210. $template->assign_block_vars('news_row', array(
  211. 'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
  212. 'FORUM_NAME' => ($forum_id) ? $fetch_news[$i]['forum_name'] : '',
  213. 'TITLE' => $fetch_news[$i]['topic_title'],
  214. 'POSTER' => $fetch_news[$i]['username'],
  215. 'POSTER_FULL' => $fetch_news[$i]['username_full'],
  216. 'USERNAME_FULL_LAST' => $fetch_news[$i]['username_full_last'],
  217. 'U_USER_PROFILE' => (($fetch_news[$i]['user_type'] == USER_NORMAL || $fetch_news[$i]['user_type'] == USER_FOUNDER) && $fetch_news[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $fetch_news[$i]['user_id']) : '',
  218. 'TIME' => $fetch_news[$i]['topic_time'],
  219. 'LAST_POST_TIME' => $user->format_date($fetch_news[$i]['topic_last_post_time']),
  220. 'TEXT' => $fetch_news[$i]['post_text'],
  221. 'REPLIES' => $fetch_news[$i]['topic_replies'],
  222. 'TOPIC_VIEWS' => $fetch_news[$i]['topic_views'],
  223. 'N_ID' => $i,
  224. 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
  225. 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
  226. 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
  227. 'TOPIC_ICON_IMG' => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['img'] : '',
  228. 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['width'] : '',
  229. 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['height'] : '',
  230. 'FOLDER_IMG' => $user->img('topic_read', 'NO_NEW_POSTS'),
  231. 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news[$i]['forum_id']),
  232. 'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id'] . '&amp;p=' . $fetch_news[$i]['topic_last_post_id'] . '#p' . $fetch_news[$i]['topic_last_post_id']),
  233. 'U_VIEW_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id']),
  234. 'U_VIEW_UNREAD' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id'] . '&amp;view=unread#unread'),
  235. 'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&amp;f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id']),
  236. 'U_READ_FULL' => append_sid("{$phpbb_root_path}portal.$phpEx", $read_full_url),
  237. 'L_READ_FULL' => $read_full,
  238. 'OPEN' => $open_bracket,
  239. 'CLOSE' => $close_bracket,
  240. 'S_NOT_LAST' => ($i < sizeof($fetch_news) - 1) ? true : false,
  241. 'S_POLL' => $fetch_news[$i]['poll'],
  242. 'S_UNREAD_INFO' => $unread_topic,
  243. 'PAGINATION' => topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
  244. 'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? true : false,
  245. ));
  246.  
  247. if(!empty($fetch_news[$i]['attachments']))
  248. {
  249. foreach ($fetch_news[$i]['attachments'] as $attachment)
  250. {
  251. $template->assign_block_vars('news_row.attachment', array(
  252. 'DISPLAY_ATTACHMENT' => $attachment)
  253. );
  254. }
  255. }
  256.  
  257. if ($config['board3_number_of_news1_' . $module_id] <> 0 && $config['board3_news1_archive_' . $module_id])
  258. {
  259. $template->assign_vars(array(
  260. 'NP_PAGINATION' => $pagination,
  261. 'TOTAL_news' => ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
  262. 'NP_PAGE_NUMBER' => on_page($total_news, $config['board3_number_of_news1_' . $module_id], $start))
  263. );
  264. }
  265. }
  266. }
  267. else
  268. // Show "read full" page
  269. {
  270. $i = $news;
  271. $forum_id = $fetch_news[$i]['forum_id'];
  272. $topic_id = $fetch_news[$i]['topic_id'];
  273. $unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
  274. $open_bracket = '[ ';
  275. $close_bracket = ' ]';
  276. $read_full = $user->lang['BACK'];
  277.  
  278. $read_full_url = (isset($_GET['np'])) ? append_sid("{$phpbb_root_path}portal.$phpEx", "np=$start#n$i") : append_sid("{$phpbb_root_path}portal.$phpEx#n$i");
  279. $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&amp;t=' . $topic_id);
  280. if ($config['board3_news1_archive_' . $module_id])
  281. {
  282. $pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $config['board3_number_of_news1_' . $module_id], $start, ($config['board3_show_all_news1_' . $module_id]) ? 'news_all' : 'news');
  283. }
  284.  
  285. $template->assign_block_vars('news_row', array(
  286. 'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
  287. 'FORUM_NAME' => ($forum_id) ? $fetch_news[$i]['forum_name'] : '',
  288. 'TITLE' => $fetch_news[$i]['topic_title'],
  289. 'POSTER' => $fetch_news[$i]['username'],
  290. 'POSTER_FULL' => $fetch_news[$i]['username_full'],
  291. 'TIME' => $fetch_news[$i]['topic_time'],
  292. 'TEXT' => $fetch_news[$i]['post_text'],
  293. 'REPLIES' => $fetch_news[$i]['topic_replies'],
  294. 'TOPIC_VIEWS' => $fetch_news[$i]['topic_views'],
  295. 'N_ID' => $i,
  296. 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news[$i]['forum_id']),
  297. 'U_LAST_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $fetch_news[$i]['topic_last_post_id'] . '#p' . $fetch_news[$i]['topic_last_post_id']),
  298. 'U_VIEW_COMMENTS' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id']),
  299. 'U_POST_COMMENT' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&amp;f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id']),
  300. 'S_POLL' => $fetch_news[$i]['poll'],
  301. 'S_UNREAD_INFO' => $unread_topic,
  302. 'U_READ_FULL' => $read_full_url,
  303. 'L_READ_FULL' => $read_full,
  304. 'OPEN' => $open_bracket,
  305. 'CLOSE' => $close_bracket,
  306. 'PAGINATION' => topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
  307. 'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? true : false,
  308. ));
  309.  
  310. if(!empty($fetch_news[$i]['attachments']))
  311. {
  312. foreach ($fetch_news[$i]['attachments'] as $attachment)
  313. {
  314. $template->assign_block_vars('news_row.attachment', array(
  315. 'DISPLAY_ATTACHMENT' => $attachment)
  316. );
  317. }
  318. }
  319.  
  320. if ($config['board3_number_of_news1_' . $module_id] <> 0 && $config['board3_news1_archive_' . $module_id])
  321. {
  322. $template->assign_vars(array(
  323. 'NP_PAGINATION' => $pagination,
  324. 'TOTAL_news' => ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
  325. 'NP_PAGE_NUMBER' => on_page($total_news, $config['board3_number_of_news1_' . $module_id], $start))
  326. );
  327. }
  328. }
  329. }
  330.  
  331. $topic_icons = false;
  332. if(!empty($fetch_news['topic_icons']))
  333. {
  334. $topic_icons = true;
  335. }
  336.  
  337. $template->assign_vars(array(
  338. 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
  339. 'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
  340. 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
  341. 'S_NEWEST_OR_FIRST' => ($config['board3_news1_show_last_' . $module_id]) ? $user->lang['JUMP_NEWEST'] : $user->lang['JUMP_FIRST'],
  342. 'POSTED_BY_TEXT' => ($config['board3_news1_show_last_' . $module_id]) ? $user->lang['LAST_POST'] : $user->lang['POSTED'],
  343. 'S_DISPLAY_news_RVS' => ($config['board3_show_news1_replies_views_' . $module_id]) ? true : false,
  344. 'S_TOPIC_ICONS' => $topic_icons,
  345. ));
  346.  
  347. if($config['board3_news1_style_' . $module_id])
  348. {
  349. return 'news1_compact_center.html';
  350. }
  351. else
  352. {
  353. return 'news1_center.html';
  354. }
  355. }
  356.  
  357. public function get_template_acp($module_id)
  358. {
  359. return array(
  360. 'title' => 'ACP_PORTAL_news_SETTINGS',
  361. 'vars' => array(
  362. 'legend1' => 'ACP_PORTAL_news_SETTINGS',
  363. 'board3_news1_style_' . $module_id => array('lang' => 'PORTAL_news_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
  364. 'board3_show_all_news1_' . $module_id => array('lang' => 'PORTAL_SHOW_ALL_news', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
  365. 'board3_number_of_news1_' . $module_id => array('lang' => 'PORTAL_NUMBER_OF_news', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
  366. 'board3_news1_length_' . $module_id => array('lang' => 'PORTAL_news_LENGTH', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
  367. 'board3_news1_forum_' . $module_id => array('lang' => 'PORTAL_news_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'),
  368. 'board3_news1_exclude_' . $module_id => array('lang' => 'PORTAL_news_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
  369. 'board3_news1_show_last_' . $module_id => array('lang' => 'PORTAL_news_SHOW_LAST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
  370. 'board3_news1_archive_' . $module_id => array('lang' => 'PORTAL_news_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
  371. 'board3_news1_permissions_' . $module_id => array('lang' => 'PORTAL_news_PERMISSIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
  372. 'board3_show_news1_replies_views_' . $module_id => array('lang' => 'PORTAL_SHOW_REPLIES_VIEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
  373. )
  374. );
  375. }
  376.  
  377. /**
  378. * API functions
  379. */
  380. public function install($module_id)
  381. {
  382. set_config('board3_news1_length_' . $module_id, 250);
  383. set_config('board3_news1_forum_' . $module_id, '');
  384. set_config('board3_news1_permissions_' . $module_id, 1);
  385. set_config('board3_number_of_news1_' . $module_id, 5);
  386. set_config('board3_show_all_news1_' . $module_id, 1);
  387. set_config('board3_news1_exclude_' . $module_id, 0);
  388. set_config('board3_news1_archive_' . $module_id, 1);
  389. set_config('board3_news1_show_last_' . $module_id, 0);
  390. set_config('board3_show_news1_replies_views_' . $module_id, 1);
  391. set_config('board3_news1_style_' . $module_id, 1);
  392. return true;
  393. }
  394.  
  395. public function uninstall($module_id)
  396. {
  397. global $db;
  398.  
  399. $del_config = array(
  400. 'board3_news1_length_' . $module_id,
  401. 'board3_news1_forum_' . $module_id,
  402. 'board3_news1_permissions_' . $module_id,
  403. 'board3_number_of_news1_' . $module_id,
  404. 'board3_show_all_news1_' . $module_id,
  405. 'board3_news1_exclude_' . $module_id,
  406. 'board3_news1_archive_' . $module_id,
  407. 'board3_news1_show_last_' . $module_id,
  408. 'board3_show_news1_replies_views_' . $module_id,
  409. 'board3_news1_style_' . $module_id,
  410. );
  411. $sql = 'DELETE FROM ' . CONFIG_TABLE . '
  412. WHERE ' . $db->sql_in_set('config_name', $del_config);
  413. return $db->sql_query($sql);
  414. }
  415.  
  416. // Create forum select box
  417. public function select_forums($value, $key, $module_id)
  418. {
  419. global $user, $config;
  420.  
  421. $forum_list = make_forum_select(false, false, true, true, true, false, true);
  422.  
  423. $selected = array();
  424. if(isset($config[$key]) && strlen($config[$key]) > 0)
  425. {
  426. $selected = explode(',', $config[$key]);
  427. }
  428. // Build forum options
  429. $s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
  430. foreach ($forum_list as $f_id => $f_row)
  431. {
  432. $s_forum_options .= '<option value="' . $f_id . '"' . ((in_array($f_id, $selected)) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
  433. }
  434. $s_forum_options .= '</select>';
  435.  
  436. return $s_forum_options;
  437.  
  438. }
  439.  
  440. // Store selected forums
  441. public function store_selected_forums($key, $module_id)
  442. {
  443. global $db, $cache;
  444.  
  445. // Get selected extensions
  446. $values = request_var($key, array(0 => ''));
  447.  
  448. $news = implode(',', $values);
  449.  
  450. set_config($key, $news);
  451.  
  452. }
  453. }