if (isset($center_block_ary) && $show_center) {
    foreach ($center_block_ary as $block => $value) {
        // As it is not always possible to display all data as intended in a narrow block (left or right blocks) we automatically load a wide layout if it exists //
        // We check the default template folder and the SGP common folder templates //
        $my_file_wide = "{$phpbb_root_path}styles/" . $user->theme['template_path'] . '/template/blocks/' . $value;
        $my_file_wide = str_replace('.html', '_wide.html', $my_file_wide);
        if (file_exists($my_file_wide)) {
            $value = str_replace('.html', '_wide.html', $value);
        } else {
            $my_file_wide = "{$phpbb_root_path}styles/_portal_common/template/blocks/" . $value;
            $my_file_wide = str_replace('.html', '_wide.html', $my_file_wide);
            if (file_exists($my_file_wide)) {
                $value = str_replace('.html', '_wide.html', $value);
            }
        }
        $template->assign_block_vars('center_block_files', array('CENTER_BLOCKS' => portal_block_template($value), 'CENTER_BLOCK_ID' => 'C_' . $center_block_id[$block], 'CENTER_BLOCK_TITLE' => $center_block_title[$block], 'CENTER_BLOCK_SCROLL' => $center_block_scroll[$block], 'CENTER_BLOCK_HEIGHT' => $center_block_height[$block], 'CENTER_BLOCK_IMG' => $center_block_img[$block] ? '<img src="' . $phpbb_root_path . 'images/block_images/block/' . $center_block_img[$block] . '" alt="" />' : '<img src="' . $phpbb_root_path . 'images/block_images/block/none.gif" height="1px" width="1px" alt="" >', 'CENTER_BLOCK_IMG_2' => file_exists($big_image_path . $center_block_img[$block]) ? '<img src="' . $big_image_path . $center_block_img[$block] . '" alt="" />' : '<img src="' . $phpbb_root_path . 'images/block_images/large/none.png" alt="" >', 'S_CONTENT_FLOW_BEGIN' => $user->lang['DIRECTION'] == 'ltr' ? 'left' : 'right', 'S_CONTENT_FLOW_END' => $user->lang['DIRECTION'] == 'ltr' ? 'right' : 'left'));
    }
}
$template->assign_vars(array('AVATAR' => sgp_get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']), 'BLOCK_WIDTH' => $blocks_width . 'px', 'PORTAL_ACTIVE' => $config['portal_enabled'], 'PORTAL_VERSION' => $config['portal_version'], 'READ_ARTICLE_IMG' => $user->img('btn_read_article', 'READ_ARTICLE'), 'POST_COMMENTS_IMG' => $user->img('btn_post_comments', 'POST_COMMENTS'), 'VIEW_COMMENTS_IMG' => $user->img('btn_view_comments', 'VIEW_COMMENTS'), 'SITE_NAME' => $config['sitename'], 'S_USER_LOGGED_IN' => $user->data['user_id'] != ANONYMOUS ? true : false, 'S_SHOW_LEFT_BLOCKS' => $show_left, 'S_SHOW_RIGHT_BLOCKS' => $show_right, 'S_BLOCKS_ENABLED' => $blocks_enabled, 'S_ALLOW_FOOTER_IMAGES' => $k_config['allow_footer_images'] ? true : false, 'S_CONTENT_FLOW_BEGIN' => $user->lang['DIRECTION'] == 'ltr' ? 'left' : 'right', 'S_CONTENT_FLOW_END' => $user->lang['DIRECTION'] == 'ltr' ? 'right' : 'left', 'USER_NAME' => $user->data['username'], 'USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), 'U_INDEX' => append_sid("{$phpbb_root_path}index.{$phpEx}"), 'U_PORTAL' => append_sid("{$phpbb_root_path}portal.{$phpEx}"), 'U_PORTAL_ARRANGE' => append_sid("{$phpbb_root_path}portal.{$phpEx}", "arrange=1"), 'U_STAFF' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=leaders'), 'U_SEARCH_BOOKMARKS' => append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'i=main&mode=bookmarks')));
// process common data here //
if ($this_page[0] == 'viewtopic') {
    global $phpEx, $phpbb_root_path;
    global $config, $user, $template, $k_quick_posting_mode, $forum_id, $post_data, $topic_id, $topic_data, $k_config;
    // using function_exists() will still result in redeclarations errors //
    // I confirmed I could use include once under these circumstances over a year ago (official phpBB chat with devs) //
    // I need to determine the actual functions required and check agains each ? //
    include_once $phpbb_root_path . 'includes/functions_posting.' . $phpEx;
    include_once $phpbb_root_path . 'includes/functions_display.' . $phpEx;
    if (!isset($smilies_status)) {
        generate_smilies('inline', $forum_id);
    }
Ejemplo n.º 2
0
        // As it is not always possible to display all data as intended in a narrow block (left or right blocks) we automatically load a wide layout if it exists //
        // We check the default template folder and the SGP common folder templates //
        ///// 3.1
        //$my_file_wide = "{$style_path_ext}" . $user->theme['template_path'] . '/template/blocks/' . $value;
        //$my_file_wide = str_replace('.html', '_wide.html', $my_file_wide);
        $my_file_wide = $style_path_ext = '';
        if (file_exists($my_file_wide)) {
            $value = str_replace('.html', '_wide.html', $value);
        } else {
            $my_file_wide = "{$style_path_ext}common/template/blocks/" . $value;
            $my_file_wide = str_replace('.html', '_wide.html', $my_file_wide);
            if (file_exists($my_file_wide)) {
                $value = str_replace('.html', '_wide.html', $value);
            }
        }
        $template->assign_block_vars('center_block_files', array('CENTER_BLOCKS' => portal_block_template($value), 'CENTER_BLOCK_ID' => 'C_' . $center_block_id[$block], 'CENTER_BLOCK_TITLE' => $center_block_title[$block], 'CENTER_BLOCK_SCROLL' => $center_block_scroll[$block], 'CENTER_BLOCK_HEIGHT' => $center_block_height[$block], 'CENTER_BLOCK_IMG' => $center_block_img[$block] ? $block_image_path . $center_block_img[$block] : $block_image_path . 'none.gif', 'CENTER_BLOCK_IMG_2' => file_exists($big_image_path . $center_block_img[$block]) ? $big_image_path . $center_block_img[$block] : $big_image_path . 'none.png', 'S_CONTENT_FLOW_BEGIN' => $user->lang['DIRECTION'] == 'ltr' ? 'left' : 'right', 'S_CONTENT_FLOW_END' => $user->lang['DIRECTION'] == 'ltr' ? 'right' : 'left'));
    }
}
$avatar_data = array('avatar' => $row['user_avatar'], 'avatar_width' => $row['user_avatar_width'], 'avatar_height' => $row['user_avatar_height'], 'avatar_type' => $row['user_avatar_type']);
$ava = phpbb_get_avatar($avatar_data, $user->lang['USER_AVATAR'], false);
//var_dump($phpbb_root_path . 'ext/phpbbireland/portal/style/' . rawurlencode($user->style['style_path']) . '/theme/images/');
$template->assign_vars(array('T_THEME_PATH' => $phpbb_root_path . 'ext/phpbbireland/portal/style/' . rawurlencode($user->style['style_path']) . '/theme/images/', 'AVATAR' => $ava, 'BLOCK_WIDTH' => $blocks_width . 'px', 'PORTAL_ACTIVE' => $config['portal_enabled'], 'PORTAL_BUILD' => $config['portal_build'], 'PORTAL_VERSION' => $config['portal_version'], 'READ_ARTICLE_IMG' => $user->img('btn_read_article', 'READ_ARTICLE'), 'POST_COMMENTS_IMG' => $user->img('btn_post_comments', 'POST_COMMENTS'), 'VIEW_COMMENTS_IMG' => $user->img('btn_view_comments', 'VIEW_COMMENTS'), 'SITE_NAME' => $config['sitename'], 'S_USER_LOGGED_IN' => $user->data['user_id'] != ANONYMOUS ? true : false, 'S_SHOW_LEFT_BLOCKS' => $show_left, 'S_SHOW_RIGHT_BLOCKS' => $show_right, 'S_BLOCKS_ENABLED' => $blocks_enabled, 'S_K_FOOTER_IMAGES_ALLOW' => $k_config['k_footer_images_allow'] ? true : false, 'S_CONTENT_FLOW_BEGIN' => $user->lang['DIRECTION'] == 'ltr' ? 'left' : 'right', 'S_CONTENT_FLOW_END' => $user->lang['DIRECTION'] == 'ltr' ? 'right' : 'left', 'USER_NAME' => $user->data['username'], 'USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), 'U_INDEX' => append_sid("{$phpbb_root_path}index.{$phpEx}"), 'U_STAFF' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=leaders'), 'U_SEARCH_BOOKMARKS' => append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'i=main&mode=bookmarks')));
/***
// process common data here //
if ($this_page[0] == 'viewtopic')
{
	global $phpEx, $phpbb_root_path;
	global $config, $user, $template, $k_quick_posting_mode, $forum_id, $post_data, $topic_id, $topic_data, $k_config;

	include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);