if ($mode == 'post') { if ($f && $t) { $content = get_content($f, $t); $find = array('{PAGE_POST}', '{PAGE_STYLE1}', '{PAGE_STYLE2}', '{TOPIC_TITLE}', '{POST_AUTHOR}', '{POST_LINK}'); $replace = array($content['POST_TEXT'], $style1, $style2, $content['TOPIC_TITLE'], $content['POST_AUTHOR'], $content['POST_LINK']); $head = str_replace($find, $replace, $head); $body = str_replace($find, $replace, $body); $foot = str_replace($find, $replace, $foot); } $head = bbcode_nl2br($head); $body = bbcode_nl2br($body); $foot = bbcode_nl2br($foot); } $head = process_for_vars($head, true); $body = process_for_vars($body, true); $foot = process_for_vars($foot, true); $vars = array("", "\n", "\r", "\t", '$page_name', '$page_meta', '$page_desc'); $data = array('', '', '', '', $page_name, $page_meta, $page_desc); $head = str_replace($vars, $data, $head); $body = str_replace('{L_NOT_FOUND}', '<h3>{L_WEB_PAGE_EXAMPLES}</h3>{L_WEB_PAGE_EXAMPLES_2}', $body); $template->assign_vars(array('WEB_PAGE_HEAD' => htmlspecialchars_decode($head), 'WEB_PAGE_NAME' => $page_name, 'WEB_PAGE_META' => $page_meta, 'WEB_PAGE_DESC' => $page_desc, 'WEB_PAGE_BODY' => htmlspecialchars_decode($body), 'WEB_PAGE_FOOT' => htmlspecialchars_decode($foot))); // generate page // page_header($user->lang['WEB_PAGE']); if ($extern) { $template->set_filenames(array('body' => 'web_pages/pages/' . $mode)); } else { $template->set_filenames(array('body' => 'blocks/block_web_page.html')); } page_footer(); function get_content($forum, $topic) {
function sgp_build_minimods() { global $phpbb_root_path, $user, $template, $db, $k_config, $config, $k_config, $phpEx; $block_cache_time = $k_config['block_cache_time_default']; $queries = $cached_queries = $i = $j = 0; $same_mod_count = 1; $stored_mod_type = $mod_type = ''; $mod_bbcode_bitfield = ''; $filename = ''; $select_allow = $config['override_user_style'] ? false : true; $sql = "SELECT * FROM " . K_MODULES_TABLE . "\n\t\t\tWHERE mod_status > 0\n\t\t\t\tORDER BY mod_type, mod_origin DESC "; if (!($result1 = $db->sql_query($sql, $block_cache_time))) { trigger_error($user->lang['ERROR_PORTAL_MENUS'] . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } $mod = array(); while ($row = $db->sql_fetchrow($result1)) { $mods[] = $row; } foreach ($mods as $mod) { $mod_type = $mod['mod_type']; switch ($mod['mod_download_count']) { case 0: $mod['mod_download_count'] = sprintf($user->lang['DOWNLOAD_COUNT_NONE'], $mod['mod_download_count']); break; case 1: $mod['mod_download_count'] = sprintf($user->lang['DOWNLOAD_COUNT'], $mod['mod_download_count']); break; default: $mod['mod_download_count'] = sprintf($user->lang['DOWNLOAD_COUNTS'], $mod['mod_download_count']); break; } if ($mod_type == $stored_mod_type) { $same_mod_count++; } else { $same_mod_count = 1; } $info = process_for_vars(htmlspecialchars_decode($mod['mod_details'])); $info = acronym_pass($info); $mod_bbcode_bitfield = $mod_bbcode_bitfield | base64_decode($mod['mod_bbcode_bitfield']); // Instantiate BBCode class if (!isset($bbcode) && $mod_bbcode_bitfield !== '') { if (!class_exists('bbcode')) { include $phpbb_root_path . 'includes/bbcode.' . $phpEx; } $bbcode = new bbcode(base64_encode($mod_bbcode_bitfield)); } if ($mod['mod_bbcode_bitfield']) { $bbcode->bbcode_second_pass($info, $mod['mod_bbcode_uid'], $mod['mod_bbcode_bitfield']); } $info = bbcode_nl2br($info); $info = smiley_text($info); $filename = $phpbb_root_path . 'download/file.php?name=' . $mod['mod_filename'] . '.zip'; // separate out our mods // if ($mod['mod_origin']) { $template->assign_block_vars('our_mod_' . $mod['mod_type'] . '_row', array('MOD_NAME' => $mod['mod_name'], 'MOD_TYPE' => $mod['mod_type'], 'MOD_ORIGIN' => $mod['mod_origin'], 'MOD_VERSION' => $mod['mod_version'], 'MOD_IMG' => $phpbb_root_path . 'images/style_thumbs/' . $mod['mod_thumb'], 'MOD_THUMB' => $phpbb_root_path . 'images/style_thumbs/thumbs/' . $mod['mod_thumb'], 'MOD_UPDATED' => $mod['mod_last_update'], 'MOD_AUTHOR' => $mod['mod_author'], 'MOD_AUTHOR_CO' => $mod['mod_author_co'], 'MOD_DETAILS' => $info, 'MOD_THIS' => $i++, 'MOD_COUNT' => $mod['mod_type'] == 'style' ? $j++ : $j, 'MOD_DOWNLOAD_COUNT' => $mod['mod_download_count'], 'MOD_STATUS' => k_progress_bar($mod['mod_status']), 'MOD_COUNT' => $same_mod_count, 'U_MOD_FILENAME' => $filename, 'U_MOD_LINK' => htmlspecialchars_decode($mod['mod_link']), 'U_MOD_SUPPORT' => htmlspecialchars_decode($mod['mod_support_link']), 'U_MOD_TEST_IT' => $mod['mod_link_id'] && $select_allow ? $phpbb_root_path . 'portal.php?style=' . $mod['mod_link_id'] : '')); } else { $template->assign_block_vars('mod_' . $mod['mod_type'] . '_row', array('MOD_NAME' => $mod['mod_name'], 'MOD_TYPE' => $mod['mod_type'], 'MOD_ORIGIN' => $mod['mod_origin'], 'MOD_VERSION' => $mod['mod_version'], 'MOD_IMG' => $phpbb_root_path . 'images/style_thumbs/' . $mod['mod_thumb'], 'MOD_THUMB' => $phpbb_root_path . 'images/style_thumbs/thumbs/' . $mod['mod_thumb'], 'MOD_UPDATED' => $mod['mod_last_update'], 'MOD_AUTHOR' => $mod['mod_author'], 'MOD_AUTHOR_CO' => $mod['mod_author_co'], 'MOD_DETAILS' => $info, 'MOD_THIS' => $i++, 'MOD_COUNT' => $mod['mod_type'] == 'style' ? $j++ : $j, 'MOD_DOWNLOAD_COUNT' => $mod['mod_download_count'], 'MOD_STATUS' => k_progress_bar($mod['mod_status']), 'MOD_COUNT' => $same_mod_count, 'U_MOD_FILENAME' => $filename, 'U_MOD_LINK' => htmlspecialchars_decode($mod['mod_link']), 'U_MOD_SUPPORT' => htmlspecialchars_decode($mod['mod_support_link']), 'U_MOD_TEST_IT' => $mod['mod_link_id'] && $select_allow ? $phpbb_root_path . 'portal.php?style=' . $mod['mod_link_id'] : '')); } $stored_mod_type = $mod['mod_type']; } $template->assign_vars(array('DOWNLOAD_IMG' => '<img src="' . $phpbb_root_path . 'images/2download-box-32.png" title="Download" alt="" />', 'TEST_IT_IMG' => '<img src="' . $phpbb_root_path . 'images/gnome-view-fullscreen-32.png" title="Check it out!" alt="" />', 'PINFO_IMG' => '<img src="' . $phpbb_root_path . 'images/information-32.png" title="Info" alt="" />')); }
/** * @ignore */ if (!defined('IN_PHPBB')) { exit; } global $user, $k_config, $k_blocks, $phpbb_root_path, $template; $k_welcome_message = isset($k_config['k_welcome_message']) ? $k_config['k_welcome_message'] : ''; $welcome_image = $phpbb_root_path . 'ext/phpbbireland/portal/images/welcome.png'; if (file_exists($welcome_image)) { $block_link = 'portal.php'; } else { $welcome_image = ''; $block_link = ''; } foreach ($k_blocks as $blk) { if ($blk['html_file_name'] == 'block_welcome_message.html') { $block_cache_time = $blk['block_cache_time']; break; } } $block_cache_time = isset($block_cache_time) ? $block_cache_time : $k_config['block_cache_time_default']; include_once $phpbb_root_path . 'ext/phpbbireland/portal/includes/sgp_functions.' . $this->php_ext; $block_name = isset($user->lang['WELCOME']) ? $user->lang['WELCOME'] : '{L_NO_LANG_VALUE}'; // if welcome message has not been set in ACP > BLOCKS > Welcome Blocks, use default // //$block_details = (isset($k_welcome_message) && $k_welcome_message != '' ? $k_welcome_message : $user->lang['WELCOME_MESSAGE']); $block_details = $user->lang['WELCOME_MESSAGE']; $block_details = str_replace('{WM}', $k_welcome_message, $block_details); $block_details = process_for_vars($block_details, true); $block_details = str_replace("[you]", '<span style="font-weight:bold; color:#' . $user->data['user_colour'] . ';">' . $user->data['username'] . '</span>', $block_details); $this->template->assign_vars(array('W_TITLE' => $block_name, 'W_IMAGE' => $welcome_image, 'U_LINK' => $block_link, 'W_MESSAGE' => htmlspecialchars_decode($block_details)));
$block_cache_time = $blk['block_cache_time']; } } $block_cache_time = isset($block_cache_time) ? $block_cache_time : $k_config['block_cache_time_default']; include $phpbb_root_path . 'includes/sgp_functions.' . $phpEx; $sql = "SELECT * FROM " . K_MODULES_TABLE . " WHERE mod_id = 1"; if (!($result = $db->sql_query($sql, $block_cache_time))) { trigger_error('ERROR_PORTAL_WELCOME' . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } else { $row = $db->sql_fetchrow($result); $mod_name = $row['mod_name']; $mod_image = $row['mod_thumb']; $mod_details = $row['mod_details']; $mod_link = $row['mod_link']; $db->sql_freeresult($result); $mod_details = process_for_vars($mod_details, true); if ($row['mod_bbcode_bitfield']) { //include($phpbb_root_path . 'includes/bbcode.' . $phpEx); $bbcode = new bbcode(); $bbcode->bbcode_second_pass($info, $row['mod_bbcode_uid'], $row['mod_bbcode_bitfield']); } $mod_details = bbcode_nl2br($mod_details); $mod_details = smiley_text($mod_details); // note [you] is a pseudo bbcode // /* if ($user->data['username'] == 'Anonymous') { $mod_details = str_replace("[you]", $user->lang['GUEST'], $mod_details); } else