Update of /cvsroot/phpmp/phpMP/includes
In directory usw-pr-cvs1:/tmp/cvs-serv18083/includes
Modified Files:
core.php template.php
Log Message:
It is finally starting to all come together!
Index: core.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- core.php 1 Apr 2002 09:43:20 -0000 1.7
+++ core.php 1 Apr 2002 23:48:40 -0000 1.8
@@ -52,6 +52,7 @@
$core_array = explode(',', "$core_files"); // Splits core_files.
}
+ $core_array[] = 'constants';
$core_array[] = 'temp';
$core_array[] = 'dba';
$core_array[] = 'template';
Index: template.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- template.php 1 Apr 2002 09:43:20 -0000 1.4
+++ template.php 1 Apr 2002 23:48:40 -0000 1.5
@@ -36,6 +36,7 @@
var $boxcache = "";
var $block_vars_read = 0;
var $TPLVars;
+ var $nav_bar_content;
// Initializes a variable or two.
// Returns: none.
@@ -44,11 +45,31 @@
global $MPCONF, $DBA;
$sql = "SELECT * FROM " . $MPCONF['DB']['table_prefix'] . "config";
$db = $DBA->query($sql);
- while($row = @mysql_fetch_row($db)) {
- $MPCONF["{$row['type']}"]["{$row['name']}"] = $row["value"];
- }
- //if($MPCONF['TPL']['tpl_name'] != 'default') { die('$MPCONF[\'TPL\'][\'tpl_name\'] equals ' . $MPCONF['TPL']['tpl_name']); }
+ while($row = @mysql_fetch_array($db)) {
+ $MPCONF[$row['type']][$row['name']] = $row["value"];
+ }
}
+
+ function AssembleNav($link_list,$sep) {
+ global $nav_links;
+
+ $link_array = explode(',', "$link_list");
+
+ $i = 0;
+ while($link_array[$i] != "") {
+ $link_name = $link_array[$i];
+ if(isset($nav_links["$link_name"])) {
+ if($i != 0) {
+ $nav_bar_content .= ' ' . $sep . ' ' . "\n";
+ }
+ $link_each = explode('@',$nav_links["$link_name"]);
+ $this->nav_bar_content .= "<a href=\"{$link_each[0]}\">{$link_each[1]}</a>";
+ }
+ $i++;
+ }
+
+ return $this->nav_bar_content;
+ }
// Takes an array and adds default (and needed) template values to it.
// Returns: $array with some extra, assigned values.
@@ -56,9 +77,13 @@
global $MPCONF;
$array['MPPATH'] = $MPCONF['GEN']['abs_path'];
- $array['MPURL'] = $MPCONF['GEN']['uri'];
+ $array['MPURLPATH'] = $MPCONF['GEN']['uri'];
+ $array['SITEADDRESS'] = $MPCONF['GEN']['address'];
$array['DATE'] = date('l, F jS, Y');
$array['TPLNAME'] = $MPCONF['TPL']['tpl_name'];
+ $array['COPYRIGHT'] = $MPCONF['TPL']['copyright'];
+
+ include($MPCONF['GEN']['abs_path'] . '/templates/' . $MPCONF['TPL']['tpl_name'] . '/tplvars.cfg');
return $array;
}
|