[phpMP-CVS] CVS: phpMP/includes constants.php,1.5,1.6 template_ext.php,1.1,1.2
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2002-07-25 20:50:10
|
Update of /cvsroot/phpmp/phpMP/includes In directory usw-pr-cvs1:/tmp/cvs-serv26475/includes Modified Files: constants.php template_ext.php Log Message: Fully integrated Smarty (finally). Blocks now work (and quite well, too). Went ahead and split header and fotter from main template, plus added the module template. Index: constants.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/constants.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** constants.php 25 Jul 2002 06:16:22 -0000 1.5 --- constants.php 25 Jul 2002 20:50:07 -0000 1.6 *************** *** 1,6 **** <? - $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,3 ---- Index: template_ext.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template_ext.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** template_ext.php 25 Jul 2002 11:06:25 -0000 1.1 --- template_ext.php 25 Jul 2002 20:50:07 -0000 1.2 *************** *** 43,47 **** class Template extends Smarty { ! var $TPLVars; function Template() { --- 43,48 ---- class Template extends Smarty { ! var $right_side; ! var $left_side; function Template() { *************** *** 76,81 **** $content = $data_array['content']; } ! $this->TPLVars["$side"][$i]['name'] = $blockname; ! $this->TPLVars["$side"][$i]['content'] = $content; $i++; --- 77,86 ---- $content = $data_array['content']; } ! ! if($side == 'left') { ! $this->left_side["$blockname"] = $content; ! } elseif($side == 'right') { ! $this->right_side["$blockname"] = $content; ! } $i++; *************** *** 85,89 **** function assign_defaults() { ! global $MPCONF, $DBA; $this->assign( array( --- 90,94 ---- function assign_defaults() { ! global $MPCONF; $this->assign( array( *************** *** 94,100 **** "date" => date('l, F jS, Y'), "tpl_name" => $MPCONF['TPL']['tpl_name'], ! "copyright" => $MPCONF['TPL']['copyright'], ! "site_name" => $MPCONF['TPL']['sitename'], ! "bullet_html" => $MPCONF['TPL']['bullet_html'], ) ); --- 99,103 ---- "date" => date('l, F jS, Y'), "tpl_name" => $MPCONF['TPL']['tpl_name'], ! "site_name" => $MPCONF['TPL']['sitename'] ) ); *************** *** 102,105 **** --- 105,124 ---- } + function assign_language() { + // Very, very dirty. Change so that users can choose their language. + + global $MPCONF; + $default_lang = $MPCONF['TPL']['default_lang']; + + require('./languages/' . $default_lang . '/lang_main.php'); + + while (list ($key,$val) = each ($lang) ) { + if (!(empty($key))) { + $this->assign($key, $val); + } + } + + } + function display_template($temp_name) { global $DBA, $Debug; *************** *** 110,119 **** $this->assign_defaults(); $Debug->endTimer(); $this->assign("debug_info","debug mode :: " . $DBA->stats['query_count'] . " queries executed :: executed in " . $Debug->totaltime . " seconds"); ! $this->assign( "blocking", $this->TPLVars ); ! $this->display($temp_name . ".tpl"); } --- 129,141 ---- $this->assign_defaults(); + $this->assign_language(); + $Debug->endTimer(); $this->assign("debug_info","debug mode :: " . $DBA->stats['query_count'] . " queries executed :: executed in " . $Debug->totaltime . " seconds"); ! $this->assign( "left_side", $this->left_side ); ! $this->assign( "right_side", $this->right_side ); ! $this->display($temp_name); } |