diff -ru feedonfeeds-0.1.9/add.php feedonfeeds-0.1.9.1/add.php --- feedonfeeds-0.1.9/add.php 2004-12-05 06:31:00.000000000 +0100 +++ feedonfeeds-0.1.9.1/add.php 2005-06-13 18:56:32.000000000 +0200 @@ -1,3 +1,7 @@ + + + + \n"; + + $result = fof_do_query("select * from $FOF_CATEGORY_TABLE "); + while($row = mysql_fetch_array($result)) + { + if ($row['Category_ID'] == $category_id) { + $selected="selected"; + } else { + $selected = ""; + } + print "\n"; + } + + print "\n"; +} + + + + header("Content-Type: text/html; charset=utf-8"); ?> @@ -27,12 +56,18 @@ +
@@ -43,7 +78,8 @@
-RSS or weblog URL:

+RSS or weblog URL: +

@@ -59,7 +95,7 @@
- http://www.jesuislibre.org + Add category for feed item + View all new item or all item from selected category + 0.1.9 Features: Updated to MagpieRSS 0.7.1 Seulement dans feedonfeeds-0.1.9.1: CHANGELOG.orig Seulement dans feedonfeeds-0.1.9.1: config.php.orig Seulement dans feedonfeeds-0.1.9.1: delete.php.orig diff -ru feedonfeeds-0.1.9/frames/add.php feedonfeeds-0.1.9.1/frames/add.php --- feedonfeeds-0.1.9/frames/add.php 2004-12-05 06:31:00.000000000 +0100 +++ feedonfeeds-0.1.9.1/frames/add.php 2005-06-13 19:29:22.000000000 +0200 @@ -1,3 +1,4 @@ + \n"; + + $result = fof_do_query("select * from $FOF_CATEGORY_TABLE "); + while($row = mysql_fetch_array($result)) + { + if ($row['Category_ID'] == $category_id) { + $selected="selected"; + } else { + $selected = ""; + } + print "\n"; + } + + print "\n"; +} + + + + header("Content-Type: text/html; charset=utf-8"); ?> @@ -30,6 +55,11 @@ @@ -38,7 +68,8 @@
-RSS or weblog URL:

+RSS or weblog URL: +

@@ -54,7 +85,7 @@

-Return to new items. + Seulement dans feedonfeeds-0.1.9.1/frames: add.php.orig diff -ru feedonfeeds-0.1.9/frames/feeds.php feedonfeeds-0.1.9.1/frames/feeds.php --- feedonfeeds-0.1.9/frames/feeds.php 2004-12-05 06:32:00.000000000 +0100 +++ feedonfeeds-0.1.9.1/frames/feeds.php 2005-06-13 08:47:27.000000000 +0200 @@ -39,7 +39,7 @@ if(!isset($order)) { - $order = "title"; + $order = "category"; } if(!isset($direction)) @@ -67,9 +67,10 @@ $title["age"] = "sort by last update time"; $title["unread"] = "sort by number of unread items"; +$title["category"] = "sort by feed category"; $title["title"] = "sort by feed title"; -foreach (array("age", "unread", "title") as $col) +foreach (array("age", "unread", "category","title") as $col) { echo ""; +if ($memcategory_id!=$category_id) { + print "  " . fof_render_category_link($row,true) . ""; + $memcategory_id=$category_id; + } else { + print " "; + } + + + print "$title (f)"; print "u"; diff -ru feedonfeeds-0.1.9/frames/view.php feedonfeeds-0.1.9.1/frames/view.php --- feedonfeeds-0.1.9/frames/view.php 2004-12-05 06:32:00.000000000 +0100 +++ feedonfeeds-0.1.9.1/frames/view.php 2005-06-14 08:38:21.000000000 +0200 @@ -89,7 +89,7 @@ } -$result = fof_get_items($_GET['feed'], $_GET['what'], $_GET['when'], $which, $_GET['howmany'], $order); +$result = fof_get_items($_GET['feed'], $_GET['what'], $_GET['when'], $which, $_GET['howmany'], $order,$_GET['category_id']); foreach($result as $row) { @@ -107,6 +107,8 @@ $dccreator = $row['dccreator']; $dcdate = $row['dcdate']; $dcsubject = $row['dcsubject']; + $category = $row['category']; + $category_id = $row['category_id']; print '
'; print '
'; @@ -120,7 +122,7 @@ - print "

$feed_title

"; + print "

$feed_title ( $category )

"; print ''; diff -ru feedonfeeds-0.1.9/index.php feedonfeeds-0.1.9.1/index.php --- feedonfeeds-0.1.9/index.php 2004-12-16 10:57:00.000000000 +0100 +++ feedonfeeds-0.1.9.1/index.php 2005-06-13 08:47:29.000000000 +0200 @@ -41,6 +41,7 @@ { $id = $row['id']; + $category_id = $row['category_id']; $url = $row['url']; $title = $row['title']; $link = $row['link']; @@ -76,6 +77,12 @@ print "$items)"; + if ($memcategory_id!=$category_id) { + print "  " . fof_render_category_link($row) . ""; + $memcategory_id=$category_id; + } else { + print " "; + } print "  " . fof_render_feed_link($row) . ""; print "  update"; Seulement dans feedonfeeds-0.1.9.1: index.php.orig diff -ru feedonfeeds-0.1.9/init.php feedonfeeds-0.1.9.1/init.php --- feedonfeeds-0.1.9/init.php 2004-12-16 11:07:00.000000000 +0100 +++ feedonfeeds-0.1.9.1/init.php 2005-06-14 08:35:04.000000000 +0200 @@ -34,14 +34,15 @@ $FOF_FEED_TABLE = FOF_FEED_TABLE; $FOF_ITEM_TABLE = FOF_ITEM_TABLE; - +$FOF_CATEGORY_TABLE = FOF_CATEGORY_TABLE; +$FOF_CATEGORY_DEFAULT = FOF_CATEGORY_DEFAULT; $fof_rss_cache = new RSSCache( MAGPIE_CACHE_DIR ); -function fof_get_feeds($order = 'title', $direction = 'asc') +function fof_get_feeds($order = 'category', $direction = 'asc') { - global $FOF_FEED_TABLE, $FOF_ITEM_TABLE; + global $FOF_FEED_TABLE, $FOF_ITEM_TABLE,$FOF_CATEGORY_TABLE; - $result = fof_do_query("select id, url, title, link, description from $FOF_FEED_TABLE order by title"); + $result = fof_do_query("select id, url, title, link, description,$FOF_FEED_TABLE.category_id,category from $FOF_FEED_TABLE inner join $FOF_CATEGORY_TABLE on $FOF_FEED_TABLE.category_id=$FOF_CATEGORY_TABLE.category_id order by category,title"); $i = 0; @@ -55,6 +56,8 @@ $feeds[$i]['title'] = $row['title']; $feeds[$i]['link'] = $row['link']; $feeds[$i]['description'] = $row['description']; + $feeds[$i]['category_id'] = $row['category_id']; + $feeds[$i]['category'] = $row['category']; $feeds[$i]['age'] = $age; @@ -175,10 +178,10 @@ return $title; } -function fof_get_items($feed=NULL, $what="new", $when=NULL, $start=NULL, $limit=NULL, $order="desc") +function fof_get_items($feed=NULL, $what="new", $when=NULL, $start=NULL, $limit=NULL, $order="desc",$category_id=NULL) { - global $FOF_FEED_TABLE, $FOF_ITEM_TABLE; - + global $FOF_FEED_TABLE, $FOF_ITEM_TABLE,$FOF_CATEGORY_TABLE; + if(!is_null($when) && $when != "") { if($when == "today") @@ -208,13 +211,18 @@ $limit_clause = " limit $start, $limit "; } - $query = "select $FOF_ITEM_TABLE.read as item_read, $FOF_FEED_TABLE.title as feed_title, $FOF_FEED_TABLE.link as feed_link, $FOF_FEED_TABLE.description as feed_description, $FOF_ITEM_TABLE.id as item_id, $FOF_ITEM_TABLE.link as item_link, $FOF_ITEM_TABLE.title as item_title, UNIX_TIMESTAMP($FOF_ITEM_TABLE.timestamp) as timestamp, $FOF_ITEM_TABLE.content as item_content, $FOF_ITEM_TABLE.dcdate as dcdate, $FOF_ITEM_TABLE.dccreator as dccreator, $FOF_ITEM_TABLE.dcsubject as dcsubject from $FOF_FEED_TABLE, $FOF_ITEM_TABLE where $FOF_ITEM_TABLE.feed_id=$FOF_FEED_TABLE.id"; + $query = "select $FOF_ITEM_TABLE.read as item_read, $FOF_FEED_TABLE.title as feed_title, $FOF_FEED_TABLE.link as feed_link, $FOF_FEED_TABLE.description as feed_description, $FOF_ITEM_TABLE.id as item_id, $FOF_ITEM_TABLE.link as item_link, $FOF_ITEM_TABLE.title as item_title, UNIX_TIMESTAMP($FOF_ITEM_TABLE.timestamp) as timestamp, $FOF_ITEM_TABLE.content as item_content, $FOF_ITEM_TABLE.dcdate as dcdate, $FOF_ITEM_TABLE.dccreator as dccreator, $FOF_ITEM_TABLE.dcsubject as dcsubject ,$FOF_FEED_TABLE.category_id as category_id ,$FOF_CATEGORY_TABLE.category as category from $FOF_FEED_TABLE, $FOF_ITEM_TABLE inner join $FOF_CATEGORY_TABLE on $FOF_FEED_TABLE.category_id=$FOF_CATEGORY_TABLE.category_id where $FOF_ITEM_TABLE.feed_id=$FOF_FEED_TABLE.id"; if(!is_null($feed) && $feed != "") { $query .= " and $FOF_FEED_TABLE.id = $feed"; } + if(!is_null($category_id) && $category_id != "") + { + $query .= " and $FOF_FEED_TABLE.category_id = $category_id"; + } + if(!is_null($when) && $when != "") { $query .= " and UNIX_TIMESTAMP($FOF_ITEM_TABLE.timestamp) > $begin and UNIX_TIMESTAMP($FOF_ITEM_TABLE.timestamp) < $end"; @@ -390,6 +398,24 @@ } } + +function fof_render_category_link($row,$small=false) +{ + $category_id = $row['category_id']; + $category = htmlspecialchars($row['category']); + + + $s = "$category "; + if ($small) { + $s .= "(a)"; + } else { + $s .= "(all view)"; + } + + return $s; +} + + function fof_render_feed_link($row) { $link = htmlspecialchars($row['link']); @@ -418,9 +444,12 @@ return $r; } -function fof_add_feed($url) +function fof_add_feed($url,$category_id) { - if(!$url) return; + global $FOF_CATEGORY_ID; + + if(!$url) return; + if(!$category_id) $category_id=$CATEGORY_ID; $url = trim($url); @@ -476,7 +505,7 @@ } else { - fof_actually_add_feed($l, $rss); + fof_actually_add_feed($l, $rss,$category_id); echo "  Subscribed.

"; } } @@ -492,12 +521,12 @@ } else { - fof_actually_add_feed($url, $rss); + fof_actually_add_feed($url, $rss,$category_id); echo "Subscribed.
"; } } -function fof_actually_add_feed($url, $rss) +function fof_actually_add_feed($url, $rss,$category_id) { global $FOF_FEED_TABLE, $FOF_ITEM_TABLE; @@ -505,7 +534,7 @@ $link = mysql_escape_string($rss->channel['link']); $description = mysql_escape_string($rss->channel['description']); - $sql = "insert into $FOF_FEED_TABLE (url,title,link,description) values ('$url','$title','$link','$description')"; + $sql = "insert into $FOF_FEED_TABLE (url,title,link,description,category_id) values ('$url','$title','$link','$description',$category_id)"; fof_do_query($sql); fof_update_feed($url, 0); @@ -771,4 +800,4 @@ return $tab ; } -?> \ Pas de fin de ligne à la fin du fichier. +?> Seulement dans feedonfeeds-0.1.9.1: init.php.orig diff -ru feedonfeeds-0.1.9/install.php feedonfeeds-0.1.9.1/install.php --- feedonfeeds-0.1.9/install.php 2004-12-15 10:34:00.000000000 +0100 +++ feedonfeeds-0.1.9.1/install.php 2005-06-15 23:24:03.000000000 +0200 @@ -34,6 +34,32 @@ Creating tables...
" . mysql_error() . "
" ); +} + +fof_do_query("INSERT INTO $FOF_CATEGORY_TABLE VALUES (1, '[ No define ]');"); +fof_do_query("INSERT INTO $FOF_CATEGORY_TABLE VALUES (2, 'News');"); +fof_do_query("INSERT INTO $FOF_CATEGORY_TABLE VALUES (3, 'Computer');"); +fof_do_query("INSERT INTO $FOF_CATEGORY_TABLE VALUES (4, 'Computer/Security');"); +fof_do_query("INSERT INTO $FOF_CATEGORY_TABLE VALUES (5, 'Computer/Linux');"); +fof_do_query("INSERT INTO $FOF_CATEGORY_TABLE VALUES (6, 'Internet');"); +fof_do_query("INSERT INTO $FOF_CATEGORY_TABLE VALUES (7, 'Music');"); +fof_do_query("INSERT INTO $FOF_CATEGORY_TABLE VALUES (8, 'Movie');"); +fof_do_query("INSERT INTO $FOF_CATEGORY_TABLE VALUES (9, 'Sport');"); +fof_do_query("INSERT INTO $FOF_CATEGORY_TABLE VALUES (10, 'Blog');"); +fof_do_query("INSERT INTO $FOF_CATEGORY_TABLE VALUES (11, 'Standard');"); + $query = << " . mysql_error() . "
" ); +} + if(!fof_do_query("ALTER TABLE `$FOF_ITEM_TABLE` ADD INDEX `feed_id_idx` ( `feed_id` )", 1) && mysql_errno() != 1061) { exit ("Can't create index. MySQL says: " . mysql_error() . "
" ); diff -ru feedonfeeds-0.1.9/uninstall.php feedonfeeds-0.1.9.1/uninstall.php --- feedonfeeds-0.1.9/uninstall.php 2004-12-05 06:32:00.000000000 +0100 +++ feedonfeeds-0.1.9.1/uninstall.php 2005-06-15 23:12:51.000000000 +0200 @@ -35,6 +35,13 @@ { $query = <<'; print '
'; print "$item_title "; - print "$feed_title"; + print "$feed_title ( $category )"; print '';