phpmp-commits Mailing List for phpMyPublications (Page 10)
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
|
Update of /cvsroot/phpmp/phpMP/includes/plugins In directory sc8-pr-cvs1:/tmp/cvs-serv30020/plugins Removed Files: block.textformat.php function.assign.php function.assign_debug_info.php function.counter.php function.cycle.php function.debug.php function.eval.php function.fetch.php function.html_options.php function.html_select_date.php function.html_select_time.php function.mailto.php function.math.php function.popup.php function.popup_init.php modifier.capitalize.php modifier.count_characters.php modifier.count_paragraphs.php modifier.count_sentences.php modifier.count_words.php modifier.date_format.php modifier.debug_print_var.php modifier.default.php modifier.escape.php modifier.indent.php modifier.lower.php modifier.regex_replace.php modifier.replace.php modifier.spacify.php modifier.string_format.php modifier.strip.php modifier.strip_tags.php modifier.truncate.php modifier.upper.php modifier.wordwrap.php outputfilter.trimwhitespace.php shared.make_timestamp.php Log Message: Removing Smarty, since we are going to write our own template engine. --- block.textformat.php DELETED --- --- function.assign.php DELETED --- --- function.assign_debug_info.php DELETED --- --- function.counter.php DELETED --- --- function.cycle.php DELETED --- --- function.debug.php DELETED --- --- function.eval.php DELETED --- --- function.fetch.php DELETED --- --- function.html_options.php DELETED --- --- function.html_select_date.php DELETED --- --- function.html_select_time.php DELETED --- --- function.mailto.php DELETED --- --- function.math.php DELETED --- --- function.popup.php DELETED --- --- function.popup_init.php DELETED --- --- modifier.capitalize.php DELETED --- --- modifier.count_characters.php DELETED --- --- modifier.count_paragraphs.php DELETED --- --- modifier.count_sentences.php DELETED --- --- modifier.count_words.php DELETED --- --- modifier.date_format.php DELETED --- --- modifier.debug_print_var.php DELETED --- --- modifier.default.php DELETED --- --- modifier.escape.php DELETED --- --- modifier.indent.php DELETED --- --- modifier.lower.php DELETED --- --- modifier.regex_replace.php DELETED --- --- modifier.replace.php DELETED --- --- modifier.spacify.php DELETED --- --- modifier.string_format.php DELETED --- --- modifier.strip.php DELETED --- --- modifier.strip_tags.php DELETED --- --- modifier.truncate.php DELETED --- --- modifier.upper.php DELETED --- --- modifier.wordwrap.php DELETED --- --- outputfilter.trimwhitespace.php DELETED --- --- shared.make_timestamp.php DELETED --- |
From: Brian R. <hei...@us...> - 2003-05-14 06:26:13
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv2474/includes Modified Files: core.php Log Message: I guess I should follow my own coding guidelines. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -r1.52 -r1.53 *** core.php 12 May 2003 07:06:51 -0000 1.52 --- core.php 14 May 2003 06:26:09 -0000 1.53 *************** *** 4,8 **** { ! function strip_magic_quotes($arr) { foreach ($arr as $k => $v) --- 4,8 ---- { ! function stripMagicQuotes($arr) { foreach ($arr as $k => $v) *************** *** 30,36 **** if (get_magic_quotes_gpc()) { ! if (!empty($_GET)) { $_GET = $this->strip_magic_quotes($_GET); } ! if (!empty($_POST)) { $_POST = $this->strip_magic_quotes($_POST); } ! if (!empty($_COOKIE)) { $_COOKIE = $this->strip_magic_quotes($_COOKIE); } } --- 30,36 ---- if (get_magic_quotes_gpc()) { ! if (!empty($_GET)) { $_GET = $this->stripMagicQuotes($_GET); } ! if (!empty($_POST)) { $_POST = $this->stripMagicQuotes($_POST); } ! if (!empty($_COOKIE)) { $_COOKIE = $this->stripMagicQuotes($_COOKIE); } } |
From: Brian R. <hei...@us...> - 2003-05-12 07:06:54
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv21925/includes Modified Files: core.php Log Message: Oops. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -r1.51 -r1.52 *** core.php 12 May 2003 07:05:10 -0000 1.51 --- core.php 12 May 2003 07:06:51 -0000 1.52 *************** *** 40,44 **** } ! error_reporting(E_ERROR /*| E_WARNING | E_PARSE*/); //error_reporting(E_ALL); --- 40,44 ---- } ! error_reporting(E_ERROR | E_WARNING | E_PARSE); //error_reporting(E_ALL); |
From: Brian R. <hei...@us...> - 2003-05-12 07:05:15
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv21328/includes Modified Files: core.php session.php Log Message: Added per-session invisible mode. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -r1.50 -r1.51 *** core.php 9 May 2003 08:07:39 -0000 1.50 --- core.php 12 May 2003 07:05:10 -0000 1.51 *************** *** 40,44 **** } ! error_reporting(E_ERROR | E_WARNING | E_PARSE); //error_reporting(E_ALL); --- 40,44 ---- } ! error_reporting(E_ERROR /*| E_WARNING | E_PARSE*/); //error_reporting(E_ALL); Index: session.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/session.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** session.php 12 May 2003 05:06:56 -0000 1.9 --- session.php 12 May 2003 07:05:10 -0000 1.10 *************** *** 17,20 **** --- 17,22 ---- function start() { + // We'll only start a session if + // one hasn't already been started. if($this->started == false) { *************** *** 32,38 **** $this->page = basename($_SERVER['REQUEST_URI']); - $SID = "?sid="; - // Sets the session as owned by an anonymous user. $sql = "UPDATE " . DB_SESSIONS_TABLE . " SET session_exp_time=" . $exp_time . " --- 34,39 ---- $this->page = basename($_SERVER['REQUEST_URI']); // Sets the session as owned by an anonymous user. + // Since there's no reason to use a different session key, we'll keep that. $sql = "UPDATE " . DB_SESSIONS_TABLE . " SET session_exp_time=" . $exp_time . " *************** *** 43,48 **** $DB->query($sql); setcookie($Config->get('cookie_name') . '_auto', '', time() - 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); ! setcookie($Config->get('cookie_name') . '_data', '', time() - 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); } --- 44,53 ---- $DB->query($sql); + $this->session_user_id = ANONYMOUS; + setcookie($Config->get('cookie_name') . '_auto', '', time() - 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); ! ! $cookie_data = urlencode( ANONYMOUS . ':' . $this->session_key ); ! (setcookie($Config->get('cookie_name') . '_data', $cookie_data, $cur_time + $Config->get('session_length'), $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure'))) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->session_key); } *************** *** 57,61 **** $passwd_enc = md5($_POST['login_passwd']); $auto_login_set = $_POST['autologin']; ! $sql = "SELECT * FROM " . DB_USERS_TABLE . " WHERE user_name='" . addslashes($username) . "' --- 62,67 ---- $passwd_enc = md5($_POST['login_passwd']); $auto_login_set = $_POST['autologin']; ! $invisible_mode = $_POST['invisible_mode']; ! $sql = "SELECT * FROM " . DB_USERS_TABLE . " WHERE user_name='" . addslashes($username) . "' *************** *** 71,77 **** $this->is_logged_in = true; if( $auto_login_set == true ) { ! $auto_cookie_data = urlencode( $this->session_user_id . ':' . $passwd_enc ); setcookie($Config->get('cookie_name') . '_auto', $auto_cookie_data, time() + 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); } --- 77,87 ---- $this->is_logged_in = true; + // We'll look into the invisible mode setting and ensure the user's wishes are met. + ($invisible_mode == true) ? ( $User->set('invisible_mode', 1) ) : ( $User->set('invisible_mode', 0) ); + + // We'll set up an autologin cookie if the user wants us to. if( $auto_login_set == true ) { ! $auto_cookie_data = urlencode( $this->session_user_id . ':' . $passwd_enc . ':' . $User->get('invisible_mode') ); setcookie($Config->get('cookie_name') . '_auto', $auto_cookie_data, time() + 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); } *************** *** 79,83 **** else // Wrong login information. { ! die('Sorry. Your username and/or password are incorrect. '); } } --- 89,93 ---- else // Wrong login information. { ! die('Sorry. Your username and/or password are incorrect.'); } } *************** *** 245,248 **** --- 255,259 ---- { $User->set( $DB->fetchAssoc($result) ); + $User->set('invisible_mode', $auto_cookie_array[2]); $this->session_user_id = $auto_cookie_array[0]; $this->is_logged_in = true; |
From: Brian R. <hei...@us...> - 2003-05-12 07:05:12
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv21328/docs Modified Files: Changelog Log Message: Added per-session invisible mode. Index: Changelog =================================================================== RCS file: /cvsroot/phpmp/phpMP/docs/Changelog,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** Changelog 9 May 2003 08:07:38 -0000 1.34 --- Changelog 12 May 2003 07:05:09 -0000 1.35 *************** *** 1,2 **** --- 1,10 ---- + 2003-05-12 [Heimidal] + * includes/session.php + Added support for per-session invisible use mode. + This allows a user to not show up in the Who's + Online listing (which hasn't been written yet). + Invisible mode remains persistent if auto-login + is utilized (spanning multiple sessions, obviously). + 2003-05-09 [Heimidal] * almost all files (so check them all) |
From: Brian R. <hei...@us...> - 2003-05-12 07:05:12
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv21328 Modified Files: login_test.php Log Message: Added per-session invisible mode. Index: login_test.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/login_test.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** login_test.php 29 Apr 2003 08:40:54 -0000 1.2 --- login_test.php 12 May 2003 07:05:09 -0000 1.3 *************** *** 18,21 **** --- 18,24 ---- <input name="autologin" type="checkbox" id="autologin" /> </p> + <p>Invisible Mode? + <input name="invisible_mode" type="checkbox" id="invisible_mode" /> + </p> <p> <input type="submit" name="Submit" value="Submit" /> |
From: Brian R. <hei...@us...> - 2003-05-12 05:07:00
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv15846/includes Modified Files: session.php Log Message: Fixed a small bug which kept usernames from containing non-alphanumeric characters. Fixed without Changelog entry. Index: session.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/session.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** session.php 9 May 2003 08:07:39 -0000 1.8 --- session.php 12 May 2003 05:06:56 -0000 1.9 *************** *** 59,63 **** $sql = "SELECT * FROM " . DB_USERS_TABLE . " ! WHERE user_name='" . $username . "' AND user_passwd='" . $passwd_enc . "'"; --- 59,63 ---- $sql = "SELECT * FROM " . DB_USERS_TABLE . " ! WHERE user_name='" . addslashes($username) . "' AND user_passwd='" . $passwd_enc . "'"; |
From: Brian R. <hei...@us...> - 2003-05-09 08:07:42
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv26421/includes Modified Files: core.php functions.php language.php session.php template.php user.php Log Message: Huge update to variable storage system. See the Changelong. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -r1.49 -r1.50 *** core.php 9 May 2003 04:46:48 -0000 1.49 --- core.php 9 May 2003 08:07:39 -0000 1.50 *************** *** 64,76 **** define("DB_TEMPLATE_VARS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'template_vars'); ! $result = $DB->query( "SELECT * FROM " . DB_CONFIG_TABLE ); ! ! // Loop through all config values from DB. ! // Define each key as its respective value. ! while( $row = $DB->fetchArray( $result ) ) ! { ! $Config; ! $Config[$row['config_key']] = $row['config_value']; ! } include_once(PHPMP_ROOT . 'includes/constants.php'); --- 64,68 ---- define("DB_TEMPLATE_VARS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'template_vars'); ! $Config = new Config(); include_once(PHPMP_ROOT . 'includes/constants.php'); *************** *** 112,115 **** --- 104,151 ---- $DB->close(); } + } + + class Config + { + var $_cfgvars; + + function Config() + { + global $DB; + + $result = $DB->query( "SELECT * FROM " . DB_CONFIG_TABLE ); + + // Loop through all config values from DB. + // Define each key as its respective value. + while( $row = $DB->fetchArray( $result ) ) + { + $this->_cfgvars[$row['config_key']] = $row['config_value']; + } + } + + function set($cfgkey, $cfgval) + { + if( (!empty($cfgkey)) && (eregi('^[a-z]+[_a-z0-9-]*$', $cfgkey)) && (!empty($cfgval)) ) + { + $this->_cfgvars[strtolower($cfgkey)] = $cfgval; + return true; + } + else + { + return false; + } + } + + function get($cfgkey) + { + if( !empty($this->_cfgvars[strtolower($cfgkey)]) ) + { + return $this->_cfgvars[strtolower($cfgkey)]; + } + else + { + return false; + } + } } Index: functions.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/functions.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** functions.php 2 May 2003 04:52:57 -0000 1.28 --- functions.php 9 May 2003 08:07:39 -0000 1.29 *************** *** 9,14 **** global $Config, $User; ! ( $User->data['date_format'] != '' ) ? ($Config['date_format'] = $User->data['date_format']) : ($Config['date_format'] = $Config['default_date_format']); ! $Config['time_now'] = date( $Config['date_format'] ); // This is here...for now. } --- 9,14 ---- global $Config, $User; ! ( $User->get('date_format') != '' ) ? ($Config->set('date_format', $User->get('date_format'))) : ($Config->set('date_format', $Config->get('default_date_format'))); ! $Config->set('time_now', date( $Config->get('date_format') ) ); // This is here...for now. } Index: language.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/language.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** language.php 23 Apr 2003 07:21:03 -0000 1.10 --- language.php 9 May 2003 08:07:39 -0000 1.11 *************** *** 7,13 **** { global $Config, $User, $Local; ! ($User->data['language'] != '') ? ($Config['language'] = $User->data['language']) : ($Config['language'] = $Config['default_lang']); ! include_once( PHPMP_ROOT . 'languages/' . $Config['language'] . '/lang_main.php' ); $Local = new Localization(); --- 7,13 ---- { global $Config, $User, $Local; ! ($User->get('language') != '') ? ($Config->set('language', $User->get('language'))) : ($Config->set('language', $Config->get('default_lang'))); ! include_once( PHPMP_ROOT . 'languages/' . $Config->get('language') . '/lang_main.php' ); $Local = new Localization(); Index: session.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/session.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** session.php 9 May 2003 04:46:48 -0000 1.7 --- session.php 9 May 2003 08:07:39 -0000 1.8 *************** *** 29,33 **** global $DB, $Config, $SID; ! $exp_time = time() + $Config['session_length']; $this->page = basename($_SERVER['REQUEST_URI']); --- 29,33 ---- global $DB, $Config, $SID; ! $exp_time = time() + $Config->get('session_length'); $this->page = basename($_SERVER['REQUEST_URI']); *************** *** 43,48 **** $DB->query($sql); ! setcookie($Config['cookie_name'] . '_auto', '', time() - 31536000, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); ! setcookie($Config['cookie_name'] . '_data', '', time() - 31536000, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); } --- 43,48 ---- $DB->query($sql); ! setcookie($Config->get('cookie_name') . '_auto', '', time() - 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); ! setcookie($Config->get('cookie_name') . '_data', '', time() - 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); } *************** *** 67,72 **** if( $num_rows == 1 ) // We have a user! { ! $User->data = $DB->fetchAssoc($result); ! $this->session_user_id = $User->data['user_id']; $this->is_logged_in = true; --- 67,72 ---- if( $num_rows == 1 ) // We have a user! { ! $User->set( $DB->fetchAssoc($result) ); ! $this->session_user_id = $User->get('user_id'); $this->is_logged_in = true; *************** *** 74,78 **** { $auto_cookie_data = urlencode( $this->session_user_id . ':' . $passwd_enc ); ! setcookie($Config['cookie_name'] . '_auto', $auto_cookie_data, time() + 31536000, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); } } --- 74,78 ---- { $auto_cookie_data = urlencode( $this->session_user_id . ':' . $passwd_enc ); ! setcookie($Config->get('cookie_name') . '_auto', $auto_cookie_data, time() + 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); } } *************** *** 104,108 **** $cur_time = time(); // Time as of right now. ! $exp_time = $cur_time + $Config['session_length']; // Time at which this session will become invalid. $this->ip = $User->getIPEncoded(); // Gets the user's IP address. --- 104,108 ---- $cur_time = time(); // Time as of right now. ! $exp_time = $cur_time + $Config->get('session_length'); // Time at which this session will become invalid. $this->ip = $User->getIPEncoded(); // Gets the user's IP address. *************** *** 170,178 **** $result = $DB->query($sql); ! $User->data = $DB->fetchAssoc($result); } $cookie_data = urlencode( $this->session_user_id . ':' . $this->session_key ); ! (setcookie($Config['cookie_name'] . '_data', $cookie_data, $cur_time + $Config['session_length'], $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure'])) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->session_key); $this->clean(); } --- 170,178 ---- $result = $DB->query($sql); ! $User->set( $DB->fetchAssoc($result) ); } $cookie_data = urlencode( $this->session_user_id . ':' . $this->session_key ); ! (setcookie($Config->get('cookie_name') . '_data', $cookie_data, $cur_time + $Config->get('session_length'), $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure'))) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->session_key); $this->clean(); } *************** *** 203,209 **** // Let's see if we have a standard cookie available. ! if(!empty($_COOKIE[$Config['cookie_name'] . '_data'])) { ! $cookie_data = $_COOKIE[$Config['cookie_name'] . '_data']; $cookie_array = explode(':', urldecode( $cookie_data ) ); --- 203,209 ---- // Let's see if we have a standard cookie available. ! if(!empty($_COOKIE[$Config->get('cookie_name') . '_data'])) { ! $cookie_data = $_COOKIE[$Config->get('cookie_name') . '_data']; $cookie_array = explode(':', urldecode( $cookie_data ) ); *************** *** 230,236 **** if( ($this->session_user_id == ANONYMOUS) || empty($this->session_user_id) ) { ! if( !empty( $_COOKIE[$Config['cookie_name'] . '_auto'] ) ) // We have an autologin cookie set. { ! $auto_cookie_data = $_COOKIE[$Config['cookie_name'] . '_auto']; $auto_cookie_array = explode(':', urldecode( $auto_cookie_data ) ); --- 230,236 ---- if( ($this->session_user_id == ANONYMOUS) || empty($this->session_user_id) ) { ! if( !empty( $_COOKIE[$Config->get('cookie_name') . '_auto'] ) ) // We have an autologin cookie set. { ! $auto_cookie_data = $_COOKIE[$Config->get('cookie_name') . '_auto']; $auto_cookie_array = explode(':', urldecode( $auto_cookie_data ) ); *************** *** 244,248 **** if( $num_rows == 1 ) // This cookie is valid. { ! $User->data = $DB->fetchAssoc($result); $this->session_user_id = $auto_cookie_array[0]; $this->is_logged_in = true; --- 244,248 ---- if( $num_rows == 1 ) // This cookie is valid. { ! $User->set( $DB->fetchAssoc($result) ); $this->session_user_id = $auto_cookie_array[0]; $this->is_logged_in = true; *************** *** 251,255 **** { // We'll unset the cookie and continue on like nothing ever happened. ! setcookie($Config['cookie_name'] . '_auto', '', time() - 31536000, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); return false; $this->session_user_id = ANONYMOUS; --- 251,255 ---- { // We'll unset the cookie and continue on like nothing ever happened. ! setcookie($Config->get('cookie_name') . '_auto', '', time() - 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); return false; $this->session_user_id = ANONYMOUS; Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** template.php 9 May 2003 04:46:48 -0000 1.31 --- template.php 9 May 2003 08:07:39 -0000 1.32 *************** *** 7,11 **** { var $tplname; ! var $tplvars = array(); /** --- 7,11 ---- { var $tplname; ! var $_tplvars = array(); /** *************** *** 28,32 **** $this->tplname = $tplname; ! $this->tplvars = $DB->fetchArray($query); } --- 28,32 ---- $this->tplname = $tplname; ! $this->_tplvars = $DB->fetchArray($query); } *************** *** 63,79 **** { // Assign an array to the template vars hash. ! foreach( $arr as $key => $val ) { ! if(preg_match('^A-z0-9_-', $key)) { ! $Template->tplvars[$key] = $val; } // If the regex doesn't validate to A-z0-9_-, we won't do anything and ignore the fault. } } ! elseif((!empty( $new_tpl_var )) && (preg_match('^A-z0-9_-', $new_tpl_var)) && ($new_tpl_val != false)) { // Assign one single var to the template vars hash. ! $Template->tplvars[$new_tpl_var] = $new_tpl_val; } } --- 63,79 ---- { // Assign an array to the template vars hash. ! foreach( $new_tpl_var as $key => $val ) { ! if(eregi('^[a-z]+[_a-z0-9-]*$', $key)) { ! $this->_tplvars[$key] = $val; } // If the regex doesn't validate to A-z0-9_-, we won't do anything and ignore the fault. } } ! elseif((!empty( $new_tpl_var )) && (eregi('^[a-z]+[_a-z0-9-]*$', $new_tpl_var)) && ($new_tpl_val != false)) { // Assign one single var to the template vars hash. ! $this->_tplvars[$new_tpl_var] = $new_tpl_val; } } Index: user.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/user.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** user.php 29 Apr 2003 08:40:54 -0000 1.19 --- user.php 9 May 2003 08:07:39 -0000 1.20 *************** *** 4,8 **** { ! var $data; // Taken from phpBB2. Fetches the IP in a hex form. --- 4,43 ---- { ! var $_data; ! ! function set($userkey, $userval = false) ! { ! if(is_array( $userkey )) ! { ! foreach( $userkey as $key => $val ) ! { ! if(eregi('^[a-z]+[_a-z0-9-]*$', $key)) ! { ! $this->_data[strtolower($key)] = $val; ! } ! } ! } ! elseif( (!empty($userkey)) && (eregi('^[a-z]+[_a-z0-9-]*$', $userkey)) && (!empty($userval)) ) ! { ! $this->_data[strtolower($userkey)] = $userval; ! return true; ! } ! else ! { ! return false; ! } ! } ! ! function get($userkey) ! { ! if( !empty($this->_data[strtolower($userkey)]) ) ! { ! return $this->_data[strtolower($userkey)]; ! } ! else ! { ! return false; ! } ! } // Taken from phpBB2. Fetches the IP in a hex form. |
From: Brian R. <hei...@us...> - 2003-05-09 08:07:42
|
Update of /cvsroot/phpmp/phpMP/languages/english In directory sc8-pr-cvs1:/tmp/cvs-serv26421/languages/english Modified Files: lang_main.php Log Message: Huge update to variable storage system. See the Changelong. Index: lang_main.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/languages/english/lang_main.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** lang_main.php 2 May 2003 04:52:57 -0000 1.18 --- lang_main.php 9 May 2003 08:07:39 -0000 1.19 *************** *** 17,21 **** // Note: Always escape single quote characters (') with a backslash (\). // ! 'L_Welcome_to_Site' => 'Welcome to ' . $Config['site_name'] . '!', 'L_Home' => 'Home', 'L_Profile' => 'Profile', --- 17,21 ---- // Note: Always escape single quote characters (') with a backslash (\). // ! 'L_Welcome_to_Site' => 'Welcome to ' . $Config->get('site_name') . '!', 'L_Home' => 'Home', 'L_Profile' => 'Profile', *************** *** 53,57 **** // Other various parts of the templates. // ! 'L_Powered_by_phpMP' => 'powered by phpMP ' . $Config['version'] . ' © 2002 <a href="http://phpmp.sourceforge.net/">phpMP Dev. Group</a>.', 'L_Copyright' => 'All content is property of its respective owner. All rights reserved.' --- 53,57 ---- // Other various parts of the templates. // ! 'L_Powered_by_phpMP' => 'powered by phpMP ' . $Config->get('version') . ' © 2002 <a href="http://phpmp.sourceforge.net/">phpMP Dev. Group</a>.', 'L_Copyright' => 'All content is property of its respective owner. All rights reserved.' |
From: Brian R. <hei...@us...> - 2003-05-09 08:07:41
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv26421/docs Modified Files: Changelog Log Message: Huge update to variable storage system. See the Changelong. Index: Changelog =================================================================== RCS file: /cvsroot/phpmp/phpMP/docs/Changelog,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** Changelog 9 May 2003 04:46:48 -0000 1.33 --- Changelog 9 May 2003 08:07:38 -0000 1.34 *************** *** 1,2 **** --- 1,19 ---- + 2003-05-09 [Heimidal] + * almost all files (so check them all) + $Config is now located in its own object. + All Config, User, and Template array values are + henceforth unaccessible by means of direct access. + You must use the $ObjectName->get() and set() + functions in order to access this data. Currently, + the set() function in both the $User and $Template + classes accepts both singular values as well as an + associative array of values. The $Config class + does not, however. + Finally, value names must begin with a letter, + can contain all letters, numbers, dashes (-), and + underscores (_). In addition, , with the exception + of the $Template class, value names are no longer + case sensitive. + 2003-05-08 [Heimidal] * includes/template.php |
From: Brian R. <hei...@us...> - 2003-05-09 08:07:41
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv26421 Modified Files: index.php Log Message: Huge update to variable storage system. See the Changelong. Index: index.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/index.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -r1.40 -r1.41 *** index.php 2 May 2003 04:52:56 -0000 1.40 --- index.php 9 May 2003 08:07:38 -0000 1.41 *************** *** 6,22 **** // For testing purposes, we will now print all of the constants we have declared. - global $Config, $DB; ! print "phpMP Version: " . $Config['version'] . '<br>'; print "<br>"; ! print "Site Name: " . $Config['site_name'] . '<br>'; ! print "Site Address: " . $Config['site_domain'] . '<br>'; ! print "Relative Path: " . $Config['rel_path'] . '<br>'; ! print "Default Template: " . $Config['default_tpl'] . '<br>'; ! print "Default Language: " . $Config['default_lang'] . '<br>'; ! print "The Current Date and Time: " . $Config['time_now'] . '<br>'; ! print "Current Logged User: " . $User->data['user_name'] . '<br>'; print "<br>"; --- 6,21 ---- // For testing purposes, we will now print all of the constants we have declared. ! print "phpMP Version: " . $Config->get('version') . '<br>'; print "<br>"; ! print "Site Name: " . $Config->get('site_name') . '<br>'; ! print "Site Address: " . $Config->get('site_domain') . '<br>'; ! print "Relative Path: " . $Config->get('rel_path') . '<br>'; ! print "Default Template: " . $Config->get('default_tpl') . '<br>'; ! print "Default Language: " . $Config->get('default_lang') . '<br>'; ! print "The Current Date and Time: " . $Config->get('time_now') . '<br>'; ! print "Current Logged User: " . $User->get('user_name') . '<br>'; print "<br>"; *************** *** 39,44 **** print "<br>"; ! print "Regular Cookie: " . urldecode($_COOKIE[$Config['cookie_name'] . '_data']) . '<br>'; ! print "Auto-login Cookie: " . urldecode($_COOKIE[$Config['cookie_name'] . '_auto']) . '<br>'; ?> --- 38,43 ---- print "<br>"; ! print "Regular Cookie: " . urldecode($_COOKIE[$Config->get('cookie_name') . '_data']) . '<br>'; ! print "Auto-login Cookie: " . urldecode($_COOKIE[$Config->get('cookie_name') . '_auto']) . '<br>'; ?> |
From: Brian R. <hei...@us...> - 2003-05-09 04:46:51
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv30808/includes Modified Files: core.php session.php template.php Log Message: Continued work on the template system. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -r1.48 -r1.49 *** core.php 4 May 2003 21:12:06 -0000 1.48 --- core.php 9 May 2003 04:46:48 -0000 1.49 *************** *** 9,15 **** { if (is_array($v)) ! { $arr[$k] = strip_magic_quotes($v); } else ! { $arr[$k] = stripslashes($v); } } --- 9,19 ---- { if (is_array($v)) ! { ! $arr[$k] = strip_magic_quotes($v); ! } else ! { ! $arr[$k] = stripslashes($v); ! } } *************** *** 76,79 **** --- 80,85 ---- include_once(PHPMP_ROOT . 'includes/user.php'); $User = new User(); // Create an instance of User. + + createVars(); include_once(PHPMP_ROOT . 'includes/session.php'); *************** *** 86,91 **** $Language = new Language(); - createVars(); - include_once(PHPMP_ROOT . 'includes/mpcode.php'); --- 92,95 ---- *************** *** 104,108 **** //include_once(PHPMP_ROOT . 'includes/Smarty.class.php'); include_once(PHPMP_ROOT . 'includes/template.php'); ! $Template = new Template('index'); // Create an instance of Template. $DB->close(); --- 108,112 ---- //include_once(PHPMP_ROOT . 'includes/Smarty.class.php'); include_once(PHPMP_ROOT . 'includes/template.php'); ! $Template = new Template($Session->page); // Create an instance of Template. $DB->close(); Index: session.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/session.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** session.php 4 May 2003 21:12:06 -0000 1.6 --- session.php 9 May 2003 04:46:48 -0000 1.7 *************** *** 12,15 **** --- 12,16 ---- var $session_user_id; var $ip; + var $page; // Starts the session. Must be called. *************** *** 29,33 **** $exp_time = time() + $Config['session_length']; ! $page = basename($_SERVER['REQUEST_URI']); $SID = "?sid="; --- 30,34 ---- $exp_time = time() + $Config['session_length']; ! $this->page = basename($_SERVER['REQUEST_URI']); $SID = "?sid="; *************** *** 36,40 **** $sql = "UPDATE " . DB_SESSIONS_TABLE . " SET session_exp_time=" . $exp_time . " ! AND session_page='" . $page . "' AND session_user_id=" . ANONYMOUS . " WHERE session_key='" . $this->session_key . "'"; --- 37,41 ---- $sql = "UPDATE " . DB_SESSIONS_TABLE . " SET session_exp_time=" . $exp_time . " ! AND session_page='" . $this->page . "' AND session_user_id=" . ANONYMOUS . " WHERE session_key='" . $this->session_key . "'"; *************** *** 100,104 **** // Capture the page we're at. ! $page = basename($_SERVER['REQUEST_URI']); $cur_time = time(); // Time as of right now. --- 101,105 ---- // Capture the page we're at. ! $this->page = basename($_SERVER['REQUEST_URI']); $cur_time = time(); // Time as of right now. *************** *** 138,142 **** { $sql = "UPDATE " . DB_SESSIONS_TABLE . " ! SET session_exp_time=" . $exp_time . ", session_page='" . addslashes($page) . "', session_user_id=" . $this->session_user_id . " WHERE session_key='" . $this->session_key . "'"; } --- 139,143 ---- { $sql = "UPDATE " . DB_SESSIONS_TABLE . " ! SET session_exp_time=" . $exp_time . ", session_page='" . addslashes($this->page) . "', session_user_id=" . $this->session_user_id . " WHERE session_key='" . $this->session_key . "'"; } *************** *** 144,148 **** { $sql = "UPDATE " . DB_SESSIONS_TABLE . " ! SET session_exp_time=" . $exp_time . ", session_page='" . addslashes($page) . "' WHERE session_key='" . $this->session_key . "'"; } --- 145,149 ---- { $sql = "UPDATE " . DB_SESSIONS_TABLE . " ! SET session_exp_time=" . $exp_time . ", session_page='" . addslashes($this->page) . "' WHERE session_key='" . $this->session_key . "'"; } *************** *** 157,161 **** $sql = 'INSERT INTO ' . DB_SESSIONS_TABLE . ' (session_key, session_user_id, session_start_time, session_exp_time, session_page, session_ip) ! VALUES(\'' . $this->session_key . '\', ' . $this->session_user_id . ', ' . $cur_time . ', ' . $exp_time . ', \'' . addslashes($page) . '\', \'' . $this->ip . '\')'; } --- 158,162 ---- $sql = 'INSERT INTO ' . DB_SESSIONS_TABLE . ' (session_key, session_user_id, session_start_time, session_exp_time, session_page, session_ip) ! VALUES(\'' . $this->session_key . '\', ' . $this->session_user_id . ', ' . $cur_time . ', ' . $exp_time . ', \'' . addslashes($this->page) . '\', \'' . $this->ip . '\')'; } Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** template.php 4 May 2003 21:12:06 -0000 1.30 --- template.php 9 May 2003 04:46:48 -0000 1.31 *************** *** 4,8 **** // This will utilize a flat-file template system. ! class template { var $tplname; --- 4,8 ---- // This will utilize a flat-file template system. ! class Template { var $tplname; *************** *** 10,22 **** /** ! * template::template() * * Initializes the template system * Default Constructor * ! * @param $tplname * @return **/ ! function template($tplname) { global $DB; --- 10,26 ---- /** ! * Template::Template() * * Initializes the template system * Default Constructor * ! * @param $tplname, $tplsub * @return + * + * $tpl_sub will contain the called division of a page i.e. modules.php?m=news&sub=read would yield + * Template('news', 'read') so that the correct template is displayed for underlying divisions of mods + * and such. **/ ! function Template($tplname, $tplsub = '') { global $DB; *************** *** 25,28 **** --- 29,80 ---- $this->tplname = $tplname; $this->tplvars = $DB->fetchArray($query); + } + + /** + * Template::assign() + * + * Allows for the assignment of template variables. + * + * @param $new_tpl_var + * @return + * + * Note that this function can accept two forms of variables in order to assign them; + * you may specify an associative array of keys and values or call call the function + * with a single key and value. + * + * For instance, the following is entirely valid: + * + * $Template->assign( array( + * 'Google' => 'http://www.google.com', + * 'Excite' => 'http://www.excite.com', + * 'Altavista' => 'http://www.altavista.com' + * ) ); + * + * The following is also valid: + * + * $Template->assign('Google', 'http://www.google.com'); + * + * Lastly, keep in mind that, in order to make things a little cohesive and standardized, + * your template variable names may only contains characters A-Z, a-z, 0-9, (_), and (-). + **/ + function assign($new_tpl_var, $new_tpl_val = false) + { + if( is_array( $new_tpl_var ) ) + { + // Assign an array to the template vars hash. + foreach( $arr as $key => $val ) + { + if(preg_match('^A-z0-9_-', $key)) + { + $Template->tplvars[$key] = $val; + } + // If the regex doesn't validate to A-z0-9_-, we won't do anything and ignore the fault. + } + } + elseif((!empty( $new_tpl_var )) && (preg_match('^A-z0-9_-', $new_tpl_var)) && ($new_tpl_val != false)) + { + // Assign one single var to the template vars hash. + $Template->tplvars[$new_tpl_var] = $new_tpl_val; + } } } |
From: Brian R. <hei...@us...> - 2003-05-09 04:46:51
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv30808/docs Modified Files: Changelog Log Message: Continued work on the template system. Index: Changelog =================================================================== RCS file: /cvsroot/phpmp/phpMP/docs/Changelog,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** Changelog 4 May 2003 21:12:06 -0000 1.32 --- Changelog 9 May 2003 04:46:48 -0000 1.33 *************** *** 1,2 **** --- 1,8 ---- + 2003-05-08 [Heimidal] + * includes/template.php + * includes/core.php + Working on the template system. You can now + assign template vars to the $tplvars array. + 2003-05-04 [Heimidal] * includes/template.php *************** *** 11,14 **** --- 17,21 ---- 'ANONYMOUS' so the user_id for the anonymous user can be quickly edited in the future. + 2003-05-02 [AnthonyWhite] * includes/mpcode.php |
From: Brian R. <hei...@us...> - 2003-05-04 21:12:09
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv1971/includes Modified Files: constants.php core.php session.php template.php Log Message: See Changelog. Index: constants.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/constants.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** constants.php 2 May 2003 04:52:57 -0000 1.19 --- constants.php 4 May 2003 21:12:06 -0000 1.20 *************** *** 5,8 **** --- 5,10 ---- define("ACTIVATE_ADMIN", 2); + define("ANONYMOUS", 1); + define("AUTH_LVL_GUEST", 0); // Guest. define("AUTH_LVL_MEM", 1); // Standard Member Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -r1.47 -r1.48 *** core.php 2 May 2003 04:52:57 -0000 1.47 --- core.php 4 May 2003 21:12:06 -0000 1.48 *************** *** 58,61 **** --- 58,62 ---- define("DB_MODULES_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'modules'); define("DB_BLOCK_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'blocks'); + define("DB_TEMPLATE_VARS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'template_vars'); $result = $DB->query( "SELECT * FROM " . DB_CONFIG_TABLE ); *************** *** 101,107 **** } ! include_once(PHPMP_ROOT . 'includes/Smarty.class.php'); include_once(PHPMP_ROOT . 'includes/template.php'); ! $Template = new Template(); // Create an instance of Template. $DB->close(); --- 102,108 ---- } ! //include_once(PHPMP_ROOT . 'includes/Smarty.class.php'); include_once(PHPMP_ROOT . 'includes/template.php'); ! $Template = new Template('index'); // Create an instance of Template. $DB->close(); Index: session.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/session.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** session.php 2 May 2003 04:52:57 -0000 1.5 --- session.php 4 May 2003 21:12:06 -0000 1.6 *************** *** 26,40 **** function destroy() { ! global $DB, $Config; $exp_time = time() + $Config['session_length']; $page = basename($_SERVER['REQUEST_URI']); // Sets the session as owned by an anonymous user. ! $sql = 'UPDATE ' . DB_SESSIONS_TABLE . ' ! SET session_exp_time=\'' . $exp_time . '\' ! AND session_page=\'' . $page . '\' ! AND session_user_id=1 ! WHERE session_key=\'' . $this->session_key . '\''; $DB->query($sql); --- 26,42 ---- function destroy() { ! global $DB, $Config, $SID; $exp_time = time() + $Config['session_length']; $page = basename($_SERVER['REQUEST_URI']); + $SID = "?sid="; + // Sets the session as owned by an anonymous user. ! $sql = "UPDATE " . DB_SESSIONS_TABLE . " ! SET session_exp_time=" . $exp_time . " ! AND session_page='" . $page . "' ! AND session_user_id=" . ANONYMOUS . " ! WHERE session_key='" . $this->session_key . "'"; $DB->query($sql); *************** *** 83,87 **** function run() { ! global $User, $DB, $Config; if( (isset($_POST['do_login'])) && ($_POST['do_login'] == true) ) --- 85,89 ---- function run() { ! global $User, $DB, $Config, $SID; if( (isset($_POST['do_login'])) && ($_POST['do_login'] == true) ) *************** *** 127,130 **** --- 129,134 ---- $session_exists = false; } + + $this->session_user_id = $this->session_data['session_user_id']; } *************** *** 148,152 **** if( $this->is_logged_in == false ) { ! $this->session_user_id = 1; } --- 152,156 ---- if( $this->is_logged_in == false ) { ! $this->session_user_id = ANONYMOUS; } *************** *** 169,173 **** $cookie_data = urlencode( $this->session_user_id . ':' . $this->session_key ); ! setcookie($Config['cookie_name'] . '_data', $cookie_data, $cur_time + $Config['session_length'], $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); $this->clean(); } --- 173,177 ---- $cookie_data = urlencode( $this->session_user_id . ':' . $this->session_key ); ! (setcookie($Config['cookie_name'] . '_data', $cookie_data, $cur_time + $Config['session_length'], $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure'])) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->session_key); $this->clean(); } *************** *** 183,187 **** $DB->query($sql); ! if((!empty($this->session_user_id)) && ($this->session_user_id != 1) && (!empty($this->session_key))) // Note that, if we reach this point, the following query will remove past sessions for this user which may not have expired. // This is good, but would be better if done for all users or if done during the creation of new sessions. --- 187,191 ---- $DB->query($sql); ! if((!empty($this->session_user_id)) && ($this->session_user_id != ANONYMOUS) && (!empty($this->session_key))) // Note that, if we reach this point, the following query will remove past sessions for this user which may not have expired. // This is good, but would be better if done for all users or if done during the creation of new sessions. *************** *** 211,214 **** --- 215,222 ---- } } + elseif(!empty($_GET['sid'])) + { + $this->session_key = $_GET['sid']; + } if(empty($this->session_key)) // If we don't have a session key by now, there isn't one saved. *************** *** 219,223 **** // The user is currently anonymous, so let's check for auto-login. ! if( ($this->session_user_id == 1) || empty($this->session_user_id) ) { if( !empty( $_COOKIE[$Config['cookie_name'] . '_auto'] ) ) // We have an autologin cookie set. --- 227,231 ---- // The user is currently anonymous, so let's check for auto-login. ! if( ($this->session_user_id == ANONYMOUS) || empty($this->session_user_id) ) { if( !empty( $_COOKIE[$Config['cookie_name'] . '_auto'] ) ) // We have an autologin cookie set. *************** *** 244,248 **** setcookie($Config['cookie_name'] . '_auto', '', time() - 31536000, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); return false; ! $this->session_user_id = 1; } } --- 252,256 ---- setcookie($Config['cookie_name'] . '_auto', '', time() - 31536000, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); return false; ! $this->session_user_id = ANONYMOUS; } } Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** template.php 2 May 2003 04:52:57 -0000 1.29 --- template.php 4 May 2003 21:12:06 -0000 1.30 *************** *** 6,11 **** class template { ! var $tplname, $tplvars; ! $tplvars = new array(); /** --- 6,11 ---- class template { ! var $tplname; ! var $tplvars = array(); /** *************** *** 20,24 **** function template($tplname) { ! $query = $DB->query("SELECT * FROM " . DB_TABLE_PREFIX . "template_vars WHERE tpl_name='$tplname'"); $this->tplname = $tplname; --- 20,25 ---- function template($tplname) { ! global $DB; ! $query = $DB->query("SELECT * FROM " . DB_TEMPLATE_VARS_TABLE . " WHERE tpl_name='$tplname'"); $this->tplname = $tplname; |
From: Brian R. <hei...@us...> - 2003-05-04 21:12:09
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv1971/docs Modified Files: Changelog Log Message: See Changelog. Index: Changelog =================================================================== RCS file: /cvsroot/phpmp/phpMP/docs/Changelog,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** Changelog 2 May 2003 23:17:41 -0000 1.31 --- Changelog 4 May 2003 21:12:06 -0000 1.32 *************** *** 1,11 **** ! 2003-05-02 [AnthonyWhite] ! * includes/mpcode.php ! * includes/mpcode_arrays.php ! I got more work done on the MPCode system today, ! and it seems to be working great. ! I just need to add support for the harder mpcodes ! such as [url=] and [email=]. ! Hopefully I will have a complete system by the end ! of next week :) 2003-05-01 [Heimidal] --- 1,23 ---- ! 2003-05-04 [Heimidal] ! * includes/template.php ! * includes/core.php ! Globalized a few variables and fixed the way a ! var was declared. ! Ensured that the correct number of variables were ! specified in a function call to template. ! * includes/session.php ! * includes/constants.php ! Added an entry to the constants file for ! 'ANONYMOUS' so the user_id for the anonymous user ! can be quickly edited in the future. ! 2003-05-02 [AnthonyWhite] ! * includes/mpcode.php ! * includes/mpcode_arrays.php ! I got more work done on the MPCode system today, ! and it seems to be working great. ! I just need to add support for the harder mpcodes ! such as [url=] and [email=]. ! Hopefully I will have a complete system by the end ! of next week :) 2003-05-01 [Heimidal] |
From: Anthony W. <ant...@us...> - 2003-05-02 23:17:46
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv16149/docs Modified Files: Changelog Log Message: Did more work on the MPCode system. Hopefully I will finish this by the end of next week. Index: Changelog =================================================================== RCS file: /cvsroot/phpmp/phpMP/docs/Changelog,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** Changelog 2 May 2003 04:52:57 -0000 1.30 --- Changelog 2 May 2003 23:17:41 -0000 1.31 *************** *** 1,2 **** --- 1,12 ---- + 2003-05-02 [AnthonyWhite] + * includes/mpcode.php + * includes/mpcode_arrays.php + I got more work done on the MPCode system today, + and it seems to be working great. + I just need to add support for the harder mpcodes + such as [url=] and [email=]. + Hopefully I will have a complete system by the end + of next week :) + 2003-05-01 [Heimidal] * includes/debug.php |
From: Anthony W. <ant...@us...> - 2003-05-02 23:17:46
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv16149/includes Modified Files: mpcode.php mpcode_arrays.php Log Message: Did more work on the MPCode system. Hopefully I will finish this by the end of next week. Index: mpcode.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/mpcode.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** mpcode.php 1 May 2003 21:59:30 -0000 1.4 --- mpcode.php 2 May 2003 23:17:41 -0000 1.5 *************** *** 4,9 **** // These work similarly to BBCode and the like. - include ("includes/mpcode_arrays.php"); - // Work here done by anthony. If you dont like it feel free to change it. class mpcode { --- 4,7 ---- *************** *** 15,34 **** $split = explode(" ", $string); ! for ($i = 0; $i < count($split); $i++) { ! if (in_array($split[$i], $mpcode)) { ! $this->_replace($split[$i]); ! } ! } } // This may not be the best way, but it works function _replace($string) { ! for ($i = 0; $i < count($mpcode); $i++) { ! switch ($string) { ! case $mpcode[$i]: ! str_replace($string, $html[$i], $string); ! break; ! } ! } } --- 13,35 ---- $split = explode(" ", $string); ! foreach ($split as $key => $code) { ! if ($key == count($split) - 1) ! $final .= $this->_replace($code); ! else ! $final .= $this->_replace($code) . " "; ! } ! ! return $final; } // This may not be the best way, but it works function _replace($string) { ! include ("phpmp/includes/mpcode_arrays.php"); ! ! foreach ($mpcode as $key => $code) { ! $string = str_replace($code, $html[$key], $string); ! } ! ! return $string; } Index: mpcode_arrays.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/mpcode_arrays.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** mpcode_arrays.php 1 May 2003 21:59:31 -0000 1.1 --- mpcode_arrays.php 2 May 2003 23:17:41 -0000 1.2 *************** *** 4,15 **** $mpcode = array( ! 1 => "[b]", ! 2 => "[/b]" ! ); $html = array( ! 1 => "<b>", ! 2 => "</b>" ! ); ! ?> \ No newline at end of file --- 4,19 ---- $mpcode = array( ! "[b]", ! "[/b]", ! "[i]", ! "[/i]" ! ); $html = array( ! "<b>", ! "</b>", ! "<i>", ! "</i>" ! ); ! ?> |
From: Brian R. <hei...@us...> - 2003-05-02 04:54:08
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv10803/includes Modified Files: constants.php core.php debug.php functions.php session.php template.php Log Message: Fixed a few things. Removed redudant lines in template.php (redundant if initialized by Core). Config.php should always remain empty in CVS. Started work on debug interface. Lastly, autologin will now work as I want it to. Index: constants.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/constants.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** constants.php 9 Feb 2003 21:19:06 -0000 1.18 --- constants.php 2 May 2003 04:52:57 -0000 1.19 *************** *** 36,40 **** define("GMT_PLUS_5", 5); // Karachi. define("GMT_PLUS_5_30", 5.5); // New Delhi. - define("GMT_PLUS_5_45", 5.75); // Kathmandu. define("GMT_PLUS_6", 6); // Almaty. define("GMT_PLUS_6_30", 6.5); // Rangoon. --- 36,39 ---- *************** *** 47,50 **** --- 46,52 ---- define("GMT_PLUS_12", 12); // Auckland. define("GMT_PLUS_13", 13); // Nuku'alofa. + + define("DEBUG_ON", 1); + //define("DEBUG_ON", 0); ?> Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -r1.46 -r1.47 *** core.php 23 Apr 2003 07:21:03 -0000 1.46 --- core.php 2 May 2003 04:52:57 -0000 1.47 *************** *** 23,27 **** function Core( $optional_files = array() ) { ! if (get_magic_quotes_gpc()) { --- 23,27 ---- function Core( $optional_files = array() ) { ! set_magic_quotes_runtime(0); if (get_magic_quotes_gpc()) { *************** *** 35,38 **** --- 35,41 ---- define( 'PHPMP_ROOT', './' ); } + + error_reporting(E_ERROR | E_WARNING | E_PARSE); + //error_reporting(E_ALL); include_once( PHPMP_ROOT . 'config.php' ); *************** *** 44,47 **** --- 47,52 ---- $Debug = new Debug(); + set_error_handler(array('Debug', 'msgDisplay')); + include_once( PHPMP_ROOT . 'dba/' . DB_TYPE . '.dba' ); $DB = new DB(); *************** *** 86,94 **** // This while() statement will loop through the // $optional_files and include each file. ! $i = 0; ! while( $my_file = $optional_files[$i] ) { ! include_once(PHPMP_ROOT . 'includes/' . $my_file . '.php'); ! $i++; } --- 91,102 ---- // This while() statement will loop through the // $optional_files and include each file. ! if(count($optional_files) > 0) { ! $i = 0; ! while( $my_file = $optional_files[$i] ) ! { ! include_once(PHPMP_ROOT . 'includes/' . $my_file . '.php'); ! $i++; ! } } *************** *** 96,102 **** include_once(PHPMP_ROOT . 'includes/template.php'); $Template = new Template(); // Create an instance of Template. ! ! } ! } --- 104,110 ---- include_once(PHPMP_ROOT . 'includes/template.php'); $Template = new Template(); // Create an instance of Template. ! ! $DB->close(); ! } } Index: debug.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/debug.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** debug.php 8 Feb 2003 09:36:57 -0000 1.3 --- debug.php 2 May 2003 04:52:57 -0000 1.4 *************** *** 9,12 **** --- 9,40 ---- } + // Very similar to that of phpBB2, considering this is my first forray into error management. + // Hopefully, once I figure all of these different error codes and such out, I'll make it fit in more with the project. + function msgDisplay($errno, $msg_text, $errfile, $errline) + { + global $DB, $Config, $User, $Template; + + switch($errno) + { + case E_WARNING: + break; + + case E_NOTICE: + echo "PHP Notice on line <b>$errline</b> in <b>$errfile</b> :: <b>$msg_text</b><br />"; + break; + + case E_USER_ERROR: + if(isset($DB)) + { + $DB->close(); + echo "A User Error has occurred. Please notify the <a href=\"mailto: " . $Config['site_contact'] . "\">board administrator</a>."; + } + break; + + case E_USER_NOTICE: + echo "A User Notice has been issued. Please notify the <a href=\"mailto: " . $Config['site_contact'] . "\">board administrator</a>."; + break; + } + } } Index: functions.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/functions.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** functions.php 23 Apr 2003 07:21:03 -0000 1.27 --- functions.php 2 May 2003 04:52:57 -0000 1.28 *************** *** 7,11 **** function createVars() { ! global $Config; ( $User->data['date_format'] != '' ) ? ($Config['date_format'] = $User->data['date_format']) : ($Config['date_format'] = $Config['default_date_format']); --- 7,11 ---- function createVars() { ! global $Config, $User; ( $User->data['date_format'] != '' ) ? ($Config['date_format'] = $User->data['date_format']) : ($Config['date_format'] = $Config['default_date_format']); Index: session.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/session.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** session.php 29 Apr 2003 08:40:54 -0000 1.4 --- session.php 2 May 2003 04:52:57 -0000 1.5 *************** *** 14,22 **** // Starts the session. Must be called. ! function start($clean_all = false) { if($this->started == false) { - $this->clean(/*$clean_all*/ $_POST['clean_all'] ); $this->getSessionData(); $this->started = true; --- 14,21 ---- // Starts the session. Must be called. ! function start() { if($this->started == false) { $this->getSessionData(); $this->started = true; *************** *** 41,46 **** $DB->query($sql); ! setcookie($Config['cookie_name'] . '_auto', '', time() - 3600, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); ! setcookie($Config['cookie_name'] . '_data', '', time() - 3600, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); } --- 40,45 ---- $DB->query($sql); ! setcookie($Config['cookie_name'] . '_auto', '', time() - 31536000, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); ! setcookie($Config['cookie_name'] . '_data', '', time() - 31536000, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); } *************** *** 86,90 **** global $User, $DB, $Config; ! if( $_POST['do_login'] == true ) { $this->login(); --- 85,89 ---- global $User, $DB, $Config; ! if( (isset($_POST['do_login'])) && ($_POST['do_login'] == true) ) { $this->login(); *************** *** 171,174 **** --- 170,174 ---- $cookie_data = urlencode( $this->session_user_id . ':' . $this->session_key ); setcookie($Config['cookie_name'] . '_data', $cookie_data, $cur_time + $Config['session_length'], $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); + $this->clean(); } *************** *** 178,185 **** $rand = rand(0,10); ! if(($rand >= 1) || ($clean_all == true)) // 1:10 chance of session cleanup. This may later become a setting. { $sql = "DELETE FROM " . DB_SESSIONS_TABLE . " WHERE session_exp_time<" . time(); $DB->query($sql); } } --- 178,193 ---- $rand = rand(0,10); ! if(($rand <= 1) || ($clean_all == true)) // 1:10 chance of session cleanup. This may later become a setting. { $sql = "DELETE FROM " . DB_SESSIONS_TABLE . " WHERE session_exp_time<" . time(); $DB->query($sql); + + if((!empty($this->session_user_id)) && ($this->session_user_id != 1) && (!empty($this->session_key))) + // Note that, if we reach this point, the following query will remove past sessions for this user which may not have expired. + // This is good, but would be better if done for all users or if done during the creation of new sessions. + { + $sql = "DELETE FROM " . DB_SESSIONS_TABLE . " WHERE session_user_id=" . $this->session_user_id . " AND session_key!='" . $this->session_key . "'"; + $DB->query($sql); + } } } *************** *** 204,208 **** } ! if( $this->session_key == '' ) // If we don't have a session key by now, there isn't one saved. { $this->session_key = md5( uniqid (microtime(), 1) ); --- 212,216 ---- } ! if(empty($this->session_key)) // If we don't have a session key by now, there isn't one saved. { $this->session_key = md5( uniqid (microtime(), 1) ); *************** *** 234,238 **** { // We'll unset the cookie and continue on like nothing ever happened. ! setcookie($Config['cookie_name'] . '_auto', '', time() - 3600, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); return false; $this->session_user_id = 1; --- 242,246 ---- { // We'll unset the cookie and continue on like nothing ever happened. ! setcookie($Config['cookie_name'] . '_auto', '', time() - 31536000, $Config['cookie_path'], $Config['cookie_domain'], $Config['cookie_secure']); return false; $this->session_user_id = 1; Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** template.php 1 May 2003 21:59:30 -0000 1.28 --- template.php 2 May 2003 04:52:57 -0000 1.29 *************** *** 4,13 **** // This will utilize a flat-file template system. - include_once( C_PHPMP_ROOT . 'dba/' . DB_TYPE . '.dba' ); - $DB = new DB; - class template { - var $tplname, $tplvars; $tplvars = new array(); --- 4,9 ---- *************** *** 29,33 **** $this->tplvars = $DB->fetchArray($query); } - } --- 25,28 ---- |
From: Brian R. <hei...@us...> - 2003-05-02 04:54:07
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv10803/docs Modified Files: Changelog Log Message: Fixed a few things. Removed redudant lines in template.php (redundant if initialized by Core). Config.php should always remain empty in CVS. Started work on debug interface. Lastly, autologin will now work as I want it to. Index: Changelog =================================================================== RCS file: /cvsroot/phpmp/phpMP/docs/Changelog,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** Changelog 1 May 2003 21:59:30 -0000 1.29 --- Changelog 2 May 2003 04:52:57 -0000 1.30 *************** *** 1,2 **** --- 1,13 ---- + 2003-05-01 [Heimidal] + * includes/debug.php + * includes/core.php + Began work on debug/error handling. + * includes/session.php + * includes/session.php + * login_test.php + * includes/user.php + Autologin now works as I expect it to. + Cleanup of sessions is more reliable. + 2003-05-01 [AnthonyWhite] * includes/mpcode.php *************** *** 9,16 **** * session.php Added support for decoding our hexed IPs. ! * mysql_structure.sql ! * mysql_default_vals.sql Updated the table definitions. ! 2003-04-23 * index.php * login_test.php --- 20,28 ---- * session.php Added support for decoding our hexed IPs. ! * dba/sql/mysql_structure.sql ! * dba/sql/mysql_default_vals.sql Updated the table definitions. ! ! 2003-04-23 [Heimidal] * index.php * login_test.php *************** *** 28,36 **** User class. ! 2003-02-18 * includes/admin.php Changed some tabs because of my new editor ! 2003-02-14 [AnthonyWhite] * dba/mssql.dba **NEW** Added support for Microsoft SQL databases --- 40,48 ---- User class. ! 2003-02-18 [AnthonyWhite] * includes/admin.php Changed some tabs because of my new editor ! 2003-02-14 [AnthonyWhite] * dba/mssql.dba **NEW** Added support for Microsoft SQL databases *************** *** 43,47 **** Having a few problems, but I will fix them soon ! 2003-02-10 [AnthonyWhite] * includes/admin.php Started on User Management --- 55,59 ---- Having a few problems, but I will fix them soon ! 2003-02-10 [AnthonyWhite] * includes/admin.php Started on User Management *************** *** 50,59 **** * admin/index.php ! 2003-02-09 [AnthonyWhite] * includes/admin.php Added timezone dropdown Doesnt select timezone, it is displayed beside box ! 2003-02-09 [AnthonyWhite] * includes/admin.php Minor changes with site config form --- 62,71 ---- * admin/index.php ! 2003-02-09 [AnthonyWhite] * includes/admin.php Added timezone dropdown Doesnt select timezone, it is displayed beside box ! 2003-02-09 [AnthonyWhite] * includes/admin.php Minor changes with site config form |
From: Brian R. <hei...@us...> - 2003-05-02 04:54:07
|
Update of /cvsroot/phpmp/phpMP/languages/english In directory sc8-pr-cvs1:/tmp/cvs-serv10803/languages/english Modified Files: lang_main.php Log Message: Fixed a few things. Removed redudant lines in template.php (redundant if initialized by Core). Config.php should always remain empty in CVS. Started work on debug interface. Lastly, autologin will now work as I want it to. Index: lang_main.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/languages/english/lang_main.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** lang_main.php 8 Feb 2003 09:43:29 -0000 1.17 --- lang_main.php 2 May 2003 04:52:57 -0000 1.18 *************** *** 8,11 **** --- 8,12 ---- function Localization() { + global $Config; $this->lang = array( *************** *** 16,34 **** // Note: Always escape single quote characters (') with a backslash (\). // ! 'L_Welcome_to_Site' => 'Welcome to ' . C_SITE_NAME . '!', ! 'L_Home' => 'Home', ! 'L_Profile' => 'Profile', ! 'L_Modules' => 'Modules', 'L_Downloads' => 'Downloads', 'L_Username' => 'Username', ! 'L_User_CP' => 'User CP', 'L_User_Control_Panel' => 'User Control Panel', ! 'L_E-mail' => 'E-mail', 'L_Password' => 'Password', ! 'L_Comfirm' => 'Confirm', 'L_Real Name' => 'Real Name', 'L_Location' => 'Location', 'L_Register' => 'Register', ! 'L_Welcome' => 'Welcome', 'L_Administration_Area' => 'Administration Area', --- 17,35 ---- // Note: Always escape single quote characters (') with a backslash (\). // ! 'L_Welcome_to_Site' => 'Welcome to ' . $Config['site_name'] . '!', ! 'L_Home' => 'Home', ! 'L_Profile' => 'Profile', ! 'L_Modules' => 'Modules', 'L_Downloads' => 'Downloads', 'L_Username' => 'Username', ! 'L_User_CP' => 'User CP', 'L_User_Control_Panel' => 'User Control Panel', ! 'L_E-mail' => 'E-mail', 'L_Password' => 'Password', ! 'L_Confirm' => 'Confirm', 'L_Real Name' => 'Real Name', 'L_Location' => 'Location', 'L_Register' => 'Register', ! 'L_Welcome' => 'Welcome', 'L_Administration_Area' => 'Administration Area', *************** *** 52,56 **** // Other various parts of the templates. // ! 'L_Powered_by_phpMP' => 'powered by phpMP ' . C_VERSION . ' © 2002 <a href="http://phpmp.sourceforge.net/">phpMP Dev. Group</a>.', 'L_Copyright' => 'All content is property of its respective owner. All rights reserved.' --- 53,57 ---- // Other various parts of the templates. // ! 'L_Powered_by_phpMP' => 'powered by phpMP ' . $Config['version'] . ' © 2002 <a href="http://phpmp.sourceforge.net/">phpMP Dev. Group</a>.', 'L_Copyright' => 'All content is property of its respective owner. All rights reserved.' |
From: Brian R. <hei...@us...> - 2003-05-02 04:54:04
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv10803 Modified Files: config.php index.php Log Message: Fixed a few things. Removed redudant lines in template.php (redundant if initialized by Core). Config.php should always remain empty in CVS. Started work on debug interface. Lastly, autologin will now work as I want it to. Index: config.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/config.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** config.php 1 May 2003 21:59:30 -0000 1.2 --- config.php 2 May 2003 04:52:56 -0000 1.3 *************** *** 1,18 **** - <?php - - ## 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", "" ); - define( "DB_PASSWD", "" ); - - ?> \ No newline at end of file --- 0 ---- Index: index.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/index.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** index.php 29 Apr 2003 08:40:52 -0000 1.39 --- index.php 2 May 2003 04:52:56 -0000 1.40 *************** *** 6,10 **** // For testing purposes, we will now print all of the constants we have declared. ! global $Config; print "phpMP Version: " . $Config['version'] . '<br>'; --- 6,10 ---- // For testing purposes, we will now print all of the constants we have declared. ! global $Config, $DB; print "phpMP Version: " . $Config['version'] . '<br>'; *************** *** 27,30 **** --- 27,31 ---- print "DB User: " . DB_USER . '<br>'; print "Table Prefix: " . DB_TABLE_PREFIX . '<br>'; + print "Queries Exec: " . $DB->query_count . '<br>'; print "<br>"; |
From: Brian R. <hei...@us...> - 2003-05-02 04:54:04
|
Update of /cvsroot/phpmp/phpMP/dba In directory sc8-pr-cvs1:/tmp/cvs-serv10803/dba Modified Files: mysql.dba Log Message: Fixed a few things. Removed redudant lines in template.php (redundant if initialized by Core). Config.php should always remain empty in CVS. Started work on debug interface. Lastly, autologin will now work as I want it to. Index: mysql.dba =================================================================== RCS file: /cvsroot/phpmp/phpMP/dba/mysql.dba,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** mysql.dba 22 Apr 2003 10:50:51 -0000 1.22 --- mysql.dba 2 May 2003 04:52:56 -0000 1.23 *************** *** 6,9 **** --- 6,10 ---- var $ident_link; var $connected; + var $query_count; function connect () *************** *** 65,68 **** --- 66,70 ---- { $result = @mysql_query( $qry, $db ); + $this->query_count++; return $result; } |
From: Anthony W. <ant...@us...> - 2003-05-01 21:59:34
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv11175/includes Modified Files: mpcode.php template.php Added Files: mpcode_arrays.php Log Message: Started some work on mpcode, I think I have a good start here --- NEW FILE: mpcode_arrays.php --- <?php // Contains the mpcode and corresponding html arrays $mpcode = array( 1 => "[b]", 2 => "[/b]" ); $html = array( 1 => "<b>", 2 => "</b>" ); ?> Index: mpcode.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/mpcode.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** mpcode.php 8 Feb 2003 09:31:54 -0000 1.3 --- mpcode.php 1 May 2003 21:59:30 -0000 1.4 *************** *** 4,6 **** --- 4,37 ---- // These work similarly to BBCode and the like. + include ("includes/mpcode_arrays.php"); + + // Work here done by anthony. If you dont like it feel free to change it. + class mpcode { + + function parse_string($string) { + if ($string == "") + return; + + $split = explode(" ", $string); + + for ($i = 0; $i < count($split); $i++) { + if (in_array($split[$i], $mpcode)) { + $this->_replace($split[$i]); + } + } + } + + // This may not be the best way, but it works + function _replace($string) { + for ($i = 0; $i < count($mpcode); $i++) { + switch ($string) { + case $mpcode[$i]: + str_replace($string, $html[$i], $string); + break; + } + } + } + + } + ?> Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** template.php 8 Feb 2003 09:43:29 -0000 1.27 --- template.php 1 May 2003 21:59:30 -0000 1.28 *************** *** 4,66 **** // This will utilize a flat-file template system. ! class Template extends Smarty ! { ! ! // 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( ! ! "C_SITE_ADDR" => SITE_ADDR, ! "C_SITE_NAME" => SITE_NAME, ! "C_REL_PATH" => REL_PATH, ! "C_TIME_NOW" => TIME_NOW, ! "C_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 ! // Accepts: none. ! // Returns: none. ! function Template() ! { ! ! ( defined( "U_USR_TPL" ) && ( C_OVERRIDE_USR_TPL == 0 ) ) ? define( "C_TEMPLATE", U_TEMPLATE ) : define( "C_TEMPLATE", C_DEFAULT_TPL ); ! ! // Set up the directories for Smarty. ! $this->template_dir = './templates/' . C_TEMPLATE; ! $this->compile_dir = './templates/' . C_TEMPLATE . '/compile'; ! $this->config_dir = './templates/' . C_TEMPLATE . '/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. ! } ! } --- 4,33 ---- // This will utilize a flat-file template system. ! include_once( C_PHPMP_ROOT . 'dba/' . DB_TYPE . '.dba' ); ! $DB = new DB; ! class template ! { ! var $tplname, $tplvars; ! $tplvars = new array(); ! /** ! * template::template() ! * ! * Initializes the template system ! * Default Constructor ! * ! * @param $tplname ! * @return ! **/ ! function template($tplname) { + $query = $DB->query("SELECT * FROM " . DB_TABLE_PREFIX . "template_vars WHERE tpl_name='$tplname'"); ! $this->tplname = $tplname; ! $this->tplvars = $DB->fetchArray($query); } ! } |
From: Anthony W. <ant...@us...> - 2003-05-01 21:59:34
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv11175 Modified Files: config.php Log Message: Started some work on mpcode, I think I have a good start here Index: config.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/config.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** config.php 3 Apr 2002 08:47:42 -0000 1.1 --- config.php 1 May 2003 21:59:30 -0000 1.2 *************** *** 0 **** --- 1,18 ---- + <?php + + ## 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", "" ); + define( "DB_PASSWD", "" ); + + ?> \ No newline at end of file |
From: Anthony W. <ant...@us...> - 2003-05-01 21:59:34
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv11175/docs Modified Files: Changelog Log Message: Started some work on mpcode, I think I have a good start here Index: Changelog =================================================================== RCS file: /cvsroot/phpmp/phpMP/docs/Changelog,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** Changelog 23 Apr 2003 08:30:47 -0000 1.28 --- Changelog 1 May 2003 21:59:30 -0000 1.29 *************** *** 1,2 **** --- 1,9 ---- + 2003-05-01 [AnthonyWhite] + * includes/mpcode.php + Added a mpcode class to handle parsing of mpcode. + * includes/mpcode_arrays.php **NEW** + Contains mpcode syntax array with corresponding html + syntax array. + 2003-04-23 * session.php |