Thread: [phpMP-CVS] CVS: phpMP/includes constants.php,1.4,1.5 core.php,1.13,1.14 functions.php,1.9,1.10 temp
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2002-07-25 06:16:26
|
Update of /cvsroot/phpmp/phpMP/includes In directory usw-pr-cvs1:/tmp/cvs-serv16001/includes Modified Files: constants.php core.php functions.php template.php Log Message: Fixed a few bugs; changed a template or two. Expect HUGE update of teomplate engine on next go-around. Index: constants.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/constants.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** constants.php 21 Jul 2002 21:43:33 -0000 1.4 --- constants.php 25 Jul 2002 06:16:22 -0000 1.5 *************** *** 1,5 **** <? ! $MPCONF['TPL']['copyright'] .= "powered by phpMP " . $MPCONF['GEN']['version'] . " © 2002 <a href=\"http://phpmp.sourceforge.net/\">phpMP Dev. Group</a>.<br>\n"; $MPCONF['TPL']['copyright'] .= "All content is property of its respective owner. All rights reserved."; --- 1,5 ---- <? ! $MPCONF['TPL']['copyright'] .= "powered by phpMP " . $MPCONF['GEN']['version'] . " © 2002 <a href=\"http://phpmp.sourceforge.net/\">phpMP Dev. Group</a>.<br>\n"; $MPCONF['TPL']['copyright'] .= "All content is property of its respective owner. All rights reserved."; Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** core.php 23 Apr 2002 08:14:55 -0000 1.13 --- core.php 25 Jul 2002 06:16:22 -0000 1.14 *************** *** 40,43 **** --- 40,67 ---- ******************************************************************************/ + class Debug { + + var $starttime; + var $totaltime; + + function startTimer() { + $mtime = microtime (); + $mtime = explode (' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $this->starttime = $mtime; + } + function endTimer() { + $mtime = microtime (); + $mtime = explode (' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $endtime = $mtime; + $totaltime = round (($endtime - $this->starttime), 5); + $this->totaltime = $totaltime; + } + } + + $Debug = new Debug(); + $Debug->startTimer(); + // Main phpMP Class which loads all other files, config options, and modules. class PHPMP{ Index: functions.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/functions.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** functions.php 23 Apr 2002 08:14:55 -0000 1.9 --- functions.php 25 Jul 2002 06:16:22 -0000 1.10 *************** *** 47,49 **** --- 47,75 ---- } + class ModFunctions { + + // Changes the data string in the database for the module specified. + // Returns: 1 on success, 0 on failure. + function ChangeDataString($mod, $string) { + global $DBA; + $sql = "UPDATE " . $MPCONF['DB']['table_prefix'] . "modules SET data='" . $string . "'WHERE unixname='" . $mod; + if($DBA->query($sql)) { + return 1; + } else { + return 0; + } + } + + // Fetches the data stored by a module. + // Returns: data string. + function FetchDataString($mod, $string) { + global $DBA; + $sql = "SELECT data FROM " . $MPCONF['DB']['table_prefix'] . "modules WHERE unixname='" . $mod; + $db = $DBA->query($sql); + $result = $DBA->fetch_array($db); + return $result[0]; + } + + } + ?> Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** template.php 22 Jul 2002 00:49:43 -0000 1.16 --- template.php 25 Jul 2002 06:16:22 -0000 1.17 *************** *** 67,71 **** // Returns: $array with some extra, assigned values. function AssignDefaults($array) { ! global $MPCONF; $array['MPPATH'] = $MPCONF['GEN']['abs_path']; --- 67,71 ---- // Returns: $array with some extra, assigned values. function AssignDefaults($array) { ! global $MPCONF, $DBA; $array['MPPATH'] = $MPCONF['GEN']['abs_path']; *************** *** 77,80 **** --- 77,81 ---- $array['SITENAME'] = $MPCONF['TPL']['sitename']; $array['BULLETHTML'] = $MPCONF['TPL']['bullet_html']; + $array['DEVINFO'] = "debug mode :: " . $DBA->stats['query_count'] . " queries executed"; return $array; *************** *** 102,109 **** // Returns: none. function PrintFooter($tpl_array) { ! global $MPCONF; $tpl_array = $this->AssignDefaults($tpl_array); $footer_data = implode("", (@file($MPCONF['GEN']['abs_path'] . '/templates/' . $MPCONF['TPL']['tpl_name'] . '/footer.tpl'))); while (list ($key,$val) = each ($tpl_array) ) { if (!(empty($key))) { --- 103,114 ---- // Returns: none. function PrintFooter($tpl_array) { ! global $MPCONF, $Debug; $tpl_array = $this->AssignDefaults($tpl_array); $footer_data = implode("", (@file($MPCONF['GEN']['abs_path'] . '/templates/' . $MPCONF['TPL']['tpl_name'] . '/footer.tpl'))); + + $Debug->endTimer(); + $tpl_array['DEVINFO'] .= " :: executed in " . $Debug->totaltime . " seconds"; + while (list ($key,$val) = each ($tpl_array) ) { if (!(empty($key))) { |