[Scummvm-cvs-logs] CVS: web index.php,1.25,1.26 styles.css,1.22,1.23

Max Horn fingolfin at users.sourceforge.net
Fri Oct 14 05:25:39 CEST 2005


Update of /cvsroot/scummvm/web
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20105

Modified Files:
	index.php styles.css 
Log Message:
Added 'author' field to news items; upgraded all 2005 news items accordingly (feel free to convert the remaining news items, if you like, based on 'cvs log' information :-)

Index: index.php
===================================================================
RCS file: /cvsroot/scummvm/web/index.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- index.php	5 Sep 2005 08:58:32 -0000	1.25
+++ index.php	14 Oct 2005 12:24:33 -0000	1.26
@@ -119,24 +119,62 @@
 {
 	$c++;
 	
-	// display news item
-	$arr = split("\.",$person);
+	// Load news item (it's in a pseudo XML format).
+	$file = $file_root."/news/".$item;
+	if (file_exists($file))
+	{ 
+		$fp = @fopen($file, "r");
+		$data = fread($fp, filesize($file));
+		@fclose($fp);
+
+		$news_date = "";
+		if (eregi("<DATE>(.*)</DATE>", $data, $out))
+		{
+			$news_date = $out[1];
+		}
+
+		$news_author = "";
+		if (eregi("<AUTHOR>(.*)</AUTHOR>", $data, $out))
+		{
+			$news_author = "Posted by ".$out[1];
+		}
+
+		$news_title = "";
+		if (eregi("<NAME>(.*)</NAME>", $data, $out))
+		{
+			$news_title = $out[1];
+		}
+
+		$news_img = "";
+		if (eregi("<IMG>(.*)</IMG>", $data, $out))
+		{
+			$news_img = $out[1];
+		}
+
+		$news_body = "";
+		if (eregi("<BODY>(.*)</BODY>", $data, $out))
+		{
+			$news_body = $out[1];
+		}
+	}
 	
+	// Display news item
 	echo html_frame_tr(
 			    html_frame_td(
 								'<div class="news-item">'.
 									'<div class="news-header">'.
-										'<span class="date">'.display_xml($file_root."/news/".$item,'DATE')."</span>: ".
-										display_xml($file_root."/news/".$item,'NAME').
+										'<span class="date">'.$news_date."</span>: ".
+										$news_title.
 									'</div>'.
-									display_xml($file_root."/news/".$item,'IMG').
-									'<div class="news-body">'.display_xml($file_root."/news/".$item,'BODY').'</div>'.
+									'<span class="news-author">'.$news_author."</span> ".
+									$news_img.
+									'<div class="news-body">'.$news_body.'</div>'.
 								'</div>'
 			                 )
 	                  );
 	
 	
-	// only show 5 records
+	// Only show first five records, unless we are in "news" mode
 	if ($c == 4 && !$shownews)
 	{
 		echo html_frame_tr(

Index: styles.css
===================================================================
RCS file: /cvsroot/scummvm/web/styles.css,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- styles.css	2 Sep 2004 19:23:23 -0000	1.22
+++ styles.css	14 Oct 2005 12:24:33 -0000	1.23
@@ -162,11 +162,20 @@
 	padding-bottom: 1px;
 }
 
-.news-item  .news-header .date	{
+.news-item .news-header .date	{
 	font-style: normal;
 	color: #666666;
 }
 
+.news-author {
+	float: right;
+	font-size: small;
+	font-style: italic;
+	color: #666;
+	text-indent: 2em;
+	position: relative;
+}
+
 .news-item .news-body	{
 	margin: 1em 40px 2em 40px;
 }





More information about the Scummvm-git-logs mailing list