|
From: Markus P. <mar...@us...> - 2005-04-13 20:16:15
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32200 Modified Files: common.php index.php Log Message: First attempt to fix double line breaks. Index: common.php =================================================================== RCS file: /cvsroot/mxbb/core/common.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** common.php 12 Apr 2005 21:10:32 -0000 1.29 --- common.php 13 Apr 2005 20:15:55 -0000 1.30 *************** *** 1,279 **** ! <?php ! /** ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal ! * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System ! * email : jon...@ho... ! * project site : www.mx-system.com ! * ! * description : ! * ------------------------------------------------------------------------- ! * copyright : (C) 2001 The phpBB Group ! * email : su...@ph... ! * ! * $Id$ ! */ ! ! /** ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! */ ! ! if ( !defined( 'IN_PORTAL' ) ) ! { ! die( "Hacking attempt" ); ! } ! ! define( 'IN_PHPBB', 1 ); ! @session_start(); ! ! error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables ! set_magic_quotes_runtime(0); // Disable magic_quotes_runtime ! ! // The following code (unsetting globals) was contributed by Matt Kavanagh ! ! // PHP5 with register_long_arrays off? ! if (!isset($HTTP_POST_VARS) && isset($_POST)) ! { ! $HTTP_POST_VARS = $_POST; ! $HTTP_GET_VARS = $_GET; ! $HTTP_SERVER_VARS = $_SERVER; ! $HTTP_COOKIE_VARS = $_COOKIE; ! $HTTP_ENV_VARS = $_ENV; ! $HTTP_POST_FILES = $_FILES; ! ! // _SESSION is the only superglobal which is conditionally set ! if (isset($_SESSION)) ! { ! $HTTP_SESSION_VARS = $_SESSION; ! } ! } ! ! if (@phpversion() < '4.0.0') ! { ! // PHP3 path; in PHP3, globals are _always_ registered ! ! // We 'flip' the array of variables to test like this so that ! // we can validate later with isset($test[$var]) (no in_array()) ! $test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL, 'phpEx' => NULL, 'phpbb_root_path' => NULL); ! ! // Loop through each input array ! @reset($test); ! while (list($input,) = @each($test)) ! { ! while (list($var,) = @each($$input)) ! { ! // Validate the variable to be unset ! if (!isset($test[$var]) && $var != 'test' && $var != 'input') ! { ! unset($$var); ! } ! } ! } ! } ! else if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') ! { ! // PHP4+ path ! $not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path'); ! ! // Not only will array_merge give a warning if a parameter ! // is not an array, it will actually fail. So we check if ! // HTTP_SESSION_VARS has been initialised. ! if (!isset($HTTP_SESSION_VARS)) ! { ! $HTTP_SESSION_VARS = array(); ! } ! ! // Merge all into one extremely huge array; unset ! // this later ! $input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES); ! ! unset($input['input']); ! unset($input['not_unset']); ! ! while (list($var,) = @each($input)) ! { ! if (!in_array($var, $not_unset)) ! { ! unset($$var); ! } ! unset($$var); ! } ! ! unset($input); ! } ! ! // ! // addslashes to vars if magic_quotes_gpc is off ! // this is a security precaution to prevent someone ! // trying to break out of a SQL statement. ! // ! if( !get_magic_quotes_gpc() ) ! { ! if( is_array($HTTP_GET_VARS) ) ! { ! while( list($k, $v) = each($HTTP_GET_VARS) ) ! { ! if( is_array($HTTP_GET_VARS[$k]) ) ! { ! while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) ) ! { ! $HTTP_GET_VARS[$k][$k2] = addslashes($v2); ! } ! @reset($HTTP_GET_VARS[$k]); ! } ! else ! { ! $HTTP_GET_VARS[$k] = addslashes($v); ! } ! } ! @reset($HTTP_GET_VARS); ! } ! ! if( is_array($HTTP_POST_VARS) ) ! { ! while( list($k, $v) = each($HTTP_POST_VARS) ) ! { ! if( is_array($HTTP_POST_VARS[$k]) ) ! { ! while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) ! { ! $HTTP_POST_VARS[$k][$k2] = addslashes($v2); ! } ! @reset($HTTP_POST_VARS[$k]); ! } ! else ! { ! $HTTP_POST_VARS[$k] = addslashes($v); ! } ! } ! @reset($HTTP_POST_VARS); ! } ! ! if( is_array($HTTP_COOKIE_VARS) ) ! { ! while( list($k, $v) = each($HTTP_COOKIE_VARS) ) ! { ! if( is_array($HTTP_COOKIE_VARS[$k]) ) ! { ! while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) ) ! { ! $HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2); ! } ! @reset($HTTP_COOKIE_VARS[$k]); ! } ! else ! { ! $HTTP_COOKIE_VARS[$k] = addslashes($v); ! } ! } ! @reset($HTTP_COOKIE_VARS); ! } ! } ! ! // Define some basic configuration arrays this also prevents ! // malicious rewriting of language and otherarray values via ! // URI params ! ! $board_config = array(); ! $userdata = array(); ! $theme = array(); ! $images = array(); ! $lang = array(); ! $nav_links = array(); ! $gen_simple_header = false; ! ! @include_once( $mx_root_path . 'config.' . $phpEx ); ! ! if ( !defined( "MX_INSTALLED" ) ) ! { ! header( "Location: install/mx_install.$phpEx" ); ! exit; ! } ! ! str_replace( "//", "/", $phpbb_root_path ); ! include_once( $mx_root_path . 'config.' . $phpEx ); ! ! include_once( $phpbb_root_path . 'includes/constants.' . $phpEx ); ! include_once( $mx_root_path . 'includes/template.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/sessions.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/auth.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/db.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_selects.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); ! ! include_once( $mx_root_path . 'includes/mx_constants.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_functions.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_functions_phpbb.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_auth.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_cache.' . $phpEx ); ! ! // Changed my mind to make this a session var. one more query (see directly below) to make it all more foolproof ;) ! /* ! if ( !empty( $HTTP_SESSION_VARS['mx_config'] ) ) ! { ! $portal_config = $HTTP_SESSION_VARS['mx_config']; ! } ! else ! { ! $portal_config = get_info( PORTAL_TABLE, 'portal_id', 1 ); ! $HTTP_SESSION_VARS['mx_config'] = $portal_config; ! } ! */ ! ! $portal_config = get_info( PORTAL_TABLE, 'portal_id', 1 ); ! define( 'PHPBB_URL', $portal_config['portal_phpbb_url'] ); ! define( 'PORTAL_URL', $portal_config['portal_url'] ); ! define( 'PORTAL_VERSION', $portal_config['portal_version'] ); ! ! // instatiate the mx_request_vars class ! ! $mx_request_vars = new mx_request_vars(); ! ! // Obtain and encode users IP ! ! // I'm removing HTTP_X_FORWARDED_FOR ... this may well cause other problems such as ! // private range IP's appearing instead of the guilty routable IP, tough, don't ! // even bother complaining ... go scream and shout at the idiots out there who feel ! // "clever" is doing harm rather than good ... karma is a great thing ... :) ! ! $client_ip = ( !empty( $HTTP_SERVER_VARS['REMOTE_ADDR'] ) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty( $HTTP_ENV_VARS['REMOTE_ADDR'] ) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR ); ! $user_ip = encode_ip( $client_ip ); ! ! // Setup forum wide options, if this fails ! // then we output a CRITICAL_ERROR since ! // basic forum information is not available ! ! $sql = "SELECT * ! FROM " . CONFIG_TABLE; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql ); ! } ! ! while ( $row = $db->sql_fetchrow( $result ) ) ! { ! $board_config[$row['config_name']] = $row['config_value']; ! } ! ! if ( file_exists( $phpbb_root_path . 'attach_mod' ) ) ! { ! include_once( $phpbb_root_path . 'attach_mod/attachment_mod.' . $phpEx ); ! } ! ! if ( file_exists( 'install' ) || file_exists( 'contrib' ) ) ! { ! mx_message_die( GENERAL_MESSAGE, 'Please ensure both the install/ and contrib/ directories are deleted' ); ! } ! ! // Show 'Board is disabled' message if needed. ! ! if ( $board_config['board_disable'] && !defined( "IN_ADMIN" ) && !defined( "IN_LOGIN" ) ) ! { ! mx_message_die( GENERAL_MESSAGE, 'Board_disable', 'Information' ); ! } ! ?> \ No newline at end of file --- 1,278 ---- ! <?php ! /** ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal ! * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System ! * email : jon...@ho... ! * project site : www.mx-system.com ! * ! * description : ! * ------------------------------------------------------------------------- ! * copyright : (C) 2001 The phpBB Group ! * email : su...@ph... ! * ! * $Id$ ! */ ! ! /** ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! */ ! ! if ( !defined( 'IN_PORTAL' ) ) ! { ! die( "Hacking attempt" ); ! } ! ! define( 'IN_PHPBB', 1 ); ! @session_start(); ! ! error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables ! set_magic_quotes_runtime(0); // Disable magic_quotes_runtime ! ! // The following code (unsetting globals) was contributed by Matt Kavanagh ! ! // PHP5 with register_long_arrays off? ! if (!isset($HTTP_POST_VARS) && isset($_POST)) ! { ! $HTTP_POST_VARS = $_POST; ! $HTTP_GET_VARS = $_GET; ! $HTTP_SERVER_VARS = $_SERVER; ! $HTTP_COOKIE_VARS = $_COOKIE; ! $HTTP_ENV_VARS = $_ENV; ! $HTTP_POST_FILES = $_FILES; ! ! // _SESSION is the only superglobal which is conditionally set ! if (isset($_SESSION)) ! { ! $HTTP_SESSION_VARS = $_SESSION; ! } ! } ! ! if (@phpversion() < '4.0.0') ! { ! // PHP3 path; in PHP3, globals are _always_ registered ! ! // We 'flip' the array of variables to test like this so that ! // we can validate later with isset($test[$var]) (no in_array()) ! $test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL, 'phpEx' => NULL, 'phpbb_root_path' => NULL); ! ! // Loop through each input array ! @reset($test); ! while (list($input,) = @each($test)) ! { ! while (list($var,) = @each($$input)) ! { ! // Validate the variable to be unset ! if (!isset($test[$var]) && $var != 'test' && $var != 'input') ! { ! unset($$var); ! } ! } ! } ! } ! else if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') ! { ! // PHP4+ path ! $not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path'); ! ! // Not only will array_merge give a warning if a parameter ! // is not an array, it will actually fail. So we check if ! // HTTP_SESSION_VARS has been initialised. ! if (!isset($HTTP_SESSION_VARS)) ! { ! $HTTP_SESSION_VARS = array(); ! } ! ! // Merge all into one extremely huge array; unset ! // this later ! $input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES); ! ! unset($input['input']); ! unset($input['not_unset']); ! ! while (list($var,) = @each($input)) ! { ! if (!in_array($var, $not_unset)) ! { ! unset($$var); ! } ! unset($$var); ! } ! ! unset($input); ! } ! ! // ! // addslashes to vars if magic_quotes_gpc is off ! // this is a security precaution to prevent someone ! // trying to break out of a SQL statement. ! // ! if( !get_magic_quotes_gpc() ) ! { ! if( is_array($HTTP_GET_VARS) ) ! { ! while( list($k, $v) = each($HTTP_GET_VARS) ) ! { ! if( is_array($HTTP_GET_VARS[$k]) ) ! { ! while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) ) ! { ! $HTTP_GET_VARS[$k][$k2] = addslashes($v2); ! } ! @reset($HTTP_GET_VARS[$k]); ! } ! else ! { ! $HTTP_GET_VARS[$k] = addslashes($v); ! } ! } ! @reset($HTTP_GET_VARS); ! } ! ! if( is_array($HTTP_POST_VARS) ) ! { while( list($k, $v) = each($HTTP_POST_VARS) ) ! { ! if( is_array($HTTP_POST_VARS[$k]) ) ! { ! while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) ! { ! $HTTP_POST_VARS[$k][$k2] = addslashes($v2); ! } ! @reset($HTTP_POST_VARS[$k]); ! } ! else ! { ! $HTTP_POST_VARS[$k] = addslashes($v); ! } ! } ! @reset($HTTP_POST_VARS); ! } ! ! if( is_array($HTTP_COOKIE_VARS) ) ! { ! while( list($k, $v) = each($HTTP_COOKIE_VARS) ) ! { ! if( is_array($HTTP_COOKIE_VARS[$k]) ) ! { ! while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) ) ! { ! $HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2); ! } ! @reset($HTTP_COOKIE_VARS[$k]); ! } ! else ! { ! $HTTP_COOKIE_VARS[$k] = addslashes($v); ! } ! } ! @reset($HTTP_COOKIE_VARS); ! } ! } ! ! // Define some basic configuration arrays this also prevents ! // malicious rewriting of language and otherarray values via ! // URI params ! ! $board_config = array(); ! $userdata = array(); ! $theme = array(); ! $images = array(); ! $lang = array(); ! $nav_links = array(); ! $gen_simple_header = false; ! ! @include_once( $mx_root_path . 'config.' . $phpEx ); ! ! if ( !defined( "MX_INSTALLED" ) ) ! { ! header( "Location: install/mx_install.$phpEx" ); ! exit; ! } ! ! str_replace( "//", "/", $phpbb_root_path ); ! include_once( $mx_root_path . 'config.' . $phpEx ); ! ! include_once( $phpbb_root_path . 'includes/constants.' . $phpEx ); ! include_once( $mx_root_path . 'includes/template.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/sessions.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/auth.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/db.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_selects.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); ! ! include_once( $mx_root_path . 'includes/mx_constants.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_functions.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_functions_phpbb.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_auth.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_cache.' . $phpEx ); ! ! // Changed my mind to make this a session var. one more query (see directly below) to make it all more foolproof ;) ! /* ! if ( !empty( $HTTP_SESSION_VARS['mx_config'] ) ) ! { ! $portal_config = $HTTP_SESSION_VARS['mx_config']; ! } ! else ! { ! $portal_config = get_info( PORTAL_TABLE, 'portal_id', 1 ); ! $HTTP_SESSION_VARS['mx_config'] = $portal_config; ! } ! */ ! ! $portal_config = get_info( PORTAL_TABLE, 'portal_id', 1 ); ! define( 'PHPBB_URL', $portal_config['portal_phpbb_url'] ); ! define( 'PORTAL_URL', $portal_config['portal_url'] ); ! define( 'PORTAL_VERSION', $portal_config['portal_version'] ); ! ! // instatiate the mx_request_vars class ! ! $mx_request_vars = new mx_request_vars(); ! ! // Obtain and encode users IP ! ! // I'm removing HTTP_X_FORWARDED_FOR ... this may well cause other problems such as ! // private range IP's appearing instead of the guilty routable IP, tough, don't ! // even bother complaining ... go scream and shout at the idiots out there who feel ! // "clever" is doing harm rather than good ... karma is a great thing ... :) ! ! $client_ip = ( !empty( $HTTP_SERVER_VARS['REMOTE_ADDR'] ) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty( $HTTP_ENV_VARS['REMOTE_ADDR'] ) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR ); ! $user_ip = encode_ip( $client_ip ); ! ! // Setup forum wide options, if this fails ! // then we output a CRITICAL_ERROR since ! // basic forum information is not available ! ! $sql = "SELECT * ! FROM " . CONFIG_TABLE; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql ); ! } ! ! while ( $row = $db->sql_fetchrow( $result ) ) ! { ! $board_config[$row['config_name']] = $row['config_value']; ! } ! ! if ( file_exists( $phpbb_root_path . 'attach_mod' ) ) ! { ! include_once( $phpbb_root_path . 'attach_mod/attachment_mod.' . $phpEx ); ! } ! ! if ( file_exists( 'install' ) || file_exists( 'contrib' ) ) ! { ! mx_message_die( GENERAL_MESSAGE, 'Please ensure both the install/ and contrib/ directories are deleted' ); ! } ! ! // Show 'Board is disabled' message if needed. ! ! if ( $board_config['board_disable'] && !defined( "IN_ADMIN" ) && !defined( "IN_LOGIN" ) ) ! { ! mx_message_die( GENERAL_MESSAGE, 'Board_disable', 'Information' ); ! } ! ?> \ No newline at end of file Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/index.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** index.php 12 Apr 2005 21:10:33 -0000 1.29 --- index.php 13 Apr 2005 20:15:56 -0000 1.30 *************** *** 1,333 **** ! <?php ! /** ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal ! * author : jon ohlsson, marc morisette and the MX-Team ! * credits : 2001 The phpBB Group ! * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System ! * email : jon...@ho... ! * project site : www.mx-system.com ! * ! * description : the main mx-portal file ! * ------------------------------------------------------------------------- ! * ! * $Id$ ! */ ! ! /** ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! */ ! ! //define('MX_DEBUG', 1); ! define( 'IN_PORTAL', 1 ); ! $mx_root_path = "./"; ! ! include($mx_root_path . 'extension.inc'); ! include($mx_root_path . 'common.' . $phpEx); ! ! $view_page = false; ! ! // Page selector ! ! $page_id = $mx_request_vars->request('page', MX_TYPE_INT, 1); ! ! // Start session management ! $userdata = session_pagestart($user_ip, - ( 1000 + $page_id )); ! mx_init_userprefs($userdata); ! ! if ( $mx_request_vars->is_request('mx_copy') ) ! { ! compose_mx_copy(); ! } ! ! // Load page vars ! // Load http_session variables if populated, else consult db and populate http_session ! ! $mx_session_time = isset($HTTP_SESSION_VARS['mx_session_recached']) ? $HTTP_SESSION_VARS['mx_session_recached'] : $userdata['session_start']; ! if ( empty( $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id] ) || $portal_config['portal_recached'] > $mx_session_time ) ! { ! $HTTP_SESSION_VARS['mx_session_recached'] = $portal_config['portal_recached']; ! if ( defined('MX_DEBUG') ) ! { ! echo('populating page block http_session'); ! } ! // Populate all mx_pages session vars, for faster navigation ! get_page_session(); ! } ! ! $page_row = $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['page_info']; ! ! $block_rows = $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['blocks']; ! $total_block = count($block_rows); ! ! $column_rows = $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['columns']; ! $total_column = count($column_rows); ! ! $page_title .= $page_row['page_name']; ! $page_icon = $page_row['page_icon']; ! $page_ov_header = $page_row['page_header']; ! ! // Page auth ! $is_auth_ary = page_auth(AUTH_VIEW, $userdata, $page_row['page_auth_view'], $page_row['page_auth_view_group']); ! ! if ( !$is_auth_ary[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 ( !$is_auth_ary[auth_view] && !$userdata['session_logged_in'] ) ! { ! mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=" . mx_this_url(), true)); ! } ! include($mx_root_path . 'includes/page_header.' . $phpEx); ! ! // Initialize template ! ! $layouttemplate = new mx_Template($template->root, $board_config, $db); ! ! $layouttemplate->set_filenames(array( ! 'mx_main_layout' => 'mx_main_layout.tpl') ! ); ! ! // Generate the fold/unfold menu navigation switches (cookie based) ! ! if ( !empty($HTTP_COOKIE_VARS['phpbbEdit_Blocks']) ) ! { ! $edit_on = $HTTP_COOKIE_VARS['phpbbEdit_Blocks']; ! } ! elseif ( $userdata['user_level'] == ADMIN ) ! { ! $edit_on = true; ! } ! else ! { ! $edit_on = false; ! } ! ! // Start output of page --------------------------------------------------------------------------------------- ! // ------------------------------------------------------------------------------------------------------------ ! ! // Page columns ! ! for( $column = 0; $column < $total_column; $column++ ) ! { ! $block_size = $column_rows[$column]['column_size']; ! // Send optional column class ! ! if ( $total_column == 1 ) ! { ! $colclass = 'middlecol'; ! } ! else ! { ! switch( $column ) ! { ! case 0: ! $colclass = 'leftcol'; ! break; ! case 1: ! $colclass = 'middlecol'; ! break; ! case 2: ! $colclass = 'rightcol'; ! break; ! } ! } ! ! // Pass column data ! ! $layouttemplate->assign_block_vars('layout_column', array( ! 'COL_CLASS' => $colclass, ! 'BLOCK_SIZE' => $block_size ! )); ! $column_contents = array(); ! ! // Page blocks ! ! $show_edit_blocks_icon = false; ! ! for( $block = 0; $block < $total_block; $block++ ) ! { ! // Validate this block is really visible and exists for the column ! ! if ( $column_rows[$column]['column_id'] == $block_rows[$block]['column_id'] ) ! { ! $block_id = $mx_block_id = $block_rows[$block]['block_id']; ! $block_file = $block_rows[$block]['function_file']; ! $dynamic_main_block_id = ''; ! ! // Block view auth ----------------------------------------------------------------------------------------------------- ! ! $is_auth_ary = block_auth( AUTH_VIEW, $mx_block_id, $userdata, $block_rows[$block]['auth_view'], $block_rows[$block]['auth_view_group'] ); ! ! if ( ($is_auth_ary['auth_view'] && $block_rows[$block]['show_block'] == 1) || $is_auth_ary['auth_mod'] ) ! { ! //$layouttemplate->assign_block_vars('layoutcol', array()); ! $template = new mx_Template($template->root, $board_config, $db); ! ! $module_root_path = $block_rows[$block]['module_path']; ! ! $title_class = $block_rows[$block]['function_file'] != 'mx_multiple_blocks.php' ? 'mxthHead' : 'mxthHead_none'; ! ! ob_start(); ! include($module_root_path . $block_file); ! $column_contents[$column] = ob_get_contents(); ! ob_end_clean(); ! ! // Pass block data ! if ( $block_rows[$block]['show_block'] == 1 || $is_auth_ary[auth_mod] ) ! { ! $layouttemplate->assign_block_vars('layout_column.blocks', array( ! 'BLOCK' => $column_contents[$column], ! 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : '100%' ) ! )); ! ! // Switch: graphical block borders ! ! if ( !empty($page_row['page_graph_border']) ) ! { ! if ( file_exists($mx_root_path . TEMPLATE_ROOT_PATH . 'images/' . $page_row['page_graph_border'] . '1-1.gif') ) ! { ! $layouttemplate->assign_block_vars('layout_column.blocks.graph_border', array( ! 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, ! 'PREFIX' => $page_row['page_graph_border'] ! )); ! } ! } ! ! if ( $block_rows[$block]['show_stats'] == 1 && !empty($block_rows[$block]['block_time']) && !empty($block_rows[$block]['block_editor_id']) ) ! { ! $editor_name_tmp = get_userdata($block_rows[$block]['block_editor_id']); ! $editor_name = $editor_name_tmp['username']; ! $edit_time = create_date($board_config['default_dateformat'], $block_rows[$block]['block_time'], $board_config['board_timezone']); ! ! $layouttemplate->assign_block_vars('layout_column.blocks.block_stats', array( ! 'L_BLOCK_UPDATED' => $lang['Block_updated_by'], ! 'EDITOR_NAME' => $editor_name, ! 'EDIT_TIME' => $edit_time ! )); ! } ! else ! { ! $layouttemplate->assign_block_vars('layout_column.blocks.no_stats', array()); ! } ! } ! } // End View auth ! ! // Block edit auth --------------------------------------------------------------------------------- ! $mx_block_edit = false; ! ! $is_auth_ary = array(); ! $is_auth_ary = block_auth( AUTH_EDIT, $mx_block_id , $userdata, $block_rows[$block]['auth_edit'], $block_rows[$block]['auth_edit_group'] ); ! ! if ( ( ($is_auth_ary['auth_edit'] && $block_rows[$block]['show_block'] == 1 ) || $is_auth_ary['auth_mod']) ) ! { ! $show_edit_blocks_icon = true; ! $mx_block_edit = true; ! ! // Define some hidden Edit Block parameters ! $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'] ) . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="t" value="' . intval( $HTTP_GET_VARS['t'] ) . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="p" value="' . intval( $HTTP_GET_VARS['p'] ) . '" />'; ! ! // Switch between different block types ! ! $block_edit_img = ( ( $block_file == 'mx_multiple_blocks.php' ) ? 'block_edit_split.gif' : ( $block_file == 'mx_textblock_blog.php' ? 'block_edit_admin.gif' : 'block_edit.gif' ) ) ; ! $split_admin_file = !empty( $block_rows[$block]['function_admin'] ) ? $block_rows[$block]['function_admin'] : 'admin/admin_mx_block.php'; ! ! // Dynamic Block Itself ! if ( !empty($dynamic_main_block_id) ) ! { ! $is_dynamic_auth_ary = array(); ! $is_dynamic_auth_ary = block_auth( AUTH_EDIT, $dynamic_main_block_id , $userdata, $dynamic_block_config[$dynamic_main_block_id]['auth_edit'], $dynamic_block_config[$dynamic_main_block_id]['auth_edit_group'] ); ! ! if ( ($is_dynamic_auth_ary['auth_edit'] || $is_dynamic_auth_ary['auth_mod']) ) ! { ! $block_desc = !empty( $dynamic_block_config[$dynamic_main_block_id]['block_desc'] ) ? ' (' . $dynamic_block_config[$dynamic_main_block_id]['block_desc'] . ')' : ''; ! $edit_url = append_sid( $mx_root_path . 'admin/admin_mx_block.php' . "?sid=" . $userdata['session_id'] ); ! ! $edit_img = '<input type="image" class ="editblock" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/block_icons/' . 'block_edit_admin.gif' . '" alt="' . $lang['Block_Edit'] . $block_rows[$block]['block_id'] . '" title="' . $lang['Block_Edit'] . ' :: ' . $dynamic_block_config[$dynamic_main_block_id]['block_title'] . $block_desc . '">'; ! ! $s_hidden_fields .= '<input type="hidden" name="block_id" value="' . $dynamic_main_block_id . '" />'; ! ! $layouttemplate->assign_block_vars('layout_column.blocks.edit', array( ! 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => $title, ! 'L_DESC' => $b_description, ! 'EDIT_ACTION' => $edit_url, ! 'EDIT_IMG' => $edit_img, ! 'TITLECLASS' => $title_class, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields ! )); ! ! $layouttemplate->assign_block_vars('layout_column.blocks.edit.switch_edit_' . ( $edit_on ? 'on' : 'off' ), array()); ! } ! } ! ! $block_desc = !empty( $block_rows[$block]['block_desc'] ) ? ' (' . $block_rows[$block]['block_desc'] . ')' : ''; ! $edit_url = append_sid( $mx_root_path . $split_admin_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'] . ' :: ' . $block_rows[$block]['block_title'] . $block_desc . '" title="' . $lang['Block_Edit'] . ' :: ' . $block_rows[$block]['block_title'] . $block_desc . '">'; ! ! $s_hidden_fields .= '<input type="hidden" name="block_id" value="' . $mx_block_id . '" />'; ! ! $layouttemplate->assign_block_vars('layout_column.blocks.edit', array( ! 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => $title, ! 'L_DESC' => $b_description, ! 'EDIT_ACTION' => $edit_url, ! 'EDIT_IMG' => $edit_img, ! 'TITLECLASS' => $title_class, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields ! )); ! ! // Is the Block hidden ? ! ! if ( $block_rows[$block]['show_block'] == 0 ) ! { ! $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 ! )); ! } ! ! // Switch: Edit Block ! ! $layouttemplate->assign_block_vars( 'layout_column.blocks.edit.switch_edit_' . ( $edit_on ? 'on' : 'off' ), array() ); ! ! } // End Edit auth ! ! // Switch: show block header ------------------- ! if ( $block_rows[$block]['show_block'] == 1 && ( $mx_block_edit || $block_rows[$block]['show_title'] == 1 ) || $is_auth_ary[auth_mod] ) ! { ! $layouttemplate->assign_block_vars('layout_column.blocks.block_header', array()); ! ! // Switch: show title ------------------- ! if ( $block_rows[$block]['show_title'] == 1 || $is_auth_ary[auth_mod] ) ! { ! $this_block_title = $block_rows[$block]['show_title'] == 0 && $is_auth_ary[auth_mod] ? '(' . $block_rows[$block]['block_title'] . ')' : $block_rows[$block]['block_title']; ! $layouttemplate->assign_block_vars('layout_column.blocks.show_title', array( ! 'L_TITLE' => $this_block_title, ! 'TITLECLASS' => $title_class ! )); ! } ! } ! ! } ! } // for ... blocks ! } // for ... column ! ! // Output page ! ! $layouttemplate->pparse('mx_main_layout'); ! ! // Output footer ! ! include($mx_root_path . 'includes/page_tail.' . $phpEx); ! ?> \ No newline at end of file --- 1,333 ---- ! <?php ! /** ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal ! * author : jon ohlsson, marc morisette and the MX-Team ! * credits : 2001 The phpBB Group ! * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System ! * email : jon...@ho... ! * project site : www.mx-system.com ! * ! * description : the main mx-portal file ! * ------------------------------------------------------------------------- ! * ! * $Id$ ! */ ! ! /** ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! */ ! ! //define('MX_DEBUG', 1); ! define( 'IN_PORTAL', 1 ); ! $mx_root_path = "./"; ! ! include($mx_root_path . 'extension.inc'); ! include($mx_root_path . 'common.' . $phpEx); ! ! $view_page = false; ! ! // Page selector ! ! $page_id = $mx_request_vars->request('page', MX_TYPE_INT, 1); ! ! // Start session management ! $userdata = session_pagestart($user_ip, - ( 1000 + $page_id )); ! mx_init_userprefs($userdata); ! ! if ( $mx_request_vars->is_request('mx_copy') ) ! { ! compose_mx_copy(); ! } ! ! // Load page vars ! // Load http_session variables if populated, else consult db and populate http_session ! ! $mx_session_time = isset($HTTP_SESSION_VARS['mx_session_recached']) ? $HTTP_SESSION_VARS['mx_session_recached'] : $userdata['session_start']; ! if ( empty( $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id] ) || $portal_config['portal_recached'] > $mx_session_time ) ! { ! $HTTP_SESSION_VARS['mx_session_recached'] = $portal_config['portal_recached']; ! if ( defined('MX_DEBUG') ) ! { ! echo('populating page block http_session'); ! } ! // Populate all mx_pages session vars, for faster navigation ! get_page_session(); ! } ! ! $page_row = $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['page_info']; ! ! $block_rows = $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['blocks']; ! $total_block = count($block_rows); ! ! $column_rows = $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['columns']; ! $total_column = count($column_rows); ! ! $page_title .= $page_row['page_name']; ! $page_icon = $page_row['page_icon']; ! $page_ov_header = $page_row['page_header']; ! ! // Page auth ! $is_auth_ary = page_auth(AUTH_VIEW, $userdata, $page_row['page_auth_view'], $page_row['page_auth_view_group']); ! ! if ( !$is_auth_ary[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 ( !$is_auth_ary[auth_view] && !$userdata['session_logged_in'] ) ! { ! mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=" . mx_this_url(), true)); ! } ! include($mx_root_path . 'includes/page_header.' . $phpEx); ! ! // Initialize template ! ! $layouttemplate = new mx_Template($template->root, $board_config, $db); ! ! $layouttemplate->set_filenames(array( ! 'mx_main_layout' => 'mx_main_layout.tpl') ! ); ! ! // Generate the fold/unfold menu navigation switches (cookie based) ! ! if ( !empty($HTTP_COOKIE_VARS['phpbbEdit_Blocks']) ) ! { ! $edit_on = $HTTP_COOKIE_VARS['phpbbEdit_Blocks']; ! } ! elseif ( $userdata['user_level'] == ADMIN ) ! { ! $edit_on = true; ! } ! else ! { ! $edit_on = false; ! } ! ! // Start output of page --------------------------------------------------------------------------------------- ! // ------------------------------------------------------------------------------------------------------------ ! ! // Page columns ! ! for( $column = 0; $column < $total_column; $column++ ) ! { ! $block_size = $column_rows[$column]['column_size']; ! // Send optional column class ! ! if ( $total_column == 1 ) ! { ! $colclass = 'middlecol'; ! } ! else ! { ! switch( $column ) ! { ! case 0: ! $colclass = 'leftcol'; ! break; ! case 1: ! $colclass = 'middlecol'; ! break; ! case 2: ! $colclass = 'rightcol'; ! break; ! } ! } ! ! // Pass column data ! ! $layouttemplate->assign_block_vars('layout_column', array( ! 'COL_CLASS' => $colclass, ! 'BLOCK_SIZE' => $block_size ! )); ! $column_contents = array(); ! ! // Page blocks ! ! $show_edit_blocks_icon = false; ! ! for( $block = 0; $block < $total_block; $block++ ) ! { ! // Validate this block is really visible and exists for the column ! ! if ( $column_rows[$column]['column_id'] == $block_rows[$block]['column_id'] ) ! { ! $block_id = $mx_block_id = $block_rows[$block]['block_id']; ! $block_file = $block_rows[$block]['function_file']; ! $dynamic_main_block_id = ''; ! ! // Block view auth ----------------------------------------------------------------------------------------------------- ! ! $is_auth_ary = block_auth( AUTH_VIEW, $mx_block_id, $userdata, $block_rows[$block]['auth_view'], $block_rows[$block]['auth_view_group'] ); ! ! if ( ($is_auth_ary['auth_view'] && $block_rows[$block]['show_block'] == 1) || $is_auth_ary['auth_mod'] ) ! { ! //$layouttemplate->assign_block_vars('layoutcol', array()); ! $template = new mx_Template($template->root, $board_config, $db); ! ! $module_root_path = $block_rows[$block]['module_path']; ! ! $title_class = $block_rows[$block]['function_file'] != 'mx_multiple_blocks.php' ? 'mxthHead' : 'mxthHead_none'; ! ! ob_start(); ! include($module_root_path . $block_file); ! $column_contents[$column] = ob_get_contents(); ! ob_end_clean(); ! ! // Pass block data ! if ( $block_rows[$block]['show_block'] == 1 || $is_auth_ary[auth_mod] ) ! { ! $layouttemplate->assign_block_vars('layout_column.blocks', array( ! 'BLOCK' => $column_contents[$column], ! 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : '100%' ) ! )); ! ! // Switch: graphical block borders ! ! if ( !empty($page_row['page_graph_border']) ) ! { ! if ( file_exists($mx_root_path . TEMPLATE_ROOT_PATH . 'images/' . $page_row['page_graph_border'] . '1-1.gif') ) ! { ! $layouttemplate->assign_block_vars('layout_column.blocks.graph_border', array( ! 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, ! 'PREFIX' => $page_row['page_graph_border'] ! )); ! } ! } ! ! if ( $block_rows[$block]['show_stats'] == 1 && !empty($block_rows[$block]['block_time']) && !empty($block_rows[$block]['block_editor_id']) ) ! { ! $editor_name_tmp = get_userdata($block_rows[$block]['block_editor_id']); ! $editor_name = $editor_name_tmp['username']; ! $edit_time = create_date($board_config['default_dateformat'], $block_rows[$block]['block_time'], $board_config['board_timezone']); ! ! $layouttemplate->assign_block_vars('layout_column.blocks.block_stats', array( ! 'L_BLOCK_UPDATED' => $lang['Block_updated_by'], ! 'EDITOR_NAME' => $editor_name, ! 'EDIT_TIME' => $edit_time ! )); ! } ! else ! { ! $layouttemplate->assign_block_vars('layout_column.blocks.no_stats', array()); ! } ! } ! } // End View auth ! ! // Block edit auth --------------------------------------------------------------------------------- ! $mx_block_edit = false; ! ! $is_auth_ary = array(); ! $is_auth_ary = block_auth( AUTH_EDIT, $mx_block_id , $userdata, $block_rows[$block]['auth_edit'], $block_rows[$block]['auth_edit_group'] ); ! ! if ( ( ($is_auth_ary['auth_edit'] && $block_rows[$block]['show_block'] == 1 ) || $is_auth_ary['auth_mod']) ) ! { ! $show_edit_blocks_icon = true; ! $mx_block_edit = true; ! ! // Define some hidden Edit Block parameters ! $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'] ) . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="t" value="' . intval( $HTTP_GET_VARS['t'] ) . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="p" value="' . intval( $HTTP_GET_VARS['p'] ) . '" />'; ! ! // Switch between different block types ! ! $block_edit_img = ( ( $block_file == 'mx_multiple_blocks.php' ) ? 'block_edit_split.gif' : ( $block_file == 'mx_textblock_blog.php' ? 'block_edit_admin.gif' : 'block_edit.gif' ) ) ; ! $split_admin_file = !empty( $block_rows[$block]['function_admin'] ) ? $block_rows[$block]['function_admin'] : 'admin/admin_mx_block.php'; ! ! // Dynamic Block Itself ! if ( !empty($dynamic_main_block_id) ) ! { ! $is_dynamic_auth_ary = array(); ! $is_dynamic_auth_ary = block_auth( AUTH_EDIT, $dynamic_main_block_id , $userdata, $dynamic_block_config[$dynamic_main_block_id]['auth_edit'], $dynamic_block_config[$dynamic_main_block_id]['auth_edit_group'] ); ! ! if ( ($is_dynamic_auth_ary['auth_edit'] || $is_dynamic_auth_ary['auth_mod']) ) ! { ! $block_desc = !empty( $dynamic_block_config[$dynamic_main_block_id]['block_desc'] ) ? ' (' . $dynamic_block_config[$dynamic_main_block_id]['block_desc'] . ')' : ''; ! $edit_url = append_sid( $mx_root_path . 'admin/admin_mx_block.php' . "?sid=" . $userdata['session_id'] ); ! ! $edit_img = '<input type="image" class ="editblock" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/block_icons/' . 'block_edit_admin.gif' . '" alt="' . $lang['Block_Edit'] . $block_rows[$block]['block_id'] . '" title="' . $lang['Block_Edit'] . ' :: ' . $dynamic_block_config[$dynamic_main_block_id]['block_title'] . $block_desc . '">'; ! ! $s_hidden_fields .= '<input type="hidden" name="block_id" value="' . $dynamic_main_block_id . '" />'; ! ! $layouttemplate->assign_block_vars('layout_column.blocks.edit', array( ! 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => $title, ! 'L_DESC' => $b_description, ! 'EDIT_ACTION' => $edit_url, ! 'EDIT_IMG' => $edit_img, ! 'TITLECLASS' => $title_class, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields ! )); ! ! $layouttemplate->assign_block_vars('layout_column.blocks.edit.switch_edit_' . ( $edit_on ? 'on' : 'off' ), array()); ! } ! } ! ! $block_desc = !empty( $block_rows[$block]['block_desc'] ) ? ' (' . $block_rows[$block]['block_desc'] . ')' : ''; ! $edit_url = append_sid( $mx_root_path . $split_admin_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'] . ' :: ' . $block_rows[$block]['block_title'] . $block_desc . '" title="' . $lang['Block_Edit'] . ' :: ' . $block_rows[$block]['block_title'] . $block_desc . '">'; ! ! $s_hidden_fields .= '<input type="hidden" name="block_id" value="' . $mx_block_id . '" />'; ! ! $layouttemplate->assign_block_vars('layout_column.blocks.edit', array( ! 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => $title, ! 'L_DESC' => $b_description, ! 'EDIT_ACTION' => $edit_url, ! 'EDIT_IMG' => $edit_img, ! 'TITLECLASS' => $title_class, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields ! )); ! ! // Is the Block hidden ? ! ! if ( $block_rows[$block]['show_block'] == 0 ) ! { ! $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 ! )); ! } ! ! // Switch: Edit Block ! ! $layouttemplate->assign_block_vars( 'layout_column.blocks.edit.switch_edit_' . ( $edit_on ? 'on' : 'off' ), array() ); ! ! } // End Edit auth ! ! // Switch: show block header ------------------- ! if ( $block_rows[$block]['show_block'] == 1 && ( $mx_block_edit || $block_rows[$block]['show_title'] == 1 ) || $is_auth_ary[auth_mod] ) ! { ! $layouttemplate->assign_block_vars('layout_column.blocks.block_header', array()); ! ! // Switch: show title ------------------- ! if ( $block_rows[$block]['show_title'] == 1 || $is_auth_ary[auth_mod] ) ! { ! $this_block_title = $block_rows[$block]['show_title'] == 0 && $is_auth_ary[auth_mod] ? '(' . $block_rows[$block]['block_title'] . ')' : $block_rows[$block]['block_title']; ! $layouttemplate->assign_block_vars('layout_column.blocks.show_title', array( ! 'L_TITLE' => $this_block_title, ! 'TITLECLASS' => $title_class ! )); ! } ! } ! ! } ! } // for ... blocks ! } // for ... column ! ! // Output page ! ! $layouttemplate->pparse('mx_main_layout'); ! ! // Output footer ! ! include($mx_root_path . 'includes/page_tail.' . $phpEx); ! ?> \ No newline at end of file |