|
From: Jon O. <jon...@us...> - 2005-09-06 18:52:06
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4716/includes Modified Files: mx_functions.php mx_functions_admincp.php mx_functions_blockcp.php mx_functions_core.php Log Message: Finalizing core 2.8 ;) Index: mx_functions_blockcp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_blockcp.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mx_functions_blockcp.php 20 Aug 2005 18:48:49 -0000 1.2 --- mx_functions_blockcp.php 6 Sep 2005 18:51:56 -0000 1.3 *************** *** 50,53 **** --- 50,58 ---- class mx_blockcp extends mx_block { + // + // Define blockcp mode: 'mx_blockcp' or 'admin_mx_block_cp' + // + var $blockcp_mode = 'mx_blockcp'; + // ------------------------------ // Private Methods *************** *** 60,64 **** function _controlpanel( $id, $new_block ) { ! global $blockcptemplate, $lang, $db, $board_config, $theme, $HTTP_GET_VARS, $HTTP_POST_VARS, $phpEx, $mx_root_path, $s_hidden_fields, $userdata, $portalpage, $cookie_states, $module_nav_icon_url, $portalpage; if (empty($id)) --- 65,71 ---- function _controlpanel( $id, $new_block ) { ! global $blockcptemplate, $lang, $db, $board_config, $theme, $HTTP_GET_VARS, $HTTP_POST_VARS, $phpEx, $mx_root_path, $s_hidden_fields, $userdata, $portalpage, $cookie_states, $module_nav_icon_url, $portalpage, $mx_request_vars; ! ! $dynamic_block_id = $mx_request_vars->request('dynamic_block', MX_TYPE_INT, ''); if (empty($id)) *************** *** 199,203 **** 'SID' => $userdata['session_id'], - 'RESULT_MESSAGE' => !empty($result_message) ? '<div style="overflow:auto; height:50px;"><span class="gensmall">-::-<br/>' . $result_message . '<br/> -::-</span></div>': '', // --- 206,209 ---- *************** *** 279,282 **** --- 285,289 ---- <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $block_id . '" /> + <input type="hidden" name="dynamic_block" value="' . $dynamic_block_id . '" /> <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; *************** *** 285,288 **** --- 292,296 ---- <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $block_id . '" /> + <input type="hidden" name="dynamic_block" value="' . $dynamic_block_id . '" /> <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; *************** *** 291,294 **** --- 299,303 ---- <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $block_id . '" /> + <input type="hidden" name="dynamic_block" value="' . $dynamic_block_id . '" /> <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mx_functions_core.php 20 Aug 2005 18:48:49 -0000 1.2 --- mx_functions_core.php 6 Sep 2005 18:51:56 -0000 1.3 *************** *** 51,61 **** // The following flags are class specific options // ! define('MX_ALL_DATA' , -1); // Flag - write all data ! define('MX_ALL_BLOCKS' , -2); // Flag - write all blocks data ! define('MX_ALL_PAGES' , -3); // Flag - write all pages data ! define('MX_BLOCK' , 0); // Block read mode ! define('MX_PAGE' , 1); // Page read mode ! define('MX_QUERY_DB' , true); // Flag - to force db query define('MX_CACHE_DEBUG' , false); // echo lots of debug info --- 51,60 ---- // The following flags are class specific options // ! define('MX_CACHE_ALL' , -1); // Flag - all ! define('MX_CACHE_SINGLE' , -2); // Flag - all ! define('MX_CACHE_PAGE_TYPE' , -3); // Flag - blocks data ! define('MX_CACHE_BLOCK_TYPE' , -4); // Flag - pages data ! define('MX_QUERY_DB' , true); // Flag - to force db query // not used define('MX_CACHE_DEBUG' , false); // echo lots of debug info *************** *** 76,80 **** switch ( $type ) { ! case MX_BLOCK: $cache_file = $cache_dir . "block_" . $id . ".xml"; --- 75,79 ---- switch ( $type ) { ! case MX_CACHE_BLOCK_TYPE: $cache_file = $cache_dir . "block_" . $id . ".xml"; *************** *** 95,99 **** break; ! case MX_PAGE: $cache_file = $cache_dir . "page_" . $id . ".xml"; --- 94,98 ---- break; ! case MX_CACHE_PAGE_TYPE: $cache_file = $cache_dir . "page_" . $id . ".xml"; *************** *** 117,121 **** // Write cache ! function _write_config( $type, $id, $action ) { global $portal_config, $mx_root_path, $lang; --- 116,120 ---- // Write cache ! function _write_config( $type, $action, $id = '' ) { global $portal_config, $mx_root_path, $lang; *************** *** 126,130 **** @chmod($cache_dir, 0777); ! $cache_file = $cache_dir . ( $type == MX_BLOCK ? "block_" : "page_" ) . ( $action == 'single' ? $id . ".xml" : '' ); if ( !is_writable($cache_dir) ) --- 125,129 ---- @chmod($cache_dir, 0777); ! $cache_file = $cache_dir . ( $type == MX_CACHE_BLOCK_TYPE ? "block_" : "page_" ) . ( $action == MX_CACHE_SINGLE ? $id . ".xml" : '' ); if ( !is_writable($cache_dir) ) *************** *** 136,144 **** switch ( $type ) { ! case MX_BLOCK: switch ( $action ) { ! case 'all': if ( MX_CACHE_DEBUG ) { echo('writing all block cache'); } --- 135,143 ---- switch ( $type ) { ! case MX_CACHE_BLOCK_TYPE: switch ( $action ) { ! case MX_CACHE_ALL: if ( MX_CACHE_DEBUG ) { echo('writing all block cache'); } *************** *** 148,154 **** break; ! case 'single': ! if ( MX_CACHE_DEBUG ) { echo('writing id block cache'); } $block_config = $this->_get_block_config( $id, 0 ); $this->_data2cache( $block_config[$id], $cache_file, $action, $type ); --- 147,153 ---- break; ! case MX_CACHE_SINGLE: ! if ( MX_CACHE_DEBUG ) { echo('writing id (' . $id .') block cache'); } $block_config = $this->_get_block_config( $id, 0 ); $this->_data2cache( $block_config[$id], $cache_file, $action, $type ); *************** *** 159,167 **** break; ! case MX_PAGE: switch ( $action ) { ! case 'all': if ( MX_CACHE_DEBUG ) { echo('writing all page cache'); } --- 158,166 ---- break; ! case MX_CACHE_PAGE_TYPE: switch ( $action ) { ! case MX_CACHE_ALL: if ( MX_CACHE_DEBUG ) { echo('writing all page cache'); } *************** *** 171,177 **** break; ! case 'single': ! if ( MX_CACHE_DEBUG ) { echo('writing id page cache'); } $pages_config = $this->_get_page_config( $id ); $this->_data2cache( $pages_config, $cache_file, $action, $type ); --- 170,176 ---- break; ! case MX_CACHE_SINGLE: ! if ( MX_CACHE_DEBUG ) { echo('writing id (' . $id .') page cache'); } $pages_config = $this->_get_page_config( $id ); $this->_data2cache( $pages_config, $cache_file, $action, $type ); *************** *** 192,196 **** switch ( $action ) { ! case 'all': if ( empty($data) || empty($xml_file) ) --- 191,195 ---- switch ( $action ) { ! case MX_CACHE_ALL: if ( empty($data) || empty($xml_file) ) *************** *** 203,207 **** $OUTPUT = serialize($value); ! if ( $type == MX_PAGE ) { $fp = fopen($xml_file . $value['page_info']['page_id'] . $xml_file_type . ".xml","w"); // open file with Write permission --- 202,206 ---- $OUTPUT = serialize($value); ! if ( $type == MX_CACHE_PAGE_TYPE ) { $fp = fopen($xml_file . $value['page_info']['page_id'] . $xml_file_type . ".xml","w"); // open file with Write permission *************** *** 220,224 **** break; ! case 'single': if ( empty($data) || empty($xml_file) ) --- 219,223 ---- break; ! case MX_CACHE_SINGLE: if ( empty($data) || empty($xml_file) ) *************** *** 520,531 **** // ! // $block_config = $mx_cache->read( MX_BLOCK, $block_id, [MX_QUERY_DB] ); // Optional flag 'MX_QUERY_DB' to force db query ! // $page_config = $mx_cache->read( MX_PAGE, $page_id, [MX_QUERY_DB] ); // Optional flag 'MX_QUERY_DB' to force db query // $mx_cache->update( MX_ALL_DATA ); // Updates all cache ! // $mx_cache->update( MX_BLOCK, [$block_id] ); // Optional parameter $block_id to update only specific cache fle ! // $mx_cache->update( MX_PAGE, [$page_id] ); // Optional parameter $page_id to update only specific cache file ! function read( $id = '', $type = MX_BLOCK, $force_query = false ) { if ( is_array( $id ) ) --- 519,530 ---- // ! // $block_config = $mx_cache->read( MX_CACHE_BLOCK_TYPE, $block_id, [MX_QUERY_DB] ); // Optional flag 'MX_QUERY_DB' to force db query ! // $page_config = $mx_cache->read( MX_CACHE_PAGE_TYPE, $page_id, [MX_QUERY_DB] ); // Optional flag 'MX_QUERY_DB' to force db query // $mx_cache->update( MX_ALL_DATA ); // Updates all cache ! // $mx_cache->update( MX_CACHE_BLOCK_TYPE, [$block_id] ); // Optional parameter $block_id to update only specific cache fle ! // $mx_cache->update( MX_CACHE_PAGE_TYPE, [$page_id] ); // Optional parameter $page_id to update only specific cache file ! function read( $id = '', $type = MX_CACHE_BLOCK_TYPE, $force_query = false ) { if ( is_array( $id ) ) *************** *** 550,572 **** } ! // TYPE: MX_ALL_DATA, MX_PAGE, MX_BLOCK ! function update( $type = MX_ALL_DATA, $id = '' ) { ! if ( $type == MX_ALL_DATA && empty($id) ) { ! $this->_write_config( MX_BLOCK, '', 'all' ); ! $this->_write_config( MX_PAGE, '', 'all' ); } ! else if ( $type == MX_ALL_BLOCKS && empty($id) ) { ! $this->_write_config( MX_BLOCK, '', 'all' ); } ! else if ( $type == MX_ALL_PAGES && empty($id) ) { ! $this->_write_config( MX_PAGE, '', 'all' ); } ! else if ( $id > 0 ) { ! $this->_write_config( $type, $id, 'single' ); } else --- 549,571 ---- } ! // TYPE: MX_CACHE_ALL, MX_CACHE_PAGE_TYPE, MX_CACHE_BLOCK_TYPE ! function update( $type = MX_CACHE_ALL, $id = '' ) { ! if ( $type == MX_CACHE_ALL && empty($id) ) { ! $this->_write_config( MX_CACHE_PAGE_TYPE, MX_CACHE_ALL ); ! $this->_write_config( MX_CACHE_BLOCK_TYPE, MX_CACHE_ALL ); } ! else if ( $type == MX_CACHE_BLOCK_TYPE && empty($id) ) { ! $this->_write_config( MX_CACHE_BLOCK_TYPE, MX_CACHE_ALL ); } ! else if ( $type == MX_CACHE_PAGE_TYPE && empty($id) ) { ! $this->_write_config( MX_CACHE_PAGE_TYPE, MX_CACHE_ALL ); } ! else if ( $type != MX_CACHE_ALL && $id > 0 ) { ! $this->_write_config( $type, MX_CACHE_SINGLE, $id ); } else *************** *** 793,797 **** global $mx_cache; ! $this->block_config = $mx_cache->read( $block_id, MX_BLOCK, $force_query ); $this->_set_all( $block_id ); } --- 792,796 ---- global $mx_cache; ! $this->block_config = $mx_cache->read( $block_id, MX_CACHE_BLOCK_TYPE, $force_query ); $this->_set_all( $block_id ); } *************** *** 855,859 **** global $layouttemplate, $lang; ! $hidden_img = '<img src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/block_icons/block_hidden.gif" alt="' . $lang['Hidden_block'] . '">'; $layouttemplate->assign_block_vars('layout_column.blocks.edit.hidden_block', array( 'HIDDEN_BLOCK' => $hidden_img --- 854,858 ---- global $layouttemplate, $lang; ! $hidden_img = '<img src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/block_icons/block_hidden.gif" alt="' . $lang['Hidden_block_explain'] . '">'; $layouttemplate->assign_block_vars('layout_column.blocks.edit.hidden_block', array( 'HIDDEN_BLOCK' => $hidden_img *************** *** 885,889 **** // ! $block_edit_img = ( ( $this->block_file == 'mx_multiple_blocks.php' ) ? 'block_edit_split.gif' : ( $this->block_file == 'mx_textblock_blog.php' ? 'block_edit_admin.gif' : 'block_edit.gif' ) ) ; $edit_file = !empty( $this->block_edit_file ) ? $this->block_edit_file : 'modules/mx_coreblocks/mx_blockcp.php'; --- 884,904 ---- // ! //$block_edit_img = ( ( $this->block_file == 'mx_multiple_blocks.php' ) ? 'block_edit_split.gif' : ( $this->block_file == 'mx_textblock_blog.php' ? 'block_edit_admin.gif' : 'block_edit.gif' ) ) ; ! if ($this->is_dynamic) ! { ! $block_edit_img = 'block_edit_admin.gif'; ! $block_edit_alt = $lang['Block_Edit_dyn']; ! } ! else if ($this->is_sub) ! { ! $block_edit_img = 'block_edit_split.gif'; ! $block_edit_alt = $lang['Block_Edit_sub']; ! } ! else ! { ! $block_edit_img = 'block_edit.gif'; ! $block_edit_alt = $lang['Block_Edit']; ! } ! $edit_file = !empty( $this->block_edit_file ) ? $this->block_edit_file : 'modules/mx_coreblocks/mx_blockcp.php'; *************** *** 894,900 **** $block_desc = !empty( $this->block_desc ) ? ' (' . $this->block_desc . ')' : ''; $edit_url = append_sid( $mx_root_path . $edit_file . "?sid=" . $userdata['session_id'] ); ! $edit_img = '<input type="image" class ="editblock" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/block_icons/' . $block_edit_img . '" alt="' . $lang['Block_Edit'] . ' :: ' . $this->block_title . $block_desc . '" title="' . $lang['Block_Edit'] . ' :: ' . $this->block_title . $block_desc . '">'; $s_hidden_fields .= '<input type="hidden" name="block_id" value="' . $this->block_id . '" />'; // --- 909,916 ---- $block_desc = !empty( $this->block_desc ) ? ' (' . $this->block_desc . ')' : ''; $edit_url = append_sid( $mx_root_path . $edit_file . "?sid=" . $userdata['session_id'] ); ! $edit_img = '<input type="image" class ="editblock" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/block_icons/' . $block_edit_img . '" alt="' . $block_edit_alt . ' :: ' . $this->block_title . $block_desc . '" title="' . $block_edit_alt . "\n" . '- ' . $this->block_title . $block_desc . '">'; $s_hidden_fields .= '<input type="hidden" name="block_id" value="' . $this->block_id . '" />'; + $s_hidden_fields .= '<input type="hidden" name="dynamic_block" value="' . $this->dynamic_block_id . '" />'; // *************** *** 1048,1052 **** function submit_parameters( $block_id = false ) { ! global $HTTP_POST_VARS, $db; $return = false; --- 1064,1068 ---- function submit_parameters( $block_id = false ) { ! global $HTTP_POST_VARS, $db, $mx_cache, $lang; $return = false; *************** *** 1056,1139 **** { $parameter_id = $parameter_data['parameter_id']; ! if ( isset($HTTP_POST_VARS[$parameter_id]) || isset($HTTP_POST_VARS[$parameter_name]) ) { ! $parameter_value = $HTTP_POST_VARS[$parameter_id]; ! ! $parameter_opt = ''; ! ! switch ( $parameter_data['parameter_type'] ) ! { ! case 'Boolean': ! case 'Text': ! case 'TextArea': ! $parameter_value = htmlspecialchars( trim( $parameter_value ) ); ! break; ! case 'BBText': ! $bbcode_uid = $parameter_opt = make_bbcode_uid(); ! $parameter_value = prepare_message($parameter_value, true, true, true, $bbcode_uid); ! break; ! case 'Html': ! $parameter_value = prepare_message($parameter_value, true, false, false); ! break; ! case 'Number': ! $parameter_value = intval($parameter_value); ! break; ! case 'Function': ! if( is_array($parameter_value) ) ! { ! $parameter_value = implode(',' , htmlspecialchars($parameter_value)); ! } ! break; ! // Custom Fields ! case 'Radio_single_select': ! case 'Menu_single_select': ! $parameter_value = htmlspecialchars( trim( $parameter_value ) ); ! break; ! case 'Menu_multiple_select': ! case 'Checkbox_multiple_select': ! $parameter_value = addslashes( serialize( $parameter_value ) ); ! break; ! default: ! $parameter_custom = $this->_submit_custom_module_parameters($parameter_data); ! $parameter_value = $parameter_custom['parameter_value']; ! $parameter_opt = $parameter_custom['parameter_opt']; ! } ! ! if ( $sub_id == $parameter_data['sub_id'] || true ) ! { ! //echo('d'.$sub_id . 'd' .$parameter_data['sub_id']); ! // ! // If standard block ! // ! $sql = "UPDATE " . BLOCK_SYSTEM_PARAMETER_TABLE . " ! SET parameter_value = '" . str_replace("\'", "''", $parameter_value) . "', ! parameter_opt = '$parameter_opt' ! WHERE block_id = '$block_id' ! AND parameter_id = '$parameter_id' ! AND sub_id = '$sub_id'"; ! } ! else ! { ! /* ! // ! // If subblock ! // ! $sql = "INSERT INTO " . BLOCK_SYSTEM_PARAMETER_TABLE . "(block_id, parameter_id, parameter_value, parameter_opt, sub_id) ! VALUES('$block_id','$parameter_id','" . str_replace("\'", "''", $parameter_value) . "','$parameter_opt', '$sub_id')"; ! */ ! } ! if( !($db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Couldn't update system parameter table", "", __LINE__, __FILE__, $sql); ! } ! ! ! $this->_submit_custom_module_parameters($parameter_data, $block_id); } } } --- 1072,1157 ---- { $parameter_id = $parameter_data['parameter_id']; ! $parameter_value = isset($HTTP_POST_VARS[$parameter_id]) ? $HTTP_POST_VARS[$parameter_id] : $parameter_data['parameter_default']; ! $parameter_opt = ''; ! ! switch ( $parameter_data['parameter_type'] ) { ! case 'Boolean': ! case 'Text': ! case 'TextArea': ! $parameter_value = htmlspecialchars( trim( $parameter_value ) ); ! break; ! case 'BBText': ! $bbcode_uid = $parameter_opt = make_bbcode_uid(); ! $parameter_value = prepare_message($parameter_value, true, true, true, $bbcode_uid); ! break; ! case 'Html': ! $parameter_value = prepare_message($parameter_value, true, false, false); ! break; ! case 'Number': ! $parameter_value = intval($parameter_value); ! break; ! case 'Function': ! if( is_array($parameter_value) ) ! { ! //$parameter_value = implode(',' , htmlspecialchars($parameter_value)); ! $parameter_value = implode(',' , $parameter_value); ! } ! break; ! // Custom Fields ! case 'Radio_single_select': ! case 'Menu_single_select': ! $parameter_value = htmlspecialchars( trim( $parameter_value ) ); ! break; ! case 'Menu_multiple_select': ! case 'Checkbox_multiple_select': ! $parameter_value = addslashes( serialize( $parameter_value ) ); ! break; ! case 'Separator': ! break; ! default: ! $parameter_custom = $this->_submit_custom_module_parameters($parameter_data, $block_id); ! $parameter_value = $parameter_custom['parameter_value']; ! $parameter_opt = $parameter_custom['parameter_opt']; ! break; ! } ! if ( $sub_id == $parameter_data['sub_id'] || true ) ! { ! // ! // If standard block ! // ! $sql = "UPDATE " . BLOCK_SYSTEM_PARAMETER_TABLE . " ! SET parameter_value = '" . str_replace("\'", "''", $parameter_value) . "', ! parameter_opt = '$parameter_opt' ! WHERE block_id = '$block_id' ! AND parameter_id = '$parameter_id' ! AND sub_id = '$sub_id'"; ! } ! else ! { ! /* ! // ! // If subblock ! // ! $sql = "INSERT INTO " . BLOCK_SYSTEM_PARAMETER_TABLE . "(block_id, parameter_id, parameter_value, parameter_opt, sub_id) ! VALUES('$block_id','$parameter_id','" . str_replace("\'", "''", $parameter_value) . "','$parameter_opt', '$sub_id')"; ! */ ! } ! if( !($db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Couldn't update system parameter table", "", __LINE__, __FILE__, $sql); } + } + // + // Update cache + // + $mx_cache->update(MX_CACHE_BLOCK_TYPE, $block_id); // Maybe ambitious, but why not ;) + $message .= $lang['AdminCP_action'] . ": " . $lang['Block'] . ' ' . $lang['was_updated']; + } *************** *** 1184,1188 **** switch ( $parameter_data['parameter_type'] ) { ! case 'Text': $this->display_edit_PlainTextField( $block_id, $parameter_data['parameter_id'], $parameter_data ); break; --- 1202,1209 ---- switch ( $parameter_data['parameter_type'] ) { ! case 'Separator': ! $this->display_edit_Separator( $block_id, $parameter_data['parameter_id'], $parameter_data ); ! break; ! case 'Text': $this->display_edit_PlainTextField( $block_id, $parameter_data['parameter_id'], $parameter_data ); break; *************** *** 1219,1226 **** $this->display_edit_Checkbox_multiple_select( $block_id, $parameter_data['parameter_id'], $parameter_data ); break; } - $this->_get_custom_module_parameters($parameter_data, $block_id); - $return = true; } --- 1240,1248 ---- $this->display_edit_Checkbox_multiple_select( $block_id, $parameter_data['parameter_id'], $parameter_data ); break; + default: + $this->_get_custom_module_parameters($parameter_data, $block_id); + break; } $return = true; } *************** *** 1238,1241 **** --- 1260,1283 ---- } + function display_edit_Separator( $block_id, $parameter_id, $parameter_data ) + { + global $template, $board_config, $db, $theme, $lang; + + // $parameter_field = '<input type="text" maxlength="150" size="50" name="' . $parameter_id . '" value="' . $parameter_data['parameter_value'] . '" />'; + + $template->set_filenames(array( + 'parameter' => 'admin/mx_core_parameters.tpl') + ); + + $template->assign_block_vars('separator', array( + 'PARAMETER_TITLE' => ( !empty($lang[$parameter_data['parameter_name']]) ) ? $lang[$parameter_data['parameter_name']] : $parameter_data['parameter_name'], + 'PARAMETER_TITLE_EXPLAIN' => ( !empty($lang[$parameter_data['parameter_name']. "_explain"]) ) ? '<br />' . $lang[$parameter_data['parameter_name']. "_explain"] : '', + 'PARAMETER_TYPE' => ( !empty($lang["ParType_".$parameter_data['parameter_type']]) ) ? $lang["ParType_".$parameter_data['parameter_type']] : '', + 'PARAMETER_TYPE_INFO' => ( !empty($lang["ParType_".$parameter_data['parameter_type'] . "_info"]) ) ? ' :: ' . $lang["ParType_".$parameter_data['parameter_type'] . "_info"] : '' + )); + + $template->pparse('parameter'); + } + function display_edit_PlainTextField( $block_id, $parameter_id, $parameter_data ) { *************** *** 1353,1357 **** $selected_true = ''; $selected_false = ''; ! if( $parameter_data['parameter_value'] == 'TRUE' ) { $selected_true = ' checked="checked"'; --- 1395,1399 ---- $selected_true = ''; $selected_false = ''; ! if( $parameter_data['parameter_value'] == 'TRUE' || $parameter_data['parameter_value'] == '1' ) { $selected_true = ' checked="checked"'; *************** *** 1414,1417 **** --- 1456,1462 ---- $template->assign_block_vars( 'radio', array( + 'PARAMETER_TITLE' => ( !empty($lang[$parameter_data['parameter_name']]) ) ? $lang[$parameter_data['parameter_name']] : $parameter_data['parameter_name'], + 'PARAMETER_TITLE_EXPLAIN' => ( !empty($lang[$parameter_data['parameter_name']. "_explain"]) ) ? '<br />' . $lang[$parameter_data['parameter_name']. "_explain"] : '', + 'FIELD_NAME' => ( !empty($lang[$parameter_data['parameter_name']]) ) ? $lang[$parameter_data['parameter_name']] : $parameter_data['parameter_name'], 'FIELD_ID' => $parameter_data['parameter_id'], *************** *** 1444,1447 **** --- 1489,1495 ---- $template->assign_block_vars( 'select', array( + 'PARAMETER_TITLE' => ( !empty($lang[$parameter_data['parameter_name']]) ) ? $lang[$parameter_data['parameter_name']] : $parameter_data['parameter_name'], + 'PARAMETER_TITLE_EXPLAIN' => ( !empty($lang[$parameter_data['parameter_name']. "_explain"]) ) ? '<br />' . $lang[$parameter_data['parameter_name']. "_explain"] : '', + 'FIELD_NAME' => ( !empty($lang[$parameter_data['parameter_name']]) ) ? $lang[$parameter_data['parameter_name']] : $parameter_data['parameter_name'], 'FIELD_ID' => $parameter_data['parameter_id'], *************** *** 1513,1516 **** --- 1561,1567 ---- $template->assign_block_vars( 'checkbox', array( + 'PARAMETER_TITLE' => ( !empty($lang[$parameter_data['parameter_name']]) ) ? $lang[$parameter_data['parameter_name']] : $parameter_data['parameter_name'], + 'PARAMETER_TITLE_EXPLAIN' => ( !empty($lang[$parameter_data['parameter_name']. "_explain"]) ) ? '<br />' . $lang[$parameter_data['parameter_name']. "_explain"] : '', + 'FIELD_NAME' => ( !empty($lang[$parameter_data['parameter_name']]) ) ? $lang[$parameter_data['parameter_name']] : $parameter_data['parameter_name'], 'FIELD_ID' => $parameter_data['parameter_id'], *************** *** 1685,1693 **** // ! function init( $page_id ) { global $mx_cache; ! $this->page_config = $mx_cache->read( $page_id, MX_PAGE ); $this->_set_all( $page_id ); } --- 1736,1744 ---- // ! function init( $page_id, $force_query = false ) { global $mx_cache; ! $this->page_config = $mx_cache->read( $page_id, MX_CACHE_PAGE_TYPE, $force_query ); $this->_set_all( $page_id ); } *************** *** 1714,1722 **** $block_size = $this->columns[$column]['column_size']; ! // // Setup column css styles // - $colclass = $this->_get_colclass( $column ); --- 1765,1772 ---- $block_size = $this->columns[$column]['column_size']; ! // // Setup column css styles // $colclass = $this->_get_colclass( $column ); *************** *** 1724,1728 **** // Output // - $layouttemplate->assign_block_vars('layout_column', array( 'COL_CLASS' => $colclass, --- 1774,1777 ---- *************** *** 1756,1760 **** global $mx_cache; ! if ($id == MX_ALL_BLOCKS) { $mx_cache->update( MX_ALL_BLOCKS ); --- 1805,1822 ---- global $mx_cache; ! if (!is_object($mx_cache)) ! { ! // ! // instatiate the mx_cache class ! // ! $mx_cache = new mx_cache(); ! } ! ! if ($id == MX_ALL_DATA) ! { ! $mx_cache->update( MX_ALL_BLOCKS ); ! $mx_cache->update( MX_ALL_PAGES ); ! } ! else if ($id == MX_ALL_BLOCKS) { $mx_cache->update( MX_ALL_BLOCKS ); Index: mx_functions_admincp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_admincp.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mx_functions_admincp.php 21 Aug 2005 21:40:51 -0000 1.2 --- mx_functions_admincp.php 6 Sep 2005 18:51:56 -0000 1.3 *************** *** 20,32 **** */ - /** - * Included functions in this file: - * - mx_db_remove - * - mx_db_add - * - mx_do_install_upgrade - */ - - // For use during module import/export [...3877 lines suppressed...] + $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; + $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; + $message .= '3) Then (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; + + $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; + } + else + { + $message .= '<br /><br /><b>Portal installed successfully (with some warnings)! </b><hr><br /><br />'; + $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; + $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; + $message .= '3) Now (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; + $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; + } + } + return $message; + } ?> \ No newline at end of file Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** mx_functions.php 20 Aug 2005 18:19:11 -0000 1.44 --- mx_functions.php 6 Sep 2005 18:51:56 -0000 1.45 *************** *** 107,114 **** $sql .= " WHERE $idfield <> $id"; } ! if( !empty($id2) ) { ! $sql .= " WHERE $idfield2 = $id2"; } $sql .= " ORDER BY $namefield"; --- 107,118 ---- $sql .= " WHERE $idfield <> $id"; } ! if( !$select && !empty($id2) ) { ! $sql .= " AND $idfield2 = $id2"; } + if( $select && !empty($id2) ) + { + $sql .= " WHERE $idfield2 = $id2"; + } $sql .= " ORDER BY $namefield"; *************** *** 254,284 **** /********************************************************************************\ - | - \********************************************************************************/ - function get_mx_select_list($type = 'includex', $id, $name_select) - { - global $lang; - - switch($type) - { - case 'includex': - $select_row = array('x_listen', 'x_iframe', 'x_textfile', 'x_multimedia', 'x_pic', 'x_format'); - $select_list = '<select name="' . $name_select . '">'; - for( $i = 0; $i < count($select_row); $i++ ) - { - $selected = ( $i == $id ) ? ' selected="selected"' : ''; - $select_list .= '<option value="' . $i . '"' . $selected . '>' . $lang[$select_row[$i]] . "</option>\n"; - } - $select_list .= '</select>'; - break; - - default: - break; - } - - return $select_list; - } - - /********************************************************************************\ | function get_list_formatted() | ------------------------------------------------------------------------------- --- 258,261 ---- *************** *** 983,986 **** --- 960,964 ---- $type |= (MX_TYPE_POST_VARS|MX_TYPE_GET_VARS); } + if( ($type & MX_TYPE_POST_VARS) && isset($HTTP_POST_VARS[$var]) || ($type & MX_TYPE_GET_VARS) && isset($HTTP_GET_VARS[$var]) ) *************** *** 1006,1017 **** --- 984,998 ---- $val = $dflt; } + if( $type & MX_TYPE_INT ) // integer { return intval($val); } + if( $type & MX_TYPE_FLOAT ) // float { return floatval($val); } + if( $type & MX_TYPE_NO_TAGS ) // ie username { *************** *** 1042,1045 **** --- 1023,1027 ---- } } + if( $type & MX_TYPE_SQL_QUOTED ) { *************** *** 1056,1059 **** --- 1038,1042 ---- } } + return $val; } |