[SUCS Devel] site r642 - in branches/sucs-site: components lib templates

imranh at sucs.org imranh at sucs.org
Fri Jan 30 21:09:39 GMT 2015


Author: imranh
Date: 2015-01-30 21:09:38 +0000 (Fri, 30 Jan 2015)
New Revision: 642

Removed:
   branches/sucs-site/components/blogadmin.php
   branches/sucs-site/components/blogcomment.php
   branches/sucs-site/components/blogfeed.php
   branches/sucs-site/components/blogs.php
   branches/sucs-site/components/planet.php
   branches/sucs-site/components/planetconfig.php
   branches/sucs-site/components/planetposts.php
   branches/sucs-site/lib/blog/
   branches/sucs-site/templates/planetconfig.tpl
   branches/sucs-site/templates/planetposts.tpl
Modified:
   branches/sucs-site/components/front.php
   branches/sucs-site/components/members.php
   branches/sucs-site/components/options.php
   branches/sucs-site/templates/members.tpl
   branches/sucs-site/templates/options.tpl
Log:
Reverting 640 as it breaks the sucssite.

Deleted: branches/sucs-site/components/blogadmin.php
===================================================================
--- branches/sucs-site/components/blogadmin.php	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/components/blogadmin.php	2015-01-30 21:09:38 UTC (rev 642)
@@ -1,129 +0,0 @@
-<?php
-	//include our admin functions
-	include("../lib/blog/admin.lib.php");
-	$admin = new admin();
-
-	//make our command list from the path
-	$request=$pathlist;
-array_shift($request);
-array_shift($request);
-array_shift($request);
-
-$smarty->assign("title", "Blog Admin");
-
-	if ($session->loggedin) $admin->menu(); else {
-		header("Location: {$admin->httpPath}");
-		exit;
-	}
-
-ob_start();
-		//alter the debuging state on request
-		if ($request[0] == "debug") {
-			$_SESSION[debug] = $request[1];
-		}
-		//if logged in
-		if($session->loggedin && blogger($session->username)) {
-				//call appropriate functions..
-				switch (array_shift($request)) {
-					case "newentry":
-						$admin->printEntryForm() ;
-						$smarty->assign("subselect", _("Write new entry"));
-						if ($admin->blog->editor) $smarty->assign("action", "edit");
-						break;
-					case "Settings":
-						if ($_REQUEST['submit'] == "Save Settings") {
-							$admin->updateSettings();
-						} else {
-							$admin->printSettingsForm() ;
-						}
-						$smarty->assign("subselect", _("Settings"));
-						break;
-					case "postentry":
-						$admin->postEntry() ;
-						break;
-					case "postupdate":
-						$admin->updateEntry(array_shift($request)) ;
-						break;
-					case "update":
-						$admin->updateForm(array_shift($request)) ;
-						$smarty->assign("subselect", _("Edit entries"));
-						if ($admin->blog->editor) $smarty->assign("action", "edit");
-						break;
-					case "showentries":
-						$admin->printEntries() ;
-						$smarty->assign("subselect", _("Edit entries"));
-						break;
-					case "deleteentry":
-						$admin->deleteEntry(array_shift($request)) ;
-						break;
-					case "confirmdeleteentries":
-						$admin->confirmDeleteEntries();
-						break;
-					case "deleteentries":
-						$admin->deleteEntries();
-						break;
-					case "moderatecomments":
-						$admin->printComments();
-						$admin->printAuthorisedUsers();
-						$comments=_("Comments");
-						$result = $BlogDB->GetOne("SELECT count(comments.id) from comments join entries on comments.post = entries.id where moderated = false and entries.user_id = ".$admin->id.";");
-						if($result){
-							$comments .= " (".$result[0].")";
-						}
-						$smarty->assign("subselect", $comments);
-						break;
-					case "updatecomments":
-						$admin->updateComments();
-						break;
-					case "deletecomments":
-						$admin->deleteComments(array_shift($request));
-						break;
-					case "updateauthusers":
-						$admin->updateAuthorisedUsers();
-						break;
-					default:
-						$admin->mainPage();
-				}
-		}
-		else {
-			//run appropriate functions
-			switch (array_shift($request)) {
-				case "signup":
-					$admin->addUserForm();
-					$smarty->assign("subselect", _("Start a Blog"));
-					break;
-				case "adduser":
-					$admin->addUser();
-					break;
-				//or offer login box
-				default:
-					$admin->addUserForm();
-					$smarty->assign("subselect", _("Start a Blog"));
-					break;
-			}
-		}
-
-	?>
-    <div id="bottompanel">
-	<p><? echo _("Validate"); ?> : <a href="http://validator.w3.org/check?uri=referer">XHTML</a> / <a href="http://jigsaw.w3.org/css-validator/check/referer/">CSS</a></p>
-    </div>
-<?php
-$page = ob_get_contents();
-ob_end_clean();
-
-$smarty->assign("body", $page);
-$smarty->assign("extra_styles", "/css/blog.css");
-
-
-	//if we are in debug mode display a bunch of stuff
-	if($_SESSION[debug]){
-		echo "<div class=\"debug\"><h2>"._("Debug Info")."</h2><pre>\n";
-		echo "**"._("Session")."**\n";
-		print_r($_SESSION);
-		echo "**"._("Request")."**\n";
-		print_r($_REQUEST);
-		echo "**"._("Class")."**\n";
-		print_r($admin);
-		echo "</pre></div>";
-	}
-?>

Deleted: branches/sucs-site/components/blogcomment.php
===================================================================
--- branches/sucs-site/components/blogcomment.php	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/components/blogcomment.php	2015-01-30 21:09:38 UTC (rev 642)
@@ -1,28 +0,0 @@
-<?php
-/*
- * Comment posting AJAX service
- */
-
-// don't output the site template
-$no_template = TRUE;
-
-// don't output anything before we've returned status
-ob_start();
-require_once("../lib/blog/blog.lib.php");
-
-$blogid = $_POST['blog'];
-$postid = $_POST['post'];
-$blog = new blogs($blogid);
-
-$ret = $blog->newComment($postid, FALSE);
-
-
-if($ret[0]) {
-	        echo "<split>OK";
-} else {
-	        echo "<split>ERROR<split>".$ret[1];
-}
-
-ob_end_flush();
-
-?>

Deleted: branches/sucs-site/components/blogfeed.php
===================================================================
--- branches/sucs-site/components/blogfeed.php	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/components/blogfeed.php	2015-01-30 21:09:38 UTC (rev 642)
@@ -1,157 +0,0 @@
-<?php
-/*
- * feed script - outputs an feed. Currently supports both RSS 2.0 and ATOM
- */
-
-// We're outputting raw XML, so want to turn the templating off
-$no_template = TRUE;
-
-//include the blog lib, and thus everything else we need
-include("../lib/blog/blog.lib.php");
-
-//setup our path and from that get the feed type and usernae
-$request = explode('/', substr($_SERVER['PATH_INFO'], 1));
-array_shift($request);
-array_shift($request);
-//default to rss (so old links and existing feed readers still work, would be nice to ditch this at some point)
-$feedtype = 'rss';
-if ($request[0] == 'rss' or $request[0] == 'atom'){
-	$feedtype = array_shift($request);
-}
-//grab the username
-$user = array('username'=> array_shift($request));
-//check the user is sane
-if(!safeuname($user['username'])){
-	error(1,"Invalid username");
-}
-//check the user exists
-$row = $BlogDB->GetRow("SELECT username, id, name, title, description FROM users WHERE username=? AND enabled=true;", array($user['username']));
-if(!$row){
-	error(1, "No such user");
-}
-else {
-	//fetch the users info from the db
-	$user = $row;
-	if(substr(dirname($_SERVER['SCRIPT_NAME']), -1)=="/"){
-		$user['link'] = "http://".$_SERVER['HTTP_HOST']."/blogs/".$user['username']."/";
-		$user['feed'] = "http://".$_SERVER['HTTP_HOST']."/blog/feed/".$feedtype."/".$user['username']."";
-	}
-	else {
-		$user['link'] = "http://".$_SERVER['HTTP_HOST']."/blogs/".$user['username']."/";
-		$user['feed'] = "http://".$_SERVER['HTTP_HOST']."/blog/feed/".$feedtype."/".$user['username']."";
-	}
-}
-
-$query = "SELECT subject, body, timestamp, shortsubject FROM entries WHERE user_id=?";
-$params = array( $user['id'] );
-//check to see if we are only interested in one category
-switch(array_shift($request)){
-	case "category":
-		$query .= " AND category=?";
-		$params[] = (int)array_shift($request);
-		break;
-}
-$query .= " ORDER BY timestamp DESC LIMIT 15;";
-
-//grab the first 15 entires
-$result = $BlogDB->GetAll($query, $params);
-
-//if we have relivent entrys fetch them
-if (count($result) > 0) {
-	$row = array_shift($result);
-	//set the publish dates in the required format
-	if($feedtype=='rss') {
-		$pubdate = date("r",strtotime($row['timestamp']));
-	}
-	if($feedtype=='atom') {
-		//this should be a date type c when we are on php5, untill then, this nasty hack should work.
-		$pubdate = preg_replace('/ /', 'T', $row['timestamp']).":00";
-	}
-	$entries = "";
-	//output this entry
-	if ($feedtype=='rss') {
-		do {
-			$entrydate = date("r",strtotime($row['timestamp']));
-			$entries .= "\t\t<item>\n";
-			$entries .= "\t\t\t<guid>".$user['link']."entry/".$row['shortsubject']."</guid>\n";
-			$entries .= "\t\t\t<title>" . $row['subject'] . "</title>\n";
-			$entries .= "\t\t\t<description><![CDATA[" . substr(strip_tags($row['body']),0,150) . " [...]]]></description>\n";
-			$entries .= "\t\t\t<link>".$user['link']."entry/".$row['shortsubject']."</link>\n";
-			$entries .= "\t\t\t<pubDate>" . $entrydate . "</pubDate>\n";
-			$entries .= "\t\t\t<dc:creator>".$user['name']."</dc:creator>\n";
-			$entries .= "\t\t\t<content:encoded><![CDATA[" . str_replace("'", "’", $row['body']) . "]]></content:encoded>\n";
-			$entries .= "\t\t</item>\n";
-			//and ever other 
-		} while ($row = array_shift($result));
-	}
-	if($feedtype=='atom') {
-		do {
-			$entrydate = preg_replace('/ /', 'T', $row['timestamp']).":00";
-			$entries .= "\t<entry>\n";
-			$entries .= "\t\t<title>".htmlentities($row['subject'])."</title>\n";
-			$entries .= "\t\t<link rel=\"alternate\" type=\"text/html\" href=\"".$user['link']."entry/".$row['shortsubject']."\"/>\n";
-			$entries .= "\t\t<id>".$user['link']."entry/".$row['shortsubject']."</id>\n";
-			$entries .= "\t\t<updated>".$entrydate."</updated>\n";
-			$entries .= "\t\t<content type=\"xhtml\" xml:lang=\"en\" xml:base=\"".$user['link']."entry/"."\">\n";
-			$entries .= "\t\t<div xmlns=\"http://www.w3.org/1999/xhtml\">\n";
-			//just passing though the raw body will cause the feed to fail if the code isnt valid, perhaps we should chuck everything though tidy on its way in (or even out) once we're on php5
-			$config = array('output-xhtml' => true, 'show-body-only' => true, 'wrap' => false);
-			$tidy = new tidy;
-			$tidy->parseString($row['body'], $config, 'utf8');
-			$tidy->cleanRepair();
-			$entries .= $tidy;
-			$entries .= "\t\t</div>\n";
-			$entries .= "\t\t</content>\n";
-			$entries .= "\t</entry>\n";
-		} while ($row = array_shift($result));
-	}
-}
-
-if($feedtype=='rss') {
-	//tell the client its xml and utf8 encoded (which it should be)
-	header("Content-type: application/rss+xml; charset=utf-8");
-	echo "<?xml version=\"1.0\" ?>\n";
-?>
-<rss version="2.0" 
-	xmlns:content="http://purl.org/rss/1.0/modules/content/"
-	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
-	xmlns:dc="http://purl.org/dc/elements/1.1/"
->
-	<channel>
-		<title><?php print $user['title']?></title>
-		<description><?php print $user['description']?></description>
-		<link><?php print $user['link']?></link>
-		<pubDate><?php echo $pubdate; ?></pubDate>
-		<generator>SUCS Blogs - http://sucs.org/blogs/</generator>
-		<language>en</language>
-		<?php 
-		// add our entrys here
-		echo $entries; ?>
-	</channel>
-</rss>
-<?
-}
-if($feedtype=='atom') {
-	//tell the client its xml and utf8 encoded (which it should be)
-	header("Content-type: application/atom+xml; charset=utf-8");
-	echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
-	?>
-	<feed xmlns="http://www.w3.org/2005/Atom">
-		<title type="text"><?php print $user['title']?></title>
-		<subtitle type="text"><?php print $user['description']?></subtitle>
-		<updated><?php print $pubdate;?></updated>
-		<id><?php print $user['link']?></id>
-		<link rel="alternate" type="text/html" hreflang="en" href="<?php print $user['link']?>"/>
-		<link rel="self" type="application/atom+xml" href="<?php print $user['feed']?>"/>
-		<rights>Copyright (c) <? echo date("Y",strtotime($row['timestamp'])).", ".$user['name'] ?></rights>
-		<author>
-			<name><? echo $user['name'] ?></name>
-		</author>
-		<generator uri="http://sucs.org/blogs/" version="1.0">SUCS Blogs</generator>
-<?
-		echo $entries; 
-?>
-	</feed>
-<?
-}
-?>

Deleted: branches/sucs-site/components/blogs.php
===================================================================
--- branches/sucs-site/components/blogs.php	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/components/blogs.php	2015-01-30 21:09:38 UTC (rev 642)
@@ -1,102 +0,0 @@
-<?php
-	//include our blog functions
-	require_once("../lib/blog/blog.lib.php");
-	//make our command list
-	$request=explode('/',substr($_SERVER['PATH_INFO'], 1));
-
-//bodge - fix this
-array_shift($request);
-
-	//if we have something which might be a username start a blogs instance
-	if ($request[0] != "" and $request[0] != "list"){
-		$blogsingle = new blogs(array_shift($request));
-	} 
-	//otherwise, or if there was no such user, start a bloglist instance
-	if (!isset($blogsingle) || !isset($blogsingle->id)) {
-		$bloglist = new bloglist();
-		$request = array("list");
-	}
-
-
-	$blog = isset($bloglist) ? $bloglist : $blogsingle;
-
-	if (isset($blog->userName)) {
-		if ($session->username==$blog->userName) $smarty->assign("subselect", _("My Blog"));
-		else $smarty->assign("subselect", $blog->userName._("'s Blog"));
-	}
-	
-	ob_start();
-
-$smarty->assign("title", $blog->title);
-$smarty->assign("extra_scripts", array("<script type=\"text/javascript\" src=\"$baseurl/js/xmlhttp.js\"></script>"));
-	//check we have a valid username before offering a RSS feed
-	if($blog->userName) {
-		$smarty->assign("rss_url", "http://{$_SERVER['HTTP_HOST']}{$blog->httpPath}feed/rss/{$blog->userName}".(($request[0]=="category") ? "/category/".(int)$request[1]:""));
-		$smarty->assign("atom_url", "http://{$_SERVER['HTTP_HOST']}{$blog->httpPath}feed/atom/{$blog->userName}".(($request[0]=="category") ? "/category/".(int)$request[1]:""));
-//		echo "    <link rel=\"alternate\" type=\"application/rss+xml\" title=\"{$blog->title}\" href=\"$rss_url\"/>\n";
-//		echo "    <link rel=\"alternate\" type=\"application/atom+xml\" title=\"{$blog->title}\" href=\"$atom_url\"/>\n";
-	}
-
-ob_start();
-    
-$blog->menu();
-
-		// if there was an error, print it here
-		if (isset($blogsingle) && !isset($blogsingle->id)) {
-			error_exc($blogsingle);
-		}
-	    	//run the appropriate command
-		switch (array_shift($request)) {
-			case "entry":
-				$blog->printEntryAndComments(array_shift($request));
-				break;
-			case "category":
-				$blog->printEntries(0,15,'and category = '.(int)array_shift($request)); 
-				break;
-			case "postcomment":
-				$blog->newComment((int)array_shift($request)) ; 
-				break;
-			case "Archive":
-				$blog->printArchive($request);
-				if ($session->username == $blog->userName) $smarty->assign("subselect", _("My Archive"));
-				else $smarty->assign("subselect", $blog->userName._("'s Archive"));
-				break;
-			case "list":
-				$blog->listBlogs();
-				break;
-			default:
-				$blog->printEntries(); 
-		}
-	     ?>
-    <div id="bottompanel">
-	<p><? echo _("Validate"); ?> : <a href="http://validator.w3.org/check?uri=referer">XHTML</a> / <a href="http://jigsaw.w3.org/css-validator/check/referer/">CSS</a> / 
-<?
-	if($blog->userName) {
-		echo "<a href=\"http://feedvalidator.org/check.cgi?url=$rss_url\">RSS</a> / <a href=\"http://feedvalidator.org/check.cgi?url=$atom_url\">ATOM</a>";
-	}
-	else {
-		echo "RSS / ATOM";
-	}
-?>
-	</p>
-    </div>
-<?php
-$page = ob_get_contents();
-ob_end_clean();
-
-$smarty->assign("body", $page);
-$smarty->assign("extra_styles", "/css/blog.css");
-
-	//display debuing info as required
-	if($_SESSION[debug]){
-		echo "<div class=\"debug\"><h2>"._("Debug Info")."</h2><pre>\n";
-		echo "**"._("Session")."**\n";
-		print_r($_SESSION);
-		echo "**"._("Request")."**\n";
-		print_r($_REQUEST);
-		echo "**"._("Class")."**\n";
-		print_r($blog);
-		echo "</pre></div>";
-	}
-
-?>

Modified: branches/sucs-site/components/front.php
===================================================================
--- branches/sucs-site/components/front.php	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/components/front.php	2015-01-30 21:09:38 UTC (rev 642)
@@ -14,8 +14,6 @@
 //$output .= $result;
 include('electionreminder.php');
 $output .= $result;
-include('planetposts.php');
-$output .= $result;
 
 }
 

Modified: branches/sucs-site/components/members.php
===================================================================
--- branches/sucs-site/components/members.php	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/components/members.php	2015-01-30 21:09:38 UTC (rev 642)
@@ -31,7 +31,7 @@
 		// Redirect if we have found a valid single user
 		if (count($usernames) == 1) {
 			$smarty->assign('who', $usernames[0]['uid']);
-			// Add banana widget to the sidebar 
+			// Add banana widget to the sidebar
 			$who = $usernames[0]['uid'];
 			include("../lib/banana-admin.php");
 			// Needs Redirection
@@ -53,41 +53,32 @@
 				if (file_exists( $usernames[0]['homedir'] . '/.plan')) {
 					$usernames[0]['plan'] = file_get_contents($usernames[0]['homedir'] . '/.plan');
 				}
-				// Website	
+				// Website
 				if ( file_exists( $usernames[0]['homedir'] . '/public_html')) {
 					$usernames[0]['website'] = true;
 				}
-				// Blog
-				require_once("/usr/share/php/adodb/adodb.inc.php");
-				$BlogDB = NewADOConnection('postgres8');
-				$BlogDB->Connect('dbname=blogs user=apache');
-				$BlogDB->SetFetchMode(ADODB_FETCH_ASSOC);
-				require_once('../lib/blog/validation.lib.php');
-				if (blogger($usernames[0]['uid'])) {
-					$usernames[0]['blog'] = $BlogDB->GetOne("select title from users where username='".$usernames[0]['uid']."'");
-				}
 				// Bananas stuff
 				$bananasql = "SELECT *, date_trunc('second', whn) FROM awards ";
 				$bananasql .= "WHERE username ~* ? ORDER BY WHN DESC";
 				$awards = $DB->GetAll($bananasql, array("^".$usernames[0]['uid']."$"));
-				
+
 				// arrange by academic year, calculate sums as we go
 				foreach ($awards as $award) {
 					$acyear = academicYear(strtotime($award['whn']));
 					$awards_by_year[$acyear]['awards'][] = $award;
-					$awards_by_year[$acyear]['sum'] += $award['score']; 
+					$awards_by_year[$acyear]['sum'] += $award['score'];
 					$bananasum += $award['score'];
-				} 
-				
-				$usernames[0]['awardsbyyear'] = &$awards_by_year; 
+				}
+
+				$usernames[0]['awardsbyyear'] = &$awards_by_year;
 				$usernames[0]['bananascore'] = $bananasum;
 			}
 		}
 		$smarty->assign('results', $usernames);
-	
+
 	} else {
 	// generate fun data to put on index page
-		
+
 		// top 5
 		$stats['top'] = $DB->GetAll("SELECT username, sum(score) as sum FROM awards GROUP BY username ORDER BY sum DESC LIMIT 5");
 

Modified: branches/sucs-site/components/options.php
===================================================================
--- branches/sucs-site/components/options.php	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/components/options.php	2015-01-30 21:09:38 UTC (rev 642)
@@ -180,34 +180,6 @@
 	return FALSE;
 }
 
-function changeBlogFeed($type, $feed, $syndicate) {
-	global $sucsDB, $session, $smarty;
-	if ($type == "sucs") {
-		$feed="http://sucs.org/blog/feed/atom/".$session->username;
-	}
-	
-	if ($syndicate=="on") {
-		$syndicate = "t";
-	} else {
-		$syndicate = "f";
-	}
-
-	// try to read up to 100KB of the provided feed uri
-	if (@file_get_contents($feed,FALSE,null,0,100000) == FALSE) {
-		trigger_error("Unable to read from provided blog feed URL", E_USER_WARNING);
-		return FALSE;
-	}
-
-	if ($sucsDB->Execute("UPDATE members SET blogfeed=?,syndicateblog=? WHERE username=?", 
-		array($feed, $syndicate, $session->username)) == FALSE) {
-		return FALSE;
-		}	
-
-
-	include("planetconfig.php"); 
-	return TRUE;
-}
-
 function updateRenew() {
 	global $sucsDB, $session, $error;
 	global $paydate;
@@ -283,13 +255,6 @@
 					message_flash('Hackergotchi Cleared');
 				}
 				break;
-			case 'changeblogfeed' :
-				if (changeBlogFeed($_POST['blogtype'], $_POST['bloguri'], $_POST['syndicateblog'])){
-					message_flash("Blog Feed Updated");
-				} else {
-					trigger_error("Blog Feed has not been updated", E_USER_NOTICE);
-				}
-				break;
 			case 'renew' :
 				if (updateRenew()) {
 					message_flash('Account renewed');
@@ -321,28 +286,6 @@
 
 $smarty->assign('member', $member);
 
-// connect to Blog DB to see if user has a SUCS blog	
-	require_once("/usr/share/php/adodb/adodb.inc.php");
-	$BlogDB = NewADOConnection('postgres8');
-	$BlogDB->Connect('dbname=blogs user=apache');
-	$BlogDB->SetFetchMode(ADODB_FETCH_ASSOC); 
-	require_once('../lib/blog/validation.lib.php');
-	if (blogger($session->username)) {
-		$smarty->assign("sucsblogger", TRUE);
-		$feed="http://sucs.org/blog/feed/atom/".$session->username;
-		if ($member['blogfeed'] == $feed) {
-			$smarty->assign("sucsblogfeed", TRUE);
-		}
-	}
-
-	// change postgresql boolean to PHP boolean
-	if ($member['syndicateblog'] == 't') {
-		$member['syndicateblog'] = true;
-	} else {
-		$member['syndicateblog'] = false;
-	}
-	$smarty->assign('member', $member);
-
 }
 
 $smarty->assign('url', $component['path']);

Deleted: branches/sucs-site/components/planet.php
===================================================================
--- branches/sucs-site/components/planet.php	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/components/planet.php	2015-01-30 21:09:38 UTC (rev 642)
@@ -1,10 +0,0 @@
-<?php
-
-$smarty->assign("title", "Planet SUCS");
-$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");
-$smarty->assign("body", $body);
-
-?>

Deleted: branches/sucs-site/components/planetconfig.php
===================================================================
--- branches/sucs-site/components/planetconfig.php	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/components/planetconfig.php	2015-01-30 21:09:38 UTC (rev 642)
@@ -1,38 +0,0 @@
-<?php
-// component to dynamically generate a configuration file for the Planet feed aggregator
-
-global $base;
-
-// where to put the generated config file?
-$outputfile = $base."lib/venus/sucs/generatedconfig.ini";
-
-// Where Planet should output its generated files to
-$planetoutputdir = $base."htdocs/planet";
-
-$sucsdbname = "sucs";
-$hackergotchipath = "/var/www/sucssite/htdocs/pictures/people/";
-
-// open connection to sucs database
-$sucsDB = NewADOConnection('postgres8');
-$sucsDB->Connect('dbname='.$sucsdbname.' user=apache');
-$sucsDB->SetFetchMode(ADODB_FETCH_ASSOC);
-
-// fetch blogroll
-$blogroll = $sucsDB->GetAll("SELECT username, blogfeed AS feeduri FROM members WHERE syndicateblog=TRUE");
-
-// figure out whether each user has a hackergotchi picture
-foreach($blogroll as &$blog) {
-	if (is_file($hackergotchipath.$blog['username'].".png")) {
-		$blog['hackergotchi'] = TRUE;
-	} else {
-		$blog['hackergotchi'] = FALSE;
-	}
-}
-
-$smarty->assign("blogroll", $blogroll);
-$smarty->assign("planetoutputdir", $planetoutputdir);
-$config = $smarty->fetch("planetconfig.tpl");
-file_put_contents($outputfile, $config);
-
-
-?>

Deleted: branches/sucs-site/components/planetposts.php
===================================================================
--- branches/sucs-site/components/planetposts.php	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/components/planetposts.php	2015-01-30 21:09:38 UTC (rev 642)
@@ -1,33 +0,0 @@
-<?php
-
-// number of recent planet entries we want to return
-$num_entries = 5;
-
-unset($result);
-$planetposts = array();
-
-$xmldata = @file_get_contents("../htdocs/planet/atom.xml");
-
-if (!$xmldata) {
-	trigger_error("No planet atom.xml data loaded", E_USER_WARNING);
-	return;
-} 
-
-$simplexml = simplexml_load_string($xmldata);
-$xml = $simplexml->children('http://www.w3.org/2005/Atom');
-
-foreach ($xml->entry as $entry) {
-	$planetposts[] = array(
-		"post" => $entry->title, 
-		"post_uri" => $entry->link->attributes()->href, 
-		"user" => $entry->author->name,
-		"user_uri" => $entry->author->uri
-		);
-}
-
-$planetposts = array_slice($planetposts, 0, $num_entries);
-
-$smarty->assign('planetposts', $planetposts);
-$result = $smarty->fetch('planetposts.tpl');
-
-?>

Modified: branches/sucs-site/templates/members.tpl
===================================================================
--- branches/sucs-site/templates/members.tpl	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/templates/members.tpl	2015-01-30 21:09:38 UTC (rev 642)
@@ -26,10 +26,6 @@
 	<dt>Website</dt>
 	<dd><a href="http://sucs.org/~{$member.uid|escape:'url'}/">http://sucs.org/~{$member.uid|escape:'url'}/</a></dd>
 {/if}
-{if isset($member.blog) }
-	<dt>Blog</dt>
-	<dd><a href="/Blogs/{$member.uid|escape:'url'}">{$member.blog}</a></dd>
-{/if}
 {if isset($member.project) }
 	<dt>Project</dt>
 	<dd id="project">{$member.project|escape:'htmlall'}</dd>

Modified: branches/sucs-site/templates/options.tpl
===================================================================
--- branches/sucs-site/templates/options.tpl	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/templates/options.tpl	2015-01-30 21:09:38 UTC (rev 642)
@@ -164,45 +164,7 @@
 {/if}
 	</fieldset>
 	</form>
-	<form method="post" action="{$baseurl}{$path}">
-	<input type="hidden" name="action" value="changeblogfeed" />
-	<fieldset>
-	<legend>Blog Feed</legend>
 
-{* if the member has a SUCS blog, offer this *}
-{if $sucsblogger}
-	<div class="row">
-	<label for="blogtype">My SUCS Blog:</label>
-	<span class="textinput">
-		<input type="radio" name="blogtype" value="sucs" {if $sucsblogfeed}checked="checked"{/if} />
-	</span>
-	</div>
-{/if}
-	<div class="row">
-		<label for="bloguri">RSS/Atom feed:</label>
-		<span class="textinput">
-		{if $sucsblogger} 
-			<input type="radio" name="blogtype" value="custom" {if not $sucsblogfeed}checked="checked"{/if} />
-		{/if}
-			<input type="text" name="bloguri" id="bloguri" style="width:90%;" {if $member.blogfeed}value="{$member.blogfeed}"{/if} />
-		</span>
-	</div>
-	<div class="row">
-		<label for="syndicateblog">Display on Planet SUCS:</label>
-		<span class="textinput">
-			<input type="checkbox" name="syndicateblog" id="syndicateblog" {if $member.syndicateblog}checked="checked"{/if} />
-			<div class="note">Tick this box if you wish to have your blog syndicated on <a href="http://sucs.org/Community/Planet">Planet SUCS</a>. We'd like to keep the Planet free of needlessly offensive/illegal/liable-to-melt-eyeballs material, and may decide to remove feeds which don't comply with this policy. Consider setting up a category and separate feed for posts you'd like to appear on Planet if you feel your blog may otherwise be unsuitable.
-			</div>
-		</span>
-	</div>
-	<div class="row">
-		<input type="submit" value="Change" />
-	</div>
-
-
-	</fieldset>
-	</form>
-
 {if ($member.type == 1 || $member.type == 2) && $member.paid != $paydate}
 	<form method="post" action="{$baseurl}{$path}">
 	<fieldset>

Deleted: branches/sucs-site/templates/planetconfig.tpl
===================================================================
--- branches/sucs-site/templates/planetconfig.tpl	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/templates/planetconfig.tpl	2015-01-30 21:09:38 UTC (rev 642)
@@ -1,67 +0,0 @@
-# Planet configuration file
-
-[Planet]
-name = Planet SUCS
-link = http://www.sucs.org/planet
-owner_name = SUCS Admin
-owner_email = admin at sucs.org
-
-# cache_directory: Where cached feeds are stored
-# new_feed_items: Number of items to take from new feeds
-# log_level: One of DEBUG, INFO, WARNING, ERROR or CRITICAL
-# feed_timeout: number of seconds to wait for any given feed
-cache_directory = cache
-new_feed_items = 2
-log_level = ERROR
-feed_timeout = 20
-
-# template_files: Space-separated list of output template files
-template_files = sucs/Planet.txt.tmpl sucs/atom.xml.tmpl sucs/rss20.xml.tmpl sucs/rss10.xml.tmpl sucs/opml.xml.tmpl sucs/foafroll.xml.tmpl
-
-output_dir = {$planetoutputdir}
-items_per_page = 50
-days_per_page = 0
-date_format = %b %d, %Y at %I:%M %p
-new_date_format = %B %d, %Y
-encoding = utf-8
-# locale = C
-
-# To define a different value for a particular template you may create
-# a section with the same name as the template file's filename (as given
-# in template_files).
-
-# If non-zero, all feeds which have not been updated in the indicated
-# number of days will be marked as inactive
-activity_threshold = 0
-
-# Options placed in the [DEFAULT] section provide defaults for the feed
-# sections.  Placing a default here means you only need to override the
-# special cases later.
-#[DEFAULT]
-# Hackergotchi default size.
-# If we want to put a face alongside a feed, and it's this size, we
-# can omit these variables.
-#facewidth = 65
-#faceheight = 85
-
-# Any other section defines a feed to subscribe to.  The section title
-# (in the []s) is the URI of the feed itself.  A section can also be
-# have any of the following options:
-# 
-# name: Name of the feed (defaults to the title found in the feed)
-
-
-#blogroll pulled from the database
-{foreach from=$blogroll item=blog}
-[{$blog.feeduri}]
-name = {$blog.username}
-{if $blog.hackergotchi}
-face = {$blog.username}.png
-{/if}
-
-{/foreach}
-
-#static entries 
-
-[http://sucs.org/blog/feed/atom/vote]
-name = Election 2009

Deleted: branches/sucs-site/templates/planetposts.tpl
===================================================================
--- branches/sucs-site/templates/planetposts.tpl	2015-01-30 20:59:55 UTC (rev 641)
+++ branches/sucs-site/templates/planetposts.tpl	2015-01-30 21:09:38 UTC (rev 642)
@@ -1,19 +0,0 @@
-{if count($planetposts) > 0 }
-<div class="cbb">
-
-<h3><a href="/planet/">Recent Blog entries</a></h3>
-
-<table width="100%" class="border">
-<tr>
-<th>Subject</th>
-<th>by</th>
-</tr>
-{foreach name=planetposts from=$planetposts item=post}
-<tr>
-	<td><a href="{$post.post_uri}">{$post.post}</a></td>
-	<td><a href="{$post.user_uri}">{$post.user}</a></td>
-</tr>
-{/foreach}
-</table>
-</div>
-{/if}




More information about the Devel mailing list