|
From: Jon O. <jon...@us...> - 2007-07-21 23:07:20
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25016/includes Modified Files: mx_functions_admincp.php mx_functions_core.php page_tail.php Log Message: Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** mx_functions_core.php 12 Jul 2007 22:42:26 -0000 1.49 --- mx_functions_core.php 21 Jul 2007 23:07:15 -0000 1.50 *************** *** 365,368 **** --- 365,370 ---- $sql = "SELECT col.page_id, pag.page_name, + pag.page_parent, + pag.parents_data, pag.page_icon, pag.page_alt_icon, *************** *** 412,415 **** --- 414,419 ---- "page_id" => $row['page_id'], "page_name" => $row['page_name'], + "page_parent" => $row['page_parent'], + "parent_data" => $row['parents_data'], "page_icon" => $row['page_icon'], "page_alt_icon" => $row['page_alt_icon'], *************** *** 2454,2458 **** * * Examples: ! * - $mx_page->init($block_id) * - $mx_page->kill_me() * - $mx_page->output_column($column) --- 2458,2462 ---- * * Examples: ! * - $mx_page->init($page_id) * - $mx_page->kill_me() * - $mx_page->output_column($column) *************** *** 2475,2478 **** --- 2479,2498 ---- /**#@+ + * Core data containers. + * + * @access public + * @var array + */ + var $page_rowset = array(); + var $subpage_rowset = array(); + var $total_page = 0; + + var $modified = false; + var $error = array(); + + var $navigation = ''; + /**#@-*/ + + /**#@+ * Page data containers. * *************** *** 2517,2520 **** --- 2537,2580 ---- // Constructor // + /** + * Init CORE/page. + * + * @access public + * @param integer $page_id + * @param boolean $force_query + */ + function init( $page_id, $force_query = false ) + { + global $db, $userdata, $debug, $portal_config, $mx_cache; + + unset( $this->page_rowset ); + unset( $this->subpage_rowset ); + + $sql = 'SELECT * + FROM ' . PAGE_TABLE . ' + ORDER BY page_parent, page_order ASC'; + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt Query pages info', '', __LINE__, __FILE__, $sql ); + } + $page_rowset = $db->sql_fetchrowset( $result ); + + $db->sql_freeresult( $result ); + + for( $i = 0; $i < count( $page_rowset ); $i++ ) + { + $this->page_rowset[$page_rowset[$i]['page_id']] = $page_rowset[$i]; + $this->subpage_rowset[$page_rowset[$i]['page_parent']][$page_rowset[$i]['page_id']] = $page_rowset[$i]; + $this->total_page++; + } + + // + // Load page data + // + $this->page_id = $page_id; + $this->page_config = $mx_cache->read( $this->page_id, MX_CACHE_PAGE_TYPE, $force_query ); + $this->_set_all(); + } // ------------------------------ *************** *** 2523,2526 **** --- 2583,2669 ---- /** + * Clean up + * @access private + */ + function _core() + { + if ( $this->modified ) + { + $this->sync_all(); + } + } + + /** + * Sync All. + * @access private + */ + function sync_all() + { + foreach( $this->page_rowset as $page_id => $void ) + { + $this->sync( $page_id, false ); + } + $this->init(); + } + + /** + * Do Sync + * + * @access private + * @param unknown_type $page_id + * @param unknown_type $init + */ + function sync( $page_id, $init = true ) + { + global $db; + + $page_nav = array(); + $this->core_nav( $this->page_rowset[$cat_id]['page_parent'], &$page_nav ); + + $sql = 'UPDATE ' . PAGE_TABLE . " + SET parents_data = '' + WHERE page_parent = " . $this->page_rowset[$page_id]['page_parent']; + + if ( !( $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Couldnt Query pages info', '', __LINE__, __FILE__, $sql ); + } + + if ( $init ) + { + $this->init(); + } + return; + } + + /** + * Navigation data + * + * @access public + * @param unknown_type $parent_id + * @param unknown_type $page_nav + */ + function core_nav( $parent_id, &$page_nav ) + { + if ( !empty( $this->page_rowset[$parent_id] ) ) + { + $this->core_nav( $this->page_rowset[$parent_id]['page_parent'], &$page_nav ); + $page_nav[$parent_id] = $this->page_rowset[$parent_id]['page_name']; + } + return; + } + + /** + * Is modified + * + * @access public + * @param unknown_type $true_false + */ + function modified( $true_false = false ) + { + $this->modified = $true_false; + } + + /** * Initiate and load page data * @access private *************** *** 2529,2532 **** --- 2672,2676 ---- { global $userdata, $mx_root_path, $HTTP_GET_VARS, $HTTP_COOKIE_VARS, $portal_config, $theme, $lang; + global $mx_block; $this->info = $this->page_config[$this->page_id]['page_info']; *************** *** 2619,2649 **** /** ! * Init page. * * @access public - * @param integer $page_id - * @param boolean $force_query */ ! function init( $page_id, $force_query = false ) { global $mx_cache; ! $this->page_id = $page_id; ! $this->page_config = $mx_cache->read( $this->page_id, MX_CACHE_PAGE_TYPE, $force_query ); ! $this->_set_all(); } /** ! * Kill me. * ! * Unset and unload all page data * * @access public */ ! function kill_me() { ! global $mx_cache; ! $this->page_config = ''; } --- 2763,2874 ---- /** ! * Kill me. ! * ! * Unset and unload all page data * * @access public */ ! function kill_me() { global $mx_cache; ! $this->page_config = ''; } /** ! * Jump menu function. * ! * @access public ! * @param unknown_type $page_id to handle parent page_id ! * @param unknown_type $depth related to function to generate tree ! * @param unknown_type $default the page you wanted to be selected ! * @return unknown ! */ ! function generate_jumpbox( $page_id = 0, $depth = 0, $default = '' ) ! { ! $page_list .= ''; ! ! $pre = str_repeat( ' ', $depth ); ! ! if ( !empty( $this->page_rowset ) ) ! { ! foreach ( $this->page_rowset as $temp_page_id => $page ) ! { ! if ( $page['page_parent'] == $page_id ) ! { ! if ( is_array( $default ) ) ! { ! if ( isset( $default[$page['page_id']] ) ) ! { ! $sel = ' selected="selected"'; ! } ! else ! { ! $sel = ''; ! } ! } ! $page_pre = '+ '; ! $sub_page_id = $page['page_id']; ! $page_class = ''; ! $page_list .= '<option value="' . $sub_page_id . '"' . $sel . ' ' . $page_class . ' />' . $pre . $page_pre . $page['page_name'] . (!empty($page['page_desc']) ? ' (' . $page['page_desc'] . ')' : '') . '</option>'; ! $page_list .= $this->generate_jumpbox( $page['page_id'], $depth + 1, $default ); ! } ! } ! return $page_list; ! } ! else ! { ! return; ! } ! } ! ! /** ! * Generate_navigation. ! * ! * Not in use... * * @access public + * @param unknown_type $page_id */ ! function generate_navigation( $page_id ) { ! global $template, $db; ! if ( $this->page_rowset[$page_id]['parents_data'] == '' ) ! { ! $page_nav = array(); ! $this->core_nav( $this->page_rowset[$page_id]['page_parent'], &$page_nav ); ! ! $sql = 'UPDATE ' . PAGE_TABLE . " ! SET parents_data = '" . addslashes( serialize( $page_nav ) ) . "' ! WHERE page_parent = " . $this->page_rowset[$page_id]['page_parent']; ! ! if ( !( $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Couldnt Query pages info', '', __LINE__, __FILE__, $sql ); ! } ! } ! else ! { ! $page_nav = unserialize( stripslashes( $this->page_rowset[$page_id]['parents_data'] ) ); ! } ! ! if ( !empty( $page_nav ) ) ! { ! foreach ( $page_nav as $parent_page_id => $parent_name ) ! { ! $template->assign_block_vars( 'navlinks', array( ! 'PAGE_NAME' => $parent_name, ! 'U_VIEW_PAGE' => append_sid( $this->this_mxurl( 'page=' . $parent_page_id ) ) ) ! ); ! } ! } ! ! $template->assign_block_vars( 'navlinks', array( ! 'PAGE_NAME' => $this->page_rowset[$page_id]['page_name'], ! 'U_VIEW_PAGE' => append_sid( $this->this_mxurl( 'page=' . $this->page_rowset[$page_id]['page_id'] ) ) ) ! ); ! ! return; } *************** *** 2827,2833 **** * * @access private * @return array */ ! function auth() { global $db, $lang, $userdata; --- 3052,3061 ---- * * @access private + * @param unknown_type $auth_data + * @param unknown_type $group_data + * @param unknown_type $moderator_data * @return array */ ! function auth($auth_data = '', $group_data = '', $moderator_data = '') { global $db, $lang, $userdata; *************** *** 2842,2846 **** for( $i = 0; $i < count($auth_fields); $i++ ) { ! switch( $this->info[$auth_fields[$i]] ) { case AUTH_ALL: --- 3070,3081 ---- for( $i = 0; $i < count($auth_fields); $i++ ) { ! // ! // Fix for making this method useful also other pages, not only current one. ! // ! $auth_data = !empty($auth_data) ? $auth_data : $this->info[$auth_fields[$i]]; ! $group_data = !empty($group_data) ? $group_data : $this->info[$auth_fields_groups[$i]]; ! $moderator_data = !empty($moderator_data) ? $moderator_data : $this->info['page_auth_moderator_group']; ! ! switch( $auth_data ) { case AUTH_ALL: *************** *** 2860,2869 **** case AUTH_ACL: // PRIVATE ! $auth_user[$auth_label[$i]] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($this->info[$auth_fields_groups[$i]]) || $is_admin : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $auth_user[$auth_label[$i]] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($this->info['page_auth_moderator_group']) || $is_admin : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Moderators']; break; --- 3095,3104 ---- case AUTH_ACL: // PRIVATE ! $auth_user[$auth_label[$i]] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($group_data) || $is_admin : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $auth_user[$auth_label[$i]] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($moderator_data) || $is_admin : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Moderators']; break; *************** *** 2882,2886 **** // // Is user a moderator? ! $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($this->info['page_auth_moderator_group']) || $is_admin : 0; return $auth_user; --- 3117,3121 ---- // // Is user a moderator? ! $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($moderator_data) || $is_admin : 0; return $auth_user; *************** *** 3244,3246 **** --- 3479,3797 ---- } // class mx_request_vars + + class temp + { + + /** + * get_sub_cat. + * + * get all sub category in side certain category + * - used when listing files/articles/links etc + * + * @param unknown_type $cat_id + * @return unknown + */ + function get_sub_cat( $cat_id ) + { + global $mx_root_path, $module_root_path, $is_block, $phpEx; + + $cat_sub = ''; + if ( !empty( $this->subpage_rowset[$cat_id] ) ) + { + $class = "gensmall"; + $init_link_max = ( count( $this->subpage_rowset[$cat_id] ) > 3 ) ? 3 : count( $this->subpage_rowset[$cat_id] ); + $truncate = false; + $i = 0; + foreach( $this->subpage_rowset[$cat_id] as $cat_id => $cat_row ) + { + if ( $this->auth_user[$cat_row['cat_id']]['auth_view'] && ( $cat_row['cat_allow_file'] || !empty( $this->subpage_rowset[$cat_row['cat_id']] ) ) ) + { + $i++; + if ($i > $init_link_max) + { + $truncate = true; + break; + } + $cat_sub .= (!empty($cat_sub) ? '<span class=' . $class . '>, </span>' : '') . '<a href="' . append_sid( $this->this_mxurl( 'action=category&cat_id=' . $cat_row['cat_id'] ) ) . '" class=' . $class . '>' . $cat_row['cat_name'] . '</a>'; + } + /* + else + { + if ( !empty( $this->subpage_rowset[$cat_row['cat_id']] ) ) + { + foreach( $this->subpage_rowset[$cat_row['cat_id']] as $sub_cat_id => $sub_cat_row ) + { + if ( $sub_cat_row['cat_allow_file'] ) + { + $i++; + if ($i > $init_link_max) + { + $truncate = true; + break; + } + $cat_sub .= (!empty($cat_sub) ? '<span class=' . $class . '>, </span>' : '') . '<a href="' . append_sid( $this->this_mxurl( 'action=category&cat_id=' . $sub_cat_row['cat_id'] ) ) . '" class=' . $class . '>' . $sub_cat_row['cat_name'] . '</a>'; + } + } + } + } + */ + } + + if ($truncate) + { + $cat_sub .= '<span class=' . $class . '>, ...</span>'; + } + } + return $cat_sub; + } + + /** + * display_categories. + * + * @param unknown_type $cat_id + */ + function display_categories( $cat_id = PA_ROOT_CAT ) + { + global $db, $pafiledb_template, $lang, $userdata, $phpEx, $images; + global $pafiledb_config, $board_config, $debug; + + if ( $this->cat_empty() ) + { + if ( !$userdata['session_logged_in'] ) + { + $redirect = ( $cat_id != PA_ROOT_CAT ) ? $this->this_mxurl( "action=category&cat_id=$cat_id" ) : $this->this_mxurl(); + redirect( append_sid( "login.$phpEx?redirect=$redirect", true ) ); + } + mx_message_die( GENERAL_ERROR, 'Either you are not allowed to view any category, or there is no category in the database' ); + } + + $pafiledb_template->assign_vars( array( + 'CAT_NAV_SIMPLE' => true, + 'L_SUB_CAT' => $lang['Sub_category'], + 'L_CATEGORY' => $lang['Category'], + 'L_LAST_FILE' => $lang['Last_file'], + 'L_FILES' => $lang['Files'] ) + ); + + // + // Output the categories + // + if ( isset( $this->subpage_rowset[$cat_id] ) ) + { + $catnum = count($this->subpage_rowset[$cat_id]); + $catcol = $pafiledb_config['cat_col'] > 0 ? $pafiledb_config['cat_col'] : 1; + $num_of_rows = intval( $catnum / $catcol ); + + if ( $catnum % $catcol ) + { + $num_of_rows++; + } + + $pafiledb_template->assign_vars( array( 'WIDTH' => 100 / $catcol ) ); + $i = 0; + + foreach( $this->subpage_rowset[$cat_id] as $subcat_id => $subcat_row ) + { + if ( $i == 0 || $i == $catcol) + { + $pafiledb_template->assign_block_vars( 'catcol', array() ); + $i = 0; + } + $i++; + + $last_file_info = array(); + $this->last_item_in_cat( $subcat_id, $last_file_info ); + + if ( !empty( $last_file_info['file_id'] ) && $this->auth_user[$subcat_id]['auth_read'] ) + { + $last_file_time = create_date( $board_config['default_dateformat'], $last_file_info['file_time'], $board_config['board_timezone'] ); + $last_file = $last_file_time . '<br />'; + $last_file_name = ( strlen( stripslashes( $last_file_info['file_name'] ) ) > 20 ) ? substr( stripslashes( $last_file_info['file_name'] ), 0, 20 ) . '...' : stripslashes( $last_file_info['file_name'] ); + $last_file .= '<a href="' . append_sid( $this->this_mxurl( 'action=file&file_id=' . $last_file_info['file_id'] ) ) . '" alt="' . stripslashes( $last_file_info['file_name'] ) . '" title="' . stripslashes( $last_file_info['file_name'] ) . '">' . $last_file_name . '</a> '; + $last_file .= '<a href="' . append_sid( $this->this_mxurl( 'action=file&file_id=' . $last_file_info['file_id'] ) ) . '"><img src="' . $images['pa_icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_file'] . '" title="' . $lang['View_latest_file'] . '" /></a>'; + } + else + { + $last_file = $lang['No_file']; + } + + $is_new = false; + if ( $this->new_item_in_cat( $subcat_id ) ) + { + $is_new = true; + } + + $sub_cat = $this->get_sub_cat( $subcat_id ); + $pafiledb_template->assign_block_vars( 'catcol.no_cat_parent', array( + 'U_CAT' => append_sid( $this->this_mxurl( 'action=category&cat_id=' . $subcat_id ) ), + 'SUB_CAT' => ( !empty( $sub_cat ) ) ? " $sub_cat" : "", + 'CAT_IMAGE' => ( $is_new ) ? $images['pa_folder_new'] : $images['pa_folder'], + 'CAT_NAME' => $subcat_row['cat_name'], + 'FILECAT' => $this->items_in_cat( $subcat_id ) ) + ); + } + } + } + + /** + * display_categories - original. + * + * @param unknown_type $cat_id + */ + function display_categories_original( $cat_id = PA_ROOT_CAT, $action_name = 'action', $action_default = 'category', $map_xtra = '' ) + { + global $db, $pafiledb_template, $lang, $userdata, $phpEx, $images; + global $pafiledb_config, $board_config, $debug; + global $phpbb_root_path, $mx_root_path, $module_root_path, $is_block, $phpEx; + + if ( $this->cat_empty() ) + { + if ( !$userdata['session_logged_in'] ) + { + $redirect = ( $cat_id != PA_ROOT_CAT ) ? $this->this_mxurl( "$action_name=$action_default&cat_id=$cat_id" ) : $this->this_mxurl(); + redirect( append_sid( "login.$phpEx?redirect=$redirect", true ) ); + } + mx_message_die( GENERAL_ERROR, 'Either you are not allowed to view any category, or there is no category in the database' ); + } + + $pafiledb_template->assign_vars( array( + 'CAT_NAV_STANDARD' => true, + 'L_SUB_CAT' => $lang['Sub_category'], + 'L_CATEGORY' => $lang['Category'], + 'L_LAST_FILE' => $lang['Last_file'], + 'L_FILES' => $lang['Files'] ) + ); + + // + // Category navigation for cat_id that allow files + // - used in cat pages without files + // + if ( isset( $this->subpage_rowset[$cat_id] ) ) + { + foreach( $this->subpage_rowset[$cat_id] as $subcat_id => $subcat_row ) + { + if ( ( $subcat_row['cat_allow_file'] == PA_CAT_ALLOW_FILE ) ) + { + $last_file_info = array(); + $this->last_item_in_cat( $subcat_id, $last_file_info ); + + if ( !empty( $last_file_info['file_id'] ) && $this->auth_user[$subcat_id]['auth_read'] ) + { + $last_file_time = create_date( $board_config['default_dateformat'], $last_file_info['file_time'], $board_config['board_timezone'] ); + $last_file = $last_file_time . '<br />'; + $last_file_name = ( strlen( stripslashes( $last_file_info['file_name'] ) ) > 20 ) ? substr( stripslashes( $last_file_info['file_name'] ), 0, 20 ) . '...' : stripslashes( $last_file_info['file_name'] ); + $last_file .= '<a href="' . append_sid( $this->this_mxurl( 'action=file&file_id=' . $last_file_info['file_id'] ) ) . '" alt="' . stripslashes( $last_file_info['file_name'] ) . '" title="' . stripslashes( $last_file_info['file_name'] ) . '">' . $last_file_name . '</a> '; + $last_file .= '<a href="' . append_sid( $this->this_mxurl( 'action=file&file_id=' . $last_file_info['file_id'] ) ) . '"><img src="' . $images['pa_icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_file'] . '" title="' . $lang['View_latest_file'] . '" /></a>'; + } + else + { + $last_file = $lang['No_file']; + } + $is_new = false; + + if ( $this->new_item_in_cat( $subcat_id ) ) + { + $is_new = true; + } + + $sub_cat = $this->get_sub_cat( $subcat_id ); + + $pafiledb_template->assign_block_vars( 'no_cat_parent', array( + 'IS_HIGHER_CAT' => false, + 'U_CAT' => append_sid( $this->this_mxurl( "$action_name=$action_default&cat_id=" . $subcat_id . $map_xtra ) ), + 'SUB_CAT' => ( !empty( $sub_cat ) ) ? '<br /><b>' . $lang['Sub_category'] . ': </b>' . $sub_cat : '', + 'CAT_IMAGE' => ( $is_new ) ? $images['pa_folder_new'] : $images['pa_folder'], + 'CAT_NEW_FILE' => ( $is_new ) ? $lang['New_file'] : $lang['No_new_file'], + 'CAT_NAME' => $subcat_row['cat_name'], + 'FILECAT' => $this->items_in_cat( $subcat_id ), + 'LAST_FILE' => $last_file, + 'CAT_DESC' => $subcat_row['cat_desc'] ) + ); + } + } + } + + // + // Category navigation for cat_id that doesn't allow files + // - used in cat pages with files + // + if ( isset( $this->subpage_rowset[$cat_id] ) ) + { + foreach( $this->subpage_rowset[$cat_id] as $subcat_id => $subcat_row ) + { + $total_sub_cat = 0; + if ( isset( $this->subpage_rowset[$subcat_id] ) ) + { + foreach( $this->subpage_rowset[$subcat_id] as $sub_no_cat_id => $sub_no_cat_row ) + { + if ( $sub_no_cat_row['cat_allow_file'] == PA_CAT_ALLOW_FILE ) + { + $sub_page_rowset[$total_sub_cat] = $sub_no_cat_row; + $total_sub_cat++; + } + } + } + + // + // This is a container category + // + if ( ( $subcat_row['cat_allow_file'] != PA_CAT_ALLOW_FILE ) ) + { + if ( $total_sub_cat ) + { + $pafiledb_template->assign_block_vars( 'no_cat_parent', array( + 'IS_HIGHER_CAT' => true, + 'U_CAT' => append_sid( $this->this_mxurl( "$action_name=$action_default&cat_id=" . $subcat_id . $map_xtra) ), + 'CAT_NAME' => $subcat_row['cat_name'] ) + ); + } + + for( $k = 0; $k < $total_sub_cat; $k++ ) + { + $last_file_info = array(); + $this->last_item_in_cat( $sub_page_rowset[$k]['cat_id'], $last_file_info ); + + if ( $sub_page_rowset[$k]['cat_parent'] == $subcat_id ) + { + if ( !empty( $last_file_info['file_id'] ) && $this->auth_user[$sub_page_rowset[$k]['cat_id']]['auth_read'] ) + { + $last_file_time = create_date( $board_config['default_dateformat'], $last_file_info['file_time'], $board_config['board_timezone'] ); + $last_file = $last_file_time . '<br />'; + $last_file_name = ( strlen( $last_file_info['file_name'] ) > 20 ) ? substr( $last_file_info['file_name'], 0, 20 ) . '...' : $last_file_info['file_name']; + $last_file .= '<a href="' . append_sid( $this->this_mxurl( 'action=file&file_id=' . $last_file_info['file_id'] ) ) . '">' . $last_file_name . '</a> '; + $last_file .= '<a href="' . append_sid( $this->this_mxurl( 'action=file&file_id=' . $last_file_info['file_id'] ) ) . '"><img src="' . $images['pa_icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_file'] . '" title="' . $lang['View_latest_file'] . '" /></a>'; + } + else + { + $last_file = $lang['No_file']; + } + + $is_new = false; + + if ( $this->new_item_in_cat( $sub_page_rowset[$k]['cat_id'] ) ) + { + $is_new = true; + } + + $sub_cat = $this->get_sub_cat( $sub_page_rowset[$k]['cat_id'] ); + + $pafiledb_template->assign_block_vars( 'no_cat_parent', array( + 'IS_HIGHER_CAT' => false, + 'U_CAT' => append_sid( $this->this_mxurl( "$action_name=$action_default&cat_id=" . $sub_page_rowset[$k]['cat_id'] . $map_xtra ) ), + 'SUB_CAT' => ( !empty( $sub_cat ) ) ? '<br /><b>' . $lang['Sub_category'] . ': </b>' . $sub_cat : '', + 'CAT_IMAGE' => ( $is_new ) ? $images['pa_folder_new'] : $images['pa_folder'], + 'CAT_NEW_FILE' => ( $is_new ) ? $lang['New_file'] : $lang['No_new_file'], + 'CAT_NAME' => $sub_page_rowset[$k]['cat_name'], + 'FILECAT' => $this->items_in_cat( $sub_page_rowset[$k]['cat_id'] ), + 'LAST_FILE' => $last_file, + 'CAT_DESC' => $sub_page_rowset[$k]['cat_desc'] ) + ); + } // Have a permission to view the category + } // It is not parent category + } + } + } //higher Category + } + } + ?> Index: mx_functions_admincp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_admincp.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** mx_functions_admincp.php 9 Jul 2007 21:57:05 -0000 1.37 --- mx_functions_admincp.php 21 Jul 2007 23:07:15 -0000 1.38 *************** *** 333,336 **** --- 333,337 ---- $page_name = $mx_request_vars->post('page_name', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); $page_desc = $mx_request_vars->post('page_desc', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); + $page_parent = $mx_request_vars->post('page_parent', MX_TYPE_INT, ''); $page_icon = $mx_request_vars->post('menuicons', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); $page_alt_icon = $mx_request_vars->post('page_alt_icon', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); *************** *** 371,378 **** } ! $sql = "INSERT INTO " . PAGE_TABLE . " ( page_id, page_name, page_desc, page_icon, page_alt_icon, auth_view, default_style, override_user_style, page_header, page_footer, page_main_layout, navigation_block, ip_filter, phpbb_stats ) VALUES ( '" . $page_id_new . "', '" . $page_name . "', '" . $page_desc . "', '" . $page_icon . "', '" . $page_alt_icon . "', --- 372,380 ---- } ! $sql = "INSERT INTO " . PAGE_TABLE . " ( page_id, page_name, page_desc, page_parent, page_icon, page_alt_icon, auth_view, default_style, override_user_style, page_header, page_footer, page_main_layout, navigation_block, ip_filter, phpbb_stats ) VALUES ( '" . $page_id_new . "', '" . $page_name . "', '" . $page_desc . "', + '" . $page_parent . "', '" . $page_icon . "', '" . $page_alt_icon . "', *************** *** 927,930 **** --- 929,933 ---- $page_name = $mx_request_vars->post('page_name', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); $page_desc = $mx_request_vars->post('page_desc', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); + $page_parent = $mx_request_vars->post('page_parent', MX_TYPE_INT, ''); $page_icon = $mx_request_vars->post('menuicons', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); $page_alt_icon = $mx_request_vars->post('page_alt_icon', MX_TYPE_NO_TAGS | MX_TYPE_SQL_QUOTED, ''); *************** *** 953,956 **** --- 956,960 ---- SET page_name = '$page_name', page_desc = '$page_desc', + page_parent = '$page_parent', page_icon = '$page_icon', page_alt_icon = '$page_alt_icon', Index: page_tail.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_tail.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** page_tail.php 19 Jun 2007 19:03:48 -0000 1.31 --- page_tail.php 21 Jul 2007 23:07:15 -0000 1.32 *************** *** 107,110 **** --- 107,115 ---- // + // Close the mx_page class + // + $mx_page->_core(); + + // // Unload cache, must be done before the DB connection is closed // |