[SUCS Devel] site r615 - in branches/imranh: . components htdocs lib lib/blog templates

imranh at sucs.org imranh at sucs.org
Mon Dec 1 10:30:43 GMT 2014


Author: imranh
Date: 2014-12-01 10:30:41 +0000 (Mon, 01 Dec 2014)
New Revision: 615

Modified:
   branches/imranh/
   branches/imranh/components/events.php
   branches/imranh/components/planet.php
   branches/imranh/htdocs/index.php
   branches/imranh/lib/blog/blog.lib.php
   branches/imranh/lib/page-feedback.php
   branches/imranh/templates/event.tpl
   branches/imranh/templates/event_edit.tpl
   branches/imranh/templates/events.tpl
   branches/imranh/templates/feedback.tpl
   branches/imranh/templates/foot.tpl
   branches/imranh/templates/uri.tpl
Log:
Merging changes with my branch


Property changes on: branches/imranh
___________________________________________________________________
Added: svn:mergeinfo
   + /branches:590
/branches/sucs-site:590,594-595,597-608,610-614
/branches/sucs-site/branches/sucs-site:590-591

Modified: branches/imranh/components/events.php
===================================================================
--- branches/imranh/components/events.php	2014-12-01 09:52:18 UTC (rev 614)
+++ branches/imranh/components/events.php	2014-12-01 10:30:41 UTC (rev 615)
@@ -1,12 +1,12 @@
 <?php
-/* 
+/*
  * Main events page, including admin functions
  */
 
 
-$permission = "bananas";
+$permission = "sucsstaff";
 $eventtable = "events";
-$eventcategories = array("Talks","Gaming","Social","Misc");
+$eventcategories = array("Technical","Talks","Gaming","Social","Misc");
 
 $smarty->assign("event_categories", $eventcategories);
 
@@ -25,7 +25,7 @@
 }
 
 if (isset($session->groups[$permission])) {
-	$smarty->assign("editable", true); 
+	$smarty->assign("editable", true);
 	$action = @$_REQUEST['action'];
 
 	// process form actions with side-effects first
@@ -43,6 +43,7 @@
 			$datetime .= " ".$_REQUEST['Time_Hour'];
 			$datetime .= ":".$_REQUEST['Time_Minute'];
 
+
 			$record['whn'] = $datetime;
 			$record['category'] = $_REQUEST['category'];
 			$id = @$_REQUEST['id'];
@@ -52,11 +53,11 @@
 				$DB->AutoExecute($eventtable, $record, 'UPDATE', "id=".$id);
 			} else {
 				$DB->AutoExecute($eventtable, $record, 'INSERT');
-			} 
+			}
 
 			unset($action);
 			break;
-    } 
+    }
 }
 
 if (isset($session->groups[$permission]) && isset($action)) {
@@ -64,10 +65,10 @@
 		case "create":
 			$event = array("id" => "*");
 			$body = $smarty->fetch("event_edit.tpl");
-			break; 
+			break;
 		case "edit":
 			if (isset($eventcat) && isset($eventid)) {
-				$event = $DB->GetRow("SELECT * FROM $eventtable WHERE id=?", array($eventid)); 
+				$event = $DB->GetRow("SELECT * FROM $eventtable WHERE id=?", array($eventid));
 
 				//make tastier breadcrumbs
 				$pathlist[$events_index + 1] = $event['name'];
@@ -78,7 +79,7 @@
 			break;
 	}
 } else {
-	// not logged in, or no special action required 
+	// not logged in, or no special action required
 	if (isset($eventcat) && isset($eventid)) {
 		$event = $DB->GetRow("SELECT * FROM $eventtable WHERE id=?", array($eventid));
 
@@ -88,7 +89,7 @@
 		$smarty->assign("event", $event);
 		$body = $smarty->fetch("event.tpl");
 	} else {
-		$events = $DB->GetAll("SELECT *,date_part('epoch', whn) as whn_timestamp 
+		$events = $DB->GetAll("SELECT *,date_part('epoch', whn) as whn_timestamp
 					FROM $eventtable WHERE date_trunc('day', whn) >= date_trunc('day',NOW()) ORDER BY whn ASC");
 		$oldevents = $DB->GetAll("SELECT *,date_part('epoch', whn) as whn_timestamp 
 					FROM $eventtable WHERE date_trunc('day', whn) < date_trunc('day', NOW()) ORDER BY whn DESC LIMIT 3");
@@ -96,11 +97,11 @@
 		$smarty->assign("oldevents", $oldevents);
 		$body = $smarty->fetch("events.tpl");
 	}
-} 
+}
 
 $smarty->assign("body", $body);
 $smarty->assign("title", "Events");
-$smarty->assign("secondary", file_get_contents("../static/fragments/Events-secondary.txt"));
+//$smarty->assign("secondary", file_get_contents("../static/fragments/Events.txt"));
 
 
 ?>

Modified: branches/imranh/components/planet.php
===================================================================
--- branches/imranh/components/planet.php	2014-12-01 09:52:18 UTC (rev 614)
+++ branches/imranh/components/planet.php	2014-12-01 10:30:41 UTC (rev 615)
@@ -4,7 +4,7 @@
 $smarty->assign("rss_url", "http://planet.sucs.org/rss20.xml");
 $smarty->assign("atom_url", "http://planet.sucs.org/atom.xml");
 // Read planet output from where (we hope) Planet wrote it
-$body = file_get_contents($base."static/Community/Planet.txt");
+$body = file_get_contents("/home/member/imranh/public_html/sucs-site/static/Community/Planet.txt");
 $smarty->assign("body", $body);
 
 ?>

Modified: branches/imranh/htdocs/index.php
===================================================================
--- branches/imranh/htdocs/index.php	2014-12-01 09:52:18 UTC (rev 614)
+++ branches/imranh/htdocs/index.php	2014-12-01 10:30:41 UTC (rev 615)
@@ -28,9 +28,9 @@
 
 
 // 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;
+define('SMARTY_DIR', '/usr/share/php/smarty3/');
+require("/home/member/imranh/public_html/sucs-site/libs/SmartyBC.class.php");
+$smarty = new SmartyBC;
 $smarty->template_dir = $base."templates";
 $smarty->compile_dir = $base."templates_c";
 $smarty->plugins_dir[] = $base."plugins";
@@ -126,7 +126,6 @@
 } else {
 	$smarty->assign("component", $pagemap[0]['component']);
 	$component = $pagemap[0];
-	
 }
 
 if ($path == "") $path="/";

Modified: branches/imranh/lib/blog/blog.lib.php
===================================================================
--- branches/imranh/lib/blog/blog.lib.php	2014-12-01 09:52:18 UTC (rev 614)
+++ branches/imranh/lib/blog/blog.lib.php	2014-12-01 10:30:41 UTC (rev 615)
@@ -1,4 +1,7 @@
 <?php
+
+ini_set('session.save_path',realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '~/session'));
+
 /* vim: set tabstop=4: */
 /*
  * blogs class - provides functions for blogs
@@ -10,7 +13,7 @@
 // Initialise the database
 require_once("/usr/share/php/adodb/adodb.inc.php");
 $BlogDB = NewADOConnection('postgres8');
-$BlogDB->Connect('dbname=blogs user=apache');
+$BlogDB->Connect('dbname=blogs user=imranh');
 $BlogDB->SetFetchMode(ADODB_FETCH_ASSOC);
 
 // Some useful validation functions

Modified: branches/imranh/lib/page-feedback.php
===================================================================
--- branches/imranh/lib/page-feedback.php	2014-12-01 09:52:18 UTC (rev 614)
+++ branches/imranh/lib/page-feedback.php	2014-12-01 10:30:41 UTC (rev 615)
@@ -2,12 +2,12 @@
 /* mechanism for members to give us feedback about web pages */
 
 // where do website feedback mails go?
-$contact = "chckens at sucs.org";
+$contact = "imranh at sucs.org";
 
 if ($session->loggedin) {
-	if ($_REQUEST['action'] == "feedback") {
-		$feedback = $_REQUEST['feedback'];
-		
+	if ($_REQUEST["action"] == "feedback") {
+		$feedback = $_REQUEST["feedback"];
+
 		$msgbody = "{$session->username} had this to say about the page {$_SERVER['REQUEST_URI']}:\r\n\r\n";
 		$msgbody .= "\"{$feedback}\"\r\n";
 

Modified: branches/imranh/templates/event.tpl
===================================================================
--- branches/imranh/templates/event.tpl	2014-12-01 09:52:18 UTC (rev 614)
+++ branches/imranh/templates/event.tpl	2014-12-01 10:30:41 UTC (rev 615)
@@ -1,4 +1,26 @@
-<h1>{$event.name}</h1>
+{if $editable}
+	<div style="float: right">
+	<a href="{$baseurl}/Community/Events/{$event.category}_{$event.id}?action=edit">(Edit)</a>
+	</div>
+{/if}
+        
+<div>
+	<h2 style="text-align:left;display:inline">What?</h2> 
+	<h1 style="text-align:right;display:inline">{$event.name}</h1>
+</div>
+<br>
+<div>
+	<h2 style="text-align:left;display:inline">Where?</h2>
+	<h1 style="text-align:right;display:inline">{$event.location}</h1>
+</div>
+<br>
+<div>
+	<h2 style="text-align:left;display:inline">When?</h2>
+	<h1 style="text-align:right;display:inline">{$event.whn|date_format:"l \t\h\e jS \o\f F Y \a\t h:i:s A"}{if $event.show_time},{$event.whn_timestamp|date_format:"%H:%M"}{/if}</h1>
+</div>
+
+<h1>Why?</h1>
+
+<p1>
 {$event.description}
-{$event.location}
-{$event.whn}
+</p1>
\ No newline at end of file

Modified: branches/imranh/templates/event_edit.tpl
===================================================================
--- branches/imranh/templates/event_edit.tpl	2014-12-01 09:52:18 UTC (rev 614)
+++ branches/imranh/templates/event_edit.tpl	2014-12-01 10:30:41 UTC (rev 615)
@@ -6,8 +6,8 @@
 	<span class="textinput"><input type="text" name="name" {if $event.name}value="{$event.name}"{/if} /></span>
 </div>
 <div class="row">
-	<label>Date</label> 
-	<span class="textinput">{html_select_date}</span>
+	<label>Date</label>
+	<span class="textinput">{html_select_date end_year='+2' }</span>
 </div>
 <div class="row">
 	<label>Time</label>
@@ -33,4 +33,4 @@
 <input type="submit" value="Save" />
 </div>
 
-</form>
+</form>
\ No newline at end of file

Modified: branches/imranh/templates/events.tpl
===================================================================
--- branches/imranh/templates/events.tpl	2014-12-01 09:52:18 UTC (rev 614)
+++ branches/imranh/templates/events.tpl	2014-12-01 10:30:41 UTC (rev 615)
@@ -1,22 +1,34 @@
+{include file="../static/fragments/Events.txt"}
+	<div class="box">
+		<div class="boxhead">
+			<h3>Got an idea?</h3>
+		</div>
+		<div class="boxcontent">
+			<p>Got an idea for a event you'd like to see hosted? Email {mailto address="exec at sucs.org" encode='javascript'}</p>
+		</div>
+		<div class="hollowfoot"><div><div></div></div></div>
+		</div>
+
 {if $editable}
 <a href="?action=create">Add Event</a>
 {/if}
+
 <div class="box">
 <div class="boxhead"><h2>Upcoming Events</h2></div>
 <div class="boxcontent">
 {if $events|@count < 1}
 <p>No events :(</p> 
-<p>Pester <tt>exec AT sucs.org</tt> to organise some!</p>
+<p>Pester {mailto address="exec at sucs.org" encode='javascript'} to organise some!</p>
+
 {else}
 {foreach from=$events item=event}
-<h3>{$event.name}
-{if $editable}<a href="{$baseurl}/Community/Events/{$event.category}_{$event.id}?action=edit">(Edit)</a>{/if} 
-</h3>
-<div>{$event.whn_timestamp|date:"l, jS F"}{if $event.show_time},{$event.whn_timestamp|date_format:"%H:%M"}{/if}</div>
-<div>at {$event.location}</div>
-<p>
-{$event.description}
-</p>
+<h2>
+	<a href="{$baseurl}/Community/Events/{$event.category}_{$event.id}">{$event.name}</a>
+</h2>
+<div><b>{$event.whn_timestamp|date_format:"l, jS F Y"}{if $event.show_time},{$event.whn_timestamp|date_format:"%H:%M"}{/if}</b></div>
+<div>at <b>{$event.location}</b></div>
+<div><p>{$event.description}</p></div>
+
 {/foreach}
 {/if}
 </div>
@@ -28,5 +40,5 @@
 <h2>Recent Events</h2>
 <p><small>You missed them. Too bad!</small></p>
 {foreach from=$oldevents item=event}
-<h4>{$event.name} - <small>{$event.whn_timestamp|date_format:"%A, %e %B"}</small></h4>
+<h4><a href="{$baseurl}/Community/Events/{$event.category}_{$event.id}">{$event.name}</a> - <small>{$event.whn_timestamp|date_format:"%A, %e %B"}</small></h4>
 {/foreach}

Modified: branches/imranh/templates/feedback.tpl
===================================================================
--- branches/imranh/templates/feedback.tpl	2014-12-01 09:52:18 UTC (rev 614)
+++ branches/imranh/templates/feedback.tpl	2014-12-01 10:30:41 UTC (rev 615)
@@ -6,11 +6,11 @@
 	<p>Your comments have been sent to the SUCS admin team</p>
 {else}
 	<h3>Something you think we should know?</h3>
-<form action="{$baseurl}{$path}" method="post">
+<form name="feedback" action="{$baseurl}{$path}" method="post">
 	<input type="hidden" name="action" value="feedback" />
 	<p>Spotted a mistake on this page? Have some useful info? Let us know below:</p>
 	<div>
-		<span class="textinput"><textarea id="pagefeedback" name="feedback" cols="25" rows="6"></textarea></span>
+		<span class="textinput"><textarea id="pagefeedback" name="feedback" cols="10" rows="6"></textarea></span>
 	</div>
 	<div>
 		<span class="textinput"><input type="submit" value="Feed back!" /></span>

Modified: branches/imranh/templates/foot.tpl
===================================================================
--- branches/imranh/templates/foot.tpl	2014-12-01 09:52:18 UTC (rev 614)
+++ branches/imranh/templates/foot.tpl	2014-12-01 10:30:41 UTC (rev 615)
@@ -6,6 +6,11 @@
 
 {include file="search.tpl"}
 
+{if $session->loggedin}
+	<div style="resize: both;">
+		{include file="feedback.tpl"}
+	</div>
+{/if}
 
 {* include file="valid.tpl" *}
 

Modified: branches/imranh/templates/uri.tpl
===================================================================
--- branches/imranh/templates/uri.tpl	2014-12-01 09:52:18 UTC (rev 614)
+++ branches/imranh/templates/uri.tpl	2014-12-01 10:30:41 UTC (rev 615)
@@ -1,11 +1,11 @@
 {php}
 $script = "<script type=\"text/javascript\">\n";
-$script .= "window.addEventListener('load', function(e) {\n";
+$script .= "window.addEventListener('load', function(e) { \n";
 $script .= "\tdocument.getElementById(\"uri\").focus();\n";
 $script .= "}, true);\n";
 $script .= "</script>";
 
-$this->append('extra_scripts', $script);
+//$this->append('extra_scripts', $script);
 {/php}
 
 {if $session->loggedin}




More information about the Devel mailing list