Enlightenment CVS committal
Author : dj2
Project : web
Module : www
Dir : web/www/p/news
Modified Files:
latestnews.php
Log Message:
- allow a marker to truncate front page news and add a more link. should
keep long posts from making the front page look bad
===================================================================
RCS file: /cvs/e/web/www/p/news/latestnews.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- latestnews.php 8 Nov 2007 06:47:44 -0000 1.5
+++ latestnews.php 9 Nov 2007 05:27:42 -0000 1.6
@@ -9,11 +9,22 @@
{
if (($new = $news->read_content($new)) !== NULL)
{
- echo "<p class='news-latest-title'><a
href='p.php?p=news/show&l=".$news->lang."&news_id=$new[id]'>".$new['title']."</a><br
/>";
+ $n = $new['content'];
+ $link = "p.php?p=news/show&l=" . $news->lang . "&news_id=$new[id]";
+
+ $pos = strpos($n, '<!-- cut -->');
+ if ($pos != FALSE)
+ {
+ $before = substr($n, 0, $pos);
+ $before .= "<div align='right' class='news-latest-date'><a
href='$link'>more »</div>";
+ }
+ else $before = $n;
+
+ echo "<p class='news-latest-title'><a href='$link'>" . $new['title'] .
"</a><br />";
echo "<em class='news-latest-date'>" . $new['date'] . "</em></p>";
- echo "<p class='news-latest-body'>".$new['content']."</p>\n";
+ echo "<p class='news-latest-body'>" . $before . "</p>\n";
}
}
-echo "<p align='right'><a href='p.php?p=news&l=".$news->lang."'
title='News'>more ... </a></p>";
+echo "<p align='right'><a href='p.php?p=news&l=" . $news->lang . "'
title='News'>Archives</a></p>";
?>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs