[phpMP-CVS] CVS: phpMP/includes constants.php,1.10,1.11 core.php,1.37,1.38 functions.php,1.13,1.14 l
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2002-12-03 11:17:45
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv27709/includes Modified Files: constants.php core.php functions.php language.php template.php user.php Log Message: Reformatted language file. Started organizing constants file. Added a bit of logic to variables - U_ prefix is a user var. Index: constants.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/constants.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** constants.php 1 Dec 2002 03:47:22 -0000 1.10 --- constants.php 3 Dec 2002 11:17:42 -0000 1.11 *************** *** 3,5 **** --- 3,15 ---- define("TIME_NOW", date( DATE_FORMAT ) ); + define("ACTIVATE_DISABLED", 0); + define("ACTIVATE_USER", 1); + define("ACTIVATE_ADMIN", 2); + + define("AUTH_LVL_GUEST", 0); // Guest. + define("AUTH_LVL_MEM", 1); // Standard Member + define("AUTH_LVL_CONTRIB", 2); // Contributor + define("AUTH_LVL_MOD", 3); // Moderator + define("AUTH_LVL_ADMIN", 4); // Administrator + ?> Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** core.php 3 Dec 2002 08:37:11 -0000 1.37 --- core.php 3 Dec 2002 11:17:42 -0000 1.38 *************** *** 49,60 **** $this->_initConfig(); // Grab DB-stored config values. include_once(PHPMP_ROOT . 'includes/user.php'); $User = new User(); // Create an instance of User. - include_once(PHPMP_ROOT . 'includes/functions.php'); - include_once(PHPMP_ROOT . 'includes/language.php'); $Language = new Language(); include_once(PHPMP_ROOT . 'includes/constants.php'); --- 49,61 ---- $this->_initConfig(); // Grab DB-stored config values. + include_once(PHPMP_ROOT . 'includes/functions.php'); + include_once(PHPMP_ROOT . 'includes/user.php'); $User = new User(); // Create an instance of User. include_once(PHPMP_ROOT . 'includes/language.php'); $Language = new Language(); + createConstants(); include_once(PHPMP_ROOT . 'includes/constants.php'); Index: functions.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/functions.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** functions.php 5 Nov 2002 22:11:06 -0000 1.13 --- functions.php 3 Dec 2002 11:17:42 -0000 1.14 *************** *** 1,5 **** <? ! // File for functions that go nowhere in particular. ?> --- 1,19 ---- <? ! // Defines constants whose contents may be questionable. ! // Author: Brian 'Heimidal' Rose ! // Accepts: none. ! // Returns: none. ! function createConstants() ! { ! ! if( defined( "U_DATE_FORMAT" ) ) ! { ! define( "DATE_FORMAT", U_DATE_FORMAT ); ! } ! else ! { ! define( "DATE_FORMAT", DEFAULT_DATE_FORMAT ); ! } ?> Index: language.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/language.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** language.php 3 Dec 2002 06:37:34 -0000 1.3 --- language.php 3 Dec 2002 11:17:42 -0000 1.4 *************** *** 7,13 **** { ! if( defined("USR_LANG") ) { ! define( "LANGUAGE", USR_LANG ); } else { --- 7,13 ---- { ! if( defined("U_LANGUAGE") ) { ! define( "LANGUAGE", U_LANGUAGE ); } else { *************** *** 17,21 **** global $Local; ! include_once( PHPMP_ROOT . 'languages/' . LANGUAGE . '/lang_main.php'); $Local = new Localization(); --- 17,21 ---- global $Local; ! include_once( PHPMP_ROOT . 'languages/' . LANGUAGE . '/lang_main.php' ); $Local = new Localization(); *************** *** 24,26 **** } ! ?> --- 24,26 ---- } ! ?> \ No newline at end of file Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** template.php 1 Dec 2002 03:47:22 -0000 1.22 --- template.php 3 Dec 2002 11:17:42 -0000 1.23 *************** *** 7,10 **** --- 7,43 ---- { + // Assigns template constants. + // This function should somehow be integrated into constants.php. + // Author: Nrian 'Heimidal' Rose + // Accepts: none. + // Returns: none. + function assignConstants() + { + + $this->assign( array( + + "SITE_ADDR" => SITE_ADDR, + "SITE_NAME" => SITE_NAME, + "REL_PATH" => REL_PATH, + "TIME_NOW" => TIME_NOW, + "TEMPLATE" => TEMPLATE + + ) ); + + } + + // Assigns template vars through lang files. + // Author: Brian 'Heimidal' Rose + // Accepts: none. + // Returns: none. + function assignLangVars() + { + + global $Local; + + $this->assign( $Local->lang ); + + } + // Initiates the Template engine. // Author: Brian 'Heimidal' Rose *************** *** 16,20 **** if( defined( "USR_TPL" ) && ( OVERRIDE_USR_TPL == 0 ) ) { ! define( "TEMPLATE", USR_TPL ); } else { --- 49,53 ---- if( defined( "USR_TPL" ) && ( OVERRIDE_USR_TPL == 0 ) ) { ! define( "TEMPLATE", U_TEMPLATE ); } else { *************** *** 32,57 **** // Switch for caching. ! $this->caching = false; //Caching does not currently work. Maybe later. ! ! } ! ! ! // Assigns template constants. ! // This function should somehow be integrated into constants.php. ! // Author: Nrian 'Heimidal' Rose ! // Accepts: none. ! // Returns: none. ! function assign_constants() ! { ! ! $this->assign( array( ! ! "SITE_ADDR" => SITE_ADDR, ! "SITE_NAME" => SITE_NAME, ! "REL_PATH" => REL_PATH, ! "TIME_NOW" => TIME_NOW, ! "TEMPLATE" => TEMPLATE ! ! ) ); } --- 65,69 ---- // Switch for caching. ! $this->caching = false; // Caching does not currently work. Maybe later. } *************** *** 59,61 **** } ! ?> --- 71,73 ---- } ! ?> \ No newline at end of file Index: user.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/user.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** user.php 3 Dec 2002 08:37:11 -0000 1.3 --- user.php 3 Dec 2002 11:17:42 -0000 1.4 *************** *** 18,22 **** while( list ($key, $val) = each ($user_array) ) { ! define( "U_" . $key, $val ); } --- 18,25 ---- while( list ($key, $val) = each ($user_array) ) { ! if( $val != '' ) ! { ! define( "U_" . $key, $val ); ! } } *************** *** 62,66 **** { ! $this->snapshot(1); } --- 65,69 ---- { ! $this->snapshot('-1'); } |