|
From: Jon O. <jon...@us...> - 2005-12-11 16:13:51
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17207/includes Modified Files: mx_functions.php mx_functions_admincp.php mx_functions_auth.php mx_functions_core.php Log Message: Adding php5 support + minor fixes Index: mx_functions_auth.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_auth.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mx_functions_auth.php 8 Dec 2005 14:41:48 -0000 1.5 --- mx_functions_auth.php 11 Dec 2005 16:13:39 -0000 1.6 *************** *** 211,215 **** case AUTH_ALL: $auth_user[$key] = TRUE; ! $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; --- 211,215 ---- case AUTH_ALL: $auth_user[$key] = TRUE; ! $auth_user[$key . '_type'] = $lang['Auth_Anonymous_Users']; break; *************** *** 221,225 **** case AUTH_ANONYMOUS: $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? TRUE : 0; ! $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; --- 221,225 ---- case AUTH_ANONYMOUS: $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? TRUE : 0; ! $auth_user[$key . '_type'] = $lang['Auth_Anonymous_Users']; break; *************** *** 303,307 **** case AUTH_ALL: $auth_user[$key] = TRUE; ! $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; --- 303,307 ---- case AUTH_ALL: $auth_user[$key] = TRUE; ! $auth_user[$key . '_type'] = $lang['Auth_Anonymous_Users']; break; *************** *** 313,317 **** case AUTH_ANONYMOUS: $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? TRUE : 0; ! $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; --- 313,317 ---- case AUTH_ANONYMOUS: $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? TRUE : 0; ! $auth_user[$key . '_type'] = $lang['Auth_Anonymous_Users']; break; Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** mx_functions_core.php 9 Dec 2005 23:22:03 -0000 1.18 --- mx_functions_core.php 11 Dec 2005 16:13:39 -0000 1.19 *************** *** 256,260 **** $cache_file = $cache_dir . "block_" . $id . ".xml"; ! $block_config = ''; if ( file_exists( $cache_file ) && !empty($id) && $cache == true && $sub_id == 0 && $portal_config['mx_use_cache'] == 1 ) { --- 256,260 ---- $cache_file = $cache_dir . "block_" . $id . ".xml"; ! $block_config = array(); if ( file_exists( $cache_file ) && !empty($id) && $cache == true && $sub_id == 0 && $portal_config['mx_use_cache'] == 1 ) { *************** *** 275,279 **** $cache_file = $cache_dir . "page_" . $id . ".xml"; ! $pages_config = ''; if ( file_exists( $cache_file ) && !empty($id) && $cache == true && $portal_config['mx_use_cache'] == 1 ) { --- 275,279 ---- $cache_file = $cache_dir . "page_" . $id . ".xml"; ! $pages_config = array(); if ( file_exists( $cache_file ) && !empty($id) && $cache == true && $portal_config['mx_use_cache'] == 1 ) { *************** *** 499,503 **** par.parameter_name, par.parameter_type, par.parameter_function, par.parameter_default, par.parameter_order, mdl.module_path, ! fnc.function_file, fnc.function_admin FROM " . BLOCK_SYSTEM_PARAMETER_TABLE . " sys, " . PARAMETER_TABLE . " par, --- 499,503 ---- par.parameter_name, par.parameter_type, par.parameter_function, par.parameter_default, par.parameter_order, mdl.module_path, ! fnc.function_file, fnc.function_id, fnc.function_admin FROM " . BLOCK_SYSTEM_PARAMETER_TABLE . " sys, " . PARAMETER_TABLE . " par, *************** *** 543,547 **** "module_root_path" => $row['module_path'], "block_file" => $row['function_file'], ! "block_edit_file" => $row['function_admin'] ); --- 543,548 ---- "module_root_path" => $row['module_path'], "block_file" => $row['function_file'], ! "block_edit_file" => $row['function_admin'], ! "function_id" => $row['function_id'] ); *************** *** 869,879 **** // ! function _set_all( $block_id, $unset = false ) { global $userdata; ! ! $this->block_info = $this->block_config[$block_id]['block_info']; ! $this->block_parameters = $this->block_config[$block_id]['block_parameters']; ! $this->block_id = $this->block_info['block_id']; $this->block_title = $this->block_info['block_title']; --- 870,889 ---- // ! function _set_all( $unset = false ) { global $userdata; ! ! // ! // Weird rewrite for php5 - anyone explaining why wins a medal ;) ! // ! $temp = $this->block_config[$this->block_id]; ! $this->block_info = $temp['block_info']; ! $this->block_parameters = $temp['block_parameters']; ! ! /* ! $this->block_info = $this->block_config[$this->block_id]['block_info']; ! $this->block_parameters = $this->block_config[$this->block_id]['block_parameters']; ! */ ! $this->block_id = $this->block_info['block_id']; $this->block_title = $this->block_info['block_title']; *************** *** 885,893 **** $mx_is_auth_ary = array(); ! $mx_is_auth_ary = block_auth( AUTH_VIEW, $block_id, $userdata, $this->block_info['auth_view'], $this->block_info['auth_view_group'] ); $this->auth_view = $unset ? false : $mx_is_auth_ary['auth_view']; $mx_is_auth_ary = array(); ! $mx_is_auth_ary = block_auth( AUTH_EDIT, $block_id, $userdata, $this->block_info['auth_edit'], $this->block_info['auth_edit_group'] ); $this->auth_edit = $unset ? false : $mx_is_auth_ary['auth_edit']; $this->auth_mod = $unset ? false : $mx_is_auth_ary['auth_mod']; --- 895,903 ---- $mx_is_auth_ary = array(); ! $mx_is_auth_ary = block_auth( AUTH_VIEW, $this->block_id, $userdata, $this->block_info['auth_view'], $this->block_info['auth_view_group'] ); $this->auth_view = $unset ? false : $mx_is_auth_ary['auth_view']; $mx_is_auth_ary = array(); ! $mx_is_auth_ary = block_auth( AUTH_EDIT, $this->block_id, $userdata, $this->block_info['auth_edit'], $this->block_info['auth_edit_group'] ); $this->auth_edit = $unset ? false : $mx_is_auth_ary['auth_edit']; $this->auth_mod = $unset ? false : $mx_is_auth_ary['auth_mod']; *************** *** 901,910 **** $this->function_id = $this->block_info['function_id']; ! $this->is_dynamic = $unset ? false : $this->_is_dynamic( $block_id ); ! $this->is_sub = $unset ? false : $this->_is_sub( $block_id ); } ! function _is_dynamic( $block_id ) { global $mx_request_vars; --- 911,920 ---- $this->function_id = $this->block_info['function_id']; ! $this->is_dynamic = $unset ? false : $this->_is_dynamic(); ! $this->is_sub = $unset ? false : $this->_is_sub(); } ! function _is_dynamic() { global $mx_request_vars; *************** *** 926,930 **** } ! function _is_sub( $block_id ) { $is_sub = ( ( $this->block_file == 'mx_multiple_blocks.php' ) ? true : false ); --- 936,940 ---- } ! function _is_sub() { $is_sub = ( ( $this->block_file == 'mx_multiple_blocks.php' ) ? true : false ); *************** *** 966,971 **** global $mx_cache; ! $this->block_config = $mx_cache->read( $block_id, MX_CACHE_BLOCK_TYPE, $force_query ); ! $this->_set_all( $block_id ); } --- 976,982 ---- global $mx_cache; ! $this->block_id = $block_id; ! $this->block_config = $mx_cache->read( $this->block_id, MX_CACHE_BLOCK_TYPE, $force_query ); ! $this->_set_all(); } *************** *** 975,984 **** } ! function kill_me($block_id) { global $mx_cache; $this->block_config = ''; ! $this->_set_all( $block_id, true ); } --- 986,995 ---- } ! function kill_me() { global $mx_cache; $this->block_config = ''; ! $this->_set_all( true ); } *************** *** 1889,1892 **** --- 1900,1904 ---- var $blocks = array(); + var $page_id = '1'; var $page_title = ''; var $page_icon = ''; *************** *** 1919,1927 **** // ! function _set_all( $page_id ) { global $userdata, $mx_root_path, $HTTP_GET_VARS, $HTTP_COOKIE_VARS, $portal_config; ! $this->info = $this->page_config[$page_id]['page_info']; // --- 1931,1939 ---- // ! function _set_all() { global $userdata, $mx_root_path, $HTTP_GET_VARS, $HTTP_COOKIE_VARS, $portal_config; ! $this->info = $this->page_config[$this->page_id]['page_info']; // *************** *** 1950,1957 **** $this->auth_ip = $mx_ip->auth($this->info['ip_filter']); ! $this->columns = $this->page_config[$page_id]['columns']; $this->total_column = count($this->columns); ! $this->blocks = $this->page_config[$page_id]['blocks']; $this->total_block = count($this->blocks); --- 1962,1969 ---- $this->auth_ip = $mx_ip->auth($this->info['ip_filter']); ! $this->columns = $this->page_config[$this->page_id]['columns']; $this->total_column = count($this->columns); ! $this->blocks = $this->page_config[$this->page_id]['blocks']; $this->total_block = count($this->blocks); *************** *** 1959,1963 **** $s_hidden_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="portalpage" value="' . $page_id . '" />'; $s_hidden_fields .= '<input type="hidden" name="mode" value="setting" />'; $s_hidden_fields .= '<input type="hidden" name="f" value="' . intval( $HTTP_GET_VARS['f'] ) . '" />'; --- 1971,1975 ---- $s_hidden_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="portalpage" value="' . $this->page_id . '" />'; $s_hidden_fields .= '<input type="hidden" name="mode" value="setting" />'; $s_hidden_fields .= '<input type="hidden" name="f" value="' . intval( $HTTP_GET_VARS['f'] ) . '" />'; *************** *** 2013,2021 **** global $mx_cache; ! $this->page_config = $mx_cache->read( $page_id, MX_CACHE_PAGE_TYPE, $force_query ); ! $this->_set_all( $page_id ); } ! function kill_me( $page_id ) { global $mx_cache; --- 2025,2034 ---- 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(); } ! function kill_me() { global $mx_cache; Index: mx_functions_admincp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_admincp.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mx_functions_admincp.php 9 Dec 2005 23:22:03 -0000 1.14 --- mx_functions_admincp.php 11 Dec 2005 16:13:39 -0000 1.15 *************** *** 2318,2322 **** $exists_fnc_ids = array(); ! $safe_row = get_info(MODULE_TABLE, 'module_path', $module_data[3]); // --- 2318,2322 ---- $exists_fnc_ids = array(); ! $safe_row = mx_get_info(MODULE_TABLE, 'module_path', $module_data[3]); // *************** *** 2353,2357 **** } ! $safe_row = get_info(FUNCTION_TABLE, 'module_id', $module_id, 'function_file', $module_data['5']); if( $module_data['4'] == 'endoflist' ) --- 2353,2357 ---- } ! $safe_row = mx_get_info(FUNCTION_TABLE, 'module_id', $module_id, 'function_file', $module_data['5']); if( $module_data['4'] == 'endoflist' ) *************** *** 2397,2401 **** } ! $safe_row = get_info(PARAMETER_TABLE, 'function_id', $function_id, 'parameter_name', $module_data['3']); if( $module_data['4'] == 'endoflist' ) --- 2397,2401 ---- } ! $safe_row = mx_get_info(PARAMETER_TABLE, 'function_id', $function_id, 'parameter_name', $module_data['3']); if( $module_data['4'] == 'endoflist' ) *************** *** 2441,2445 **** } ! $safe_row = get_info(PARAMETER_OPTION_TABLE, 'parameter_id', $parameter_id, 'option_code', $module_data['3']); if( $module_data['4'] == 'endoflist' ) { --- 2441,2445 ---- } ! $safe_row = mx_get_info(PARAMETER_OPTION_TABLE, 'parameter_id', $parameter_id, 'option_code', $module_data['3']); if( $module_data['4'] == 'endoflist' ) { *************** *** 2473,2477 **** // case 'block': ! $safe_row = get_info(BLOCK_TABLE, 'function_id', $function_id); if( $safe_row ) { --- 2473,2477 ---- // case 'block': ! $safe_row = mx_get_info(BLOCK_TABLE, 'function_id', $function_id); if( $safe_row ) { Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** mx_functions.php 9 Dec 2005 23:22:03 -0000 1.53 --- mx_functions.php 11 Dec 2005 16:13:39 -0000 1.54 *************** *** 54,58 **** | \********************************************************************************/ ! function get_info($table, $idfield = '', $id = 0, $idfield2 = '', $id2 = 0) { global $db; --- 54,58 ---- | \********************************************************************************/ ! function mx_get_info($table, $idfield = '', $id = 0, $idfield2 = '', $id2 = 0) { global $db; *************** *** 95,99 **** | \********************************************************************************/ ! function get_list($name_select, $table, $idfield, $namefield, $id, $select = false, $idfield2 = '' , $id2 = '') { global $db; --- 95,99 ---- | \********************************************************************************/ ! function mx_get_list($name_select, $table, $idfield, $namefield, $id, $select = false, $idfield2 = '' , $id2 = '') { global $db; *************** *** 441,445 **** } ! $url = $url[path]; // Build the parameter list if( !strpos($url, '?') ) --- 441,445 ---- } ! $url = $url['path']; // Build the parameter list if( !strpos($url, '?') ) |