|
From: Jon O. <jon...@us...> - 2005-05-26 21:54:18
|
Update of /cvsroot/mxbb/core27x In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4750/core27x Modified Files: index.php mx_forum.php mx_menu_nav.php mx_multiple_blocks.php mx_online.php mx_poll.php Log Message: massive commit, for 2.7.7 http://www.mx-system.com/forum/viewtopic.php?t=6902 Index: mx_poll.php =================================================================== RCS file: /cvsroot/mxbb/core27x/mx_poll.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_poll.php 6 May 2005 06:47:57 -0000 1.1 --- mx_poll.php 26 May 2005 21:54:08 -0000 1.2 *************** *** 146,150 **** // Does this topic contain a poll? // ! //if ( !empty($forum_topic_data['topic_vote']) ) { $s_hidden_fields = ''; --- 146,150 ---- // Does this topic contain a poll? // ! if ( !empty($topic_id) ) { $s_hidden_fields = ''; Index: mx_menu_nav.php =================================================================== RCS file: /cvsroot/mxbb/core27x/mx_menu_nav.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_menu_nav.php 6 May 2005 06:47:57 -0000 1.1 --- mx_menu_nav.php 26 May 2005 21:54:08 -0000 1.2 *************** *** 14,17 **** --- 14,19 ---- ***************************************************************************/ + $mx_root_path = './'; + $block_config = read_block_config($block_id); $title = $block_config[$block_id]['block_title']; *************** *** 24,29 **** else { - // Modded by Jaime - Allow Fold/Unfold Category select - $sql1 = "SELECT cat_id FROM " . MENU_CAT_TABLE . " --- 26,29 ---- *************** *** 37,41 **** $menu_cat_show = $db->sql_fetchrowset($result_show); - for($catrow_count = 0; $catrow_count < count($menu_cat_show); $catrow_count++) { --- 37,40 ---- *************** *** 45,51 **** } - // End of modded by Jaime - Allow Fold/Unfold Category select - - if ( !empty($HTTP_POST_VARS['out']) || !empty($HTTP_GET_VARS['out']) ) { --- 44,47 ---- *************** *** 56,61 **** $show = preg_replace( "/^,/" , "" , $show ); } - - $show_opt = explode(",", $show); --- 52,55 ---- *************** *** 69,73 **** } - $template->set_filenames(array( "body" => 'mx_menu_nav.tpl') --- 63,66 ---- *************** *** 81,84 **** --- 74,78 ---- $s_hidden_fields = '<input type="hidden" name="block_id" value="' . $block_id . '" />'; $s_hidden_fields .= '<input type="hidden" name="portalpage" value="' . $page_id. '" />'; + $s_hidden_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $edit_url = $mx_root_path . "admin/admin_mx_menu.$phpEx?sid=" . $userdata['session_id']; *************** *** 101,213 **** )); ! $sql = "SELECT cat_id, cat_title, cat_desc, bbcode_uid ! FROM " . MENU_CAT_TABLE . " WHERE block_id = $block_id ORDER BY cat_order, cat_id "; ! if ( !($result_cat = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not obtain menu navigation configuration', '', __LINE__, __FILE__, $sql); } ! $menu_cat_config = $db->sql_fetchrowset($result_cat); ! for($catrow_count = 0; $catrow_count < count($menu_cat_config); $catrow_count++) ! { ! $cat_title = $menu_cat_config[$catrow_count]['cat_title']; ! $cat_id = $menu_cat_config[$catrow_count]['cat_id']; ! $cat = ( !empty($lang[$cat_title]) ? $lang[$cat_title] : $cat_title); ! ! $bbcode_uid = $menu_cat_config[$catrow_count]['bbcode_uid']; ! $cat = mx_decode($cat, $bbcode_uid); ! // $cat_icon = ( !empty($menu_nav_config[$row_count]['menu_icon']) ? '<img src="' . PORTAL_URL . 'images/' . $menu_nav_config[$row_count]['menu_icon'] . '" /> ' : '' ); ! if ( in_array($cat_id, $show_opt) ) { ! $cat_desc = ''; ! $cat_icon = '<img border="0" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/minus.gif" /> '; ! $cat_url = append_sid(PORTAL_URL . 'index.'. $phpEx.'?page=' . $page_id. '&show=' . $show . '&out='. $cat_id); } ! else { ! if ( !empty($show) ) { ! $show_lst = $show . "," . $cat_id; } else { ! $show_lst = $cat_id; } ! $cat_desc = $menu_cat_config[$catrow_count]['cat_desc']; ! $cat_desc = mx_decode($cat_desc, $bbcode_uid); ! $cat_icon = '<img border="0" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/plus.gif" /> '; ! $cat_url = append_sid(PORTAL_URL . 'index.'. $phpEx.'?page=' . $page_id. '&show=' .$show_lst); } ! ! $template->assign_block_vars("catrow", array( ! "CATEGORY" => $cat, ! "U_URL" => append_sid(PORTAL_URL . 'index.'.$phpEx.'?block_id=' .$block_id), ! "U_CAT_ICON" => $cat_icon, ! "U_URL_SHOW" => $cat_url, ! "DESCRIPTION" => $cat_desc) ! ); ! ! // Modded by Jaime - Allow page select if ( in_array($cat_id, $show_opt) ) { - $sql = "SELECT menu_id, cat_id, menu_name, menu_desc, menu_links, block_id, function_id, page_id, - auth_view, auth_view_group, link_target, menu_order, bbcode_uid, menu_icon - FROM " . MENU_NAV_TABLE . " WHERE cat_id = " . $cat_id . " ORDER BY menu_order, menu_id "; - // End of modded by Jaime - Allow page select - - if ( !($result = $db->sql_query($sql)) ) - { - mx_message_die(GENERAL_ERROR, 'Could not obtain menu navigation configuration', '', __LINE__, __FILE__, $sql); - } - - $is_auth_ary = array(); - - $menu_nav_config = $db->sql_fetchrowset($result); - - for($row_count = 0; $row_count < count($menu_nav_config); $row_count++) - { - $menu_id = $menu_nav_config[$row_count]['menu_id']; - - // - // Find if user is allowed for view - // - - // mx_message_die(GENERAL_MESSAGE, $menu_nav_config[$row_count]['auth_view_group']); - - $is_auth_ary = menu_auth(AUTH_VIEW, $menu_id , $userdata, $menu_nav_config[$row_count], $menu_nav_config[$row_count]['auth_view_group']); - if ( $is_auth_ary['auth_view'] ) - { - $row_color = ( !($row_count%2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($row_count%2) ) ? $theme['td_class1'] : $theme['td_class2']; ! $action = $menu_nav_config[$row_count]['menu_name']; $action = ( !empty( $lang[$action] ) ? $lang[$action] : $action); ! $desc = $menu_nav_config[$row_count]['menu_desc']; $desc = ( !empty( $lang[$desc] ) ? $lang[$desc] : $desc); ! $bbcode_uid = $menu_nav_config[$row_count]['bbcode_uid']; ! $action = mx_decode($action, $bbcode_uid); ! $menu_icon = ( !empty($menu_nav_config[$row_count]['menu_icon']) ? '<img src="' . PORTAL_URL . TEMPLATE_ROOT_PATH .'images/' . $menu_nav_config[$row_count]['menu_icon'] . '" alt="' . $desc . '" /> ' : '' ); ! // Modded by Jaime - Allow select page ! if ( $menu_nav_config[$row_count]['page_id'] != 0) { ! $menu_link = append_sid('index.php?page=' . $menu_nav_config[$row_count]['page_id']); } ! // End modded by Jaime ! else if ( $menu_nav_config[$row_count]['function_id'] == 0 ) { ! $menu_link = append_sid($menu_nav_config[$row_count]['menu_links']); } ! else if ( $menu_nav_config[$row_count]['block_id'] != 0 ) { ! $menu_link = append_sid('index.php?block=' . $menu_nav_config[$row_count]['block_id']); } else --- 95,201 ---- )); ! $sql = "SELECT * ! FROM " . MENU_CAT_TABLE . " cat, ! " . MENU_NAV_TABLE . " nav ! WHERE cat.block_id = '" . $block_id . "' ! AND cat.cat_id = nav.cat_id ! ORDER BY cat.cat_order, nav.menu_order"; ! if ( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not obtain menu navigation configuration', '', __LINE__, __FILE__, $sql); } ! $mx_nav_data = $db->sql_fetchrowset($result); ! $num_of_menus = count($mx_nav_data); ! $cat_id = 0; ! $num_of_cats = 0; ! for( $menu_count = 0; $menu_count < $num_of_menus; $menu_count++ ) ! { ! $menu_id = $mx_nav_data[$menu_count]['menu_id']; ! // ! // Find if user is allowed for view ! // ! $is_auth_ary = menu_auth(AUTH_VIEW, $menu_id, $userdata, $mx_nav_data[$menu_count], $mx_nav_data[$menu_count]['auth_view_group']); ! ! if ( !$is_auth_ary['auth_view'] ) { ! continue; } ! ! // New category ?? ! if ( $cat_id != $mx_nav_data[$menu_count]['cat_id'] ) { ! $num_of_cats++; ! ! $cat_title = $mx_nav_data[$menu_count]['cat_title']; ! $cat_id = $mx_nav_data[$menu_count]['cat_id']; ! $cat = ( !empty($lang[$cat_title]) ? $lang[$cat_title] : $cat_title); ! ! $bbcode_uid = $mx_nav_data[$menu_count]['bbcode_uid']; ! //$cat = mx_decode($cat, $bbcode_uid); ! ! if ( in_array($cat_id, $show_opt) ) { ! $cat_desc = ''; ! $cat_icon = '<img border="0" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/minus.gif" /> '; ! $cat_url = append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $page_id . '&show=' . $show . '&out=' . $cat_id); } else { ! if ( !empty($show) ) ! { ! $show_lst = $show . "," . $cat_id; ! } ! else ! { ! $show_lst = $cat_id; ! } ! ! $cat_desc = $mx_nav_data[$menu_count]['cat_desc']; ! //$cat_desc = mx_decode($cat_desc, $bbcode_uid); ! $cat_icon = '<img border="0" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/plus.gif" /> '; ! $cat_url = append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $page_id . '&show=' . $show_lst); } ! $template->assign_block_vars("catrow", array( ! "CATEGORY" => $cat, ! "U_URL" => append_sid(PORTAL_URL . 'index.'.$phpEx.'?block_id=' .$block_id), ! "U_CAT_ICON" => $cat_icon, ! "U_URL_SHOW" => $cat_url, ! "DESCRIPTION" => $cat_desc) ! ); } ! ! // Modded by Jaime - Allow page select if ( in_array($cat_id, $show_opt) ) { $row_color = ( !($row_count%2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($row_count%2) ) ? $theme['td_class1'] : $theme['td_class2']; ! $action = $mx_nav_data[$menu_count]['menu_name']; $action = ( !empty( $lang[$action] ) ? $lang[$action] : $action); ! $desc = $mx_nav_data[$menu_count]['menu_desc']; $desc = ( !empty( $lang[$desc] ) ? $lang[$desc] : $desc); ! $bbcode_uid = $mx_nav_data[$menu_count]['bbcode_uid']; ! //$action = mx_decode($action, $bbcode_uid); ! $menu_icon = ( !empty($mx_nav_data[$menu_count]['menu_icon']) ? '<img src="' . PORTAL_URL . TEMPLATE_ROOT_PATH .'images/' . $mx_nav_data[$menu_count]['menu_icon'] . '" alt="' . $desc . '" /> ' : '' ); ! if ( $mx_nav_data[$menu_count]['page_id'] != 0) { ! $menu_link = append_sid('index.php?page=' . $mx_nav_data[$menu_count]['page_id']); } ! else if ( $mx_nav_data[$menu_count]['function_id'] == 0 ) { ! $menu_link = append_sid($mx_nav_data[$menu_count]['menu_links']); } ! else if ( $mx_nav_data[$menu_count]['block_id'] != 0 ) { ! $menu_link = append_sid('index.php?block=' . $mx_nav_data[$menu_count]['block_id']); } else *************** *** 216,220 **** FROM " . FUNCTION_TABLE . " fnc, " . MODULE_TABLE . " modu ! WHERE fnc.function_id = " . $menu_nav_config[$row_count]['function_id'] . " AND fnc.module_id = modu.module_id"; --- 204,208 ---- FROM " . FUNCTION_TABLE . " fnc, " . MODULE_TABLE . " modu ! WHERE fnc.function_id = " . $mx_nav_data[$menu_count]['function_id'] . " AND fnc.module_id = modu.module_id"; *************** *** 225,233 **** $row = $db->sql_fetchrow($result); - $menu_link = append_sid($row['module_path'] . $row['function_file']); } ! $link_target = ($menu_nav_config[$row_count]['link_target'] == 0) ? '' : '_blank'; $template->assign_block_vars("catrow.modulerow", array( --- 213,220 ---- $row = $db->sql_fetchrow($result); $menu_link = append_sid($row['module_path'] . $row['function_file']); } ! $link_target = ($mx_nav_data[$menu_count]['link_target'] == 0) ? '' : '_blank'; $template->assign_block_vars("catrow.modulerow", array( *************** *** 240,245 **** "U_MENU_ICON" => $menu_icon) ); - } - } } } --- 227,230 ---- Index: mx_online.php =================================================================== RCS file: /cvsroot/mxbb/core27x/mx_online.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_online.php 6 May 2005 06:47:57 -0000 1.1 --- mx_online.php 26 May 2005 21:54:08 -0000 1.2 *************** *** 24,28 **** } - // ================================================================================ // The following code is backported from includes/page_header.php (phpBB 2.0.13) --- 24,27 ---- *************** *** 39,203 **** $l_online_users = ''; ! //if (defined('SHOW_ONLINE')) ! { ! ! ! $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip ! FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s ! WHERE u.user_id = s.session_user_id ! AND s.session_time >= ".( time() - 300 ) . " ! ORDER BY u.username ASC, s.session_ip ASC"; ! if( !($result = $db->sql_query($sql)) ) ! { ! message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql); ! } ! $userlist_ary = array(); ! $userlist_visible = array(); ! $prev_user_id = 0; ! $prev_user_ip = $prev_session_ip = ''; ! while( $row = $db->sql_fetchrow($result) ) { ! // User is logged in and therefor not a guest ! if ( $row['session_logged_in'] ) { ! // Skip multiple sessions for one user ! if ( $row['user_id'] != $prev_user_id ) { ! $style_color = ''; ! if ( $row['user_level'] == ADMIN ) ! { ! $row['username'] = '<b>' . $row['username'] . '</b>'; ! $style_color = 'style="color:#' . $theme['fontcolor3'] . '"'; ! } ! else if ( $row['user_level'] == MOD ) ! { ! $row['username'] = '<b>' . $row['username'] . '</b>'; ! $style_color = 'style="color:#' . $theme['fontcolor2'] . '"'; ! } ! ! if ( $row['user_allow_viewonline'] ) ! { ! $user_online_link = '<a href="' . append_sid(PHPBB_URL."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>'; ! $logged_visible_online++; ! } ! else ! { ! $user_online_link = '<a href="' . append_sid(PHPBB_URL."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>'; ! $logged_hidden_online++; ! } ! ! if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN ) ! { ! $online_userlist .= ( $online_userlist != '' ) ? ', ' . $user_online_link : $user_online_link; ! } } ! ! $prev_user_id = $row['user_id']; ! } ! else ! { ! // Skip multiple sessions for one user ! if ( $row['session_ip'] != $prev_session_ip ) { ! $guests_online++; } } ! $prev_session_ip = $row['session_ip']; } ! $db->sql_freeresult($result); ! ! if ( empty($online_userlist) ) { ! $online_userlist = $lang['None']; } ! $online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist; ! ! $total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online; ! if ( $total_online_users > $board_config['record_online_users']) ! { ! $board_config['record_online_users'] = $total_online_users; ! $board_config['record_online_date'] = time(); ! $sql = "UPDATE " . CONFIG_TABLE . " ! SET config_value = '$total_online_users' ! WHERE config_name = 'record_online_users'"; ! if ( !$db->sql_query($sql) ) ! { ! message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql); ! } ! $sql = "UPDATE " . CONFIG_TABLE . " ! SET config_value = '" . $board_config['record_online_date'] . "' ! WHERE config_name = 'record_online_date'"; ! if ( !$db->sql_query($sql) ) ! { ! message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql); ! } ! } ! if ( $total_online_users == 0 ) ! { ! $l_t_user_s = $lang['Online_users_zero_total']; ! } ! else if ( $total_online_users == 1 ) ! { ! $l_t_user_s = $lang['Online_user_total']; ! } ! else { ! $l_t_user_s = $lang['Online_users_total']; } ! if ( $logged_visible_online == 0 ) ! { ! $l_r_user_s = $lang['Reg_users_zero_total']; ! } ! else if ( $logged_visible_online == 1 ) ! { ! $l_r_user_s = $lang['Reg_user_total']; ! } ! else { ! $l_r_user_s = $lang['Reg_users_total']; } ! if ( $logged_hidden_online == 0 ) ! { ! $l_h_user_s = $lang['Hidden_users_zero_total']; ! } ! else if ( $logged_hidden_online == 1 ) ! { ! $l_h_user_s = $lang['Hidden_user_total']; ! } ! else ! { ! $l_h_user_s = $lang['Hidden_users_total']; ! } ! if ( $guests_online == 0 ) ! { ! $l_g_user_s = $lang['Guest_users_zero_total']; ! } ! else if ( $guests_online == 1 ) ! { ! $l_g_user_s = $lang['Guest_user_total']; ! } ! else ! { ! $l_g_user_s = $lang['Guest_users_total']; ! } ! $l_online_users = sprintf($l_t_user_s, $total_online_users); ! $l_online_users .= sprintf($l_r_user_s, $logged_visible_online); ! $l_online_users .= sprintf($l_h_user_s, $logged_hidden_online); ! $l_online_users .= sprintf($l_g_user_s, $guests_online); } // ================================================================================ // The following code is backported from index.php (phpBB 2.0.13) --- 38,194 ---- $l_online_users = ''; ! $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip ! FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s ! WHERE u.user_id = s.session_user_id ! AND s.session_time >= ".( time() - 300 ) . " ! ORDER BY u.username ASC, s.session_ip ASC"; ! if( !($result = $db->sql_query($sql)) ) ! { ! message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql); ! } ! $userlist_ary = array(); ! $userlist_visible = array(); ! $prev_user_id = 0; ! $prev_user_ip = $prev_session_ip = ''; ! while( $row = $db->sql_fetchrow($result) ) ! { ! // User is logged in and therefor not a guest ! if ( $row['session_logged_in'] ) { ! // Skip multiple sessions for one user ! if ( $row['user_id'] != $prev_user_id ) { ! $style_color = ''; ! if ( $row['user_level'] == ADMIN ) { ! $row['username'] = '<b>' . $row['username'] . '</b>'; ! $style_color = 'style="color:#' . $theme['fontcolor3'] . '"'; } ! else if ( $row['user_level'] == MOD ) { ! $row['username'] = '<b>' . $row['username'] . '</b>'; ! $style_color = 'style="color:#' . $theme['fontcolor2'] . '"'; ! } ! if ( $row['user_allow_viewonline'] ) ! { ! $user_online_link = '<a href="' . append_sid(PHPBB_URL."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>'; ! $logged_visible_online++; ! } ! else ! { ! $user_online_link = '<a href="' . append_sid(PHPBB_URL."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>'; ! $logged_hidden_online++; ! } ! if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN ) ! { ! $online_userlist .= ( $online_userlist != '' ) ? ', ' . $user_online_link : $user_online_link; } } ! $prev_user_id = $row['user_id']; } ! else { ! // Skip multiple sessions for one user ! if ( $row['session_ip'] != $prev_session_ip ) ! { ! $guests_online++; ! } } ! $prev_session_ip = $row['session_ip']; ! } ! $db->sql_freeresult($result); ! if ( empty($online_userlist) ) ! { ! $online_userlist = $lang['None']; ! } ! $online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist; ! $total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online; ! if ( $total_online_users > $board_config['record_online_users']) ! { ! $board_config['record_online_users'] = $total_online_users; ! $board_config['record_online_date'] = time(); ! $sql = "UPDATE " . CONFIG_TABLE . " ! SET config_value = '$total_online_users' ! WHERE config_name = 'record_online_users'"; ! if ( !$db->sql_query($sql) ) { ! message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql); } ! $sql = "UPDATE " . CONFIG_TABLE . " ! SET config_value = '" . $board_config['record_online_date'] . "' ! WHERE config_name = 'record_online_date'"; ! if ( !$db->sql_query($sql) ) { ! message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql); } + } ! if ( $total_online_users == 0 ) ! { ! $l_t_user_s = $lang['Online_users_zero_total']; ! } ! else if ( $total_online_users == 1 ) ! { ! $l_t_user_s = $lang['Online_user_total']; ! } ! else ! { ! $l_t_user_s = $lang['Online_users_total']; ! } ! if ( $logged_visible_online == 0 ) ! { ! $l_r_user_s = $lang['Reg_users_zero_total']; ! } ! else if ( $logged_visible_online == 1 ) ! { ! $l_r_user_s = $lang['Reg_user_total']; ! } ! else ! { ! $l_r_user_s = $lang['Reg_users_total']; ! } ! if ( $logged_hidden_online == 0 ) ! { ! $l_h_user_s = $lang['Hidden_users_zero_total']; ! } ! else if ( $logged_hidden_online == 1 ) ! { ! $l_h_user_s = $lang['Hidden_user_total']; ! } ! else ! { ! $l_h_user_s = $lang['Hidden_users_total']; ! } ! ! if ( $guests_online == 0 ) ! { ! $l_g_user_s = $lang['Guest_users_zero_total']; ! } ! else if ( $guests_online == 1 ) ! { ! $l_g_user_s = $lang['Guest_user_total']; ! } ! else ! { ! $l_g_user_s = $lang['Guest_users_total']; } + $l_online_users = sprintf($l_t_user_s, $total_online_users); + $l_online_users .= sprintf($l_r_user_s, $logged_visible_online); + $l_online_users .= sprintf($l_h_user_s, $logged_hidden_online); + $l_online_users .= sprintf($l_g_user_s, $guests_online); + // ================================================================================ // The following code is backported from index.php (phpBB 2.0.13) Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core27x/index.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.php 6 May 2005 06:47:57 -0000 1.1 --- index.php 26 May 2005 21:54:08 -0000 1.2 *************** *** 34,152 **** // // // ! $cache_dir = $mx_root_path . 'cache/'; - if ( $HTTP_SESSION_VARS['cache_read'] != TRUE && file_exists($cache_dir . 'block_config.xml') ) - { - include_once($mx_root_path . "cache/mx_cache.php"); // file of easy_parser class - read_cache_config(); - } // ! // End session management // ! $view_page = FALSE; // ! // Load default header // - $page_id = $mx_request_vars->request('page', MX_TYPE_INT, 1); - - $page_row = get_info(PAGE_TABLE, "page_id", $page_id); - $page_title .= $page_row['page_name']; include($mx_root_path . 'includes/page_header.'.$phpEx); ! $is_auth_ary = array(); ! $is_auth_ary = page_auth(AUTH_VIEW, $userdata, $page_row['auth_view'], $page_row['auth_view_group'] ); ! ! if ( ! $is_auth_ary['auth_view'] ) ! { ! $message = empty($lang['Page_Not_Authorised']) ? "Sorry, but you don't have privilege to access this page." : $lang['Page_Not_Authorised']; ! mx_message_die(GENERAL_MESSAGE, $message, "", __LINE__, __FILE__, ""); ! } ! ! if ( !empty($HTTP_SESSION_VARS['page_column_' . $page_id]) ) ! { ! $column_rows = $HTTP_SESSION_VARS['page_column_' . $page_id]; ! $total_column = count($HTTP_SESSION_VARS['page_column_' . $page_id]); ! } ! else { ! $sql = "SELECT col.column_id, col.column_title, col.column_order, col.column_size ! FROM " . COLUMN_TABLE . " col ! WHERE page_id = $page_id ! ORDER BY column_order"; ! if( !$q_column = $db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not query column list", "", __LINE__, __FILE__, $sql); ! } ! ! if( $total_column = $db->sql_numrows($q_column) ) ! { ! $column_rows = $db->sql_fetchrowset($q_column); ! } ! $HTTP_SESSION_VARS['page_column_' . $page_id] = $column_rows; } ! ! if ( !empty($HTTP_SESSION_VARS['page_block_' . $page_id]) ) { ! $block_rows = $HTTP_SESSION_VARS['page_block_' . $page_id]; ! $total_block = count( $HTTP_SESSION_VARS['page_block_' . $page_id] ); } - else - { - $sql = "SELECT blk.block_id, blk.auth_view_group, blk.auth_edit_group, bct.column_id, module_path, function_file, auth_view - FROM " . COLUMN_BLOCK_TABLE . " bct, - " . BLOCK_TABLE . " blk, - " . FUNCTION_TABLE . " fnc, - " . MODULE_TABLE . " modu - WHERE blk.function_id = fnc.function_id - AND blk.block_id = bct.block_id - AND fnc.module_id = modu.module_id - ORDER BY column_id, block_order"; - // AND bct.column_id = " . $column_rows[$column]['column_id'] . " - if( !$q_modules = $db->sql_query($sql) ) - { - mx_message_die(GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql); - } ! if( $total_block = $db->sql_numrows($q_modules) ) ! { ! $block_rows = $db->sql_fetchrowset($q_modules); ! $HTTP_SESSION_VARS['page_block_' . $page_id] = $block_rows; ! } ! } ECHO '<table border="0" cellspacing="4" cellpadding="0" width="100%"><tr valign="top">'; ! for($column = 0; $column < $total_column; $column++) { ! $block_size = $column_rows[$column]['column_size']; ECHO '<td width="' . $block_size . '" >'; ! for($block = 0; $block < $total_block; $block++) { ! if ( $column_rows[$column]['column_id'] == $block_rows[$block]['column_id'] ) { // // Find which blocks are visible for this user // ! $block_id = $block_rows[$block]['block_id']; ! $block_row = get_info(BLOCK_TABLE, "block_id", $block_id); ! ! $is_auth_ary = array(); ! $is_auth_ary = block_auth(AUTH_VIEW, $block_id, $userdata, $block_rows[$block], $block_row['auth_view_group']); ! if ( $is_auth_ary['auth_view'] ) { ! $template = new Template($template->root, $board_config, $db); ! ! $module_root_path = $block_rows[$block]['module_path']; ! $block_file = $block_rows[$block]['function_file']; include( $module_root_path . $block_file ); } --- 34,107 ---- // + // End session management // + $view_page = FALSE; + // ! // Page selector ! // ! $page_id = $mx_request_vars->request('page', MX_TYPE_INT, 1); // ! // Load page and block classes // + $portal_config['mx_use_cache'] = 1; + $mx_page = new mx_page(); + $mx_page->init( $page_id ); ! $mx_block = new mx_block(); // ! // ...and define some basic vars // + $page_title .= $mx_page->info['page_name']; + $page_icon = $mx_page->info['page_icon']; + $page_ov_header = $mx_page->info['page_header']; include($mx_root_path . 'includes/page_header.'.$phpEx); ! // ! // Page auth ! // ! if ( !$mx_page->auth_view && $userdata['session_logged_in'] ) { ! $message = empty( $lang['Page_Not_Authorised'] ) ? "Sorry, but you don't have privilege to access this page." : $lang['Page_Not_Authorised']; ! mx_message_die(GENERAL_MESSAGE, $message, '', __LINE__, __FILE__, ''); } ! elseif ( !$mx_page->auth_view && !$userdata['session_logged_in'] ) { ! mx_redirect( append_sid( $mx_root_path . "login.$phpEx?redirect=" . mx_this_url(), true ) ); } ! // ! // Output ! // ECHO '<table border="0" cellspacing="4" cellpadding="0" width="100%"><tr valign="top">'; ! for( $column = 0; $column < $mx_page->total_column; $column++ ) { ! $block_size = $mx_page->columns[$column]['column_size']; ECHO '<td width="' . $block_size . '" >'; ! for( $block = 0; $block < $mx_page->total_block; $block++ ) { ! if ( $mx_page->columns[$column]['column_id'] == $mx_page->blocks[$block]['column_id'] ) { // // Find which blocks are visible for this user // ! $block_id = $mx_page->blocks[$block]['block_id']; ! $mx_block->init( $block_id ); ! if ( $mx_block->auth_view ) { ! $template = new mx_Template($template->root, $board_config, $db); + $module_root_path = $mx_block->module_root_path; + $block_file = $mx_block->block_file; + include( $module_root_path . $block_file ); } Index: mx_multiple_blocks.php =================================================================== RCS file: /cvsroot/mxbb/core27x/mx_multiple_blocks.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_multiple_blocks.php 6 May 2005 06:47:57 -0000 1.1 --- mx_multiple_blocks.php 26 May 2005 21:54:08 -0000 1.2 *************** *** 36,39 **** --- 36,41 ---- echo '<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr>'; + $mx_split_block = new mx_block(); + for ($cell=0;$cell<$nested_block_count;$cell++) { $inner_block_id=$block_ids[$cell]; *************** *** 44,47 **** --- 46,50 ---- echo '<td width="'.$inner_block_size.'" valign="top"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td>'; + /* // get the necessary info about this block $sql = "SELECT blk.block_id, module_path, function_file, auth_view *************** *** 57,64 **** } $block_row = $db->sql_fetchrow($block_result); ! $module_root_path=$block_row['module_path']; ! $block_file=$block_row['function_file']; ! $auth_view=$row['auth_view']; // check visibility (code from index.php) $is_auth_ary = array(); --- 60,89 ---- } $block_row = $db->sql_fetchrow($block_result); ! */ ! // $module_root_path=$block_row['module_path']; ! // $block_file=$block_row['function_file']; ! // $auth_view=$row['auth_view']; ! ! $block_id = $inner_block_id; ! $mx_split_block->init( $inner_block_id ); ! $block_size='100%'; ! ! if ( $mx_split_block->auth_view ) ! { ! $template = new mx_Template($template->root, $board_config, $db); ! ! $module_root_path = $mx_split_block->module_root_path; ! $block_file = $mx_split_block->block_file; ! ! include( $module_root_path . $block_file ); ! ! // output additional space between blocks if it is not the last block ! if ($cell<$nested_block_count-1) { ! echo '</td><td width="'.$block_space.'">'; ! echo '<img src="templates/spacer.gif" width="'.$block_space.'">'; ! } ! } + /* // check visibility (code from index.php) $is_auth_ary = array(); *************** *** 71,77 **** $block_id=$inner_block_id; $block_size='100%'; - // echo $module_root_path.$block_file; ! $template = new Template( $template->root, $board_config, $db); include($module_root_path . $block_file ); --- 96,101 ---- $block_id=$inner_block_id; $block_size='100%'; ! $template = new mx_Template( $template->root, $board_config, $db); include($module_root_path . $block_file ); *************** *** 82,85 **** --- 106,110 ---- } } + */ // finish the inner placement table for a single block echo '</td></tr></table></td>'; Index: mx_forum.php =================================================================== RCS file: /cvsroot/mxbb/core27x/mx_forum.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_forum.php 6 May 2005 06:47:57 -0000 1.1 --- mx_forum.php 26 May 2005 21:54:08 -0000 1.2 *************** *** 81,84 **** --- 81,85 ---- // removing them // + /* $total_posts = get_db_stat('postcount'); $total_users = get_db_stat('usercount'); *************** *** 87,90 **** --- 88,92 ---- $newest_uid = $newest_userdata['user_id']; + if( $total_posts == 0 ) { *************** *** 112,116 **** $l_total_user_s = $lang['Registered_users_total']; } ! // --- 114,118 ---- $l_total_user_s = $lang['Registered_users_total']; } ! */ // *************** *** 264,270 **** $template->assign_vars(array( 'BLOCK_SIZE' => $block_size, ! 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), ! 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users), ! 'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid( PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'), 'FORUM_IMG' => $images['forum'], --- 266,272 ---- $template->assign_vars(array( 'BLOCK_SIZE' => $block_size, ! //'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), ! //'TOTAL_USERS' => sprintf($l_total_user_s, $total_users), ! //'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid( PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'), 'FORUM_IMG' => $images['forum'], |