phpmp-commits Mailing List for phpMyPublications (Page 9)
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...> - 2003-06-02 22:32:35
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv28791/includes Modified Files: core.php template.php Log Message: A trial run of the Template Engine from phpBB2.2. Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -r1.55 -r1.56 *** core.php 17 May 2003 07:50:17 -0000 1.55 --- core.php 2 Jun 2003 22:32:31 -0000 1.56 *************** *** 126,132 **** } - //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(); --- 126,132 ---- } include_once(PHPMP_ROOT . 'includes/template.php'); ! $Template = new Template(); ! $Template->set_template('BlueMP'); $DB->close(); Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** template.php 19 May 2003 23:39:59 -0000 1.34 --- template.php 2 Jun 2003 22:32:32 -0000 1.35 *************** *** 26,102 **** // This will utilize a flat-file template system. class Template { ! var $tplname; ! var $_tplvars = array(); ! ! /** ! * 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; ! $query = $DB->query("SELECT * FROM " . DB_TEMPLATE_VARS_TABLE . " WHERE tpl_name='$tplname'"); ! ! $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( $new_tpl_var as $key => $val ) { ! if(preg_match('/[^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 )) && (preg_match('/[^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; } } } --- 26,707 ---- // This will utilize a flat-file template system. + /* + The following code was taken from or inspired by the guys over at phpBB. + Any code resembling that of phpBB is probably their's and therefore + they hold the legal rights to it. Since both phpBB and phpMP are released + under the GPL, you must abide by said license. + */ + class Template { ! ! // variable that holds all the data we'll be substituting into ! // the compiled templates. Takes form: ! // --> $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value ! // if it's a root-level variable, it'll be like this: ! // --> $this->_tpldata[.][0][varname] == value ! var $_tpldata = array(); ! ! // Root dir and hash of filenames for each template handle. ! var $root = ''; ! var $cache_root = 'cache/templates/'; ! var $files = array(); ! ! // this will hash handle names to the compiled/uncompiled code for that handle. ! var $compiled_code = array(); ! ! // Various counters and storage arrays ! var $block_names = array(); ! var $block_else_level = array(); ! var $block_nesting_level = 0; ! ! var $force_recompile; ! ! ! function set_template($template = '', $force_recompile = false) { ! ! $this->root = PHPMP_ROOT . 'templates/' . $template; ! $this->cachedir = PHPMP_ROOT . $this->cache_root . $template . '/'; ! ! $this->force_recompile = $force_recompile; ! ! if (!file_exists($this->cachedir)) ! { ! @umask(0); ! mkdir($this->cachedir, 0777); ! } ! ! return true; ! } ! ! // Sets the template filenames for handles. $filename_array ! // should be a hash of handle => filename pairs. ! function set_filenames($filename_array) ! { ! if (!is_array($filename_array)) ! { ! return false; ! } ! ! $template_names = ''; ! foreach ($filename_array as $handle => $filename) ! { ! if (empty($filename)) ! { ! trigger_error("template error - Empty filename specified for $handle", E_USER_ERROR); ! } ! ! $this->filename[$handle] = $filename; ! $this->files[$handle] = $this->make_filename($filename); ! } ! ! return true; ! } ! ! // Generates a full path+filename for the given filename, which can either ! // be an absolute name, or a name relative to the rootdir for this Template ! // object. ! function make_filename($filename) ! { ! // Check if it's an absolute or relative path. ! return (substr($filename, 0, 1) != '/') ? $this->root . '/' . $filename : $filename; ! } ! ! // Destroy template data set ! function destroy() ! { ! $this->_tpldata = array(); ! } ! ! ! // Methods for loading and evaluating the templates ! function display($handle) ! { ! ! if ($filename = $this->_tpl_load($handle)) ! { ! include($filename); ! } ! else ! { ! eval(' ?>' . $this->compiled_code[$handle] . '<?php '); ! } ! ! return true; ! } ! ! // Load a compiled template if possible, if not, recompile it ! function _tpl_load(&$handle) ! { ! global $Config; ! ! $filename = $this->cachedir . $this->filename[$handle] . '.' . $Config->get('language') . '.php'; ! ! // Recompile page if the original template is newer, otherwise load the compiled version ! if (file_exists($filename) && !$this->force_recompile) ! { ! return $filename; ! } ! ! // If the file for this handle is already loaded and compiled, do nothing. ! if (!empty($this->uncompiled_code[$handle])) ! { ! return true; ! } ! ! // If we don't have a file assigned to this handle, die. ! if (!isset($this->files[$handle])) ! { ! trigger_error("Template->_tpl_load(): No file specified for handle $handle", E_USER_ERROR); ! } ! ! $str = ''; ! // Try and open template for read ! if (!($fp = @fopen($this->files[$handle], 'r'))) ! { ! trigger_error("Template->_tpl_load(): File $filename does not exist or is empty", E_USER_ERROR); ! } ! ! $str = fread($fp, filesize($this->files[$handle])); ! @fclose($fp); ! ! // Actually compile the code now. ! $this->compiled_code[$handle] = $this->compile(trim($str)); ! $this->compile_write($handle, $this->compiled_code[$handle]); ! ! return false; ! } ! ! ! // Assign key variable pairs from an array ! function assign_vars($vararray) ! { ! foreach ($vararray as $key => $val) ! { ! $this->_tpldata['.'][0][$key] = $val; ! } ! ! return true; ! } ! ! // Assign a single variable to a single key ! function assign_var($varname, $varval) ! { ! $this->_tpldata['.'][0][$varname] = $varval; ! ! return true; ! } ! ! // Assign key variable pairs from an array to a specified block ! function assign_block_vars($blockname, $vararray) ! { ! if (strstr($blockname, '.')) ! { ! // Nested block. ! $blocks = explode('.', $blockname); ! $blockcount = sizeof($blocks) - 1; ! ! $str = &$this->_tpldata; ! for ($i = 0; $i < $blockcount; $i++) ! { ! $str = &$str[$blocks[$i]]; ! $str = &$str[sizeof($str) - 1]; ! } ! ! // Now we add the block that we're actually assigning to. ! // We're adding a new iteration to this block with the given ! // variable assignments. ! $str[$blocks[$blockcount]][] = $vararray; ! } ! else ! { ! // Top-level block. ! // Add a new iteration to this block with the variable assignments ! // we were given. ! $this->_tpldata[$blockname][] = $vararray; ! } ! ! return true; } ! ! // Include a seperate template ! function _tpl_include($filename, $include = true) { ! global $user; ! ! $handle = $filename; ! $this->filename[$handle] = $filename; ! $this->files[$handle] = $this->make_filename($filename); ! ! $filename = $this->_tpl_load($handle); ! ! if ($include) { ! // eval($this->compiled_code[$handle]); ! include($filename); ! } ! } ! ! ! ! // This next set of methods could be seperated off and included since ! // they deal exclusively with compilation ... which is done infrequently ! // and would save a fair few kb ! ! ! // The all seeing all doing compile method. Parts are inspired by or directly ! // from Smarty ! function compile($code, $no_echo = false, $echo_var = '') ! { ! global $Config; ! ! // Remove any "loose" php ... we want to give admins the ability ! // to switch on/off PHP for a given template. Allowing unchecked ! // php is a no-no. There is a potential issue here in that non-php ! // content may be removed ... however designers should use entities ! // if they wish to display < and > ! $match_php_tags = array('#\<\?php .*?\?\>#is', '#\<\script language="php"\>.*?\<\/script\>#is', '#\<\?.*?\?\>#s', '#\<%.*?%\>#s'); ! $code = preg_replace($match_php_tags, '', $code); ! ! // Pull out all block/statement level elements and seperate ! // plain text ! preg_match_all('#<!-- PHP -->(.*?)<!-- ENDPHP -->#s', $code, $matches); ! $php_blocks = $matches[1]; ! $code = preg_replace('#<!-- PHP -->(.*?)<!-- ENDPHP -->#s', '<!-- PHP -->', $code); ! ! preg_match_all('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\.]+?) -->#', $code, $matches); ! $include_blocks = $matches[1]; ! $code = preg_replace('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\.]+?) -->#', '<!-- INCLUDE -->', $code); ! ! preg_match_all('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\.\\\\]+?) -->#', $code, $matches); ! $includephp_blocks = $matches[1]; ! $code = preg_replace('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\.]+?) -->#', '<!-- INCLUDEPHP -->', $code); ! ! preg_match_all('#<!-- (.*?) (.*?)?[ ]?-->#s', $code, $blocks); ! $text_blocks = preg_split('#<!-- (.*?) (.*?)?[ ]?-->#s', $code); ! for($i = 0; $i < count($text_blocks); $i++) ! { ! $this->compile_var_tags($text_blocks[$i]); ! } ! ! $compile_blocks = array(); ! ! for ($curr_tb = 0; $curr_tb < count($text_blocks); $curr_tb++) ! { ! switch ($blocks[1][$curr_tb]) { ! case 'BEGIN': ! $this->block_else_level[] = false; ! $compile_blocks[] = '<?php ' . $this->compile_tag_block($blocks[2][$curr_tb]) . ' ?>'; ! break; ! ! case 'BEGINELSE': ! $this->block_else_level[sizeof($this->block_else_level) - 1] = true; ! $compile_blocks[] = '<?php }} else { ?>'; ! break; ! ! case 'END': ! array_pop($this->block_names); ! $compile_blocks[] = '<?php ' . ((array_pop($this->block_else_level)) ? '}' : '}}') . ' ?>'; ! break; ! ! case 'IF': ! $compile_blocks[] = '<?php ' . $this->compile_tag_if($blocks[2][$curr_tb], false) . ' ?>'; ! break; ! ! case 'ELSE': ! $compile_blocks[] = '<?php } else { ?>'; ! break; ! ! case 'ELSEIF': ! $compile_blocks[] = '<?php ' . $this->compile_tag_if($blocks[2][$curr_tb], true) . ' ?>'; ! break; ! ! case 'ENDIF': ! $compile_blocks[] = '<?php } ?>'; ! break; ! ! case 'INCLUDE': ! $temp = ''; ! list(, $temp) = each($include_blocks); ! $compile_blocks[] = '<?php ' . $this->compile_tag_include($temp) . ' ?>'; ! $this->_tpl_include($temp, false); ! break; ! ! case 'INCLUDEPHP': ! if ($Config->get('tpl_php')) ! { ! $temp = ''; ! list(, $temp) = each($includephp_blocks); ! $compile_blocks[] = '<?php ' . $this->compile_tag_include_php($temp) . ' ?>'; ! } ! break; ! ! case 'PHP': ! if ($Config->get('tpl_php')) ! { ! $temp = ''; ! list(, $temp) = each($php_blocks); ! $compile_blocks[] = '<?php ' . $temp . ' ?>'; ! } ! break; ! ! default: ! $this->compile_var_tags($blocks[0][$curr_tb]); ! $trim_check = trim($blocks[0][$curr_tb]); ! $compile_blocks[] = (!$do_not_echo) ? ((!empty($trim_check)) ? $blocks[0][$curr_tb] : '') : ((!empty($trim_check)) ? $blocks[0][$curr_tb] : ''); ! break; ! } ! } ! ! $template_php = ''; ! for ($i = 0; $i < count($text_blocks); $i++) ! { ! $trim_check_text = trim($text_blocks[$i]); ! $trim_check_block = trim($compile_blocks[$i]); ! $template_php .= (!$no_echo) ? ((!empty($trim_check_text)) ? $text_blocks[$i] : '') . ((!empty($compile_blocks[$i])) ? $compile_blocks[$i] : '') : ((!empty($trim_check_text)) ? $text_blocks[$i] : '') . ((!empty($compile_blocks[$i])) ? $compile_blocks[$i] : ''); ! } ! ! // There will be a number of occassions where we switch into and out of ! // PHP mode instantaneously. Rather than "burden" the parser with this ! // we'll strip out such occurences, minimising such switching ! $template_php = str_replace(' ?><?php ', '', $template_php); ! ! return (!$no_echo) ? $template_php : "\$$echo_var .= '" . $template_php . "'"; ! } ! ! function compile_var_tags(&$text_blocks) ! { ! // change template varrefs into PHP varrefs ! $varrefs = array(); ! ! // This one will handle varrefs WITH namespaces ! preg_match_all('#\{(([a-z0-9\-_]+?\.)+?)([a-z0-9\-_]+?)\}#is', $text_blocks, $varrefs); ! ! for ($j = 0; $j < sizeof($varrefs[1]); $j++) ! { ! $namespace = $varrefs[1][$j]; ! $varname = $varrefs[3][$j]; ! $new = $this->generate_block_varref($namespace, $varname); ! ! $text_blocks = str_replace($varrefs[0][$j], $new, $text_blocks); ! } ! ! // This will handle the remaining root-level varrefs ! else ! { ! global $Local; ! ! $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]*?)\}#e', "'<?php echo ((isset(\$this->_tpldata[\'.\'][0][\'L_\\1\'])) ? \$this->_tpldata[\'.\'][0][\'L_\\1\'] : \'' . ((isset(\$Local->lang['\\1'])) ? \$Local->lang['\\1'] : '') . '\'); ?>'" , $text_blocks); ! } ! $text_blocks = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "<?php echo \$this->_tpldata['.'][0]['\\1']; ?>", $text_blocks); ! ! return; ! } ! ! function compile_tag_block($tag_args) ! { ! $tag_template_php = ''; ! array_push($this->block_names, $tag_args); ! ! if (sizeof($this->block_names) < 2) ! { ! // Block is not nested. ! $tag_template_php = '$_' . $tag_args . "_count = (isset(\$this->_tpldata['$tag_args'])) ? sizeof(\$this->_tpldata['$tag_args']) : 0;"; ! } ! else ! { ! // This block is nested. ! ! // Generate a namespace string for this block. ! $namespace = implode('.', $this->block_names); ! ! // Get a reference to the data array for this block that depends on the ! // current indices of all parent blocks. ! $varref = $this->generate_block_data_ref($namespace, false); ! ! // Create the for loop code to iterate over this block. ! $tag_template_php = '$_' . $tag_args . '_count = (isset(' . $varref . ')) ? sizeof(' . $varref . ') : 0;'; ! } ! ! $tag_template_php .= 'if ($_' . $tag_args . '_count) {'; ! $tag_template_php .= 'for ($this->_' . $tag_args . '_i = 0; $this->_' . $tag_args . '_i < $_' . $tag_args . '_count; $this->_' . $tag_args . '_i++){'; ! ! return $tag_template_php; ! } ! ! // ! // Compile IF tags - much of this is from Smarty with ! // some adaptions for our block level methods ! // ! function compile_tag_if($tag_args, $elseif) ! { ! /* Tokenize args for 'if' tag. */ ! preg_match_all('/(?: ! "[^"\\\\]*(?:\\\\.[^"\\\\]*)*" | ! \'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\' | ! [(),] | ! [^\s(),]+)/x', $tag_args, $match); ! ! $tokens = $match[0]; ! $is_arg_stack = array(); ! ! for ($i = 0; $i < count($tokens); $i++) ! { ! $token = &$tokens[$i]; ! ! switch (strtolower($token)) ! { ! case '!': ! case '%': ! case '!==': ! case '==': ! case '===': ! case '>': ! case '<': ! case '!=': ! case '<>': ! case '<<': ! case '>>': ! case '<=': ! case '>=': ! case '&&': ! case '||': ! case '|': ! case '^': ! case '&': ! case '~': ! case ')': ! case ',': ! case '+': ! case '-': ! case '*': ! case '/': ! case '@': ! break; ! ! case 'eq': ! $token = '=='; ! break; ! ! case 'ne': ! case 'neq': ! $token = '!='; ! break; ! ! case 'lt': ! $token = '<'; ! break; ! ! case 'le': ! case 'lte': ! $token = '<='; ! break; ! ! case 'gt': ! $token = '>'; ! break; ! ! case 'ge': ! case 'gte': ! $token = '>='; ! break; ! ! case 'and': ! $token = '&&'; ! break; ! ! case 'or': ! $token = '||'; ! break; ! ! case 'not': ! $token = '!'; ! break; ! ! case 'mod': ! $token = '%'; ! break; ! ! case '(': ! array_push($is_arg_stack, $i); ! break; ! ! case 'is': ! $is_arg_start = ($tokens[$i-1] == ')') ? array_pop($is_arg_stack) : $i-1; ! $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start)); ! ! $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1)); ! ! array_splice($tokens, $is_arg_start, count($tokens), $new_tokens); ! ! $i = $is_arg_start; ! ! default: ! if (preg_match('#^(([a-z0-9\-_]+?\.)+?)?([A-Z]+[A-Z0-9\-_]+?)$#s', $token, $varrefs)) ! { ! $token = (!empty($varrefs[1])) ? $this->generate_block_data_ref(substr($varrefs[1], 0, strlen($varrefs[1]) - 1), true) . '[\'' . $varrefs[3] . '\']' : '$this->_tpldata[\'.\'][0][\'' . $varrefs[3] . '\']'; ! } ! break; ! } ! } ! ! return (($elseif) ? '} elseif (' : 'if (') . (implode(' ', $tokens) . ') { '); ! } ! ! function compile_tag_include($tag_args) ! { ! return "\$this->_tpl_include('$tag_args');"; ! } ! ! function compile_tag_include_php($tag_args) ! { ! return "include('" . $this->root . '/' . $tag_args . "');"; ! } ! ! // This is from Smarty ! function _parse_is_expr($is_arg, $tokens) ! { ! $expr_end = 0; ! $negate_expr = false; ! ! if (($first_token = array_shift($tokens)) == 'not') ! { ! $negate_expr = true; ! $expr_type = array_shift($tokens); ! } ! else ! { ! $expr_type = $first_token; ! } ! ! switch ($expr_type) ! { ! case 'even': ! if (@$tokens[$expr_end] == 'by') { ! $expr_end++; ! $expr_arg = $tokens[$expr_end++]; ! $expr = "!(($is_arg / $expr_arg) % $expr_arg)"; } ! else ! { ! $expr = "!($is_arg % 2)"; ! } ! break; ! ! case 'odd': ! if (@$tokens[$expr_end] == 'by') ! { ! $expr_end++; ! $expr_arg = $tokens[$expr_end++]; ! $expr = "(($is_arg / $expr_arg) % $expr_arg)"; ! } ! else ! { ! $expr = "($is_arg % 2)"; ! } ! break; ! ! case 'div': ! if (@$tokens[$expr_end] == 'by') ! { ! $expr_end++; ! $expr_arg = $tokens[$expr_end++]; ! $expr = "!($is_arg % $expr_arg)"; ! } ! break; ! ! default: ! break; ! } ! ! if ($negate_expr) ! { ! $expr = "!($expr)"; } ! ! array_splice($tokens, 0, $expr_end, $expr); ! ! return $tokens; ! } ! ! /** ! * Generates a reference to the given variable inside the given (possibly nested) ! * block namespace. This is a string of the form: ! * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' ! * It's ready to be inserted into an "echo" line in one of the templates. ! * NOTE: expects a trailing "." on the namespace. ! */ ! function generate_block_varref($namespace, $varname) ! { ! // Strip the trailing period. ! $namespace = substr($namespace, 0, strlen($namespace) - 1); ! ! // Get a reference to the data block for this namespace. ! $varref = $this->generate_block_data_ref($namespace, true); ! // Prepend the necessary code to stick this in an echo line. ! ! // Append the variable reference. ! $varref .= "['$varname']"; ! $varref = "<?php echo $varref; ?>"; ! ! return $varref; ! ! } ! ! /** ! * Generates a reference to the array of data values for the given ! * (possibly nested) block namespace. This is a string of the form: ! * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] ! * ! * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. ! * NOTE: does not expect a trailing "." on the blockname. ! */ ! function generate_block_data_ref($blockname, $include_last_iterator) ! { ! // Get an array of the blocks involved. ! $blocks = explode('.', $blockname); ! $blockcount = sizeof($blocks) - 1; ! $varref = '$this->_tpldata'; ! ! // Build up the string with everything but the last child. ! for ($i = 0; $i < $blockcount; $i++) ! { ! $varref .= "['" . $blocks[$i] . "'][\$this->_" . $blocks[$i] . '_i]'; ! } ! ! // Add the block reference for the last child. ! $varref .= "['" . $blocks[$blockcount] . "']"; ! ! // Add the iterator for the last child if requried. ! if ($include_last_iterator) ! { ! $varref .= '[$this->_' . $blocks[$blockcount] . '_i]'; ! } ! ! return $varref; ! } ! ! function compile_write(&$handle, $data) ! { ! global $Config; ! ! $filename = $this->cachedir . $this->filename[$handle] . '.' . $Config->get('language') . '.php'; ! ! if ($fp = @fopen($filename, 'w+')) { ! @flock($fp, LOCK_EX); ! @fwrite ($fp, $data); ! @flock($fp, LOCK_UN); ! @fclose($fp); ! ! @umask(0); ! @chmod($filename, 0644); } + + return; } } |
From: Brian R. <hei...@us...> - 2003-06-02 22:32:34
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv28791 Modified Files: index.php Log Message: A trial run of the Template Engine from phpBB2.2. Index: index.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/index.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -r1.42 -r1.43 *** index.php 17 May 2003 07:50:16 -0000 1.42 --- index.php 2 Jun 2003 22:32:30 -0000 1.43 *************** *** 27,71 **** $Core = new Core(); ! // 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>"; ! ! 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 "Table Prefix: " . DB_TABLE_PREFIX . '<br>'; ! print "Queries Exec: " . $DB->query_count . '<br>'; ! ! print "<br>"; ! ! print "Config Table: " . DB_CONFIG_TABLE . '<br>'; ! print "Users Table: " . DB_USERS_TABLE . '<br>'; ! print "Block Table: " . DB_BLOCK_TABLE . '<br>'; ! print "Modules Table: " . DB_MODULES_TABLE . '<br>'; ! print "Sessions Table: " . DB_SESSIONS_TABLE . '<br>'; ! ! 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>'; ! ! ?> ! <html> ! <body> ! ! ! </body> ! </html> \ No newline at end of file --- 27,57 ---- $Core = new Core(); ! global $Template; ! $Template->assign_vars( array( ! 'C_Site_Name' => $Config->get('site_name'), ! 'C_Site_Address' => $Config->get('site_addr'), ! 'C_Version' => $Config->get('version'), ! 'C_Rel_Path' => $Config->get('rel_path'), ! 'C_Site_Name' => $Config->get('site_name'), ! 'U_Template_Name' => $User->get('template'), ! 'U_Language' => $User->get('language'), ! 'U_Current_Time' => time(), ! 'U_Username' => $User->get('username') ! ) ); ! ! $Template->set_filenames( array( ! 'header' => 'header.html', ! 'left_column' => 'left_column.html', ! 'body' => 'index.html', ! 'right_column' => 'right_column.html', ! 'footer' => 'footer.html' ! ) ); ! ! $Template->display('header'); ! $Template->display('left_column'); ! $Template->display('body'); ! $Template->display('right_column'); ! $Template->display('footer'); ! ?> \ No newline at end of file |
From: Brian R. <hei...@us...> - 2003-06-02 22:31:25
|
Update of /cvsroot/phpmp/phpMP/cache In directory sc8-pr-cvs1:/tmp/cvs-serv28433/cache Log Message: Directory /cvsroot/phpmp/phpMP/cache added to the repository |
From: Brian R. <hei...@us...> - 2003-06-01 20:42:34
|
Update of /cvsroot/phpmp/phpMP/templates/BlueMP/images In directory sc8-pr-cvs1:/tmp/cvs-serv16142/BlueMP/images Added Files: phpMP_logo.png Log Message: Adding the skeleton of the template Booster made for us. Thanks, man. --- NEW FILE: phpMP_logo.png --- PNG 0N8_%@ jrÒÓÛ¢ü9Ѩ #°-zª:QQ¹pC ÌÀBhÙ²S§Î @8Ó=°¸åà óòù"ÄÀð=4Ô|ÕªN#·Ó] 5Îi`ü*022ÇÅÉ3 Óùù¹îÜiûX9 vzÐerçÎÕ5:30(} 9eeu`t"«Æ_¿~ß¾-¥¤$pïÞ; 99¾eËL98êV03ÿþ÷ï¯Ð?¤¥5ÂÃÅgÌhcaA¸ °=0ñqr:ýÍ $¶èh3388Nçäçç¾s§ìô``ýüù2999NÎTxst´ùÌÉÀ´Q_?¥©éPÌÇGÿÞ½×®ÃYBûvCC`nfã¿{·5h;//Ó½{µ@+ð¤F +|HàË/ÀdzÙH ì « X£L#¿½½##¤©Ç1}úú7¦03s$%7/_Þ³±ÕÃ"ÈâëËQZ:l¬¬0Ðé@¯wvî.,Ì?mZ!Ü &O¾k>= ]àha ×={=¸,ÿÀX ¶â§²3à)Ç yy¦IIñྥàñãÇrrY¼<<ONàååEî 01{O*à1F$Ä`e¥¨ ðxÙ²×ËÈ« ffGpc2!YX]MÕW---ðptì ~ÉÿH"À.â/ON£ù "ÜÀ}v`zäddäÒ××ÌÍ¥Z¸¬¬ì¶mÀËçÏ¢¢¥ð´LÔLLÀ.¸ÛÈ 8yx.íÿø±cÎyÙÌÌYàÑHAÉÂÂcg§×Þî ß6óÿ¿Ó© ÅAÞS½àÒ¥O¼ÍgfØç¤ô®ÐÞn¨¯¯ÏÁî;Åÿ02þÓÕ03cÌÉ ÓÑÑf.]Ò×Ï[ô20¢¥%·pa¹ r9AW;yònpB`¬¡2`ll¬wî´ z?Oâàà ÝÝú Yà"Ôn#ººâRRìÏ}öàþýûÍÉÉ,*Ê-%ÅÏÊúÂÒRÅßß2d w`ù,À sø`d06Výã´¾Îîΰ̲Xî%'Käç§±° ÜÏݽr«_ªÏή¸sç¹ $o211ss³·µåXIÈÎn¿sç½´«ÍÄÈÍÍÜÖB;á KK{ÁóãìHK þ?þ>7ÿ¥pîÜJCCm4§½[8à$ozè¹®®|^!@<yÒÂ.\\>M;à9wðT-ZÐËËÎc ¬o³³÷¿|ùþÊ:yùLØ$ÚRövkð/¥gQý ¯Ãæ}ó½@ &º'ù.aØ®DEE1//wj ;hiiñòÍcýþýßµkwàâmÏs VnyyyWW×%KØØååÁàòvn«¸¸ªê/`¸ö§pçI°±±«ªÊ¸ºii) ÏÂ3÷<¡ ^J&£¥Upþü-xðOñÀ¶ 3Ãüà]¾ÅìàlÎÿëÿ¶mÇlÔiÊ0,¯ÿ ^Û$¶Tì-êóço,[^çÄfi9huRÒlðr&¤Å,PÄÎΦ¡ñ ¥¼|ú[<`eÈ^ÁçÓ°ª«'%Ù3yòa°/À ÀÁ+ùû»a$@ @íÿsõ*¬9n9K ËÃlìżÉ"//¢ òôéH6ò÷ôpOjhláp^¾ü\·£-µkaRPrs´À¹ ª°ÿ¥ öÅQØKHaÅbk+/Ä÷í;6qâvp>þY>¤««lk+¼Í p)Ï_~lk«fkû½²ÒoÒ¤.ccIp `JìaÛ¸¾l#··¾ÃèhÜ\i ø+pk !ûC455,°úû÷òÚfxÜà |õ곯ï¤ujh ©UQñµ¡¡aiéTpGöñã÷¾CØ55ýÎÎeàòîÚÚ úúBññÑÈgpÁ@ l@°µenl\^IG||ì ÜÀæDWsóLXøNòLIINÀÀ %yxÝËÊÊdk+dãSâpÙʬ«+mkû^§»¯"°,Èð÷o¬°Ö:rÉ.!Á#/ÿçèQH/ ÚâÓÔ|kllü÷ïjðX¤-ÿÍÂBäóçoß~üýûÓ?v ^QQ6>¾7ááv&&&Ïx Â::¿´µµaI^©k´ñÛß`6NlmÝÛòîÚÚúú¿ããÃ!yä!áÿÕûÝ»ïÁ;á à06ptüvôè/°È_p: )6kkÿ11ÛÁ¥Óxѧ©ù«ÀÖAGÊI^AÓßßÉí ØÛÿ ï7N@;¡ÌÌ$¬_JI©S \äI~Ë;`{!2 $&Eù \ 5¯o0+sÃê@6%%^xþ CG688Ø´´DbcEØÆãàý6ÕFPÙì1¨©Ië´¯ ùÈuZsó°!;Vs() {]¾|rRY^þEzz®°p4xXâ7,Éhj~'ù pÖDÿ_ ßu Ü n#ÿ 5F¹,,d?þÿöíçß¿ÿ Ûh5ÐØ÷ïÚdÓ*áaôáÃ`^FfggÛè¼ßÈH)3S ÈAçÎïß¿#ûÆ@ó·¼yó¦¦fÓ;,oß¶uu¹»ºêÂÕZô| ¤fg×%##{ýzdC/% CT0àQÿñ#°Eç(!üìÙ3Êm &üI~ËàF.¼Q%fJ»=`ÏK è$XXl¦ë EUU>~~ÞgÏ ÊÀÚÚÙ¸J |4µXeddÌáoeŬ¤$ÌÎÎßÒ²É-:ºíøe`ÐÓ,ÀÆ%U¦3g5ûãdzgï û @ QqãÂð Sù|§§£ªª"I¹ FD¢úñÖ;ÆÆ_¿²Àö¢¿ººPFF âÜ쵸¸ösç>Bö)³³³ñðpttø&&zão|ûö-:ºfÃà⬨7QaîUÅ¥¢".&öÿéÓ¾²´]»¶PBB9I; ]]ª«÷-p"m/ÿpEXxx44D'Lð31Ñgcc»uë®±qÂׯ¬`íH÷¬ýG>p¶/é6$öÎþæå娼y1¥@ ¼| Lÿÿ>dg!nØd03¶ë&¡qssËx__X¿glýõ+üÖ24L©<<rr"zzò¦¦j::"ÀJFE YDë×/?ÿÂúcØi..==9mm5üñ@,ôLÀNÉÉçþþýQ·B¹¨Ýwï>¾{÷ø Àêírб>²±ÑëèÈÄÓÍ uÑ.á¾¢âGee°ß½ûürª¼§§ª*t¿+0A ª«;ÐU,--¥¥¥j`À<yÆÒ2Ü%cÃlÞ ÖóÍ@ g» ì!!¬ÎÎÎâââà_ôõ« ×CIôÿÁì¹²r;:ú ¾|a Í »/À NYYLTôCXݯ_ÌîîUàìÁºø)ÅãNñ±¯^±àJñüüÀ./° vrr·ÔçÂ^a~ü î¢aóãi_ß²/_ 'ÜsÀ2*´{n³ý(ª¬ìÙ¿ µÁì¢ÁV|Àâ¥;3°¦'`SضWçÿð\BâTRöµµ<ù<̱®R V Ô'ÀX§xIMÍ¿IIÈ)|<ëCÃ$ØZή °~cu çá«Á¸¹ÿäæ:ÀºhGæÍÛôôé7°F^Øø7ò´((Ký(ÆÏÿÑÁAkíÃ1/_2;0ìùÂÂÜÀ|."òæÇ·Ç;°t3Ñ'ØäåTTïzx¨ÍseÏG`+¸Ð&ba)^HA-,âÁXKf´Ub,,À¯®.ª©ùØÂ6ö~þü ìÇÿþXØÃϯÀF 0q{/ÜÀö ¥Ý lײ±±ðº/¯ÌÌäÝyyùsç®ÚØäS</æ #8ÅSü¿¤$/´´ÖO Øâw_þ }´²12òv_AvìØlpÄsÁÒZ e\)>¶ºr #ê|0ÝHÊÉý6¦ ªê¤¤p\ ú£iÕ°"¥øs66UàéuüANôÀ¦7°É¤¡ñ¾( ´=þþý÷íÛï¯_Ý ìPãâñãç¶¶LÙÙ1QQ[¶¼äåUAs (¾88X%$xÅÄa)þ °;®$--ìÂ"Ó?~}ùòØaýû÷×ïßbcC d¤þ·oßïÝ{zÒÒ"ÚÚ³feAn¸X ±75Õñò²An¦ ¹qãncã+÷ÃÎ!dvÙÄÍÍ%£)?¶r 2 |
From: Brian R. <hei...@us...> - 2003-06-01 20:42:33
|
Update of /cvsroot/phpmp/phpMP/templates/BlueMP/css In directory sc8-pr-cvs1:/tmp/cvs-serv16142/BlueMP/css Added Files: base.css Log Message: Adding the skeleton of the template Booster made for us. Thanks, man. --- NEW FILE: base.css --- body { background-color: #FFFFFF; font-size: 80%; font-family: Verdana, Helvetica, Arial, Sans Serif; color: #000000; text-align: center; } img { border: none; } a:link, a:active, a:visited { background-color: transparent; color: #000000; font-size: 100%; } div#container { background-color: transparent; width: 100%; text-align: left; } div#footer { background-color: #CCCCCC; border-style: solid; border-color: #000000; border-width: 1px; padding: 4px; text-align: center; } div#logininfo { background-color: #CCCCCC; border-style: solid; border-color: #000000; border-width: 1px 0px 1px 0px; padding: 2px 0px 2px 0px; margin: 0px 0px 10px 0px; text-align: right; } div#leftboxes { background-color: transparent; float: left; width: 20%; } div#contentboxes { background-color: transparent; float: left; width: 57%; margin: 0px 1.4%; } div#rightboxes { background-color: transparent; float: right; width: 20%; } div.boxheader { background-color: #000099; border-style: solid; border-color: #000000; border-width: 1px 0px 1px 0px; font-size: 100%; color: #FFFFFF; font-weight: bold; padding: 2px; margin: 2px 0px 0px 0px; } div.boxcontent { background-color: transparent; border-style: solid; border-color: #000000; border-width: 1px; margin: 2px 0px 10px 0px; padding: 4px; } div.boxcontent ul { background-color: transparent; list-style: none; padding: 2px; margin: 0px; } |
From: Brian R. <hei...@us...> - 2003-06-01 20:42:33
|
Update of /cvsroot/phpmp/phpMP/templates/BlueMP In directory sc8-pr-cvs1:/tmp/cvs-serv16142/BlueMP Added Files: index.html Log Message: Adding the skeleton of the template Booster made for us. Thanks, man. --- NEW FILE: index.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr"> <head> <title>phpMP :: Template</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" media="screen" href="css/base.css" /> </head> <body> <div id="container"> <div id="logo"><a href="index.html"><img src="images/phpMp_logo.png" width="252" height="78" alt="" /></a></div> <div id="logininfo"><a href="login">Login</a> - <a href="register">Register</a></div> <div id="leftboxes"> <div class="boxheader">Main Menu</div> <div class="boxcontent"> <ul> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> </ul> </div> <div class="boxheader">Left Box 1</div> <div class="boxcontent"> <ul> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> </ul> </div> <div class="boxheader">Login Box</div> <div class="boxcontent"> <form action="login" method="post"> <div>Username: <input type="text" name="username" value="" style="width: 100px;" /></div> <div>Password: <input type="password" name="password" value="" style="width: 100px;" /></div> <div><input type="submit" name="login" value="Logon!" /></div> </form> </div> </div> <div id="contentboxes"> <div class="boxheader">» Welcome Message</div> <div class="boxcontent"> <p>blah blah blah blah</p> </div> <div class="boxheader">Articles</div> <div class="boxheader">» Article</div> <div class="boxcontent"> <p>blah blah blah blah</p> </div> <div class="boxheader">» Article</div> <div class="boxcontent"> <p>blah blah blah blah</p> </div> <div class="boxheader">» Article</div> <div class="boxcontent"> <p>blah blah blah blah</p> </div> <div class="boxheader">» Article</div> <div class="boxcontent"> <p>blah blah blah blah</p> </div> <div id="footer"> Copyright © 2003 </div> </div> <div id="rightboxes"> <div class="boxheader">Main Menu</div> <div class="boxcontent"> <ul> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> </ul> </div> <div class="boxheader">Left Box 1</div> <div class="boxcontent"> <ul> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> <li><a href="index">Link</a></li> </ul> </div> <div class="boxheader">Login Box</div> <div class="boxcontent"> <form action="login" method="post"> <div>Username: <input type="text" name="username" value="" style="width: 100px;" /></div> <div>Password: <input type="password" name="password" value="" style="width: 100px;" /></div> <div><input type="submit" name="login" value="Logon!" /></div> </form> </div> </div> </div> </body> </html> |
From: Brian R. <hei...@us...> - 2003-06-01 20:39:38
|
Update of /cvsroot/phpmp/phpMP/templates/BlueMP/images In directory sc8-pr-cvs1:/tmp/cvs-serv14889/images Log Message: Directory /cvsroot/phpmp/phpMP/templates/BlueMP/images added to the repository |
From: Brian R. <hei...@us...> - 2003-06-01 20:39:28
|
Update of /cvsroot/phpmp/phpMP/templates/BlueMP/css In directory sc8-pr-cvs1:/tmp/cvs-serv14800/css Log Message: Directory /cvsroot/phpmp/phpMP/templates/BlueMP/css added to the repository |
From: Brian R. <hei...@us...> - 2003-06-01 20:39:14
|
Update of /cvsroot/phpmp/phpMP/templates/BlueMP In directory sc8-pr-cvs1:/tmp/cvs-serv14681/BlueMP Log Message: Directory /cvsroot/phpmp/phpMP/templates/BlueMP added to the repository |
From: Brian R. <hei...@us...> - 2003-06-01 20:30:44
|
Update of /cvsroot/phpmp/phpMP/templates/css In directory sc8-pr-cvs1:/tmp/cvs-serv11507/css Log Message: Directory /cvsroot/phpmp/phpMP/templates/css added to the repository |
From: Brian R. <hei...@us...> - 2003-05-20 00:11:56
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv4650/docs Modified Files: Changelog Log Message: Changelog updated. Index: Changelog =================================================================== RCS file: /cvsroot/phpmp/phpMP/docs/Changelog,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** Changelog 17 May 2003 07:11:43 -0000 1.37 --- Changelog 19 May 2003 23:58:07 -0000 1.38 *************** *** 1,2 **** --- 1,12 ---- + 2003-05-19 [Heimidal] + * module.php + Began work and planning on the module system. + * includes/config.init.php + * includes/template.php + * includes/user.php + Changed a bit of regex syntax. We're now using + preg_match instead of eregi (as per some speed + advice from a friend). + 2003-05-17 [Heimidal] * includes/core.php |
From: Brian R. <hei...@us...> - 2003-05-19 23:40:02
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv26596/includes Modified Files: config.init.php template.php user.php Log Message: Began work on the module interface. Made some improvements to my (rather crappy) regex implementation. Index: config.init.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/config.init.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** config.init.php 17 May 2003 07:43:41 -0000 1.3 --- config.init.php 19 May 2003 23:39:59 -0000 1.4 *************** *** 43,49 **** function set($cfgkey, $cfgval) { ! if( (!empty($cfgkey)) && (eregi('^[a-z]+[_a-z0-9-]*$', $cfgkey)) && (!empty($cfgval)) ) { ! $this->_cfgvars[strtolower($cfgkey)] = $cfgval; return true; } --- 43,49 ---- function set($cfgkey, $cfgval) { ! if( (!empty($cfgkey)) && (preg_match('/[^a-z][a-z0-9_-]/', $cfgkey)) && (!empty($cfgval)) ) { ! $this->_cfgvars[$cfgkey] = $cfgval; return true; } *************** *** 56,62 **** function get($cfgkey) { ! if( !empty($this->_cfgvars[strtolower($cfgkey)]) ) { ! return $this->_cfgvars[strtolower($cfgkey)]; } else --- 56,62 ---- function get($cfgkey) { ! if( !empty($this->_cfgvars[$cfgkey]) ) { ! return $this->_cfgvars[$cfgkey]; } else Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** template.php 17 May 2003 07:56:05 -0000 1.33 --- template.php 19 May 2003 23:39:59 -0000 1.34 *************** *** 87,91 **** foreach( $new_tpl_var as $key => $val ) { ! if(eregi('^[a-z]+[_a-z0-9-]*$', $key)) { $this->_tplvars[$key] = $val; --- 87,91 ---- foreach( $new_tpl_var as $key => $val ) { ! if(preg_match('/[^A-z][A-z0-9_-]/', $key)) { $this->_tplvars[$key] = $val; *************** *** 94,98 **** } } ! 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. --- 94,98 ---- } } ! elseif((!empty( $new_tpl_var )) && (preg_match('/[^A-z][A-z0-9_-]/', $new_tpl_var)) && ($new_tpl_val != false)) { // Assign one single var to the template vars hash. Index: user.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/user.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** user.php 17 May 2003 07:50:17 -0000 1.21 --- user.php 19 May 2003 23:39:59 -0000 1.22 *************** *** 34,46 **** 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; } --- 34,46 ---- foreach( $userkey as $key => $val ) { ! if(preg_match('/[^a-z][a-z0-9_-]/', $key)) { ! $this->_data[$key] = $val; } } } ! elseif( (!empty($userkey)) && (preg_match('/[^a-z][a-z0-9_-]/', $userkey)) && (!empty($userval)) ) { ! $this->_data[$userkey] = $userval; return true; } *************** *** 53,59 **** function get($userkey) { ! if( !empty($this->_data[strtolower($userkey)]) ) { ! return $this->_data[strtolower($userkey)]; } else --- 53,59 ---- function get($userkey) { ! if( !empty($this->_data[$userkey]) ) { ! return $this->_data[$userkey]; } else |
From: Brian R. <hei...@us...> - 2003-05-19 23:40:02
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv26596 Modified Files: modules.php Log Message: Began work on the module interface. Made some improvements to my (rather crappy) regex implementation. Index: modules.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/modules.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** modules.php 17 May 2003 07:50:16 -0000 1.16 --- modules.php 19 May 2003 23:39:59 -0000 1.17 *************** *** 24,27 **** // Module handler. ! ?> --- 24,72 ---- // Module handler. ! class Module ! { ! ! // The following two functions manage module variables, allowing the ! // module author to easily maintain variable data from point to point. ! // All modules, in order to meet compliance, should fully utilize these ! // functions. ! function setVar($varkey, $varval = false) ! { ! if(is_array( $varkey )) ! { ! foreach( $userkey as $key => $val ) ! { ! if( preg_match('/[^a-z][a-z0-9_-]/', $key) ) ! { ! $this->_keydata[$key] = $val; ! } ! } ! } ! elseif( (!empty($varkey)) && (preg_match('/[^a-z][a-z0-9_-]/', $varkey)) && (!empty($varval)) ) ! { ! $this->_data[$userkey] = $userval; ! return true; ! } ! else ! { ! return false; ! } ! } ! ! function getVar($varkey) ! { ! if( !empty($this->_data[$varkey]) ) ! { ! return $this->_data[$varkey]; ! } ! else ! { ! return false; ! } ! } ! ! function loadHook( $hookname, $hookjob ) ! { ! } ! } ?> |
From: Brian R. <hei...@us...> - 2003-05-17 07:56:09
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv31035/includes Modified Files: template.php Log Message: Oops, missed one. Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** template.php 9 May 2003 08:07:39 -0000 1.32 --- template.php 17 May 2003 07:56:05 -0000 1.33 *************** *** 1,82 **** ! <?php ! ! // Contains the Template class. ! // This will utilize a flat-file template system. ! ! class Template ! { ! var $tplname; ! var $_tplvars = array(); ! ! /** ! * 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; ! $query = $DB->query("SELECT * FROM " . DB_TEMPLATE_VARS_TABLE . " WHERE tpl_name='$tplname'"); ! ! $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( $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; ! } ! } ! } ! ?> --- 1,104 ---- ! <?php ! ! /* ! * phpMP - The PHP Modular Portal System ! * Copyright (C) 2002-2003 Brian Rose and the phpMP group ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! * $Id$ ! * ! */ ! ! // Contains the Template class. ! // This will utilize a flat-file template system. ! ! class Template ! { ! var $tplname; ! var $_tplvars = array(); ! ! /** ! * 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; ! $query = $DB->query("SELECT * FROM " . DB_TEMPLATE_VARS_TABLE . " WHERE tpl_name='$tplname'"); ! ! $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( $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; ! } ! } ! } ! ?> |
From: Brian R. <hei...@us...> - 2003-05-17 07:50:20
|
Update of /cvsroot/phpmp/phpMP/languages/english In directory sc8-pr-cvs1:/tmp/cvs-serv29050/languages/english Modified Files: lang_main.php Log Message: Added the license notice to each PHP file. No Changelog entry. Index: lang_main.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/languages/english/lang_main.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** lang_main.php 9 May 2003 08:07:39 -0000 1.19 --- lang_main.php 17 May 2003 07:50:17 -0000 1.20 *************** *** 1,67 **** ! <?php ! ! class Localization ! { ! ! var $lang; ! ! function Localization() ! { ! global $Config; ! ! $this->lang = array( ! ! // ! // General language used throughout site. ! // ! // 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', ! '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', ! 'L_Register_a_Username' => 'Register a Username', ! ! ! // ! // Below is language used almost specifically for auth. ! // ! 'L_Login' => 'Login', ! 'L_Logout' => 'Logout', ! ! 'L_Account_Activated' => 'Your account has been activated. You may now log in.', ! 'L_Required_Field' => 'Denotes a Required Field', ! 'L_Register_Finished' => 'Your registration has been processed. Please check your e-mail for a message explaining how to activate your new account.', ! 'L_Forgot_Password' => 'Forgot Your Password?', ! 'L_Not_logged_in' => 'You are not logged in.', ! ! ! // ! // 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.' ! ! // It is IMPERATIVE that the last array value entered (usually the copyright) ! // does not end in a comma. ! ! ); ! ! } ! ! } ! ?> --- 1,89 ---- ! <?php ! ! /* ! * phpMP - The PHP Modular Portal System ! * Copyright (C) 2002-2003 Brian Rose and the phpMP group ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! * $Id$ ! * ! */ ! ! class Localization ! { ! ! var $lang; ! ! function Localization() ! { ! global $Config; ! ! $this->lang = array( ! ! // ! // General language used throughout site. ! // ! // 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', ! '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', ! 'L_Register_a_Username' => 'Register a Username', ! ! ! // ! // Below is language used almost specifically for auth. ! // ! 'L_Login' => 'Login', ! 'L_Logout' => 'Logout', ! ! 'L_Account_Activated' => 'Your account has been activated. You may now log in.', ! 'L_Required_Field' => 'Denotes a Required Field', ! 'L_Register_Finished' => 'Your registration has been processed. Please check your e-mail for a message explaining how to activate your new account.', ! 'L_Forgot_Password' => 'Forgot Your Password?', ! 'L_Not_logged_in' => 'You are not logged in.', ! ! ! // ! // 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.' ! ! // It is IMPERATIVE that the last array value entered (usually the copyright) ! // does not end in a comma. ! ! ); ! ! } ! ! } ! ?> |
From: Brian R. <hei...@us...> - 2003-05-17 07:50:20
|
Update of /cvsroot/phpmp/phpMP/languages/french In directory sc8-pr-cvs1:/tmp/cvs-serv29050/languages/french Modified Files: lang_main.php Log Message: Added the license notice to each PHP file. No Changelog entry. Index: lang_main.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/languages/french/lang_main.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** lang_main.php 8 Feb 2003 09:43:29 -0000 1.7 --- lang_main.php 17 May 2003 07:50:17 -0000 1.8 *************** *** 1,66 **** ! <?php ! ! class Localization ! { ! ! var $lang; ! ! function Localization() ! { ! ! $this->lang = array( ! ! // ! // General language used throughout site. ! // ! // Note: Always escape single quote characters (') with a backslash (\). ! // ! 'L_Welcome_to_Site' => 'Bienvenue chez ' . C_SITE_NAME . '!', ! 'L_Home' => 'Accueil', ! 'L_Profile' => 'Profil', ! 'L_Modules' => 'Modules', ! 'L_Downloads' => 'Téléchargements', ! 'L_Username' => 'Nom d\'usager', ! 'L_User_CP' => 'User CP', ! 'L_User_Control_Panel' => 'Votre panneau de commande', ! 'L_E-mail' => 'Courriel', ! 'L_Password' => 'Mot de passe', ! 'L_Comfirm' => 'Confirmez', ! 'L_Real Name' => 'Prénom et Nom', ! 'L_Location' => 'Location', ! 'L_Register' => 'Enregistrer', ! 'L_Welcome' => 'Bienvenue', ! ! 'L_Administration_Area' => 'Section Administrative', ! 'L_Register_a_Username' => 'Enregistrez votre nom d\'usager', ! ! ! // ! // Below is language used almost specifically for auth. ! // ! 'L_Login' => 'Ouvrir session', ! 'L_Logout' => 'Fermer session', ! ! 'L_Account_Activated' => 'Votre compte a été activé. Vous pouvez maintenant ouvrir une session.', ! 'L_Required_Field' => 'Ceci dénote de l\'information requise pour votre enregistrement', ! 'L_Register_Finished' => 'Votre enregistrement a été traité. Un courriel expliquant l\'activation de votre compte sera envoyé à l\'adresse soumisse sous peu.', ! 'L_Forgot_Password' => 'Avez-vous oubliez votre mot de pass?', ! 'L_Not_logged_in' => 'Veuillez ouvrir une session via votre compte personel.', ! ! ! // ! // Other various parts of the templates. ! // ! 'L_Powered_by_phpMP' => 'Actionné par phpMP ' . C_VERSION . ' © 2002 <a href="http://phpmp.sourceforge.net/">phpMP Dev. Group</a>.', ! 'L_Copyright' => 'Tout le contenu de se site est la propriété du propriétaire respectif. Tous droits réservés.' ! ! // It is IMPERATIVE that the last array value entered (usually the copyright) ! // does not end in a comma. ! ! ); ! ! } ! ! } ! ?> --- 1,88 ---- ! <?php ! ! /* ! * phpMP - The PHP Modular Portal System ! * Copyright (C) 2002-2003 Brian Rose and the phpMP group ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! * $Id$ ! * ! */ ! ! class Localization ! { ! ! var $lang; ! ! function Localization() ! { ! ! $this->lang = array( ! ! // ! // General language used throughout site. ! // ! // Note: Always escape single quote characters (') with a backslash (\). ! // ! 'L_Welcome_to_Site' => 'Bienvenue chez ' . C_SITE_NAME . '!', ! 'L_Home' => 'Accueil', ! 'L_Profile' => 'Profil', ! 'L_Modules' => 'Modules', ! 'L_Downloads' => 'Téléchargements', ! 'L_Username' => 'Nom d\'usager', ! 'L_User_CP' => 'User CP', ! 'L_User_Control_Panel' => 'Votre panneau de commande', ! 'L_E-mail' => 'Courriel', ! 'L_Password' => 'Mot de passe', ! 'L_Comfirm' => 'Confirmez', ! 'L_Real Name' => 'Prénom et Nom', ! 'L_Location' => 'Location', ! 'L_Register' => 'Enregistrer', ! 'L_Welcome' => 'Bienvenue', ! ! 'L_Administration_Area' => 'Section Administrative', ! 'L_Register_a_Username' => 'Enregistrez votre nom d\'usager', ! ! ! // ! // Below is language used almost specifically for auth. ! // ! 'L_Login' => 'Ouvrir session', ! 'L_Logout' => 'Fermer session', ! ! 'L_Account_Activated' => 'Votre compte a été activé. Vous pouvez maintenant ouvrir une session.', ! 'L_Required_Field' => 'Ceci dénote de l\'information requise pour votre enregistrement', ! 'L_Register_Finished' => 'Votre enregistrement a été traité. Un courriel expliquant l\'activation de votre compte sera envoyé à l\'adresse soumisse sous peu.', ! 'L_Forgot_Password' => 'Avez-vous oubliez votre mot de pass?', ! 'L_Not_logged_in' => 'Veuillez ouvrir une session via votre compte personel.', ! ! ! // ! // Other various parts of the templates. ! // ! 'L_Powered_by_phpMP' => 'Actionné par phpMP ' . C_VERSION . ' © 2002 <a href="http://phpmp.sourceforge.net/">phpMP Dev. Group</a>.', ! 'L_Copyright' => 'Tout le contenu de se site est la propriété du propriétaire respectif. Tous droits réservés.' ! ! // It is IMPERATIVE that the last array value entered (usually the copyright) ! // does not end in a comma. ! ! ); ! ! } ! ! } ! ?> |
From: Brian R. <hei...@us...> - 2003-05-17 07:50:20
|
Update of /cvsroot/phpmp/phpMP/dba In directory sc8-pr-cvs1:/tmp/cvs-serv29050/dba Modified Files: mssql.dba mysql.dba Log Message: Added the license notice to each PHP file. No Changelog entry. Index: mssql.dba =================================================================== RCS file: /cvsroot/phpmp/phpMP/dba/mssql.dba,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** mssql.dba 15 Feb 2003 00:35:24 -0000 1.1 --- mssql.dba 17 May 2003 07:50:17 -0000 1.2 *************** *** 1,169 **** ! <?php ! ! class DB ! { ! ! var $ident_link; ! var $connected; ! ! function connect() ! { ! if (empty($this->ident_link)) ! { ! $connection = @mssql_connect(DB_HOST, DB_USER, DB_PASSWD); ! ! if (!$connection) ! { ! $this->connected = 0; ! return 0; ! } ! else ! { ! $this->ident_link = $connection; ! ! return $this->ident_link; ! } ! } ! } ! ! function close() ! { ! if ($this->ident_link != 0) ! { ! @mssql_close($this->ident_link); ! $this->ident_link = 0; ! ! return 1; ! } ! else ! { ! return 1; ! } ! } ! ! function query($qry) ! { ! if ($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if (!$db) ! { ! return 0; ! } ! else ! { ! $result = @mssql_query($qry, $db); ! return $result; ! } ! } ! ! function numRows($qry) ! { ! if ($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if (!$db) ! { ! return 0; ! } ! else ! { ! $num = @mssql_num_rows($qry); ! return $num; ! } ! } ! ! function result($result, $row=0, $field='') ! { ! if ($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if (!$db) ! { ! return 0; ! } ! else ! { ! $return = @mssql_result($result, $row, $field); ! return $return; ! } ! } ! ! function fetchArray($qry) ! { ! if ($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if (!$db) ! { ! return 0; ! } ! else ! { ! $result = @mssql_fetch_array($qry); ! return $result; ! } ! } ! ! function fetchRow($qry) ! { ! if ($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if (!$db) ! { ! return 0; ! } ! else ! { ! $result = @mssql_fetch_row($qry) ! return $result; ! } ! } ! ! function escapeString($string) ! { ! if( stripslashes($string) == $string ) // Will be true if no slashes were removed. ! { ! addslashes($string); // We'll add the slashes because they haven't already been added. ! return true; ! } ! else // Slashes have already been added (hopefully only once). ! { ! return true; ! } ! } ! ! } ! ! ?> --- 1,191 ---- ! <?php ! ! /* ! * phpMP - The PHP Modular Portal System ! * Copyright (C) 2002-2003 Brian Rose and the phpMP group ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! * $Id$ ! * ! */ ! ! class DB ! { ! ! var $ident_link; ! var $connected; ! ! function connect() ! { ! if (empty($this->ident_link)) ! { ! $connection = @mssql_connect(DB_HOST, DB_USER, DB_PASSWD); ! ! if (!$connection) ! { ! $this->connected = 0; ! return 0; ! } ! else ! { ! $this->ident_link = $connection; ! ! return $this->ident_link; ! } ! } ! } ! ! function close() ! { ! if ($this->ident_link != 0) ! { ! @mssql_close($this->ident_link); ! $this->ident_link = 0; ! ! return 1; ! } ! else ! { ! return 1; ! } ! } ! ! function query($qry) ! { ! if ($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if (!$db) ! { ! return 0; ! } ! else ! { ! $result = @mssql_query($qry, $db); ! return $result; ! } ! } ! ! function numRows($qry) ! { ! if ($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if (!$db) ! { ! return 0; ! } ! else ! { ! $num = @mssql_num_rows($qry); ! return $num; ! } ! } ! ! function result($result, $row=0, $field='') ! { ! if ($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if (!$db) ! { ! return 0; ! } ! else ! { ! $return = @mssql_result($result, $row, $field); ! return $return; ! } ! } ! ! function fetchArray($qry) ! { ! if ($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if (!$db) ! { ! return 0; ! } ! else ! { ! $result = @mssql_fetch_array($qry); ! return $result; ! } ! } ! ! function fetchRow($qry) ! { ! if ($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! if (!$db) ! { ! return 0; ! } ! else ! { ! $result = @mssql_fetch_row($qry) ! return $result; ! } ! } ! ! function escapeString($string) ! { ! if( stripslashes($string) == $string ) // Will be true if no slashes were removed. ! { ! addslashes($string); // We'll add the slashes because they haven't already been added. ! return true; ! } ! else // Slashes have already been added (hopefully only once). ! { ! return true; ! } ! } ! ! } ! ! ?> Index: mysql.dba =================================================================== RCS file: /cvsroot/phpmp/phpMP/dba/mysql.dba,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** mysql.dba 2 May 2003 04:52:56 -0000 1.23 --- mysql.dba 17 May 2003 07:50:17 -0000 1.24 *************** *** 1,177 **** ! <?php ! ! class DB ! { ! ! var $ident_link; ! var $connected; ! var $query_count; ! ! function 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; ! ! return $this->ident_link; ! } ! } ! else ! { ! return $this->ident_link; ! } ! ! } ! ! function close () ! { ! if ( $this->ident_link != 0 ) ! { ! @mysql_close($this->ident_link); ! $this->ident_link = 0; ! ! return 1; ! } ! else ! { ! return 1; ! } ! } ! ! function 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 ); ! $this->query_count++; ! 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 fetchAssoc($query) ! { ! if($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! return @mysql_fetch_assoc($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); ! } ! } ! ?> --- 1,199 ---- ! <?php ! ! /* ! * phpMP - The PHP Modular Portal System ! * Copyright (C) 2002-2003 Brian Rose and the phpMP group ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! * $Id$ ! * ! */ ! ! class DB ! { ! ! var $ident_link; ! var $connected; ! var $query_count; ! ! function 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; ! ! return $this->ident_link; ! } ! } ! else ! { ! return $this->ident_link; ! } ! ! } ! ! function close () ! { ! if ( $this->ident_link != 0 ) ! { ! @mysql_close($this->ident_link); ! $this->ident_link = 0; ! ! return 1; ! } ! else ! { ! return 1; ! } ! } ! ! function 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 ); ! $this->query_count++; ! 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 fetchAssoc($query) ! { ! if($this->ident_link == 0) ! { ! $db = $this->connect(); ! } ! else ! { ! $db = $this->ident_link; ! } ! ! return @mysql_fetch_assoc($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...> - 2003-05-17 07:50:20
|
Update of /cvsroot/phpmp/phpMP/admin In directory sc8-pr-cvs1:/tmp/cvs-serv29050/admin Modified Files: index.php main.php nav.php Log Message: Added the license notice to each PHP file. No Changelog entry. Index: index.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/admin/index.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** index.php 11 Feb 2003 00:24:25 -0000 1.6 --- index.php 17 May 2003 07:50:16 -0000 1.7 *************** *** 1,25 **** ! <?php ! ! define( C_PHPMP_ROOT, '../' ); ! ! include_once( C_PHPMP_ROOT . 'includes/core.php' ); ! ! $Core = new Core(); ! ! $Core->init(); ! ! /******* Commented for Testing ******* ! if (U_AUTH_LEVEL != AUTH_LVL_ADMIN) ! { ! exit; ! end; ! } ! **************************************/ ! ! // Create the frameset navigation ! print "<frameset cols=\"150,*\">"; ! print "<frame name=\"nav\" src=\"nav.php\">"; ! print "<frame name=\"cont\" src=\"main.php\">"; ! print "</frameset>"; ! ! ?> --- 1,47 ---- ! <?php ! ! /* ! * phpMP - The PHP Modular Portal System ! * Copyright (C) 2002-2003 Brian Rose and the phpMP group ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! * $Id$ ! * ! */ ! ! define( C_PHPMP_ROOT, '../' ); ! ! include_once( C_PHPMP_ROOT . 'includes/core.php' ); ! ! $Core = new Core(); ! ! $Core->init(); ! ! /******* Commented for Testing ******* ! if (U_AUTH_LEVEL != AUTH_LVL_ADMIN) ! { ! exit; ! end; ! } ! **************************************/ ! ! // Create the frameset navigation ! print "<frameset cols=\"150,*\">"; ! print "<frame name=\"nav\" src=\"nav.php\">"; ! print "<frame name=\"cont\" src=\"main.php\">"; ! print "</frameset>"; ! ! ?> Index: main.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/admin/main.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** main.php 11 Feb 2003 21:06:18 -0000 1.5 --- main.php 17 May 2003 07:50:17 -0000 1.6 *************** *** 1,40 **** ! <?php ! // Action definitions ! define( C_ACTION_NONE, 0 ); ! define( C_ACTION_SITE, 1 ); ! define( C_ACTION_USER, 2 ); ! define( C_PARSE_USER, 3 ); ! ! define( C_PHPMP_ROOT, '../' ); ! ! include_once( C_PHPMP_ROOT . 'includes/core.php' ); ! ! $Core = new Core(); ! ! $Core->init(); ! ! // Main administration file - just shows site stats, etc... ! ! include_once( C_PHPMP_ROOT . 'includes/admin.php' ); ! $admin = new Admin(); ! ! switch ($parse) ! { ! case C_ACTION_SITE: ! if (!$submit_general) { return; } ! $admin->parse_site($sname, $ovrtpl, $deftpl, $deflang, $defdate, $accact, $systime, $portperms); ! break; ! case C_ACTION_USER: ! if (!$submit_user) { return; } ! $admin->show_user($userid); ! break; ! case C_PARSE_USER: ! if (!$submit_user_parse) { return; } ! $admin->parse_user($userid, $username, $passwd, $email, $auth_level, $date_format, $template, $signature, $delete); ! break; ! default: // $parse is not supplied, so execute $action instead ! if ($action != C_ACTION_NONE) { $admin->execute($action); } ! break; ! } ! ! ?> --- 1,63 ---- ! <?php ! ! /* ! * phpMP - The PHP Modular Portal System ! * Copyright (C) 2002-2003 Brian Rose and the phpMP group ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! * $Id$ ! * ! */ ! ! // Action definitions ! define( C_ACTION_NONE, 0 ); ! define( C_ACTION_SITE, 1 ); ! define( C_ACTION_USER, 2 ); ! define( C_PARSE_USER, 3 ); ! ! define( C_PHPMP_ROOT, '../' ); ! ! include_once( C_PHPMP_ROOT . 'includes/core.php' ); ! ! $Core = new Core(); ! ! $Core->init(); ! ! // Main administration file - just shows site stats, etc... ! ! include_once( C_PHPMP_ROOT . 'includes/admin.php' ); ! $admin = new Admin(); ! ! switch ($parse) ! { ! case C_ACTION_SITE: ! if (!$submit_general) { return; } ! $admin->parse_site($sname, $ovrtpl, $deftpl, $deflang, $defdate, $accact, $systime, $portperms); ! break; ! case C_ACTION_USER: ! if (!$submit_user) { return; } ! $admin->show_user($userid); ! break; ! case C_PARSE_USER: ! if (!$submit_user_parse) { return; } ! $admin->parse_user($userid, $username, $passwd, $email, $auth_level, $date_format, $template, $signature, $delete); ! break; ! default: // $parse is not supplied, so execute $action instead ! if ($action != C_ACTION_NONE) { $admin->execute($action); } ! break; ! } ! ! ?> Index: nav.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/admin/nav.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** nav.php 11 Feb 2003 00:24:25 -0000 1.4 --- nav.php 17 May 2003 07:50:17 -0000 1.5 *************** *** 1,25 **** ! <?php ! ! // Basic Navigation (not very pretty, just a throw-together for testing ! ! define( C_PHPMP_ROOT, '../' ); ! ! include_once( C_PHPMP_ROOT . 'includes/core.php' ); ! ! $Core = new Core(); ! ! $Core->init(); ! ! /******* Comented for Testing ******* ! if (U_AUTH_LEVEL != AUTH_LVL_ADMIN) ! { ! exit; ! end; ! } ! *************************************/ ! ! print "<base target=\"cont\">\n"; ! print "<a href=\"main.php?action=1\">Site Configuration</a><br>"; ! print "<a href=\"main.php?action=2\">User Management</a>"; ! ! ?> --- 1,47 ---- ! <?php ! ! /* ! * phpMP - The PHP Modular Portal System ! * Copyright (C) 2002-2003 Brian Rose and the phpMP group ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! * $Id$ ! * ! */ ! ! // Basic Navigation (not very pretty, just a throw-together for testing ! ! define( C_PHPMP_ROOT, '../' ); ! ! include_once( C_PHPMP_ROOT . 'includes/core.php' ); ! ! $Core = new Core(); ! ! $Core->init(); ! ! /******* Comented for Testing ******* ! if (U_AUTH_LEVEL != AUTH_LVL_ADMIN) ! { ! exit; ! end; ! } ! *************************************/ ! ! print "<base target=\"cont\">\n"; ! print "<a href=\"main.php?action=1\">Site Configuration</a><br>"; ! print "<a href=\"main.php?action=2\">User Management</a>"; ! ! ?> |
From: Brian R. <hei...@us...> - 2003-05-17 07:50:20
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv29050 Modified Files: index.php modules.php Log Message: Added the license notice to each PHP file. No Changelog entry. Index: index.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/index.php,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -r1.41 -r1.42 *** index.php 9 May 2003 08:07:38 -0000 1.41 --- index.php 17 May 2003 07:50:16 -0000 1.42 *************** *** 1,49 **** ! <?php ! ! define("PHPMP_ROOT", "./"); ! include_once( PHPMP_ROOT . 'includes/core.php' ); ! $Core = new Core(); ! ! // 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>"; ! ! 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 "Table Prefix: " . DB_TABLE_PREFIX . '<br>'; ! print "Queries Exec: " . $DB->query_count . '<br>'; ! ! print "<br>"; ! ! print "Config Table: " . DB_CONFIG_TABLE . '<br>'; ! print "Users Table: " . DB_USERS_TABLE . '<br>'; ! print "Block Table: " . DB_BLOCK_TABLE . '<br>'; ! print "Modules Table: " . DB_MODULES_TABLE . '<br>'; ! print "Sessions Table: " . DB_SESSIONS_TABLE . '<br>'; ! ! 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>'; ! ! ?> ! <html> ! <body> ! ! ! </body> </html> --- 1,71 ---- ! <?php ! ! /* ! * phpMP - The PHP Modular Portal System ! * Copyright (C) 2002-2003 Brian Rose and the phpMP group ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! * $Id$ ! * ! */ ! ! define("PHPMP_ROOT", "./"); ! include_once( PHPMP_ROOT . 'includes/core.php' ); ! $Core = new Core(); ! ! // 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>"; ! ! 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 "Table Prefix: " . DB_TABLE_PREFIX . '<br>'; ! print "Queries Exec: " . $DB->query_count . '<br>'; ! ! print "<br>"; ! ! print "Config Table: " . DB_CONFIG_TABLE . '<br>'; ! print "Users Table: " . DB_USERS_TABLE . '<br>'; ! print "Block Table: " . DB_BLOCK_TABLE . '<br>'; ! print "Modules Table: " . DB_MODULES_TABLE . '<br>'; ! print "Sessions Table: " . DB_SESSIONS_TABLE . '<br>'; ! ! 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>'; ! ! ?> ! <html> ! <body> ! ! ! </body> </html> Index: modules.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/modules.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** modules.php 8 Feb 2003 09:43:29 -0000 1.15 --- modules.php 17 May 2003 07:50:16 -0000 1.16 *************** *** 1,5 **** ! <?php ! ! // Module handler. ! ?> --- 1,27 ---- ! <?php ! ! /* ! * phpMP - The PHP Modular Portal System ! * Copyright (C) 2002-2003 Brian Rose and the phpMP group ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! * ! * $Id$ ! * ! */ ! ! // Module handler. ! ?> |
From: Brian R. <hei...@us...> - 2003-05-17 07:43:43
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv27259 Modified Files: config.init.php Log Message: Testing the new license notice (again). Index: config.init.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/config.init.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** config.init.php 17 May 2003 07:42:35 -0000 1.2 --- config.init.php 17 May 2003 07:43:41 -0000 1.3 *************** *** 19,23 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ! * $Id: * */ --- 19,23 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ! * $Id$ * */ |
From: Brian R. <hei...@us...> - 2003-05-17 07:42:38
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv26925 Modified Files: config.init.php Log Message: Testing the new license notice. Index: config.init.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/config.init.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** config.init.php 17 May 2003 07:00:39 -0000 1.1 --- config.init.php 17 May 2003 07:42:35 -0000 1.2 *************** *** 1,4 **** --- 1,26 ---- <?php + /* + * phpMP - The PHP Modular Portal System + * Copyright (C) 2002-2003 Brian Rose and the phpMP group + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id: + * + */ + class Config { |
From: Brian R. <hei...@us...> - 2003-05-17 07:11:46
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv17912 Modified Files: Changelog Log Message: Changelog updated (again..oops). Index: Changelog =================================================================== RCS file: /cvsroot/phpmp/phpMP/docs/Changelog,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** Changelog 17 May 2003 07:10:09 -0000 1.36 --- Changelog 17 May 2003 07:11:43 -0000 1.37 *************** *** 5,9 **** * includes/Smarty.class.php **REMOVED** * includes/Smart_Compiler.class.php **REMOVED** ! * includes/Config_ * includes/plugins/ **REMOVED** Removed all remnant Smarty files. We'll design --- 5,9 ---- * includes/Smarty.class.php **REMOVED** * includes/Smart_Compiler.class.php **REMOVED** ! * includes/Config_File.class.php **REMOVED** * includes/plugins/ **REMOVED** Removed all remnant Smarty files. We'll design |
From: Brian R. <hei...@us...> - 2003-05-17 07:10:12
|
Update of /cvsroot/phpmp/phpMP/docs In directory sc8-pr-cvs1:/tmp/cvs-serv17352 Modified Files: Changelog Log Message: Changelog updated. Index: Changelog =================================================================== RCS file: /cvsroot/phpmp/phpMP/docs/Changelog,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** Changelog 12 May 2003 07:05:09 -0000 1.35 --- Changelog 17 May 2003 07:10:09 -0000 1.36 *************** *** 1,361 **** ! 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) ! $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 ! * 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 ! * 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] ! * 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 ! 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 ! 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 ! * includes/sessions.php **REMOVED** ! * includes/session.php **NEW** ! * includes/user.php ! * includes/core.php ! * includes/functions.php ! * includes/language.php ! * includes/auth.php **REMOVED** ! The session/login system now works as I expect it to. ! All config settings are now housed in $Config. ! You MUST globalize $Config in each new class. ! The Auth class has bee removed, in favor of the ! 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 ! ! 2003-02-11 [AnthonyWhite] ! * admin/main.php ! Fixed a few issues regarding parsing multiple forms ! * includes/admin.php ! Added support for complete user management ! Having a few problems, but I will fix them soon ! ! 2003-02-10 [AnthonyWhite] ! * includes/admin.php ! Started on User Management ! * admin/main.php ! * admin/nav.php ! * 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 ! ! 2003-02-09 [Heimidal] ! * includes/constants.php ! Added timezones. ! ! 2003-02-09 [AnthonyWhite] ! * admin/main.php ! Changed the panel handling once again ! Not a big change - just got rid of if statement ! * admin/nav.php ! Nothing special, just changed a link's text ! * includes/admin.php ! Handles site configuration fully now ! outputs a form and handles it (for site config) ! Site config functions are basis for others now ! ! 2003-02-09 [AnthonyWhite] ! * admin/main.php ! Changed the way the panel is handled. ! May not be the best, but it works ! * includes/admin.php **NEW** ! Class file - Backend for the admin panel ! ! 2003-02-08 [AnthonyWhite] ! * admin/main.php **NEW** ! The main page for the admin panel, will show site stats ! Controlled by a switch / case statement (not best way) ! I will probably change the way this is eventually ! * admin/nav.php ! Just added a link for testing ! * admin/index.php ! Changed the frameset a bit ! ! 2003-02-08 [AnthonyWhite] ! * admin/index.php ! My first commit :) ! I am basically just starting on the admin panel here. ! So far, I have a basic layout with frames and so on. ! * admin/nav.php **NEW** ! Just a basic navigation file for the admin panel. ! If you dont like what I did just let me know, ! otherwise I will just continue on. ! ! 2003-02-08 [Heimidal] ! * A LOT of files. ! Dreamweaver changed \r\n to \r. That's fixed. ! Started moving includes around in core.php. ! Making the loading structure of files logical. ! constant.php actually contains 'constants' now. ! Began serious work on sessions.php. ! Auth will be called by sessions.php henceforth. ! ! 2003-02-05 [Heimidal] ! * Most included files. ! Changed DB table to carry a DB_ prefix. ! Fixed a mistake I made in constants.php. ! ! 2003-02-03 [Heimidal] ! ! * Every file I can think of. ! Changed <? to <?php for compatibility. ! Changed a few config values and such. ! ! 2003-02-03 [Heimidal] ! ! * includes/user.php ! * includes/auth.php ! Fixed a few small problems. ! ! 2003-01-31 [Heimidal] ! ! * dba/mysql.dba ! Added escapeString() function. ! * includes/user.php ! Added the escapeString() call to usernames. ! ! 2003-01-14 [Heimidal] ! ! * includes/user.php ! Continuing my update to the Authentication system. ! ! 2002-12-07 [Heimidal] ! ! * dba/sql/mysql_default_vals.sql ! Removed the date format for the Anon user. ! Added a 'T' to the default date format (timezone). ! ! 2002-12-07 [Heimidal] ! ! * index.php ! Missed the addition of 'C_' on a config variable. ! ! 2002-12-05 [Heimidal] ! ! * dba/sql/mysql_default_vals.sql ! * includes/user.php ! Changed the Anonymous user back to userid=1. ! ! 2002-12-04 [Heimidal] ! ! * all php files ! Added 'C_' to all config values not involving the DB. ! ! 2002-12-04 [Heimidal] ! ! * languages/english/lang_main.php ! * languages/french/lang_main.php ! Forgot $this->, changing the depth of the $lang var. ! ! 2002-12-04 [TopherCoS] ! ! * languages/english/lang_main.php ! * languages/french/lang_main.php ! Escape more single-quotes neeeding escaping (fr) ! Aesthetic cleanups ! Convert fr language file to new format ! ! 2002-12-03 [Heimidal] ! ! * includes/constants.php ! * includes/user.php ! * includes/auth.php ! Continuous updates to the auth system. ! 2002-12-02 [Heimidal] ! ! * dba/sql/mysql_structure.sql ! Updates to DB structure. ! * dba/sql/mysql_default_vals.sql ! Updates to default MySQL table values. ! ! 2002-12-02 [Heimidal] ! ! * languages/english/lang_main.php ! Altered the way in which the lang array is defined. ! * includes/core.php ! * includes/functions.php ! * includes/constants.php ! Begin arranging and declaring constants. ! * includes/template.php ! * includes/user.php ! To be logical, U_ will now prefix user vars. ! User variables will not be defined if empty. ! Anonymous user now carries a User ID of -1. ! ! 2002-12-02 [Heimidal] ! ! * includes/core.php ! Added an 's' to SESSIONS_TABLE. ! * includes/user.php ! Keep work up on the auth system. ! * dba/sql/mysql_default_vals.sql ! Changed a few defaults to reflect typical setups. ! ! ! ! 2002-12-02 [Heimidal] ! ! * index.php ! * includes/core.php ! Attempt to comply with coding standards. ! * includes/language.php ! Fixed inclusion of main language file. ! ! 2002-12-02 [Heimidal] ! ! * templates/TealMP/compile/ **NEW** ! * templates/TealMP/configs/ **NEW** ! ! 2002-12-02 [TopherCoS] ! ! * languages/french/lang_main.php **NEW** ! Added French language support ! ! 2002-12-02 [Heimidal] ! ! * includes/auth.php ! * includes/user.php ! Started work on the Auth system. ! * includes/language.php ! Changed the way language class works. ! * languages/english/lang_main.php ! Reformatted the language file for better use. ! * includes/debug.php **NEW** ! Just laying stuff out. ! ! 2002-12-02 [TopherCoS] ! ! * languages/english/lang_main.php ! Fix another minor typo I missed earlier ! ! 2002-12-02 [TopherCoS] ! ! * languages/english/lang_main.php ! Fix a minor typo ! ! 2002-12-02 [TopherCoS] ! ! * Changelog **NEW** ! Added Changelog to help keep track of changes ! * Format ! Entries begin with date in YYYY-MM-DD ! One <TAB> after the date followed by the SF username in ! brackets ! Optionally the software version number seperated by one ! <TAB> ! One empty line ! One <TAB> followed by "* dir/filename.php" ! One <TAB> then "**NEW** if a new file ! Next line is two <TAB>s followed by a concise description ! of the changes. ! Text should not wrap, nor should it extend beyond 80 ! characters on a single line. ! Entries seperated by an empty line ! Added a couple of extra entries to help illustrate format ! ! 2002-12-02 [heimidal] ! ! * includes/core.php ! Ugh. Stupid mistake ! ! 2002-12-02 [heimidal] ! ! * includes/core.php ! Fixed a few small errors ! ! 2002-12-02 [heimidal] ! ! * index.php ! * includes/auth.php ! * includes/core.php ! * includes/user.php **NEW** ! Made use of files within hierarchy much easier. ! Seperated User and Auth so we aren't forced into ! loading Auth. ! Started writing a basic auth system (though the ! parts written are contained in User) --- 1,372 ---- ! 2003-05-17 [Heimidal] ! * includes/core.php ! * includes/config.init.php **NEW** ! Moved the Config class to its own file. ! * includes/Smarty.class.php **REMOVED** ! * includes/Smart_Compiler.class.php **REMOVED** ! * includes/Config_ ! * includes/plugins/ **REMOVED** ! Removed all remnant Smarty files. We'll design ! our own template engine. ! ! 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) ! $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 ! * 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 ! * 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] ! * 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 ! 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 ! 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 ! * includes/sessions.php **REMOVED** ! * includes/session.php **NEW** ! * includes/user.php ! * includes/core.php ! * includes/functions.php ! * includes/language.php ! * includes/auth.php **REMOVED** ! The session/login system now works as I expect it to. ! All config settings are now housed in $Config. ! You MUST globalize $Config in each new class. ! The Auth class has bee removed, in favor of the ! 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 ! ! 2003-02-11 [AnthonyWhite] ! * admin/main.php ! Fixed a few issues regarding parsing multiple forms ! * includes/admin.php ! Added support for complete user management ! Having a few problems, but I will fix them soon ! ! 2003-02-10 [AnthonyWhite] ! * includes/admin.php ! Started on User Management ! * admin/main.php ! * admin/nav.php ! * 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 ! ! 2003-02-09 [Heimidal] ! * includes/constants.php ! Added timezones. ! ! 2003-02-09 [AnthonyWhite] ! * admin/main.php ! Changed the panel handling once again ! Not a big change - just got rid of if statement ! * admin/nav.php ! Nothing special, just changed a link's text ! * includes/admin.php ! Handles site configuration fully now ! outputs a form and handles it (for site config) ! Site config functions are basis for others now ! ! 2003-02-09 [AnthonyWhite] ! * admin/main.php ! Changed the way the panel is handled. ! May not be the best, but it works ! * includes/admin.php **NEW** ! Class file - Backend for the admin panel ! ! 2003-02-08 [AnthonyWhite] ! * admin/main.php **NEW** ! The main page for the admin panel, will show site stats ! Controlled by a switch / case statement (not best way) ! I will probably change the way this is eventually ! * admin/nav.php ! Just added a link for testing ! * admin/index.php ! Changed the frameset a bit ! ! 2003-02-08 [AnthonyWhite] ! * admin/index.php ! My first commit :) ! I am basically just starting on the admin panel here. ! So far, I have a basic layout with frames and so on. ! * admin/nav.php **NEW** ! Just a basic navigation file for the admin panel. ! If you dont like what I did just let me know, ! otherwise I will just continue on. ! ! 2003-02-08 [Heimidal] ! * A LOT of files. ! Dreamweaver changed \r\n to \r. That's fixed. ! Started moving includes around in core.php. ! Making the loading structure of files logical. ! constant.php actually contains 'constants' now. ! Began serious work on sessions.php. ! Auth will be called by sessions.php henceforth. ! ! 2003-02-05 [Heimidal] ! * Most included files. ! Changed DB table to carry a DB_ prefix. ! Fixed a mistake I made in constants.php. ! ! 2003-02-03 [Heimidal] ! ! * Every file I can think of. ! Changed <? to <?php for compatibility. ! Changed a few config values and such. ! ! 2003-02-03 [Heimidal] ! ! * includes/user.php ! * includes/auth.php ! Fixed a few small problems. ! ! 2003-01-31 [Heimidal] ! ! * dba/mysql.dba ! Added escapeString() function. ! * includes/user.php ! Added the escapeString() call to usernames. ! ! 2003-01-14 [Heimidal] ! ! * includes/user.php ! Continuing my update to the Authentication system. ! ! 2002-12-07 [Heimidal] ! ! * dba/sql/mysql_default_vals.sql ! Removed the date format for the Anon user. ! Added a 'T' to the default date format (timezone). ! ! 2002-12-07 [Heimidal] ! ! * index.php ! Missed the addition of 'C_' on a config variable. ! ! 2002-12-05 [Heimidal] ! ! * dba/sql/mysql_default_vals.sql ! * includes/user.php ! Changed the Anonymous user back to userid=1. ! ! 2002-12-04 [Heimidal] ! ! * all php files ! Added 'C_' to all config values not involving the DB. ! ! 2002-12-04 [Heimidal] ! ! * languages/english/lang_main.php ! * languages/french/lang_main.php ! Forgot $this->, changing the depth of the $lang var. ! ! 2002-12-04 [TopherCoS] ! ! * languages/english/lang_main.php ! * languages/french/lang_main.php ! Escape more single-quotes neeeding escaping (fr) ! Aesthetic cleanups ! Convert fr language file to new format ! ! 2002-12-03 [Heimidal] ! ! * includes/constants.php ! * includes/user.php ! * includes/auth.php ! Continuous updates to the auth system. ! 2002-12-02 [Heimidal] ! ! * dba/sql/mysql_structure.sql ! Updates to DB structure. ! * dba/sql/mysql_default_vals.sql ! Updates to default MySQL table values. ! ! 2002-12-02 [Heimidal] ! ! * languages/english/lang_main.php ! Altered the way in which the lang array is defined. ! * includes/core.php ! * includes/functions.php ! * includes/constants.php ! Begin arranging and declaring constants. ! * includes/template.php ! * includes/user.php ! To be logical, U_ will now prefix user vars. ! User variables will not be defined if empty. ! Anonymous user now carries a User ID of -1. ! ! 2002-12-02 [Heimidal] ! ! * includes/core.php ! Added an 's' to SESSIONS_TABLE. ! * includes/user.php ! Keep work up on the auth system. ! * dba/sql/mysql_default_vals.sql ! Changed a few defaults to reflect typical setups. ! ! ! ! 2002-12-02 [Heimidal] ! ! * index.php ! * includes/core.php ! Attempt to comply with coding standards. ! * includes/language.php ! Fixed inclusion of main language file. ! ! 2002-12-02 [Heimidal] ! ! * templates/TealMP/compile/ **NEW** ! * templates/TealMP/configs/ **NEW** ! ! 2002-12-02 [TopherCoS] ! ! * languages/french/lang_main.php **NEW** ! Added French language support ! ! 2002-12-02 [Heimidal] ! ! * includes/auth.php ! * includes/user.php ! Started work on the Auth system. ! * includes/language.php ! Changed the way language class works. ! * languages/english/lang_main.php ! Reformatted the language file for better use. ! * includes/debug.php **NEW** ! Just laying stuff out. ! ! 2002-12-02 [TopherCoS] ! ! * languages/english/lang_main.php ! Fix another minor typo I missed earlier ! ! 2002-12-02 [TopherCoS] ! ! * languages/english/lang_main.php ! Fix a minor typo ! ! 2002-12-02 [TopherCoS] ! ! * Changelog **NEW** ! Added Changelog to help keep track of changes ! * Format ! Entries begin with date in YYYY-MM-DD ! One <TAB> after the date followed by the SF username in ! brackets ! Optionally the software version number seperated by one ! <TAB> ! One empty line ! One <TAB> followed by "* dir/filename.php" ! One <TAB> then "**NEW** if a new file ! Next line is two <TAB>s followed by a concise description ! of the changes. ! Text should not wrap, nor should it extend beyond 80 ! characters on a single line. ! Entries seperated by an empty line ! Added a couple of extra entries to help illustrate format ! ! 2002-12-02 [heimidal] ! ! * includes/core.php ! Ugh. Stupid mistake ! ! 2002-12-02 [heimidal] ! ! * includes/core.php ! Fixed a few small errors ! ! 2002-12-02 [heimidal] ! ! * index.php ! * includes/auth.php ! * includes/core.php ! * includes/user.php **NEW** ! Made use of files within hierarchy much easier. ! Seperated User and Auth so we aren't forced into ! loading Auth. ! Started writing a basic auth system (though the ! parts written are contained in User) |
From: Brian R. <hei...@us...> - 2003-05-17 07:00:42
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv14768 Modified Files: core.php Added Files: config.init.php Log Message: Moved the Config class to its own file. --- NEW FILE: config.init.php --- <?php 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: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -r1.53 -r1.54 *** core.php 14 May 2003 06:26:09 -0000 1.53 --- core.php 17 May 2003 07:00:39 -0000 1.54 *************** *** 1,152 **** ! <?php ! ! class Core // Does, literally, everything. ! { ! ! function stripMagicQuotes($arr) ! { ! foreach ($arr as $k => $v) ! { ! if (is_array($v)) ! { ! $arr[$k] = strip_magic_quotes($v); ! } ! else ! { ! $arr[$k] = stripslashes($v); ! } ! } ! ! return $arr; ! } ! ! // Initiates all core components. ! // Author: Brian 'Heimidal' Rose ! // Accepts: $optional_files (string of needed files separated by commas). ! // Returns: none. ! function Core( $optional_files = array() ) ! { ! set_magic_quotes_runtime(0); ! 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); } ! } ! ! if( !defined("PHPMP_ROOT") ) ! { ! define( 'PHPMP_ROOT', './' ); ! } ! ! error_reporting(E_ERROR | E_WARNING | E_PARSE); ! //error_reporting(E_ALL); ! ! include_once( PHPMP_ROOT . 'config.php' ); ! ! // Globalize all major class-containing variables. ! global $Config, $Debug, $DB, $User, $MPCode, $Template; ! ! include_once( PHPMP_ROOT . 'includes/debug.php' ); ! $Debug = new Debug(); ! ! set_error_handler(array('Debug', 'msgDisplay')); ! ! include_once( PHPMP_ROOT . 'dba/' . DB_TYPE . '.dba' ); ! $DB = new DB(); ! $DB->connect(); ! ! define("DB_CONFIG_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'config'); ! define("DB_USERS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'users'); ! define("DB_SESSIONS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'sessions'); ! 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'); ! ! $Config = new Config(); ! ! include_once(PHPMP_ROOT . 'includes/constants.php'); ! ! include_once(PHPMP_ROOT . 'includes/functions.php'); ! ! include_once(PHPMP_ROOT . 'includes/user.php'); ! $User = new User(); // Create an instance of User. ! ! createVars(); ! ! include_once(PHPMP_ROOT . 'includes/session.php'); ! $Session = new Session(); ! ! $Session->start(); ! $Session->run(); ! ! include_once(PHPMP_ROOT . 'includes/language.php'); ! $Language = new Language(); ! ! include_once(PHPMP_ROOT . 'includes/mpcode.php'); ! ! // 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++; ! } ! } ! ! //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(); ! } ! } ! ! 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; ! } ! } ! } ! ?> --- 1,109 ---- ! <?php ! ! class Core // Does, literally, everything. ! { ! ! function stripMagicQuotes($arr) ! { ! foreach ($arr as $k => $v) ! { ! if (is_array($v)) ! { ! $arr[$k] = strip_magic_quotes($v); ! } ! else ! { ! $arr[$k] = stripslashes($v); ! } ! } ! ! return $arr; ! } ! ! // Initiates all core components. ! // Author: Brian 'Heimidal' Rose ! // Accepts: $optional_files (string of needed files separated by commas). ! // Returns: none. ! function Core( $optional_files = array() ) ! { ! set_magic_quotes_runtime(0); ! 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); } ! } ! ! if( !defined("PHPMP_ROOT") ) ! { ! define( 'PHPMP_ROOT', './' ); ! } ! ! error_reporting(E_ERROR | E_WARNING | E_PARSE); ! //error_reporting(E_ALL); ! ! include_once( PHPMP_ROOT . 'config.php' ); ! ! // Globalize all major class-containing variables. ! global $Config, $Debug, $DB, $User, $MPCode, $Template; ! ! include_once( PHPMP_ROOT . 'includes/debug.php' ); ! $Debug = new Debug(); ! ! set_error_handler(array('Debug', 'msgDisplay')); ! ! include_once( PHPMP_ROOT . 'dba/' . DB_TYPE . '.dba' ); ! $DB = new DB(); ! $DB->connect(); ! ! define("DB_CONFIG_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'config'); ! define("DB_USERS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'users'); ! define("DB_SESSIONS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'sessions'); ! 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'); ! ! include_once(PHPMP_ROOT . 'includes/config.init.php'); ! $Config = new Config(); ! ! include_once(PHPMP_ROOT . 'includes/constants.php'); ! ! include_once(PHPMP_ROOT . 'includes/functions.php'); ! ! include_once(PHPMP_ROOT . 'includes/user.php'); ! $User = new User(); // Create an instance of User. ! ! createVars(); ! ! include_once(PHPMP_ROOT . 'includes/session.php'); ! $Session = new Session(); ! ! $Session->start(); ! $Session->run(); ! ! include_once(PHPMP_ROOT . 'includes/language.php'); ! $Language = new Language(); ! ! include_once(PHPMP_ROOT . 'includes/mpcode.php'); ! ! // 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++; ! } ! } ! ! //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(); ! } ! } ! ?> |
From: Brian R. <hei...@us...> - 2003-05-17 06:03:28
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv30020 Removed Files: Config_File.class.php Smarty.class.php Smarty_Compiler.class.php Log Message: Removing Smarty, since we are going to write our own template engine. --- Config_File.class.php DELETED --- --- Smarty.class.php DELETED --- --- Smarty_Compiler.class.php DELETED --- |