[SUCS Devel] site r653 - in branches/sucs-site: components htdocs templates

imranh at sucs.org imranh at sucs.org
Thu Apr 2 15:19:40 BST 2015


Author: imranh
Date: 2015-04-02 15:19:40 +0100 (Thu, 02 Apr 2015)
New Revision: 653

Modified:
   branches/sucs-site/components/news.php
   branches/sucs-site/components/pastebin.php
   branches/sucs-site/htdocs/index.php
   branches/sucs-site/templates/library.tpl
   branches/sucs-site/templates/members.tpl
   branches/sucs-site/templates/uri.tpl
Log:
Smarty 3. Move the site over to smarty 3 but using it's smarty 2 BC layer.

Modified: branches/sucs-site/components/news.php
===================================================================
--- branches/sucs-site/components/news.php	2015-04-02 12:20:04 UTC (rev 652)
+++ branches/sucs-site/components/news.php	2015-04-02 14:19:40 UTC (rev 653)
@@ -17,7 +17,7 @@
 			$record['sticky'] = 't';
 		else
 			$record['sticky'] = 'f';
-		
+
 		if ($_REQUEST['id']=="*") {
 			$record['author'] = $session->username;
 			$record['date'] = "now";
@@ -26,7 +26,7 @@
 			$DB->AutoExecute($newstable, $record, 'UPDATE', "id=".$DB->qstr($_REQUEST['id']));
 		}
 		include("motd.php");
-		
+
 		break;
 	case "Delete":
 		$deleted = $DB->Execute("DELETE FROM $newstable WHERE id=?", array($_REQUEST['id']));
@@ -60,10 +60,10 @@
 		$smarty->assign("title", "Edit News");
 		break;
 	case "delete-query":
-		$output = $smarty->fetch('news_delete.tpl').$output;		
+		$output = $smarty->fetch('news_delete.tpl').$output;
 		break;
 	case "expire-query":
-		$output = $smarty->fetch('news_expire.tpl').$output;		
+		$output = $smarty->fetch('news_expire.tpl').$output;
 		break;
 	case "Delete":
 		if ($deleted) $output = "News item deleted";

Modified: branches/sucs-site/components/pastebin.php
===================================================================
--- branches/sucs-site/components/pastebin.php	2015-04-02 12:20:04 UTC (rev 652)
+++ branches/sucs-site/components/pastebin.php	2015-04-02 14:19:40 UTC (rev 653)
@@ -29,7 +29,7 @@
 
 
 // Debugging
-error_reporting(E_ALL);
+//error_reporting(E_ALL);
 
 // Config
 define('_LIST_LIMIT', 15);

Modified: branches/sucs-site/htdocs/index.php
===================================================================
--- branches/sucs-site/htdocs/index.php	2015-04-02 12:20:04 UTC (rev 652)
+++ branches/sucs-site/htdocs/index.php	2015-04-02 14:19:40 UTC (rev 653)
@@ -28,12 +28,12 @@
 
 
 // Include the Smarty templating engine
-define('SMARTY_DIR', '/usr/share/php/smarty/libs/');
-require("/usr/share/php/smarty/libs/Smarty.class.php");
-$smarty = new Smarty;
-$smarty->template_dir = $base."templates";
-$smarty->compile_dir = $base."templates_c";
-$smarty->plugins_dir[] = $base."plugins";
+define('SMARTY_DIR', '/usr/share/php/smarty3/');
+require("/usr/share/php/smarty3/SmartyBC.class.php");
+$smarty = new SmartyBC();
+$smarty->setTemplateDir($base."templates");
+$smarty->setCompileDir($base."templates_c");
+$smarty->addPluginsDir($base."plugins");
 
 $smarty->assign("baseurl", $baseurl);
 
@@ -142,7 +142,6 @@
 } else {
 	$smarty->assign("component", $pagemap[0]['component']);
 	$component = $pagemap[0];
-	
 }
 
 if ($path == "") $path="/";
@@ -202,4 +201,4 @@
 $session->save();
 
 
-?>
+?>
\ No newline at end of file

Modified: branches/sucs-site/templates/library.tpl
===================================================================
--- branches/sucs-site/templates/library.tpl	2015-04-02 12:20:04 UTC (rev 652)
+++ branches/sucs-site/templates/library.tpl	2015-04-02 14:19:40 UTC (rev 653)
@@ -14,7 +14,7 @@
 
 {elseif $mode == 'display'}
 
-{include file=library-book.tpl book=$book}
+{include file='library-book.tpl' book=$book}
 
 {elseif $mode == 'search'}
 <h3>Search Results</h3>

Modified: branches/sucs-site/templates/members.tpl
===================================================================
--- branches/sucs-site/templates/members.tpl	2015-04-02 12:20:04 UTC (rev 652)
+++ branches/sucs-site/templates/members.tpl	2015-04-02 14:19:40 UTC (rev 653)
@@ -55,7 +55,7 @@
 		<dl class="bananas">
                 {foreach name=awardsbyyear from=$member.awardsbyyear key=yearname item=year}
 			<dt>{$yearname}/{math equation="x + 1" x=$yearname}: <small>{$year.sum} banana{if $year.sum|abs != 1}s{/if}</small></dt>
-			<dd>{include file=banana-awardlist.tpl awards=$year.awards singlemember=true}</dd>
+			<dd>{include file='banana-awardlist.tpl' awards=$year.awards singlemember=true}</dd>
                 {/foreach}
 		</dl>
 </div>
@@ -72,7 +72,7 @@
 {else}
 <p> Please search for a member in the sidebar.</p>
 <h3>Recent Awards</h3>
-{include file=banana-awardlist.tpl awards=$stats.recent}
+{include file='banana-awardlist.tpl' awards=$stats.recent}
 {/if}
 {else}
 <p>Please log in to view full member details.</p>

Modified: branches/sucs-site/templates/uri.tpl
===================================================================
--- branches/sucs-site/templates/uri.tpl	2015-04-02 12:20:04 UTC (rev 652)
+++ branches/sucs-site/templates/uri.tpl	2015-04-02 14:19:40 UTC (rev 653)
@@ -1,4 +1,4 @@
-{php}
+{* {php}
 $script = "<script type=\"text/javascript\">\n";
 $script .= "window.addEventListener('load', function(e) {\n";
 $script .= "\tdocument.getElementById(\"uri\").focus();\n";
@@ -7,6 +7,7 @@
 
 $this->append('extra_scripts', $script);
 {/php}
+*}
 
 {if $session->loggedin}
 




More information about the Devel mailing list