From 51aefe4979bad8b0349fb2a96a8aa6bc95f233c7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 20 Jan 2006 07:39:29 +0000 Subject: [PATCH] rss svn path=/trunk/boinc/; revision=9270 --- checkin_notes | 12 ++++++++++++ doc/rss_main.php | 6 ++++-- html/inc/news.inc | 4 +++- html/user/all_news.php | 13 +++++++++++++ html/user/sample_rss_main.php | 8 +++++--- 5 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 html/user/all_news.php diff --git a/checkin_notes b/checkin_notes index 0200fe3562..baa0e4aafd 100755 --- a/checkin_notes +++ b/checkin_notes @@ -647,3 +647,15 @@ David 19 Jan 2006 sched_array.C sched_shmem.C,h show_shmem.C + +David 19 Jan 2006 + - RSS items should refer to a page that has all news items, + not just old ones + - Make news item indices permanent + + html/ + inc/ + news.inc + user/ + all_news.php (new) + sample_rss_main.php diff --git a/doc/rss_main.php b/doc/rss_main.php index 046e47e6fd..55fc69d6b6 100644 --- a/doc/rss_main.php +++ b/doc/rss_main.php @@ -51,14 +51,16 @@ echo " // - Create news items // -$news = min( count($project_news), $news); +$tot = count($project_news); +$news = min( $tot, $news); for( $item=0; $item < $news; $item++ ) { + $j = $tot - $item; if( count($project_news[$item]) == 2) { $d = strtotime($project_news[$item][0]); $d = strftime("%a, %d %b %Y", $d); echo " Project News ".strip_tags($project_news[$item][0])." - http://boinc.berkeley.edu/old_news.php#$item + http://boinc.berkeley.edu/all_news.php#$j $item ".strip_tags($project_news[$item][1])." $d diff --git a/html/inc/news.inc b/html/inc/news.inc index f9255f3c13..d8227c21cc 100644 --- a/html/inc/news.inc +++ b/html/inc/news.inc @@ -18,8 +18,10 @@ function show_news($items, $n) { } function show_old_news($items, $n) { + $tot = count($items); for ($i=$n; $i\n"; + $j = $tot-$i; + echo "\n"; news_item($items[$i][0], $items[$i][1]); } } diff --git a/html/user/all_news.php b/html/user/all_news.php new file mode 100644 index 0000000000..d9b4ae2734 --- /dev/null +++ b/html/user/all_news.php @@ -0,0 +1,13 @@ + diff --git a/html/user/sample_rss_main.php b/html/user/sample_rss_main.php index 70d67a6a68..6b7cfb9140 100644 --- a/html/user/sample_rss_main.php +++ b/html/user/sample_rss_main.php @@ -48,16 +48,18 @@ echo " "; -// - Create news items +// write news items // -$news = min( count($project_news), $news); +$tot = count($project_news); +$news = min( $tot, $news); for( $item=0; $item < $news; $item++ ) { + $j = $tot - $item; if( count($project_news[$item]) == 2) { $d = strtotime($project_news[$item][0]); $d = strftime("%a, %d %b %Y", $d); echo " Project News ".strip_tags($project_news[$item][0])." - ".URL_BASE."old_news.php#$item + ".URL_BASE."all_news.php#$j $item ".strip_tags($project_news[$item][1])." $d