phpmp-commits Mailing List for phpMyPublications (Page 17)
Status: Pre-Alpha
Brought to you by:
heimidal
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(69) |
May
(1) |
Jun
|
Jul
(53) |
Aug
(27) |
Sep
|
Oct
|
Nov
(35) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(5) |
Feb
(65) |
Mar
|
Apr
(15) |
May
(40) |
Jun
(72) |
Jul
|
Aug
(2) |
Sep
(95) |
Oct
(37) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Brian R. <hei...@us...> - 2002-12-02 00:44:38
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv3806 Added Files: phpmp_db_default_vals.sql phpmp_db_structure.sql Log Message: Added the db structure and default data files so that someone can actually set this up. --- NEW FILE: phpmp_db_default_vals.sql --- # phpMyAdmin MySQL-Dump # version 2.3.2 # http://www.phpmyadmin.net/ (download page) # # Host: localhost # Generation Time: Dec 01, 2002 at 05:40 PM # Server version: 3.23.53 # PHP Version: 4.2.3 # Database : `phpmp` # # Dumping data for table `phpmp_config` # INSERT INTO phpmp_config (config_key, config_value) VALUES ('site_addr', 'http://192.168.0.2'); INSERT INTO phpmp_config (config_key, config_value) VALUES ('rel_path', '/'); INSERT INTO phpmp_config (config_key, config_value) VALUES ('default_tpl', 'TealMP'); INSERT INTO phpmp_config (config_key, config_value) VALUES ('override_usr_tpl', '0'); INSERT INTO phpmp_config (config_key, config_value) VALUES ('site_name', 'phpMP Development'); INSERT INTO phpmp_config (config_key, config_value) VALUES ('default_lang', 'english'); INSERT INTO phpmp_config (config_key, config_value) VALUES ('date_format', 'M j, Y h:iA'); INSERT INTO phpmp_config (config_key, config_value) VALUES ('enable_account_activation', '0'); INSERT INTO phpmp_config (config_key, config_value) VALUES ('system_timezone', '-7'); --- NEW FILE: phpmp_db_structure.sql --- # phpMyAdmin MySQL-Dump # version 2.3.2 # http://www.phpmyadmin.net/ (download page) # # Host: localhost # Generation Time: Dec 01, 2002 at 05:39 PM # Server version: 3.23.53 # PHP Version: 4.2.3 # Database : `phpmp` # -------------------------------------------------------- # # Table structure for table `phpmp_config` # CREATE TABLE phpmp_config ( config_key varchar(255) NOT NULL default '', config_value varchar(255) NOT NULL default '', PRIMARY KEY (config_key) ) TYPE=MyISAM; |
From: Brian R. <hei...@us...> - 2002-12-02 00:37:59
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv32142 Added Files: config.php.sample Log Message: Added a sample config file for developers. --- NEW FILE: config.php.sample --- <? ## DO NOT ALTER THIS FILE. ## This file is automatically generated ## by the phpMP install script. Do not ## alter this file if you don't know ## what you're doing. define( "PHPMP_INSTALLED", TRUE ); define( "DB_TYPE", "mysql" ); define( "DB_HOST", "localhost" ); define( "DB_NAME", "phpmp" ); define( "DB_TABLE_PREFIX", "phpmp_" ); define( "DB_USER", "phpmp" ); define( "DB_PASSWD", "passwd" ); ?> |
From: Brian R. <hei...@us...> - 2002-12-01 21:49:14
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv9993/includes Modified Files: core.php Log Message: Redestributed $DB to its own variable and not within the scope of $Core. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** core.php 1 Dec 2002 03:47:22 -0000 1.30 --- core.php 1 Dec 2002 21:49:11 -0000 1.31 *************** *** 4,9 **** { - var $DB; - // Initiates configuration from database. // Author: Brian 'Heimidal' Rose --- 4,7 ---- *************** *** 19,27 **** define("BLOCK_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'blocks'); ! $result = $this->DB->query( "SELECT * FROM " . CONFIG_TABLE ); // Loop through all config values from DB. // Define each key as its respective value. ! while( $row = $this->DB->fetchArray( $result ) ) { define( strtoupper( $row['key'] ), $row['value'] ); --- 17,27 ---- define("BLOCK_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'blocks'); ! global $DB; ! ! $result = $DB->query( "SELECT * FROM " . CONFIG_TABLE ); // Loop through all config values from DB. // Define each key as its respective value. ! while( $row = $DB->fetchArray( $result ) ) { define( strtoupper( $row['key'] ), $row['value'] ); *************** *** 43,49 **** //$Debug = new Debug(); include( './dba/' . DB_TYPE . '.dba' ); ! $this->DB = new DB(); ! $this->DB->connect(); $this->_initConfig(); // Grab DB-stored config values. --- 43,51 ---- //$Debug = new Debug(); + global $DB; + include( './dba/' . DB_TYPE . '.dba' ); ! $DB = new DB(); ! $DB->connect(); $this->_initConfig(); // Grab DB-stored config values. |
From: Brian R. <hei...@us...> - 2002-12-01 03:47:25
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv23442/includes Modified Files: constants.php core.php template.php Log Message: Realized after an hour of long, torturous thought that the constants file wouldn't work as laid out. Made a few other small updates as well. Screwed with the other files randomly to get everything working alright. Index: constants.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/constants.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** constants.php 30 Nov 2002 23:38:06 -0000 1.9 --- constants.php 1 Dec 2002 03:47:22 -0000 1.10 *************** *** 1,9 **** <? ! define("CONFIG_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'config'); ! define("USERS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'users'); ! define("SESSION_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'sessions'); ! define("MODULES_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'modules'); ! define("BLOCK_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'blocks'); ?> --- 1,5 ---- <? ! define("TIME_NOW", date( DATE_FORMAT ) ); ?> Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** core.php 30 Nov 2002 23:18:39 -0000 1.29 --- core.php 1 Dec 2002 03:47:22 -0000 1.30 *************** *** 4,7 **** --- 4,9 ---- { + var $DB; + // Initiates configuration from database. // Author: Brian 'Heimidal' Rose *************** *** 11,26 **** { ! global $DB; // Globalize DB class. ! $sql = "SELECT * FROM " . CONFIG_TABLE; ! $result = $DB->query( $sql ); // Loop through all config values from DB. // Define each key as its respective value. ! while( $row = $DB->fetch_array( $result ) ) { ! define( str_to_upper( $row['key'] ), $row['value'] ); } } --- 13,33 ---- { ! define("CONFIG_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'config'); ! define("USERS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'users'); ! define("SESSION_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'sessions'); ! define("MODULES_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'modules'); ! define("BLOCK_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'blocks'); ! $result = $this->DB->query( "SELECT * FROM " . CONFIG_TABLE ); // Loop through all config values from DB. // Define each key as its respective value. ! while( $row = $this->DB->fetchArray( $result ) ) { ! define( strtoupper( $row['key'] ), $row['value'] ); } + print "Config values defined.<br /><br />"; + } *************** *** 33,47 **** include_once('./config.php'); ! include_once('./includes/debug.php'); ! $Debug = new Debug(); ! include_once( './dba/' . DB_TYPE . '.dba' ); ! $DB = new DB(); ! $DB->connect; $this->_initConfig(); // Grab DB-stored config values. include_once('./includes/auth.php'); ! $Auth = new Auth(); // Create an instance of Auth. include_once('./includes/language.php'); --- 40,54 ---- include_once('./config.php'); ! //include_once('./includes/debug.php'); ! //$Debug = new Debug(); ! include( './dba/' . DB_TYPE . '.dba' ); ! $this->DB = new DB(); ! $this->DB->connect(); $this->_initConfig(); // Grab DB-stored config values. include_once('./includes/auth.php'); ! //$Auth = new Auth(); // Create an instance of Auth. include_once('./includes/language.php'); *************** *** 72,76 **** // Globalize all major class-containing variables. ! global $Debug, $DB, $Auth, $Language, $Parser, $Template; } --- 79,83 ---- // Globalize all major class-containing variables. ! global $Debug, $Auth, $Language, $Parser, $Template; } Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** template.php 30 Nov 2002 10:58:23 -0000 1.21 --- template.php 1 Dec 2002 03:47:22 -0000 1.22 *************** *** 14,21 **** { // Set up the directories for Smarty. $this->template_dir = './templates/' . TEMPLATE; $this->compile_dir = './templates/' . TEMPLATE . '/compile'; ! $this->config_dir = './templates/' . TEMPLATE . '/configs' $this->cache_dir = ''; --- 14,29 ---- { + if( defined( "USR_TPL" ) && ( OVERRIDE_USR_TPL == 0 ) ) + { + define( "TEMPLATE", USR_TPL ); + } + else { + define( "TEMPLATE", DEFAULT_TPL ); + } + // Set up the directories for Smarty. $this->template_dir = './templates/' . TEMPLATE; $this->compile_dir = './templates/' . TEMPLATE . '/compile'; ! $this->config_dir = './templates/' . TEMPLATE . '/configs'; $this->cache_dir = ''; *************** *** 34,38 **** // Accepts: none. // Returns: none. ! assign_constants() { --- 42,46 ---- // Accepts: none. // Returns: none. ! function assign_constants() { *************** *** 40,47 **** "SITE_ADDR" => SITE_ADDR, "REL_PATH" => REL_PATH, ! "TODAY" => TODAY, ! "TEMPLATE" => TEMPLATE, ! "SITE_NAME" => SITE_NAME ) ); --- 48,55 ---- "SITE_ADDR" => SITE_ADDR, + "SITE_NAME" => SITE_NAME, "REL_PATH" => REL_PATH, ! "TIME_NOW" => TIME_NOW, ! "TEMPLATE" => TEMPLATE ) ); |
From: Brian R. <hei...@us...> - 2002-12-01 03:47:24
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv23442 Modified Files: index.php Log Message: Realized after an hour of long, torturous thought that the constants file wouldn't work as laid out. Made a few other small updates as well. Screwed with the other files randomly to get everything working alright. Index: index.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/index.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** index.php 5 Nov 2002 22:11:05 -0000 1.22 --- index.php 1 Dec 2002 03:47:21 -0000 1.23 *************** *** 1,5 **** <? ! // Index file. ! ?> \ No newline at end of file --- 1,43 ---- + <html> + <body> + <? ! include( './includes/core.php' ); ! $Core = new Core(); ! ! $Core->init(); ! ! // For testing purposes, we will now print all of the constants we have declared. ! ! print "phpMP Version: " . VERSION . '<br>'; ! ! print "<br>"; ! ! print "Site Name: " . SITE_NAME . '<br>'; ! print "Site Address: " . SITE_ADDR . '<br>'; ! print "Relative Path: " . REL_PATH . '<br>'; ! print "Default Template: " . DEFAULT_TPL . '<br>'; ! print "Default Language: " . DEFAULT_LANG . '<br>'; ! print "The Current Date and Time: " . TIME_NOW . '<br>'; ! ! print "<br>"; ! ! print "DB Type: " . DB_TYPE . '<br>'; ! print "DB Host: " . DB_HOST . '<br>'; ! print "DB Name: " . DB_NAME . '<br>'; ! print "DB User: " . DB_USER . '<br>'; ! print "DB Host: " . DB_TABLE_PREFIX . '<br>'; ! ! print "<br>"; ! ! print "Config Table: " . CONFIG_TABLE . '<br>'; ! print "Users Table: " . USERS_TABLE . '<br>'; ! print "Block Table: " . BLOCK_TABLE . '<br>'; ! print "Modules Table: " . MODULES_TABLE . '<br>'; ! print "Session Table: " . SESSION_TABLE . '<br>'; ! ! ?> ! </body> ! </html> \ No newline at end of file |
From: Brian R. <hei...@us...> - 2002-12-01 03:47:24
|
Update of /cvsroot/phpmp/phpMP/dba In directory sc8-pr-cvs1:/tmp/cvs-serv23442/dba Modified Files: mysql.dba Log Message: Realized after an hour of long, torturous thought that the constants file wouldn't work as laid out. Made a few other small updates as well. Screwed with the other files randomly to get everything working alright. Index: mysql.dba =================================================================== RCS file: /cvsroot/phpmp/phpMP/dba/mysql.dba,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** mysql.dba 30 Nov 2002 23:40:09 -0000 1.19 --- mysql.dba 1 Dec 2002 03:47:21 -0000 1.20 *************** *** 7,11 **** var $connected; ! connect () { if ( empty ($this->ident_link) ) --- 7,11 ---- var $connected; ! function connect () { if ( empty ($this->ident_link) ) *************** *** 32,36 **** } ! close () { if ( $this->ident_link != 0 ) --- 32,36 ---- } ! function close () { if ( $this->ident_link != 0 ) *************** *** 47,51 **** } ! query ( $qry ) { if ( $this->ident_link == 0 ) --- 47,51 ---- } ! function query ( $qry ) { if ( $this->ident_link == 0 ) *************** *** 160,162 **** } ! ?> --- 160,162 ---- } ! ?> \ No newline at end of file |
From: Brian R. <hei...@us...> - 2002-11-30 23:40:12
|
Update of /cvsroot/phpmp/phpMP/dba In directory sc8-pr-cvs1:/tmp/cvs-serv6520 Modified Files: mysql.dba Log Message: Dropped the select db calls since we don't really need them. Index: mysql.dba =================================================================== RCS file: /cvsroot/phpmp/phpMP/dba/mysql.dba,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** mysql.dba 6 Nov 2002 03:28:19 -0000 1.18 --- mysql.dba 30 Nov 2002 23:40:09 -0000 1.19 *************** *** 21,26 **** { $this->ident_link = $connection; ! ! $this->selectDB (DB_NAME, $connection); return $this->ident_link; } --- 21,25 ---- { $this->ident_link = $connection; ! return $this->ident_link; } *************** *** 69,94 **** } } - - function selectDB ( $db_name ) { - - if ( $this->ident_link == 0 ) - { - $db = $this->connect(); - } - else - { - $db = $this->ident_link; - } - - if (!$db) - { - return 0; - } - else - { - $result = @mysql_select_db($db_name, $db); - return $result; - } - } function numRows ($query) --- 68,71 ---- *************** *** 183,185 **** } ! ?> \ No newline at end of file --- 160,162 ---- } ! ?> |
From: Brian R. <hei...@us...> - 2002-11-30 23:38:09
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv4166 Modified Files: constants.php Log Message: Updated constant file to include the db_name (makes like easier for the db). Index: constants.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/constants.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** constants.php 6 Nov 2002 01:49:24 -0000 1.8 --- constants.php 30 Nov 2002 23:38:06 -0000 1.9 *************** *** 1,9 **** <? ! define("CONFIG_TABLE", DB_TABLE_PREFIX . 'config'); ! define("USERS_TABLE", DB_TABLE_PREFIX . 'users'); ! define("SESSION_TABLE", DB_TABLE_PREFIX . 'sessions'); ! define("MODULES_TABLE", DB_TABLE_PREFIX . 'modules'); ! define("BLOCK_TABLE", DB_TABLE_PREFIX . 'blocks'); ?> --- 1,9 ---- <? ! define("CONFIG_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'config'); ! define("USERS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'users'); ! define("SESSION_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'sessions'); ! define("MODULES_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'modules'); ! define("BLOCK_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'blocks'); ?> |
From: Brian R. <hei...@us...> - 2002-11-30 23:18:42
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv24349 Modified Files: core.php Added Files: mpcode.php Removed Files: parser.php Log Message: paerser.php is now mpcode.php. core.php has been updated to fix a few mistakes I made. --- NEW FILE: mpcode.php --- <? // Content parsing functions to be developed here. // These work similarly to BBCode and the like. ?> Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** core.php 30 Nov 2002 05:55:04 -0000 1.28 --- core.php 30 Nov 2002 23:18:39 -0000 1.29 *************** *** 20,24 **** while( $row = $DB->fetch_array( $result ) ) { ! define( str_to_uppoer($row['key']), $row['value'] ); } --- 20,24 ---- while( $row = $DB->fetch_array( $result ) ) { ! define( str_to_upper( $row['key'] ), $row['value'] ); } *************** *** 51,55 **** include_once('./includes/functions.php'); ! include_once('./includes/parser.php'); // This while() statement will loop through the --- 51,55 ---- include_once('./includes/functions.php'); ! include_once('./includes/mpcode.php'); // This while() statement will loop through the --- parser.php DELETED --- |
From: Brian R. <hei...@us...> - 2002-11-30 11:06:39
|
Update of /cvsroot/phpmp/phpMP/languages/english In directory sc8-pr-cvs1:/tmp/cvs-serv26704 Modified Files: lang_main.php Log Message: Started updating the language file after changing from config array to constants. SOME WERE MISSED ON PURPOSE. Index: lang_main.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/languages/english/lang_main.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** lang_main.php 12 Aug 2002 01:08:29 -0000 1.4 --- lang_main.php 30 Nov 2002 11:06:36 -0000 1.5 *************** *** 37,44 **** function Language() { - global $MPCONF; - $this->lang['l_home'] = 'Home'; ! $this->lang['l_nav_bar'] = '<a href="' . $MPCONF['GEN']['uri'] . 'index.php">home</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'features.php">features</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'forums/index.php">forums</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'downloads.php">downloads</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'support.php">support</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'about.php">about</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'team.php">team</a> <font color="#0a4a67">•</font> <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpmp/phpMP/">cvs</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'devworld/modules/index.php?action=list">modules</a> <font color="#0a4a67">•</font> <a href="http://www.sourceforge.net/">sourceforge</a>'; $this->lang['l_username'] = 'Username'; --- 37,42 ---- function Language() { $this->lang['l_home'] = 'Home'; ! $this->lang['l_nav_bar'] = '<a href="' . REL_PATH . 'index.php">home</a> <font color="#0a4a67">•</font> <a href="' . REL_PATH . 'features.php">features</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'forums/index.php">forums</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'downloads.php">downloads</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'support.php">support</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'about.php">about</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'team.php">team</a> <font color="#0a4a67">•</font> <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpmp/phpMP/">cvs</a> <font color="#0a4a67">•</font> <a href="' . $MPCONF['GEN']['uri'] . 'devworld/modules/index.php?action=list">modules</a> <font color="#0a4a67">•</font> <a href="http://www.sourceforge.net/">sourceforge</a>'; $this->lang['l_username'] = 'Username'; *************** *** 52,58 **** $this->lang['l_required_field'] = 'Denotes a Requires Field'; $this->lang['l_register_fin'] = 'Your registration has been proccessed. Please check your e-mail for a message explaining how to activate your new account.'; ! $this->lang['l_fin_register_subject'] = 'Welcome to ' . $MPCONF['TPL']['sitename'] . '!'; $this->lang['l_fin_register_message'] = ' ! $temp_message = "Welcome to {$MPCONF[\'TPL\'][\'sitename\']}! To complete your registration, please click on the link below. You will be unable to log in until you do so. --- 50,56 ---- $this->lang['l_required_field'] = 'Denotes a Requires Field'; $this->lang['l_register_fin'] = 'Your registration has been proccessed. Please check your e-mail for a message explaining how to activate your new account.'; ! $this->lang['l_fin_register_subject'] = 'Welcome to ' . SITE_NAME . '!'; $this->lang['l_fin_register_message'] = ' ! $temp_message = "Welcome to " . SITE_NAME . "! To complete your registration, please click on the link below. You will be unable to log in until you do so. *************** *** 75,79 **** $this->lang['l_not_logged_in'] = 'You are not logged in.'; ! $this->lang['l_powered_by'] = 'powered by phpMP ' . $MPCONF['GEN']['version'] . ' © 2002 <a href="http://phpmp.sourceforge.net/">phpMP Dev. Group</a>.'; $this->lang['l_copyright'] = 'All content is property of its respective owner. All rights reserved.'; --- 73,77 ---- $this->lang['l_not_logged_in'] = 'You are not logged in.'; ! $this->lang['l_powered_by'] = 'powered by phpMP ' . VERSION . ' © 2002 <a href="http://phpmp.sourceforge.net/">phpMP Dev. Group</a>.'; $this->lang['l_copyright'] = 'All content is property of its respective owner. All rights reserved.'; *************** *** 82,84 **** } ! ?> \ No newline at end of file --- 80,82 ---- } ! ?> |
From: Brian R. <hei...@us...> - 2002-11-30 10:58:28
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv24219/includes Modified Files: template.php Added Files: language.php Log Message: Cleaned up a few files. Fixed some defines. Added the language.php file which determines and sets language constants. --- NEW FILE: language.php --- <? class Language { function Language() { if( defined("USR_LANG") ) { define( "LANGUAGE", USR_LANG ); } else { define( "LANGUAGE", DEFAULT_LANG ); } } } ?> Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** template.php 30 Nov 2002 05:56:09 -0000 1.20 --- template.php 30 Nov 2002 10:58:23 -0000 1.21 *************** *** 15,21 **** // Set up the directories for Smarty. ! $this->template_dir = './templates/' . TPL_DIR; ! $this->compile_dir = './templates/' . TPL_DIR . '/compile'; ! $this->config_dir = './templates/' . TPL_DIR . '/configs' $this->cache_dir = ''; --- 15,21 ---- // Set up the directories for Smarty. ! $this->template_dir = './templates/' . TEMPLATE; ! $this->compile_dir = './templates/' . TEMPLATE . '/compile'; ! $this->config_dir = './templates/' . TEMPLATE . '/configs' $this->cache_dir = ''; *************** *** 42,46 **** "REL_PATH" => REL_PATH, "TODAY" => TODAY, ! "TPL_DIR" => TPL_DIR, "SITE_NAME" => SITE_NAME --- 42,46 ---- "REL_PATH" => REL_PATH, "TODAY" => TODAY, ! "TEMPLATE" => TEMPLATE, "SITE_NAME" => SITE_NAME |
From: Brian R. <hei...@us...> - 2002-11-30 10:58:26
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv24219 Removed Files: error.php Log Message: Cleaned up a few files. Fixed some defines. Added the language.php file which determines and sets language constants. --- error.php DELETED --- |
From: Brian R. <hei...@us...> - 2002-11-30 05:56:13
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv20105 Modified Files: template.php Log Message: Modified handling of var loading and how we're doing a bunch of stuff. Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** template.php 5 Nov 2002 22:11:06 -0000 1.19 --- template.php 30 Nov 2002 05:56:09 -0000 1.20 *************** *** 4,6 **** // This will utilize a flat-file template system. ! ?> \ No newline at end of file --- 4,53 ---- // This will utilize a flat-file template system. ! class Template extends Smarty ! { ! ! // Initiates the Template engine. ! // Author: Brian 'Heimidal' Rose ! // Accepts: none. ! // Returns: none. ! function Template() ! { ! ! // Set up the directories for Smarty. ! $this->template_dir = './templates/' . TPL_DIR; ! $this->compile_dir = './templates/' . TPL_DIR . '/compile'; ! $this->config_dir = './templates/' . TPL_DIR . '/configs' ! $this->cache_dir = ''; ! ! // Turn on compile_check. ! $this->compile_check = 1; ! ! // 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. ! assign_constants() ! { ! ! $this->assign( array( ! ! "SITE_ADDR" => SITE_ADDR, ! "REL_PATH" => REL_PATH, ! "TODAY" => TODAY, ! "TPL_DIR" => TPL_DIR, ! "SITE_NAME" => SITE_NAME ! ! ) ); ! ! } ! ! } ! ! ?> |
From: Brian R. <hei...@us...> - 2002-11-30 05:55:09
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv19720 Modified Files: core.php Log Message: Restructured the way we're handling loading of files and how we'll decide what to load and when. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** core.php 6 Nov 2002 03:28:19 -0000 1.27 --- core.php 30 Nov 2002 05:55:04 -0000 1.28 *************** *** 1,5 **** <? ! class Core ## Does, literally, everything. { --- 1,5 ---- <? ! class Core // Does, literally, everything. { *************** *** 10,92 **** function _initConfig () { ! ! global $DB; ## Globalize DB class. ! $sql = "SELECT * FROM " . CONFIG_TABLE; ! $result = $DBA->query( $sql ); ! ! ## Loop through all config values from DB. ! ## Define each key as its respective value. while( $row = $DB->fetch_array( $result ) ) { ! define( $row['key'], $row['value'] ); } ! } ! // Initiates all core components. // Author: Brian 'Heimidal' Rose ! // Accepts: $required_files (string of needed files separated by commas). // Returns: none. function init ( $optional_files = array() ) { ! ! ## First, we'll create an array of files that must ! ## be loaded for any instance of the portal. We'll ! ## call this array '$required_files'. ! $required_files[] = 'debug'; ! $required_files[] = 'constants'; ! $required_files[] = 'functions'; ! $required_files[] = 'auth'; ! $required_files[] = 'parser'; ! $required_files[] = 'Smarty.class'; ! $required_files[] = 'template'; ! ! ## Next, we'll merge the $required_files array with ! ## the $optional_files array, allowing us to include ! ## all files that may be needed. ! $file_array = array_merge_recursive( $required_array, $optional_files ); ! ! ## This while() statement will loop through the ! ## $file_array and include each file. $i = 0; ! while( $my_file = $file_array[$i] ) { ! ! ## We'll use include_once() in order to keep from ! ## including a file more than once (through ! ## malicious or accidental coding of a page). include_once('./includes/' . $my_file . '.php'); $i++; ! } ! ! ## Globalize all major class-containing variables. global $Debug, $DB, $Auth, $Language, $Parser, $Template; ! ! ## Create an instance of the Debug interface. ! $Debug = new Debug(); ! ! ## We should add initialization function calls later ! ## when they're written. ! ! include_once('./dba/' . DB_TYPE . '.dba'); ## Include DBA layer. ! ! $DB = new DBA(); ## Create an instance of DBA. ! $DBA->connect; ## Connect to the specified SQL system. ! ! $this->_initConfig(); ## Grab DB-stored config values. ! ! $Auth = new Auth(); ## Create an instance of Auth. ! ! $Language = new Language(); ## Create an instance of Language. ! ! $Parser = new Parser(); ## Create an instance of Parser. ! ! $Template = new Template(); ## Create an instance of Template. ! } ! } ! ?> \ No newline at end of file --- 10,80 ---- function _initConfig () { ! ! global $DB; // Globalize DB class. ! $sql = "SELECT * FROM " . CONFIG_TABLE; ! $result = $DB->query( $sql ); ! ! // Loop through all config values from DB. ! // Define each key as its respective value. while( $row = $DB->fetch_array( $result ) ) { ! define( str_to_uppoer($row['key']), $row['value'] ); } ! } ! // Initiates all core components. // Author: Brian 'Heimidal' Rose ! // Accepts: $optional_files (string of needed files separated by commas). // Returns: none. function init ( $optional_files = array() ) { ! include_once('./config.php'); ! ! include_once('./includes/debug.php'); ! $Debug = new Debug(); ! ! include_once( './dba/' . DB_TYPE . '.dba' ); ! $DB = new DB(); ! $DB->connect; ! ! $this->_initConfig(); // Grab DB-stored config values. ! ! include_once('./includes/auth.php'); ! $Auth = new Auth(); // Create an instance of Auth. ! ! include_once('./includes/language.php'); ! ! include_once('./includes/constants.php'); ! ! include_once('./includes/functions.php'); ! ! include_once('./includes/parser.php'); ! ! // This while() statement will loop through the ! // $optional_files and include each file. $i = 0; ! while( $my_file = $optional_files[$i] ) { ! ! // We'll use include_once() in order to keep from ! // including a file more than once (through ! // malicious or accidental coding of a page). include_once('./includes/' . $my_file . '.php'); $i++; ! } ! ! include_once('./includes/Smarty.class.php'); ! include_once('./includes/template.php'); ! $Template = new Template(); // Create an instance of Template. ! ! // Globalize all major class-containing variables. global $Debug, $DB, $Auth, $Language, $Parser, $Template; ! } ! } ! ?> |
From: Brian R. <hei...@us...> - 2002-11-28 05:27:56
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv20362/includes Modified Files: Config_File.class.php Smarty.class.php Smarty_Compiler.class.php Log Message: Updated Smarty template engine Index: Config_File.class.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/Config_File.class.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Config_File.class.php 14 Aug 2002 17:44:06 -0000 1.2 --- Config_File.class.php 28 Nov 2002 05:27:53 -0000 1.3 *************** *** 4,8 **** * Config_File class. * ! * @version 2.3.0 * @author Andrei Zmievski <an...@ph...> * @access public --- 4,8 ---- * Config_File class. * ! * @version 2.3.1 * @author Andrei Zmievski <an...@ph...> * @access public *************** *** 61,64 **** --- 61,72 ---- var $read_hidden = true; + /** + * Controls whether or not to fix mac or dos formatted newlines. + * If set to true, \r or \r\n will be changed to \n. + * + * @access public + */ + var $fix_newlines = true; + /* Private variables */ var $_config_path = ""; *************** *** 254,257 **** --- 262,270 ---- $contents = fread($fp, filesize($config_file)); fclose($fp); + + if($this->fix_newlines) { + // fix mac/dos formatted newlines + $contents = preg_replace('!\r\n?!',"\n",$contents); + } $config_data = array(); Index: Smarty.class.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/Smarty.class.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Smarty.class.php 14 Aug 2002 17:44:06 -0000 1.2 --- Smarty.class.php 28 Nov 2002 05:27:53 -0000 1.3 *************** *** 6,10 **** * Andrei Zmievski <an...@ph...> * ! * Version: 2.3.0 * Copyright: 2001,2002 ispi of Lincoln, Inc. * --- 6,10 ---- * Andrei Zmievski <an...@ph...> * ! * Version: 2.3.1 * Copyright: 2001,2002 ispi of Lincoln, Inc. * *************** *** 172,176 **** var $_config = array(); // loaded configuration settings var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f'; // md5 checksum of the string 'Smarty' ! var $_version = '2.3.0'; // Smarty version number var $_extract = false; // flag for custom functions var $_inclusion_depth = 0; // current template inclusion depth --- 172,176 ---- var $_config = array(); // loaded configuration settings var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f'; // md5 checksum of the string 'Smarty' ! var $_version = '2.3.1'; // Smarty version number var $_extract = false; // flag for custom functions var $_inclusion_depth = 0; // current template inclusion depth *************** *** 932,936 **** // compile template $this->_compile_template($tpl_file, $template_source, $template_compiled); ! $this->_write_compiled_template($compile_path, $template_compiled); return true; } --- 932,936 ---- // compile template $this->_compile_template($tpl_file, $template_source, $template_compiled); ! $this->_write_compiled_template($compile_path, $template_compiled, $template_timestamp); return true; } *************** *** 943,947 **** } $this->_compile_template($tpl_file, $template_source, $template_compiled); ! $this->_write_compiled_template($compile_path, $template_compiled); return true; } --- 943,947 ---- } $this->_compile_template($tpl_file, $template_source, $template_compiled); ! $this->_write_compiled_template($compile_path, $template_compiled, $template_timestamp); return true; } *************** *** 962,969 **** Purpose: \*======================================================================*/ ! function _write_compiled_template($compile_path, $template_compiled) { // we save everything into $compile_dir $this->_write_file($compile_path, $template_compiled, true); return true; } --- 962,970 ---- Purpose: \*======================================================================*/ ! function _write_compiled_template($compile_path, $template_compiled, $template_timestamp) { // we save everything into $compile_dir $this->_write_file($compile_path, $template_compiled, true); + touch($compile_path, $template_timestamp); return true; } *************** *** 1515,1519 **** function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null) { ! if (!is_dir($auto_base)) return false; --- 1516,1520 ---- function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null) { ! if (!@is_dir($auto_base)) return false; *************** *** 1524,1528 **** if(isset($auto_source)) { ! $res = @unlink($tname); } elseif ($this->use_sub_dirs) { $res = $this->_rmdir($tname, 1, $exp_time); --- 1525,1529 ---- if(isset($auto_source)) { ! $res = $this->_unlink($tname); } elseif ($this->use_sub_dirs) { $res = $this->_rmdir($tname, 1, $exp_time); *************** *** 1555,1559 **** while ($entry = readdir($handle)) { if ($entry != '.' && $entry != '..') { ! if (is_dir($dirname . DIR_SEP . $entry)) { $this->_rmdir($dirname . DIR_SEP . $entry, $level + 1, $exp_time); } --- 1556,1560 ---- while ($entry = readdir($handle)) { if ($entry != '.' && $entry != '..') { ! if (@is_dir($dirname . DIR_SEP . $entry)) { $this->_rmdir($dirname . DIR_SEP . $entry, $level + 1, $exp_time); } *************** *** 1584,1591 **** if(isset($exp_time)) { if(time() - filemtime($resource) >= $exp_time) { ! unlink($resource); } } else { ! unlink($resource); } } --- 1585,1592 ---- if(isset($exp_time)) { if(time() - filemtime($resource) >= $exp_time) { ! @unlink($resource); } } else { ! @unlink($resource); } } *************** *** 1598,1610 **** { if (!@file_exists($dir)) { ! $dir_parts = preg_split('!\\'.DIR_SEP.'+!', $dir, -1, PREG_SPLIT_NO_EMPTY); ! $new_dir = ($dir{0} == DIR_SEP) ? DIR_SEP : ''; ! foreach ($dir_parts as $dir_part) { ! $new_dir .= $dir_part; ! if (!file_exists($new_dir) && !mkdir($new_dir, 0771)) { $this->trigger_error("problem creating directory \"$dir\""); return false; } ! $new_dir .= DIR_SEP; } } --- 1599,1635 ---- { if (!@file_exists($dir)) { ! $_dir_parts = preg_split('!\\'.DIR_SEP.'+!', $dir, -1, PREG_SPLIT_NO_EMPTY); ! $_new_dir = ($dir{0} == DIR_SEP) ? DIR_SEP : ''; ! ! // do not attempt to test or make directories outside of open_basedir ! $_open_basedir_ini = ini_get('open_basedir'); ! if(!empty($_open_basedir_ini)) { ! $_use_open_basedir = true; ! $_open_basedir_sep = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') ? ';' : ':'; ! $_open_basedirs = explode($_open_basedir_sep, $_open_basedir_ini); ! } else { ! $_use_open_basedir = false; ! } ! ! foreach ($_dir_parts as $_dir_part) { ! $_new_dir .= $_dir_part; ! ! if ($_use_open_basedir) { ! $_make_new_dir = false; ! foreach ($_open_basedirs as $_open_basedir) { ! if (substr($_new_dir.'/', 0, strlen($_open_basedir)) == $_open_basedir) { ! $_make_new_dir = true; ! break; ! } ! } ! } else { ! $_make_new_dir = true; ! } ! ! if ($_make_new_dir && !@file_exists($_new_dir) && !@mkdir($_new_dir, 0771)) { $this->trigger_error("problem creating directory \"$dir\""); return false; } ! $_new_dir .= DIR_SEP; } } Index: Smarty_Compiler.class.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/Smarty_Compiler.class.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Smarty_Compiler.class.php 14 Aug 2002 17:44:06 -0000 1.2 --- Smarty_Compiler.class.php 28 Nov 2002 05:27:53 -0000 1.3 *************** *** 7,11 **** * Andrei Zmievski <an...@ph...> * ! * Version: 2.3.0 * Copyright: 2001,2002 ispi of Lincoln, Inc. * --- 7,11 ---- * Andrei Zmievski <an...@ph...> * ! * Version: 2.3.1 * Copyright: 2001,2002 ispi of Lincoln, Inc. * *************** *** 1298,1303 **** case 'get': array_shift($indexes); ! $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_GET_VARS']['$name']"; break; --- 1298,1304 ---- case 'get': array_shift($indexes); ! $compiled_ref = "\$GLOBALS['HTTP_GET_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; *************** *** 1305,1309 **** array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_POST_VARS']['$name']"; break; --- 1306,1312 ---- array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_POST_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; *************** *** 1311,1321 **** array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_COOKIE_VARS']['$name']"; break; case 'env': array_shift($indexes); ! $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_ENV_VARS']['$name']"; break; --- 1314,1327 ---- array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_COOKIE_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; case 'env': array_shift($indexes); ! $compiled_ref = "\$GLOBALS['HTTP_ENV_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; *************** *** 1323,1327 **** array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_SERVER_VARS']['$name']"; break; --- 1329,1335 ---- array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_SERVER_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; *************** *** 1329,1333 **** array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_SESSION_VARS']['$name']"; break; --- 1337,1343 ---- array_shift($indexes); $name = substr($indexes[0], 1); ! $compiled_ref = "\$GLOBALS['HTTP_SESSION_VARS']"; ! if ($name = substr($indexes[0], 1)) ! $compiled_ref .= "['$name']"; break; |
From: Brian R. <hei...@us...> - 2002-11-28 05:27:56
|
Update of /cvsroot/phpmp/phpMP/includes/plugins In directory sc8-pr-cvs1:/tmp/cvs-serv20362/includes/plugins Modified Files: function.html_options.php function.html_select_time.php function.popup_init.php modifier.debug_print_var.php modifier.default.php Added Files: block.textformat.php function.debug.php modifier.strip.php Log Message: Updated Smarty template engine --- NEW FILE: block.textformat.php --- <?php /* * Smarty plugin * ------------------------------------------------------------- * Type: block function * Name: textformat * Purpose: format text a certain way with preset styles * or custom wrap/indent settings * Params: style: string (email) * indent: integer (0) * wrap: integer (80) * wrap_char string ("\n") * indent_char: string (" ") * wrap_boundary: boolean (true) * ------------------------------------------------------------- */ function smarty_block_textformat($params, $content, &$this) { $style = null; $indent = 0; $indent_first = 0; $indent_char = ' '; $wrap = 80; $wrap_char = "\n"; $wrap_cut = false; $assign = null; if($content == null) { return true; } extract($params); if($style == 'email') { $wrap = 72; } // split into paragraphs $paragraphs = preg_split('![\r\n][\r\n]!',$content); foreach($paragraphs as $paragraph) { if($paragraph == '') { continue; } // convert mult. spaces & special chars to single space $paragraph = preg_replace(array('!\s+!','!(^\s+)|(\s+$)!'),array(' ',''),$paragraph); // indent first line if($indent_first > 0) { $paragraph = str_repeat($indent_char,$indent_first) . $paragraph; } // wordwrap sentences $paragraph = wordwrap($paragraph, $wrap - $indent, $wrap_char, $wrap_cut); // indent lines if($indent > 0) { $paragraph = preg_replace('!^!m',str_repeat($indent_char,$indent),$paragraph); } $output .= $paragraph . $wrap_char . $wrap_char; } if($assign != null) { $this->assign($assign,$output); } else { echo $output; } //echo $content; } /* vim: set expandtab: */ ?> --- NEW FILE: function.debug.php --- <?php /* * Smarty plugin * ------------------------------------------------------------- * Type: function * Name: debug * Version: 1.0 * Date: July 1, 2002 * Author: Monte Ohrt <mo...@is...> * Purpose: popup debug window * ------------------------------------------------------------- */ function smarty_function_debug($params, &$smarty) { if($params['output']) { $smarty->assign('_smarty_debug_output',$params['output']); } echo $smarty->_generate_debug_output(); } /* vim: set expandtab: */ ?> --- NEW FILE: modifier.strip.php --- <?php /* * Smarty plugin * ------------------------------------------------------------- * Type: modifier * Name: strip * Purpose: Replace all repeated spaces, newlines, tabs * with a single space or supplied replacement string. * Example: {$var|strip} {$var|strip:" "} * Author: Monte Ohrt <mo...@is...> * Version: 1.0 * Date: September 25th, 2002 * ------------------------------------------------------------- */ function smarty_modifier_strip($text, $replace = ' ') { return preg_replace('!\s+!', $replace, $text); } /* vim: set expandtab: */ ?> Index: function.html_options.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.html_options.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** function.html_options.php 25 Jul 2002 11:06:25 -0000 1.1 --- function.html_options.php 28 Nov 2002 05:27:53 -0000 1.2 *************** *** 22,29 **** settype($options, 'array'); foreach ($options as $key => $value) { ! $html_result .= "<option value=\"$key\""; ! if (in_array($key, $selected)) ! $html_result .= " selected=\"selected\""; ! $html_result .= ">$value</option>\n"; } } else { --- 22,26 ---- settype($options, 'array'); foreach ($options as $key => $value) { ! $html_result .= smarty_function_html_options_optoutput($key, $value, $selected); } } else { *************** *** 31,45 **** settype($values, 'array'); for ($i = 0, $for_max = count($output); $i < $for_max; $i++) { ! /* By default, check value against $selected */ ! $sel_check = $values[$i]; ! $html_result .= "<option"; ! if ($i < count($values)) ! $html_result .= " value=\"".$values[$i]."\""; ! else ! $sel_check = $output[$i]; /* if more outputs than values, then ! check output against $selected */ ! if (in_array($sel_check, $selected)) ! $html_result .= " selected=\"selected\""; ! $html_result .= ">".$output[$i]."</option>\n"; } } --- 28,36 ---- settype($values, 'array'); for ($i = 0, $for_max = count($output); $i < $for_max; $i++) { ! if ($i < count($values)) { ! $html_result .= smarty_function_html_options_optoutput($values[$i], $output[$i], $selected); ! } else { ! $html_result .= smarty_function_html_options_optoutput($output[$i], $output[$i], $selected); ! } } } *************** *** 49,52 **** --- 40,64 ---- else return $html_result; + } + + function smarty_function_html_options_optoutput($key, $value, $selected) { + if(!is_array($value)) { + $html_result = "<option label=\"$key\" value=\"$key\""; + if (in_array($key, $selected)) + $html_result .= " selected=\"selected\""; + $html_result .= ">$value</option>\n"; + } else { + $html_result = smarty_function_html_options_optgroup($key, $value, $selected); + } + return $html_result; + } + + function smarty_function_html_options_optgroup($key, $values, $selected) { + $optgroup_html = "<optgroup label=\"$key\">\n"; + foreach ($values as $key => $value) { + $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected); + } + $optgroup_html .= "</optgroup>\n"; + return $optgroup_html; } Index: function.html_select_time.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.html_select_time.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** function.html_select_time.php 25 Jul 2002 11:06:25 -0000 1.1 --- function.html_select_time.php 28 Nov 2002 05:27:53 -0000 1.2 *************** *** 28,31 **** --- 28,36 ---- Can be combined with prefix. */ $field_array = null; + $all_extra = null; + $hour_extra = null; + $minute_extra = null; + $second_extra = null; + $meridian_extra = null; extract($params); *************** *** 42,49 **** $html_result .= '<select name='; if (null !== $field_array) { ! $html_result .= '"' . $field_array . '[' . $prefix . 'Hour]">'."\n"; } else { ! $html_result .= '"' . $prefix . 'Hour">'."\n"; } $html_result .= smarty_function_html_options(array('output' => $hours, 'values' => $hours, --- 47,61 ---- $html_result .= '<select name='; if (null !== $field_array) { ! $html_result .= '"' . $field_array . '[' . $prefix . 'Hour]"'; } else { ! $html_result .= '"' . $prefix . 'Hour"'; } + if (null !== $hour_extra){ + $html_result .= ' ' . $hour_extra; + } + if (null !== $all_extra){ + $html_result .= ' ' . $all_extra; + } + $html_result .= '>'."\n"; $html_result .= smarty_function_html_options(array('output' => $hours, 'values' => $hours, *************** *** 61,68 **** $html_result .= '<select name='; if (null !== $field_array) { ! $html_result .= '"' . $field_array . '[' . $prefix . 'Minute]">'."\n"; } else { ! $html_result .= '"' . $prefix . 'Minute">'."\n"; } $html_result .= smarty_function_html_options(array('output' => $minutes, 'values' => $minutes, --- 73,88 ---- $html_result .= '<select name='; if (null !== $field_array) { ! $html_result .= '"' . $field_array . '[' . $prefix . 'Minute]"'; } else { ! $html_result .= '"' . $prefix . 'Minute"'; ! } ! if (null !== $minute_extra){ ! $html_result .= ' ' . $minute_extra; ! } ! if (null !== $all_extra){ ! $html_result .= ' ' . $all_extra; } + $html_result .= '>'."\n"; + $html_result .= smarty_function_html_options(array('output' => $minutes, 'values' => $minutes, *************** *** 80,87 **** $html_result .= '<select name='; if (null !== $field_array) { ! $html_result .= '"' . $field_array . '[' . $prefix . 'Second]">'."\n"; } else { ! $html_result .= '"' . $prefix . 'Second">'."\n"; } $html_result .= smarty_function_html_options(array('output' => $seconds, 'values' => $seconds, --- 100,116 ---- $html_result .= '<select name='; if (null !== $field_array) { ! $html_result .= '"' . $field_array . '[' . $prefix . 'Second]"'; } else { ! $html_result .= '"' . $prefix . 'Second"'; } + + if (null !== $second_extra){ + $html_result .= ' ' . $second_extra; + } + if (null !== $all_extra){ + $html_result .= ' ' . $all_extra; + } + $html_result .= '>'."\n"; + $html_result .= smarty_function_html_options(array('output' => $seconds, 'values' => $seconds, *************** *** 95,102 **** $html_result .= '<select name='; if (null !== $field_array) { ! $html_result .= '"' . $field_array . '[' . $prefix . 'Meridian]">'."\n"; } else { ! $html_result .= '"' . $prefix . 'Meridian">'."\n"; } $html_result .= smarty_function_html_options(array('output' => array('AM', 'PM'), 'values' => array('am', 'pm'), --- 124,140 ---- $html_result .= '<select name='; if (null !== $field_array) { ! $html_result .= '"' . $field_array . '[' . $prefix . 'Meridian]"'; } else { ! $html_result .= '"' . $prefix . 'Meridian"'; ! } ! ! if (null !== $meridian_extra){ ! $html_result .= ' ' . $meridian_extra; ! } ! if (null !== $all_extra){ ! $html_result .= ' ' . $all_extra; } + $html_result .= '>'."\n"; + $html_result .= smarty_function_html_options(array('output' => array('AM', 'PM'), 'values' => array('am', 'pm'), Index: function.popup_init.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.popup_init.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** function.popup_init.php 25 Jul 2002 11:06:25 -0000 1.1 --- function.popup_init.php 28 Nov 2002 05:27:53 -0000 1.2 *************** *** 19,23 **** if (!empty($params['src'])) { echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>'."\n"; ! echo '<script language="JavaScript" src="'.$params['src'].'"></script>'."\n"; } else { $smarty->trigger_error("popup_init: missing src parameter"); --- 19,23 ---- if (!empty($params['src'])) { echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>'."\n"; ! echo '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>'."\n"; } else { $smarty->trigger_error("popup_init: missing src parameter"); Index: modifier.debug_print_var.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/modifier.debug_print_var.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** modifier.debug_print_var.php 25 Jul 2002 11:06:25 -0000 1.1 --- modifier.debug_print_var.php 28 Nov 2002 05:27:53 -0000 1.2 *************** *** 18,21 **** --- 18,29 ---- } return $results; + } else if (is_object($var)) { + $object_vars = get_object_vars($var); + $results = "<b>".get_class($var)." Object (".count($object_vars).")</b>"; + foreach ($object_vars as $curr_key => $curr_val) { + $return = smarty_modifier_debug_print_var($curr_val, $depth+1); + $results .= '<br>\r'.str_repeat(' ', $depth*2)."<b>$curr_key</b> => $return"; + } + return $results; } else { if (empty($var) && $var != "0") { Index: modifier.default.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/modifier.default.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** modifier.default.php 25 Jul 2002 11:06:25 -0000 1.1 --- modifier.default.php 28 Nov 2002 05:27:53 -0000 1.2 *************** *** 11,15 **** function smarty_modifier_default($string, $default = '') { ! if (empty($string)) return $default; else --- 11,15 ---- function smarty_modifier_default($string, $default = '') { ! if (!isset($string) || $string == '') return $default; else |
From: Brian R. <hei...@us...> - 2002-11-06 03:28:22
|
Update of /cvsroot/phpmp/phpMP/dba In directory usw-pr-cvs1:/tmp/cvs-serv3263/dba Modified Files: mysql.dba Log Message: Added MySQL DBA Layer. Index: mysql.dba =================================================================== RCS file: /cvsroot/phpmp/phpMP/dba/mysql.dba,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** mysql.dba 5 Nov 2002 22:11:05 -0000 1.17 --- mysql.dba 6 Nov 2002 03:28:19 -0000 1.18 *************** *** 1,5 **** <?php ! // MySQL DB Layer. ?> --- 1,185 ---- <?php ! class DB ! { ! ! var $ident_link; ! var $connected; ! ! connect () ! { ! if ( empty ($this->ident_link) ) ! { ! $connection = @mysql_connect(DB_HOST, DB_USER, DB_PASSWD); ! ! if ( !$connection ) ! { ! $this->connected = 0; ! return 0; ! } ! else ! { ! $this->ident_link = $connection; ! ! $this->selectDB (DB_NAME, $connection); ! return $this->ident_link; ! } ! } ! else ! { ! return $this->ident_link; ! } ! ! } ! ! close () ! { ! if ( $this->ident_link != 0 ) ! { ! @mysql_close($this->ident_link); ! $this->ident_link = 0; ! ! return 1; ! } ! else ! { ! return 1; ! } ! } ! ! query ( $qry ) ! { ! if ( $this->ident_link == 0 ) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if ( !$db ) ! { ! return 0; ! } ! else ! { ! $result = @mysql_query( $qry, $db ); ! return $result; ! } ! } ! ! function selectDB ( $db_name ) { ! ! if ( $this->ident_link == 0 ) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if (!$db) ! { ! return 0; ! } ! else ! { ! $result = @mysql_select_db($db_name, $db); ! return $result; ! } ! } ! ! function numRows ($query) ! { ! if ( $this->ident_link == 0 ) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! $num = @mysql_num_rows($query); ! return $num; ! ! } ! ! function insertID() ! { ! if($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! $num = @mysql_insert_id($this->ident_link); ! return $num; ! ! } ! ! function result ( $result, $row=0, $field='' ) ! { ! if($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! $result = @mysql_result($result, $row, $field); ! return $result; ! } ! ! function fetchArray($query) ! { ! if($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! return @mysql_fetch_array($query); ! } ! ! function fetchRow($query) ! { ! if ( $this->ident_link == 0 ) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! $result = @mysql_fetch_row($query); ! return $result; ! } ! ! function affectedRows() { ! if($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! return @mysql_affected_rows($db); ! } ! ! } ?> |
From: Brian R. <hei...@us...> - 2002-11-06 03:28:22
|
Update of /cvsroot/phpmp/phpMP/includes In directory usw-pr-cvs1:/tmp/cvs-serv3263/includes Modified Files: core.php Removed Files: dba.php Log Message: Added MySQL DBA Layer. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** core.php 6 Nov 2002 01:49:24 -0000 1.26 --- core.php 6 Nov 2002 03:28:19 -0000 1.27 *************** *** 37,41 **** $required_files[] = 'debug'; $required_files[] = 'constants'; - $required_files[] = 'dba'; $required_files[] = 'functions'; $required_files[] = 'auth'; --- 37,40 ---- *************** *** 71,74 **** --- 70,75 ---- ## We should add initialization function calls later ## when they're written. + + include_once('./dba/' . DB_TYPE . '.dba'); ## Include DBA layer. $DB = new DBA(); ## Create an instance of DBA. --- dba.php DELETED --- |
From: Brian R. <hei...@us...> - 2002-11-06 01:49:27
|
Update of /cvsroot/phpmp/phpMP/includes In directory usw-pr-cvs1:/tmp/cvs-serv10051/includes Modified Files: constants.php core.php Log Message: Changed a few lines. Index: constants.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/constants.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** constants.php 5 Nov 2002 22:11:06 -0000 1.7 --- constants.php 6 Nov 2002 01:49:24 -0000 1.8 *************** *** 1,9 **** <? ! define("CONFIG_TABLE", TABLE_PREFIX . 'config'); ! define("USERS_TABLE", TABLE_PREFIX . 'users'); ! define("SESSION_TABLE", TABLE_PREFIX . 'sessions'); ! define("MODULES_TABLE", TABLE_PREFIX . 'modules'); ! define("BLOCK_TABLE", TABLE_PREFIX . 'blocks'); ?> --- 1,9 ---- <? ! define("CONFIG_TABLE", DB_TABLE_PREFIX . 'config'); ! define("USERS_TABLE", DB_TABLE_PREFIX . 'users'); ! define("SESSION_TABLE", DB_TABLE_PREFIX . 'sessions'); ! define("MODULES_TABLE", DB_TABLE_PREFIX . 'modules'); ! define("BLOCK_TABLE", DB_TABLE_PREFIX . 'blocks'); ?> Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** core.php 6 Nov 2002 00:31:40 -0000 1.25 --- core.php 6 Nov 2002 01:49:24 -0000 1.26 *************** *** 1,5 **** <? ! class Core { --- 1,5 ---- <? ! class Core ## Does, literally, everything. { *************** *** 7,24 **** // Author: Brian 'Heimidal' Rose // Accepts: none. ! // Returns: Boolean - true function _initConfig () { ! global $DB; $sql = "SELECT * FROM " . CONFIG_TABLE; $result = $DBA->query( $sql ); while( $row = $DB->fetch_array( $result ) ) { define( $row['key'], $row['value'] ); } - - return true; } --- 7,25 ---- // Author: Brian 'Heimidal' Rose // Accepts: none. ! // Returns: none. function _initConfig () { ! global $DB; ## Globalize DB class. ! $sql = "SELECT * FROM " . CONFIG_TABLE; $result = $DBA->query( $sql ); + ## Loop through all config values from DB. + ## Define each key as its respective value. while( $row = $DB->fetch_array( $result ) ) { define( $row['key'], $row['value'] ); } } *************** *** 27,31 **** // Author: Brian 'Heimidal' Rose // Accepts: $required_files (string of needed files separated by commas). ! // Returns: Boolean - true function init ( $optional_files = array() ) { --- 28,32 ---- // Author: Brian 'Heimidal' Rose // Accepts: $required_files (string of needed files separated by commas). ! // Returns: none. function init ( $optional_files = array() ) { *************** *** 56,60 **** ## We'll use include_once() in order to keep from ## including a file more than once (through ! ## malicious or accidental coding of a page). */ include_once('./includes/' . $my_file . '.php'); $i++; --- 57,61 ---- ## We'll use include_once() in order to keep from ## including a file more than once (through ! ## malicious or accidental coding of a page). include_once('./includes/' . $my_file . '.php'); $i++; |
From: Brian R. <hei...@us...> - 2002-11-06 01:07:04
|
Update of /cvsroot/phpmp/phpMP/includes In directory usw-pr-cvs1:/tmp/cvs-serv24719 Removed Files: template_ext.php Log Message: Bye bye. --- template_ext.php DELETED --- |
From: Brian R. <hei...@us...> - 2002-11-06 00:31:43
|
Update of /cvsroot/phpmp/phpMP/includes In directory usw-pr-cvs1:/tmp/cvs-serv13734 Modified Files: core.php Log Message: I went on a commenting frenzy. Sue me. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** core.php 5 Nov 2002 22:34:24 -0000 1.24 --- core.php 6 Nov 2002 00:31:40 -0000 1.25 *************** *** 30,49 **** function init ( $optional_files = array() ) { - - $required_array[] = 'debug'; - $required_array[] = 'constants'; - $required_array[] = 'dba'; - $required_array[] = 'functions'; - $required_array[] = 'auth'; - $required_array[] = 'parser'; - $required_array[] = 'Smarty.class'; - $required_array[] = 'template'; ! $required_array = array_merge_recursive( $required_array, $optional_files ); $i = 0; ! while( $my_file = $required_array[$i] ) { include_once('./includes/' . $my_file . '.php'); $i++; --- 30,60 ---- function init ( $optional_files = array() ) { ! ## First, we'll create an array of files that must ! ## be loaded for any instance of the portal. We'll ! ## call this array '$required_files'. ! $required_files[] = 'debug'; ! $required_files[] = 'constants'; ! $required_files[] = 'dba'; ! $required_files[] = 'functions'; ! $required_files[] = 'auth'; ! $required_files[] = 'parser'; ! $required_files[] = 'Smarty.class'; ! $required_files[] = 'template'; ! ! ## Next, we'll merge the $required_files array with ! ## the $optional_files array, allowing us to include ! ## all files that may be needed. ! $file_array = array_merge_recursive( $required_array, $optional_files ); + ## This while() statement will loop through the + ## $file_array and include each file. $i = 0; ! while( $my_file = $file_array[$i] ) { + ## We'll use include_once() in order to keep from + ## including a file more than once (through + ## malicious or accidental coding of a page). */ include_once('./includes/' . $my_file . '.php'); $i++; *************** *** 51,77 **** } ! global $Debug, $DB, $Auth, $Parser, $Template, $Language; $Debug = new Debug(); ! $DB = new DBA(); ! $DBA->connect; ! $this->_initConfig(); } } - // Main Class - // -- Init Function - // -- -- Debug - // -- -- Globals - // -- -- Require Files - // -- -- Load Constants - // -- -- Initiate DBA - // -- -- Load DB-based Config - // -- -- Load Language Files - // -- -- Authenticate User - // -- -- Initiate Template Engine ?> --- 62,90 ---- } ! ## Globalize all major class-containing variables. ! global $Debug, $DB, $Auth, $Language, $Parser, $Template; + ## Create an instance of the Debug interface. $Debug = new Debug(); ! ## We should add initialization function calls later ! ## when they're written. ! ! $DB = new DBA(); ## Create an instance of DBA. ! $DBA->connect; ## Connect to the specified SQL system. ! ! $this->_initConfig(); ## Grab DB-stored config values. ! ! $Auth = new Auth(); ## Create an instance of Auth. ! ! $Language = new Language(); ## Create an instance of Language. ! ! $Parser = new Parser(); ## Create an instance of Parser. ! $Template = new Template(); ## Create an instance of Template. } } ?> |
From: Brian R. <hei...@us...> - 2002-11-05 22:34:26
|
Update of /cvsroot/phpmp/phpMP/includes In directory usw-pr-cvs1:/tmp/cvs-serv29719 Modified Files: core.php Log Message: yeah yeah.. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** core.php 5 Nov 2002 22:33:40 -0000 1.23 --- core.php 5 Nov 2002 22:34:24 -0000 1.24 *************** *** 28,32 **** // Accepts: $required_files (string of needed files separated by commas). // Returns: Boolean - true ! function init ( $optional_files ) { --- 28,32 ---- // Accepts: $required_files (string of needed files separated by commas). // Returns: Boolean - true ! function init ( $optional_files = array() ) { |
From: Brian R. <hei...@us...> - 2002-11-05 22:33:42
|
Update of /cvsroot/phpmp/phpMP/includes In directory usw-pr-cvs1:/tmp/cvs-serv29497 Modified Files: core.php Log Message: Decided to go with Eric's suggestion of merging two arrays together instead of a string being exploded. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** core.php 5 Nov 2002 22:26:19 -0000 1.22 --- core.php 5 Nov 2002 22:33:40 -0000 1.23 *************** *** 28,36 **** // Accepts: $required_files (string of needed files separated by commas). // Returns: Boolean - true ! function init ( $required_files ) { - $required_array = explode( '', $required_files ); - $required_array[] = 'debug'; $required_array[] = 'constants'; --- 28,34 ---- // Accepts: $required_files (string of needed files separated by commas). // Returns: Boolean - true ! function init ( $optional_files ) { $required_array[] = 'debug'; $required_array[] = 'constants'; *************** *** 41,44 **** --- 39,44 ---- $required_array[] = 'Smarty.class'; $required_array[] = 'template'; + + $required_array = array_merge_recursive( $required_array, $optional_files ); $i = 0; |
From: Brian R. <hei...@us...> - 2002-11-05 22:26:21
|
Update of /cvsroot/phpmp/phpMP/includes In directory usw-pr-cvs1:/tmp/cvs-serv26308 Modified Files: core.php Log Message: Stupid backward mistake in expode() Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** core.php 5 Nov 2002 22:11:06 -0000 1.21 --- core.php 5 Nov 2002 22:26:19 -0000 1.22 *************** *** 31,35 **** { ! $required_array = explode( $required_files, '' ); $required_array[] = 'debug'; --- 31,35 ---- { ! $required_array = explode( '', $required_files ); $required_array[] = 'debug'; |
From: Brian R. <hei...@us...> - 2002-11-05 22:11:39
|
Update of /cvsroot/phpmp/phpMP In directory usw-pr-cvs1:/tmp/cvs-serv19025 Modified Files: error.php index.php modules.php profile.php Log Message: Complete rewrite has begun! Index: error.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/error.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** error.php 5 Apr 2002 07:37:05 -0000 1.1 --- error.php 5 Nov 2002 22:11:05 -0000 1.2 *************** *** 1,5 **** <? ! print "We apologize, but there was an $ecode error."; ?> --- 1,5 ---- <? ! // Error handling. ?> Index: index.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/index.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** index.php 14 Aug 2002 06:24:23 -0000 1.21 --- index.php 5 Nov 2002 22:11:05 -0000 1.22 *************** *** 1,54 **** <? ! /****************************************************************************** ! ******************************************************************************* ! ! phpMP - The World's Greatest Modular Portal ! *********************************************** ! Are you MPowered? ! ! Copyright (C) 2002 phpMP Development Group ! All rights reserved. ! ! Lead Programmer: Brian Rose ! Lead Designer: Trevor Joynson ! ! Filename: /index.php ! Usage & Function: The file that makes it all happen! ! Create Date: March 31, 2002 ! ! $Id$ ! ! ******************************************************************************* ! ******************************************************************************* ! ! This software is provided under the GPL software license. A copy of the ! license should have been included with this software, located in the Docs ! folder. Feel free to redistribute and/or modify it according to the ! regulations stated in the license. ! ! ******************************************************************************* ! ******************************************************************************/ ! ! // Include The Main Configuration File ! include("./config.php"); ! ! if(!defined("PHPMP_INSTALLED")) { ! header('Location: ./install.php'); ! } ! ! define('IN_PHPMP', true); ! ! include($MPCONF['GEN']['abs_path'] . "/includes/core.php"); ! ! global $PHPMP; ! ! // Start phpMP ! $PHPMP = new PHPMP(); ! ! $PHPMP->Init(); ! ! $Template->assign( 'page_title', $Language->lang['l_home'] ); ! $Template->display_template('index.tpl'); ?> --- 1,5 ---- <? ! // Index file. ?> Index: modules.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/modules.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** modules.php 14 Aug 2002 06:24:23 -0000 1.12 --- modules.php 5 Nov 2002 22:11:05 -0000 1.13 *************** *** 1,108 **** <? ! /****************************************************************************** ! ******************************************************************************* ! ! phpMP - The World's Greatest Modular Portal ! *********************************************** ! Are you MPowered? ! ! Copyright (C) 2002 phpMP Development Group ! All rights reserved. ! ! Lead Programmer: Brian Rose ! Lead Designer: Trevor Joynsond ! ! Filename: /modules.php ! Usage & Function: Puts together all module content. ! Create Date: April 9, 2002 ! ! $Id$ ! ! ******************************************************************************* ! ******************************************************************************* ! ! This software is provided under the GPL software license. A copy of the ! license should have been included with this software, located in the Docs ! folder. Feel free to redistribute and/or modify it according to the ! regulations stated in the license. ! ! ******************************************************************************* ! ******************************************************************************/ ! ! include("./config.php"); ! ! define('IN_PHPMP', true); ! ! include($MPCONF['GEN']['abs_path'] . "/includes/core.php"); ! ! global $PHPMP; ! ! $PHPMP = new PHPMP(); ! ! $PHPMP->Init(); ! ! class ModClass { ! ! var $modulename; ! var $_inactive; ! var $_exists; ! ! function Init() { ! global $MPCONF, $DBA, $HTTP_GET_VARS; ! ! $this->modulename = $HTTP_GET_VARS['module']; ! $this->_inactive = 0; ! $this->_exists = 1; ! ! $query = $DBA->query("SELECT * FROM " . $MPCONF['DB']['table_prefix'] . "modules WHERE unixname='" . $this->modulename . "'"); ! $num_rows = $DBA->num_rows($query); ! if($num_rows > 0) { ! $MPCONF['MOD'] = $DBA->fetch_array($query); ! } else { ! $this->_exists = 0; ! } ! if($MPCONF['MOD']['active'] != 1) { ! $this->_inactive = 1; ! } ! } ! ! function DoCheck() { ! if(($this->_inactive == 1) || ($this->_exists != 1) || defined('PHPMP_MOD_' . $MPCONF['MOD']['mod_id'])) { ! return 0; ! } else { ! define('PHPMP_MOD_' . $MPCONF['MOD']['mod_id'], true); ! return 1; ! } ! } ! } ! ! $ModClass = new ModClass(); ! $ModClass->Init(); ! ! $ModCheck = $ModClass->DoCheck(); ! ! $my_page_title = "Module Error"; ! ! $ModFunctions = new ModFunctions(); ! ! if($ModCheck != 0) { ! include($MPCONF['GEN']['abs_path'] . '/modules/' . $MPCONF['MOD']['filename']); ! ! $Module->Init(); ! ! } ! ! if($ModCheck != 0) { ! $Module->MakeContent(); ! } else { ! $Template->Blocking('BeginBig', array(PAGETITLE => 'Module Error' )); ! print "An error occured while trying to process the module. It is either inactive or does not exist."; ! $Template->Blocking('EndBig'); ! } ! ! $Template->assign( 'page_title', $Module->module_title ); ! $Template->assign( 'module_content', $Module->module_content ); ! $Template->display_template('modules.tpl'); ?> --- 1,5 ---- <? ! // Module handler. ?> Index: profile.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/profile.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** profile.php 14 Aug 2002 06:28:14 -0000 1.5 --- profile.php 5 Nov 2002 22:11:05 -0000 1.6 *************** *** 1,112 **** <? ! /****************************************************************************** ! ******************************************************************************* ! ! phpMP - The World's Greatest Modular Portal ! *********************************************** ! Are you MPowered? ! ! Copyright (C) 2002 phpMP Development Group ! All rights reserved. ! ! Lead Programmer: Brian Rose ! Lead Designer: Trevor Joynson ! ! Filename: /profile.php ! Usage & Function: Profile/registration functions. ! Create Date: March 31, 2002 ! ! $Id$ ! ! ******************************************************************************* ! ******************************************************************************* ! ! This software is provided under the GPL software license. A copy of the ! license should have been included with this software, located in the Docs ! folder. Feel free to redistribute and/or modify it according to the ! regulations stated in the license. ! ! ******************************************************************************* ! ******************************************************************************/ ! ! include("./config.php"); ! ! define('IN_PHPMP', true); ! ! // Include The Main Core File ! include($MPCONF['GEN']['abs_path'] . "/includes/core.php"); ! ! global $PHPMP; ! ! // Start phpMP ! $PHPMP = new PHPMP(); ! ! $PHPMP->Init(); ! ! if($_GET['mode'] == 'register') { ! ! if($_GET['action'] == 'submit') { ! ! $sql = "SELECT user_id FROM " . $MPCONF['DB']['table_prefix'] . "users WHERE username='" . $_POST['r_username'] . "' OR email='" . $_POST['r_email'] . "'"; ! ! $qry = $DBA->query($sql); ! ! if((!empty($_POST['r_username'])) && (!empty($_POST['r_password'])) && (!empty($_POST['r_password_conf'])) && (!empty($_POST['r_email']))) { ! ! if(($DBA->num_rows($qry) == 0) && ($_POST['r_password'] == $_POST['r_password_conf'])) { ! ! $act_code = $_POST['r_username'] . md5( $_POST['r_email'] ); ! ! $sql = "INSERT INTO " . $MPCONF['DB']['table_prefix'] . "users (username, password, realname, email, location, act_code) VALUES('" . $_POST['r_username'] . "', MD5('" . $_POST['r_password'] . "'), '" . $_POST['r_realname'] . "', '" . $_POST['r_email'] . "', '" . $_POST['r_location'] . "', '" . $act_code . "')"; ! ! $DBA->query($sql); ! ! $url_for_act = $MPCONF['GEN']['address'] . $MPCONF['GEN']['uri'] . 'profile.php?mode=activate&u=' . $_POST['r_username'] . '&c=' . $act_code; ! ! eval( $Language->lang['l_fin_register_message'] ); ! ! mail($_POST['r_email'], $Language->lang['l_fin_register_subject'], $temp_message); ! ! $Template->assign( 'page_title', $Language->lang['l_register'] ); ! $Template->assign( "general_message", $Language->lang['l_register_fin'] ); ! ! $Template->display_template('general.tpl'); ! ! } else { ! ! header("Location: error.php?ecode=registration"); ! ! } ! ! } else { ! ! header("Location: error.php?ecode=registration"); ! ! } ! ! } else { ! ! $Template->assign( 'page_title', $Language->lang['l_register'] ); ! $Template->display_template('register.tpl'); ! ! } ! ! } elseif($_GET['mode'] == 'activate') { ! ! if( ($_GET['u'] != '') && ($_GET['c'] != '') ) { ! ! $sql = "UPDATE " . $MPCONF['DB']['table_prefix'] . "users SET active=1 WHERE username='" . $_GET['u'] . "' AND act_code='" . $_GET['c'] . "'"; ! ! $DBA->query($sql); ! ! $Template->assign( 'page_title', $Language->lang['l_register'] ); ! $Template->assign( "general_message", $Language->lang['l_activated'] ); ! ! $Template->display_template('general.tpl'); ! ! } ! ! } ?> --- 1,6 ---- <? ! // Profile handlers. ! // May be combined with other files, like auth.php or something. ?> |