function cms_block_forum() { global $db, $cache, $config, $template, $images, $lang, $bbcode, $block_id, $cms_config_vars; $template->_tpldata['fetchpost_row.'] = array(); if (!class_exists('class_topics')) { include IP_ROOT_PATH . 'includes/class_topics.' . PHP_EXT; } $class_topics = new class_topics(); $template->assign_vars(array('L_COMMENTS' => $lang['Comments'], 'L_VIEW_COMMENTS' => $lang['View_comments'], 'L_POST_COMMENT' => $lang['Post_your_comment'], 'L_POSTED' => $lang['Posted'], 'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 'L_REPLIES' => $lang['Replies'], 'L_REPLY_NEWS' => $lang['News_Reply'], 'L_PRINT_NEWS' => $lang['News_Print'], 'L_EMAIL_NEWS' => $lang['News_Email'], 'MINIPOST_IMG' => $images['icon_minipost'], 'NEWS_REPLY_IMG' => $images['news_reply'], 'NEWS_PRINT_IMG' => $images['news_print'], 'NEWS_EMAIL_IMG' => $images['news_email'], 'IMG_CLOCK' => $images['news_clock'])); $article = request_var('article', 0); if (!empty($article)) { $cms_config_vars['md_news_length'][$block_id] = 0; } // Mighty Gorgon: edited by JHL, I still need to check the impacts on the auth system //$fetchposts = $class_topics->fetch_posts($cms_config_vars['md_news_forum_id'][$block_id], $cms_config_vars['md_num_news'][$block_id], $cms_config_vars['md_news_length'][$block_id], false, false, false, false); $fetchposts = $class_topics->fetch_posts($cms_config_vars['md_news_forum_id'][$block_id], $cms_config_vars['md_num_news'][$block_id], $cms_config_vars['md_news_length'][$block_id]); for ($i = 0; $i < sizeof($fetchposts); $i++) { $open_bracket = ''; $close_bracket = ''; $read_full = ''; if (empty($article) && $fetchposts[$i]['striped'] == 1) { $open_bracket = '[ '; $close_bracket = ' ]'; $read_full = $lang['Read_Full']; } // Convert and clean special chars! $topic_title = htmlspecialchars_clean($fetchposts[$i]['topic_title']); $template->assign_block_vars('fetchpost_row', array('TOPIC_ID' => $fetchposts[$i]['topic_id'], 'TITLE' => $topic_title, 'POSTER' => $fetchposts[$i]['username'], 'POSTER_CG' => colorize_username($fetchposts[$i]['user_id'], $fetchposts[$i]['username'], $fetchposts[$i]['user_color'], $fetchposts[$i]['user_active']), 'TIME' => $fetchposts[$i]['topic_time'], 'TEXT' => $fetchposts[$i]['post_text'], 'REPLIES' => $fetchposts[$i]['topic_replies'], 'U_VIEW_COMMENTS' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'] . '&' . POST_POST_URL . '=' . $fetchposts[$i]['post_id'] . '#p' . $fetchposts[$i]['post_id'], true), 'U_POST_COMMENT' => append_sid('posting.' . PHP_EXT . '?mode=reply&' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']), 'U_PRINT_TOPIC' => append_sid('printview.' . PHP_EXT . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'] . '&start=0'), 'U_EMAIL_TOPIC' => append_sid('tellafriend.' . PHP_EXT . '?topic_title=' . urlencode(ip_utf8_decode($fetchposts[$i]['topic_title'])) . '&topic_id=' . $fetchposts[$i]['topic_id']), 'U_READ_FULL' => append_sid($index_file . '?article=' . $i), 'L_READ_FULL' => $read_full, 'OPEN' => $open_bracket, 'CLOSE' => $close_bracket)); } }
function cms_block_forum_attach() { global $db, $cache, $config, $template, $images, $lang, $bbcode, $block_id, $cms_config_vars; if (!class_exists('class_topics')) { include IP_ROOT_PATH . 'includes/class_topics.' . PHP_EXT; } $class_topics = new class_topics(); @(include_once IP_ROOT_PATH . ATTACH_MOD_PATH . 'displaying.' . PHP_EXT); $template->_tpldata['articles_fp.'] = array(); $index_file = !empty($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : getenv('SCRIPT_NAME'); $index_file = htmlspecialchars(urldecode($index_file)); $template->set_filenames(array('forum_attach_block' => 'blocks/forum_attach_block.tpl')); $template->assign_vars(array('L_COMMENTS' => $lang['Comments'], 'L_VIEW_COMMENTS' => $lang['View_comments'], 'L_POST_COMMENT' => $lang['Post_your_comment'], 'L_POSTED' => $lang['Posted'], 'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 'L_REPLIES' => $lang['Replies'], 'L_REPLY_NEWS' => $lang['News_Reply'], 'L_PRINT_NEWS' => $lang['News_Print'], 'L_EMAIL_NEWS' => $lang['News_Email'], 'MINIPOST_IMG' => $images['icon_minipost'], 'NEWS_REPLY_IMG' => $images['news_reply'], 'NEWS_PRINT_IMG' => $images['news_print'], 'NEWS_EMAIL_IMG' => $images['news_email'], 'IMG_CLOCK' => $images['news_clock'])); // $only_auth_view must have the opposite value of $cms_config_vars['md_ignore_auth_view'][$block_id] // Suggested by JHL - To Be Verified! //$only_auth_view = (!empty($cms_config_vars['md_ignore_auth_view'][$block_id]) ? true : false); $only_auth_view = !empty($cms_config_vars['md_ignore_auth_view'][$block_id]) || $cms_config_vars['md_ignore_auth_view'][$block_id] == true ? false : true; if ($cms_config_vars['md_single_post_retrieve'][$block_id]) { $single_post_id = request_var('post_id', 0); if ($cms_config_vars['md_single_post_auto_id'][$block_id]) { $single_post_id = !empty($single_post_id) ? $single_post_id : $cms_config_vars['md_single_post_id'][$block_id]; } else { $single_post_id = $cms_config_vars['md_single_post_id'][$block_id]; } // Mighty Gorgon: edited by JHL, I still need to check the impacts of this amendment //$fetchposts = $class_topics->fetch_posts($single_post_id, 1, $cms_config_vars['md_single_post_length'][$block_id], false, false, true, $only_auth_view); $fetchposts = $class_topics->fetch_posts($single_post_id, 1, $cms_config_vars['md_single_post_length'][$block_id], false, 0, true, $only_auth_view); } else { $fetchposts = $class_topics->fetch_posts($cms_config_vars['md_posts_forum_id'][$block_id], $cms_config_vars['md_num_posts'][$block_id], $cms_config_vars['md_posts_length'][$block_id], $cms_config_vars['md_posts_show_portal'][$block_id], $cms_config_vars['md_posts_random'][$block_id], false, $only_auth_view); } for ($i = 0; $i < sizeof($fetchposts); $i++) { init_display_post_attachments($fetchposts[$i]['topic_attachment'], $fetchposts[$i], true, $block_id); $open_bracket = ''; $close_bracket = ''; $read_full = ''; if ($fetchposts[$i]['striped'] == 1) { $open_bracket = '[ '; $close_bracket = ' ]'; $read_full = $lang['Read_Full']; } // Convert and clean special chars! $topic_title = htmlspecialchars_clean($fetchposts[$i]['topic_title']); $template->assign_block_vars('articles_fp', array('TOPIC_ID' => $fetchposts[$i]['topic_id'], 'FORUM_ID' => $fetchposts[$i]['forum_id'], 'TITLE' => $topic_title, 'POSTER' => $fetchposts[$i]['username'], 'POSTER_CG' => colorize_username($fetchposts[$i]['user_id'], $fetchposts[$i]['username'], $fetchposts[$i]['user_color'], $fetchposts[$i]['user_active']), 'TIME' => $fetchposts[$i]['topic_time'], 'TEXT' => $fetchposts[$i]['post_text'], 'REPLIES' => $fetchposts[$i]['topic_replies'], 'U_VIEW_COMMENTS' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'] . '&' . POST_POST_URL . '=' . $fetchposts[$i]['post_id'] . '#p' . $fetchposts[$i]['post_id'], true), 'U_POST_COMMENT' => append_sid('posting.' . PHP_EXT . '?mode=reply&' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']), 'U_PRINT_TOPIC' => append_sid('printview.' . PHP_EXT . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'] . '&start=0'), 'U_EMAIL_TOPIC' => append_sid('tellafriend.' . PHP_EXT . '?topic_title=' . urlencode(ip_utf8_decode($fetchposts[$i]['topic_title'])) . '&topic_id=' . $fetchposts[$i]['topic_id']), 'U_READ_FULL' => append_sid($index_file . '?article=' . $i), 'L_READ_FULL' => $read_full, 'OPEN' => $open_bracket, 'CLOSE' => $close_bracket)); display_attachments($fetchposts[$i]['post_id'], 'articles_fp'); } }
function cms_block_kb() { global $db, $cache, $config, $template, $theme, $images, $table_prefix, $user, $lang, $block_id, $cms_config_vars; global $ip_cms; if (!class_exists('class_topics')) { include IP_ROOT_PATH . 'includes/class_topics.' . PHP_EXT; } $class_topics = new class_topics(); @(include_once IP_ROOT_PATH . ATTACH_MOD_PATH . 'displaying.' . PHP_EXT); $template->_tpldata['kb_list.'] = array(); $template->_tpldata['kb_article.'] = array(); $template->_tpldata['cat_row.'] = array(); $template->_tpldata['menu_row.'] = array(); $template->set_filenames(array('kb_block' => 'blocks/kb_block.tpl')); $template->assign_vars(array('L_COMMENTS' => $lang['Comments'], 'L_VIEW_COMMENTS' => $lang['View_comments'], 'L_POST_COMMENT' => $lang['Post_your_comment'], 'L_POSTED' => $lang['Posted'], 'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 'L_REPLIES' => $lang['Replies'], 'L_REPLY_ARTICLE' => $lang['Article_Reply'], 'L_PRINT_ARTICLE' => $lang['Article_Print'], 'L_EMAIL_ARTICLE' => $lang['Article_Email'], 'L_TOPIC' => $lang['Topic'], 'L_ARTICLES' => $lang['Articles'], 'L_TIME' => $lang['Articles_time'], 'L_OPTIONS' => $lang['Articles_options'], 'MINIPOST_IMG' => $images['icon_minipost'], 'ARTICLE_COMMENTS_IMG' => $images['vf_topic_nor'], 'ARTICLE_REPLY_IMG' => $images['news_reply'], 'ARTICLE_PRINT_IMG' => $images['news_print'], 'ARTICLE_EMAIL_IMG' => $images['news_email'])); if (isset($_GET['kb']) && $_GET['kb'] == 'article') { $template->assign_block_vars('kb_article', array()); $forum_id = request_var(POST_FORUM_URL, 0); // Mighty Gorgon: edited by JHL, I still need to check the impacts on the auth system //$fetchposts = $class_topics->fetch_posts($forum_id, 0, 0, false, false, false, false); $fetchposts = $class_topics->fetch_posts($forum_id, 0, 0); $id = isset($_GET[POST_TOPIC_URL]) ? intval($_GET[POST_TOPIC_URL]) : intval($_POST[POST_TOPIC_URL]); $i = 0; while ($fetchposts[$i]['topic_id'] != $id) { $i++; } init_display_post_attachments($fetchposts[$i]['topic_attachment'], $fetchposts[$i], true, $block_id); $template->assign_vars(array('TOPIC_ID' => $fetchposts[$i]['topic_id'], 'KB_TITLE' => $fetchposts[$i]['topic_title'], 'TOPIC_DESC' => $fetchposts[$i]['topic_desc'], 'POSTER' => $fetchposts[$i]['username'], 'POSTER_CG' => colorize_username($fetchposts[$i]['user_id'], $fetchposts[$i]['username'], $fetchposts[$i]['user_color'], $fetchposts[$i]['user_active']), 'TIME' => $fetchposts[$i]['topic_time'], 'TEXT' => $fetchposts[$i]['post_text'], 'REPLIES' => $fetchposts[$i]['topic_replies'], 'U_VIEW_COMMENTS' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_FORUM_URL . '=' . $forum_id . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'], true), 'U_POST_COMMENT' => append_sid('posting.' . PHP_EXT . '?mode=reply&' . POST_FORUM_URL . '=' . $forum_id . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']), 'U_PRINT_TOPIC' => append_sid('printview.' . PHP_EXT . '?' . POST_FORUM_URL . '=' . $forum_id . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'] . '&start=0'), 'U_EMAIL_TOPIC' => append_sid('tellafriend.' . PHP_EXT . '?topic_title=' . urlencode(ip_utf8_decode($fetchposts[$i]['topic_title'])) . '&topic_id=' . $fetchposts[$i]['topic_id']))); display_attachments($fetchposts[$i]['post_id'], 'articles_fp'); } else { if (isset($_GET['kb']) && $_GET['kb'] == 'category') { $template->assign_block_vars('kb_list', array()); $forum_id = request_var(POST_FORUM_URL, 0); // Mighty Gorgon: edited by JHL, I still need to check the impacts on the auth system //$fetchposts = $class_topics->fetch_posts($forum_id, 0, 0, false, false, false, false); $fetchposts = $class_topics->fetch_posts($forum_id, 0, 0); for ($i = 0; $i < sizeof($fetchposts); $i++) { init_display_post_attachments($fetchposts[$i]['topic_attachment'], $fetchposts[$i], true, $block_id); $template->assign_block_vars('kb_list.kb_articles', array('TOPIC_ID' => $fetchposts[$i]['topic_id'], 'TOPIC_TITLE' => $fetchposts[$i]['topic_title'], 'TOPIC_DESC' => $fetchposts[$i]['topic_desc'], 'POSTER' => $fetchposts[$i]['username'], 'POSTER_CG' => colorize_username($fetchposts[$i]['user_id'], $fetchposts[$i]['username'], $fetchposts[$i]['user_color'], $fetchposts[$i]['user_active']), 'TIME' => $fetchposts[$i]['topic_time'], 'REPLIES' => $fetchposts[$i]['topic_replies'], 'U_VIEW_ARTICLE' => append_sid($_SERVER['SCRIPT_NAME'] . '?kb=article&f=' . $forum_id . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'], true), 'U_VIEW_COMMENTS' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_FORUM_URL . '=' . $forum_id . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'], true), 'U_POST_COMMENT' => append_sid('posting.' . PHP_EXT . '?mode=reply&' . POST_FORUM_URL . '=' . $forum_id . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']), 'U_PRINT_TOPIC' => append_sid('printview.' . PHP_EXT . '?' . POST_FORUM_URL . '=' . $forum_id . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'] . '&start=0'), 'U_EMAIL_TOPIC' => append_sid('tellafriend.' . PHP_EXT . '?topic_title=' . urlencode(ip_utf8_decode($fetchposts[$i]['topic_title'])) . '&topic_id=' . $fetchposts[$i]['topic_id']))); display_attachments($fetchposts[$i]['post_id'], 'articles_fp'); } $template->assign_vars(array('KB_TITLE' => $lang['Kb_name'])); } else { $template->assign_block_vars('cat_row', array()); $sql = "SELECT * FROM " . CMS_NAV_MENU_TABLE . "\n\t\t\t\t\t\t\tWHERE menu_id = '" . intval($cms_config_vars['kb_cat_id'][$block_id]) . "'\n\t\t\t\t\t\t\tLIMIT 1"; $result = $db->sql_query($sql, 0, 'cms_menu_', CMS_CACHE_FOLDER); //$row = $db->sql_fetchrow($result); while ($row = $db->sql_fetchrow($result)) { break; } $db->sql_freeresult($result); if ($row['menu_name_lang'] != '' && isset($lang[$row['menu_name_lang']])) { $main_menu_name = $lang[$row['menu_name_lang']]; } else { $main_menu_name = $row['menu_name'] != '' ? $row['menu_name'] : $lang['quick_links']; } $sql = "SELECT * FROM " . CMS_NAV_MENU_TABLE . "\n\t\t\t\t\t\t\tWHERE menu_parent_id = '" . intval($cms_config_vars['kb_cat_id'][$block_id]) . "'\n\t\t\t\t\t\t\tORDER BY cat_parent_id ASC, menu_order ASC"; $result = $db->sql_query($sql, 0, 'cms_menu_', CMS_CACHE_FOLDER); $menu_cat = array(); $cat_item = array(); $menu_item = array(); $auth_levels = $ip_cms->cms_auth_view(); while ($menu_item = $db->sql_fetchrow($result)) { if ($menu_item['cat_id'] > 0) { $cat_item[$menu_item['cat_id']] = $menu_item; } if ($menu_item['cat_parent_id'] > 0) { $menu_cat[$menu_item['cat_parent_id']][$menu_item['menu_item_id']] = $menu_item; } } $db->sql_freeresult($result); foreach ($cat_item as $cat_item_data) { if ($cat_item_data['menu_status'] == false) { $cat_allowed = false; } else { $auth_level_req = $cat_item_data['auth_view']; $cat_allowed = in_array($auth_level_req, $auth_levels) ? true : false; } if (!empty($cat_allowed)) { //echo($cat_item_data['menu_name'] . '<br />'); $cat_id = $cat_item_data['cat_id']; if ($cat_item_data['menu_name_lang'] != '' && isset($lang[$cat_item_data['menu_name_lang']])) { $cat_name = $lang[$cat_item_data['menu_name_lang']]; } else { $cat_name = $cat_item_data['menu_name'] != '' ? stripslashes($cat_item_data['menu_name']) : 'cat_item' . $cat_item_data['cat_id']; } $cat_icon = $cat_item_data['menu_icon'] != '' ? '<img src="' . $cat_item_data['menu_icon'] . '" alt="" title="' . $cat_name . '" style="vertical-align:middle;" /> ' : '<img src="' . $images['nav_menu_sep'] . '" alt="" title="" style="vertical-align:middle;" /> '; //$cat_icon = (($cat_item_data['menu_icon'] != '') ? '<img src="' . $cat_item_data['menu_icon'] . '" alt="" title="' . $cat_name . '" style="vertical-align:middle;" /> ' : ' '); if ($cat_item_data['menu_link'] != '') { $cat_link = append_sid($cat_item_data['menu_link']); if ($cat_item_data['menu_link_external'] == true) { $cat_link .= '" target="_blank'; } } $template->assign_block_vars('cat_row', array('CAT_ID' => $cat_item_data['cat_id'], 'CAT_ITEM' => $cat_name, 'CAT_ICON' => $cat_icon)); foreach ($menu_cat[$cat_id] as $menu_cat_item_data) { if ($menu_cat_item_data['menu_status'] == false) { $menu_allowed = false; } else { $auth_level_req = $menu_cat_item_data['auth_view']; $menu_allowed = in_array($auth_level_req, $auth_levels) ? true : false; } if (!empty($menu_allowed)) { //echo($menu_cat_item_data['menu_name'] . '<br />'); if ($menu_cat_item_data['menu_name_lang'] != '' && isset($lang[$menu_cat_item_data['menu_name_lang']])) { $menu_name = $lang[$menu_cat_item_data['menu_name_lang']]; } else { $menu_name = $menu_cat_item_data['menu_name'] != '' ? stripslashes($menu_cat_item_data['menu_name']) : 'cat_item' . $menu_cat_item_data['cat_id']; } if ($menu_cat_item_data['menu_link_external'] == true) { $menu_link .= '" target="_blank'; $menu_link = $menu_cat_item_data['menu_link']; } else { $menu_link = append_sid($menu_cat_item_data['menu_link']); } $menu_icon = $menu_cat_item_data['menu_icon'] != '' ? '<img src="' . $menu_cat_item_data['menu_icon'] . '" alt="" title="' . $menu_name . '" style="vertical-align:middle;" />' : '<img src="' . $images['nav_menu_sep'] . '" alt="" title="" style="vertical-align:middle;" />'; $menu_desc = $menu_cat_item_data['menu_desc']; $template->assign_block_vars('cat_row.menu_row', array('MENU_ITEM' => $menu_name, 'MENU_LINK' => $menu_link, 'MENU_ICON' => $menu_icon, 'MENU_DESC' => $menu_desc)); } } } } $template->assign_vars(array('KB_TITLE' => $lang['Kb_name'])); } } }
function cms_block_forum_articles() { global $db, $cache, $config, $template, $images, $lang, $bbcode, $block_id, $cms_config_vars, $meta_content, $breadcrumbs; if (!class_exists('class_topics')) { include IP_ROOT_PATH . 'includes/class_topics.' . PHP_EXT; } $class_topics = new class_topics(); @(include_once IP_ROOT_PATH . ATTACH_MOD_PATH . 'displaying.' . PHP_EXT); $template->_tpldata['articles_fa.'] = array(); $index_file = !empty($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : getenv('SCRIPT_NAME'); $index_file = htmlspecialchars(urldecode($index_file)); while (substr($index_file, 0, 1) == '/') { $index_file = substr($index_file, 1); } if ($index_file == 'index.' . PHP_EXT) { $prefix = '?page=' . request_var('page', 0) . '&'; } else { $prefix = '?'; } $meta_content['page_title_clean'] = empty($meta_content['page_title_clean']) ? strip_tags($meta_content['page_title']) : $meta_content['page_title_clean']; $template->set_filenames(array('forum_articles_block' => 'blocks/forum_articles_block.tpl')); $title = empty($cms_config_vars['md_posts_title'][$block_id]) ? $meta_content['page_title_clean'] : htmlspecialchars_clean($cms_config_vars['md_posts_title'][$block_id]); $template->assign_vars(array('L_TITLE' => $title, 'L_POSTED' => $lang['Posted'], 'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 'L_PRINT_NEWS' => $lang['News_Print'], 'L_EMAIL_NEWS' => $lang['News_Email'], 'NEWS_PRINT_IMG' => $images['news_print'], 'NEWS_EMAIL_IMG' => $images['news_email'])); // $only_auth_view must have the opposite value of $cms_config_vars['md_ignore_auth_view'][$block_id] $only_auth_view = !empty($cms_config_vars['md_ignore_auth_view'][$block_id]) || $cms_config_vars['md_ignore_auth_view'][$block_id] == true ? false : true; $single_post_id = request_var('post_id', 0); if (!empty($single_post_id)) { $fetchposts = $class_topics->fetch_posts($single_post_id, 1, 0, false, 0, true, $only_auth_view); for ($i = 0; $i < sizeof($fetchposts); $i++) { init_display_post_attachments($fetchposts[$i]['topic_attachment'], $fetchposts[$i], true, $block_id); $topic_title = htmlspecialchars_clean($fetchposts[$i]['topic_title']); $topic_link = $index_file . $prefix . 'post_id=' . $single_post_id; $template->assign_block_vars('articles_fa', array('TOPIC_ID' => $fetchposts[$i]['topic_id'], 'FORUM_ID' => $fetchposts[$i]['forum_id'], 'TITLE' => $topic_title, 'POSTER' => $fetchposts[$i]['username'], 'POSTER_CG' => colorize_username($fetchposts[$i]['user_id'], $fetchposts[$i]['username'], $fetchposts[$i]['user_color'], $fetchposts[$i]['user_active']), 'TIME' => $fetchposts[$i]['topic_time'], 'VIEWS' => $fetchposts[$i]['topic_views'], 'TEXT' => $fetchposts[$i]['post_text'], 'U_PRINT_TOPIC' => append_sid('printview.' . PHP_EXT . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'] . '&is_article=1'), 'U_EMAIL_TOPIC' => append_sid('tellafriend.' . PHP_EXT . '?topic_title=' . urlencode(ip_utf8_decode($fetchposts[$i]['topic_title'])) . '&topic_url=' . urlencode(ip_utf8_decode($topic_link))))); display_attachments($fetchposts[$i]['post_id'], 'articles'); } if ($cms_config_vars['md_posts_breadcrumbs'][$block_id]) { $meta_content['page_title_clean'] = empty($meta_content['page_title_clean']) ? strip_tags($meta_content['page_title']) : $meta_content['page_title_clean']; $breadcrumbs['address'] = ''; if ($meta_content['page_title_clean'] != $config['sitename']) { $index_url = $index_file; if ($index_file == 'index.' . PHP_EXT) { $index_url .= '?page=' . request_var('page', 0); } $breadcrumbs['address'] .= $lang['Nav_Separator'] . '<a href="' . append_sid($index_url) . '">' . $meta_content['page_title_clean'] . '</a>'; } $breadcrumbs['address'] .= $lang['Nav_Separator'] . '<a href="#" class="nav-current">' . $topic_title . '</a>'; } } else { $fetchposts = $class_topics->fetch_posts($cms_config_vars['md_posts_forum_id'][$block_id], $cms_config_vars['md_num_posts'][$block_id], -1, $cms_config_vars['md_posts_show_portal'][$block_id], $cms_config_vars['md_posts_random'][$block_id], false, $only_auth_view); for ($i = 0; $i < sizeof($fetchposts); $i++) { // Convert and clean special chars! $topic_title = htmlspecialchars_clean($fetchposts[$i]['topic_title']); $template->assign_block_vars('articles_fa', array('TOPIC_ID' => $fetchposts[$i]['topic_id'], 'FORUM_ID' => $fetchposts[$i]['forum_id'], 'TITLE' => $topic_title, 'POSTER' => $fetchposts[$i]['username'], 'POSTER_CG' => colorize_username($fetchposts[$i]['user_id'], $fetchposts[$i]['username'], $fetchposts[$i]['user_color'], $fetchposts[$i]['user_active']), 'TIME' => $fetchposts[$i]['topic_time'], 'VIEWS' => $fetchposts[$i]['topic_views'], 'U_VIEW_TOPIC' => append_sid($index_file . $prefix . 'post_id=' . $fetchposts[$i]['topic_first_post_id']))); } $template->assign_vars(array('IS_LIST' => true, 'L_TOPICS' => $lang['Topics'], 'L_AUTHOR' => $lang['Author'], 'L_VIEWS' => $lang['Views'])); if ($cms_config_vars['md_posts_breadcrumbs'][$block_id]) { $breadcrumbs['address'] = ''; if ($meta_content['page_title_clean'] != $config['sitename']) { $breadcrumbs['address'] .= $lang['Nav_Separator'] . '<a href="#" class="nav-current">' . $meta_content['page_title_clean'] . '</a>'; } } } }