[SUCS Devel] site r668 - in trunk: components htdocs lib

imranh at sucs.org imranh at sucs.org
Tue Apr 14 16:58:34 BST 2015


Author: imranh
Date: 2015-04-14 16:58:23 +0100 (Tue, 14 Apr 2015)
New Revision: 668

Modified:
   trunk/components/library.php
   trunk/components/members.php
   trunk/components/mw.php
   trunk/htdocs/index.php
   trunk/lib/banana-admin.php
Log:
Smarty 3

Modified: trunk/components/library.php
===================================================================
--- trunk/components/library.php	2015-04-13 19:39:19 UTC (rev 667)
+++ trunk/components/library.php	2015-04-14 15:58:23 UTC (rev 668)
@@ -54,7 +54,7 @@
 	} else {
 		$mode = "taglist";
 		$smarty->assign("tags", $DB->GetAll("SELECT name FROM bookcategories"));
-	}	
+	}
 
 } elseif (isset($pathlist[$library_index + 1]) && is_numeric($pathlist[$library_index + 1])) {
 // We're displaying a specific book
@@ -115,7 +115,7 @@
 			$msgbody .= " {$book['title']} by {$book['author']} from the library.\n\n";
 			$msgbody .= "Visit https://$preferred_hostname$path to process this request.";
 			mail($librarian_mail, "Book Request", $msgbody);
-			
+
 			$smarty->assign("checkout_request", true);
 		}
 
@@ -123,7 +123,6 @@
 		$book['title'] = htmlentities2($book['title']);
 		$book['author'] = htmlentities2($book['author']);
 		$book['onloan'] = ($book['onloan'] == 't') ? true : false;
-		
 
 		if (!isset($book['description'])) {
 			// no book description in the database, try using Amazon data
@@ -152,7 +151,7 @@
 		if ($session->loggedin) {
 			$members = new Members;
 			$smarty->assign("memberlist", $members->getMemberList());
-			$secondary = $smarty->get_template_vars("secondary");
+			$secondary = $smarty->getTemplateVars("secondary");
 			$secondary .= $smarty->fetch('library-loan.tpl');
 			$smarty->assign("secondary", $secondary);
 		}

Modified: trunk/components/members.php
===================================================================
--- trunk/components/members.php	2015-04-13 19:39:19 UTC (rev 667)
+++ trunk/components/members.php	2015-04-14 15:58:23 UTC (rev 668)
@@ -131,7 +131,7 @@
                 }
 
 		$smarty->assign("stats", $stats);
-		$secondary = $smarty->get_template_vars("secondary");
+		$secondary = $smarty->getTemplateVars("secondary");
 		$secondary .= $smarty->fetch("banana-leaders.tpl");
 		$smarty->assign("secondary", $secondary);
 
@@ -148,7 +148,6 @@
 	$smarty->assign("public_members", $public_usernames);
 }
 
-
 $smarty->assign('url', $component['path']);
 $smarty->assign('extra_styles', "/css/members.css");
 $result = $smarty->fetch('members.tpl');

Modified: trunk/components/mw.php
===================================================================
--- trunk/components/mw.php	2015-04-13 19:39:19 UTC (rev 667)
+++ trunk/components/mw.php	2015-04-14 15:58:23 UTC (rev 668)
@@ -128,7 +128,7 @@
 }
 
 $folders = load_folders();
-$smarty->assign_by_ref("folders", $folders);
+$smarty->assignByRef("folders", $folders);
 $smarty->assign("extra_styles", array("/css/forum/SUCS.css"));
 
 unset($mode);

Modified: trunk/htdocs/index.php
===================================================================
--- trunk/htdocs/index.php	2015-04-13 19:39:19 UTC (rev 667)
+++ trunk/htdocs/index.php	2015-04-14 15:58:23 UTC (rev 668)
@@ -1,4 +1,5 @@
 <?php
+error_reporting(E_STRICT);
 // Display execution time?
 //$displaytime = TRUE;
 
@@ -29,8 +30,8 @@
 
 // Include the Smarty templating engine
 define('SMARTY_DIR', '/usr/share/php/smarty3/');
-require("/usr/share/php/smarty3/SmartyBC.class.php");
-$smarty = new SmartyBC();
+require("/usr/share/php/smarty3/Smarty.class.php");
+$smarty = new Smarty();
 $smarty->setTemplateDir($base."templates");
 $smarty->setCompileDir($base."templates_c");
 $smarty->addPluginsDir($base."plugins");
@@ -53,7 +54,7 @@
 // Include the session library
 require($base."lib/session.php");
 $session = new Session;
-$smarty->assign_by_ref("session", $session);
+$smarty->assignByRef("session", $session);
 
 
 // include feedback form stuff
@@ -115,7 +116,7 @@
 // Determine which component to run
 $pathlist = explode('/', parse_url($pathinfo,PHP_URL_PATH));
 while (end($pathlist) === "") array_pop($pathlist);
-$smarty->assign_by_ref("pathlist", $pathlist);
+$smarty->assignByRef("pathlist", $pathlist);
 $path = '';
 $query = "select * from pagemap where path='/' ";
 $params = array();
@@ -130,7 +131,7 @@
 }
 
 // Determine the path of the request
-$smarty->assign_by_ref("path", $path);
+$smarty->assignByRef("path", $path);
 
 $query .= "order by depth desc";
 $pagemap = $DB->GetAll($query, $params);

Modified: trunk/lib/banana-admin.php
===================================================================
--- trunk/lib/banana-admin.php	2015-04-13 19:39:19 UTC (rev 667)
+++ trunk/lib/banana-admin.php	2015-04-14 15:58:23 UTC (rev 668)
@@ -26,8 +26,8 @@
 		if (trim ($_POST['why']) !== "") {
 			$number = intval($_POST['number']);
 
-			$why = $_POST['why'];	
-			
+			$why = $_POST['why'];
+
 			if ( abs($number) <= $maxbanana ){
 
 				$DB->Query("INSERT INTO awards (username, score, whn, who, why) VALUES (?,?,NOW(),?,?)", array($who, $number, $session->username, $why));
@@ -39,14 +39,14 @@
 
 		} else {
 			trigger_error("No reason entered for the awarding of bananas.", E_USER_WARNING);
-		}	
+		}
 	}
 } elseif ($session->loggedin) {
 	if ($_REQUEST['action'] == "award") {
 		$number = intval($_POST['number']);
-		$why = $_POST['why'];	
+		$why = $_POST['why'];
 
-	// Send a mail to someone about them bananas	
+	// Send a mail to someone about them bananas
 		$msgbody = $session->username." thinks $who deserves $number bananas:\r\n";
 		$msgbody .= "\"$why\"\r\n\r\nVisit https://sucs.org/Community/Members/$who if you want to make an award.";
 		mail($contact, "Banana Award Nomination", $msgbody, $msgheaders);
@@ -56,7 +56,7 @@
 }
 
 
-$secondary = $smarty->get_template_vars("secondary");
+$secondary = $smarty->getTemplateVars("secondary");
 $secondary .= $smarty->fetch('banana-award.tpl');
 $smarty->assign('secondary', $secondary);
 




More information about the Devel mailing list