[phpMP-CVS] CVS: phpMP/includes config.init.php,1.5,1.6 core.php,1.57,1.58 debug.php,1.6,1.7 languag
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2003-06-29 05:53:27
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv13269/includes Modified Files: config.init.php core.php debug.php language.php mpcode.php session.php template.php user.php Log Message: Hopefully this will fix a few problems. Index: config.init.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/config.init.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -r1.57 -r1.58 *** core.php 3 Jun 2003 06:48:21 -0000 1.57 --- core.php 29 Jun 2003 05:53:24 -0000 1.58 *************** *** 67,72 **** } ! //error_reporting(E_ERROR | E_WARNING | E_PARSE); ! error_reporting(E_ALL); include_once( PHPMP_ROOT . 'config.php' ); --- 67,72 ---- } ! //error_reporting(E_ALL); ! error_reporting(E_ERROR | E_WARNING | E_PARSE); include_once( PHPMP_ROOT . 'config.php' ); *************** *** 136,141 **** } ! $Template->set_template( $Config->get('template') ); ! echo $Config->get('template'); $DB->close(); } --- 136,140 ---- } ! $Template->set_template( $Config->get('template'), false, true ); $DB->close(); } Index: debug.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/debug.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 Index: language.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/language.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 Index: mpcode.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/mpcode.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 Index: session.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/session.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** template.php 3 Jun 2003 06:48:21 -0000 1.36 --- template.php 29 Jun 2003 05:53:24 -0000 1.37 *************** *** 7,11 **** * 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. * --- 7,11 ---- * 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 vlersion 2 of the License, or * (at your option) any later version. * *************** *** 53,64 **** var $block_nesting_level = 0; var $force_recompile; ! ! function set_template($template = '', $force_recompile = false) { $this->root = PHPMP_ROOT . 'templates/' . $template; ! $this->cachedir = PHPMP_ROOT . $this->cache_root . $template . '/'; $this->force_recompile = $force_recompile; --- 53,67 ---- var $block_nesting_level = 0; + var $static_lang; var $force_recompile; ! ! ! function set_template($template = '', $static_lang = false, $force_recompile = false) { $this->root = PHPMP_ROOT . 'templates/' . $template; ! $this->cachedir = PHPMP_ROOT . $this->cache_root . $template . '/'; + $this->static_lang = $static_lang; $this->force_recompile = $force_recompile; *************** *** 115,118 **** --- 118,122 ---- function display($handle) { + global $Config, $Local; if ($filename = $this->_tpl_load($handle)) *************** *** 131,137 **** function _tpl_load(&$handle) { ! global $Config; ! $filename = $this->cachedir . $this->filename[$handle] . '.' . $Config->get('language') . '.php'; // Recompile page if the original template is newer, otherwise load the compiled version --- 135,141 ---- function _tpl_load(&$handle) { ! global $Config, $user; ! $filename = $this->cachedir . $this->filename[$handle] . '.' . (($this->static_lang) ? $Config->get('language') . '.' : '') . 'php'; // Recompile page if the original template is newer, otherwise load the compiled version *************** *** 150,154 **** if (!isset($this->files[$handle])) { ! trigger_error("Template->_tpl_load(): No file specified for handle $handle", E_USER_ERROR); } --- 154,158 ---- if (!isset($this->files[$handle])) { ! trigger_error("template->_tpl_load(): No file specified for handle $handle", E_USER_ERROR); } *************** *** 157,161 **** if (!($fp = @fopen($this->files[$handle], 'r'))) { ! trigger_error("Template->_tpl_load(): File $filename does not exist or is empty", E_USER_ERROR); } --- 161,165 ---- if (!($fp = @fopen($this->files[$handle], 'r'))) { ! trigger_error("template->_tpl_load(): File $filename does not exist or is empty", E_USER_ERROR); } *************** *** 226,230 **** function _tpl_include($filename, $include = true) { ! global $user; $handle = $filename; --- 230,234 ---- function _tpl_include($filename, $include = true) { ! global $user, $Config, $Local; $handle = $filename; *************** *** 253,256 **** --- 257,261 ---- { global $Config; + error_reporting(E_ERROR | E_WARNING | E_PARSE); // Remove any "loose" php ... we want to give admins the ability *************** *** 348,352 **** $this->compile_var_tags($blocks[0][$curr_tb]); $trim_check = trim($blocks[0][$curr_tb]); ! $compile_blocks[] = (!$do_not_echo) ? ((!empty($trim_check)) ? $blocks[0][$curr_tb] : '') : ((!empty($trim_check)) ? $blocks[0][$curr_tb] : ''); break; } --- 353,357 ---- $this->compile_var_tags($blocks[0][$curr_tb]); $trim_check = trim($blocks[0][$curr_tb]); ! $compile_blocks[] = (!$no_echo) ? ((!empty($trim_check)) ? $blocks[0][$curr_tb] : '') : ((!empty($trim_check)) ? $blocks[0][$curr_tb] : ''); break; } *************** *** 386,398 **** } - global $Local; - // This will handle the remaining root-level varrefs if (!$this->static_lang) { $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*?)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$Local->lang['\\1'])) ? \$Local->lang['\\1'] : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }')); ?>", $text_blocks); } else { $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]*?)\}#e', "'<?php echo ((isset(\$this->_tpldata[\'.\'][0][\'L_\\1\'])) ? \$this->_tpldata[\'.\'][0][\'L_\\1\'] : \'' . ((isset(\$Local->lang['\\1'])) ? \$Local->lang['\\1'] : '') . '\'); ?>'" , $text_blocks); } --- 391,404 ---- } // This will handle the remaining root-level varrefs if (!$this->static_lang) { + global $Local; $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*?)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$Local->lang['\\1'])) ? \$Local->lang['\\1'] : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }')); ?>", $text_blocks); } else { + global $Local; + $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]*?)\}#e', "'<?php echo ((isset(\$this->_tpldata[\'.\'][0][\'L_\\1\'])) ? \$this->_tpldata[\'.\'][0][\'L_\\1\'] : \'' . ((isset(\$Local->lang['\\1'])) ? \$Local->lang['\\1'] : '') . '\'); ?>'" , $text_blocks); } *************** *** 688,694 **** function compile_write(&$handle, $data) { ! global $Config; ! $filename = $this->cachedir . $this->filename[$handle] . '.' . $Config->get('language') . '.php'; if ($fp = @fopen($filename, 'w+')) --- 694,700 ---- function compile_write(&$handle, $data) { ! global $user, $Config; ! $filename = $this->cachedir . $this->filename[$handle] . '.' . (($this->static_lang) ? $Config->get('language') . '.' : '') . 'php'; if ($fp = @fopen($filename, 'w+')) Index: user.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/user.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 |