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 @@
+
+
+
+
 <?php
 /*
  * This file is part of FEED ON FEEDS - http://feedonfeeds.com/
@@ -11,8 +15,33 @@
  * Distributed under the GPL - see LICENSE
  *
  */
-
 include_once("init.php");
+
+
+function GetCategoryList($category_id) 
+{
+
+    global $FOF_CATEGORY_TABLE;
+    
+    print "\n<select name=\"rss_category_id\">\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 "<option value=\"" . $row['Category_ID'] . "\" $selected >" . $row['Category'] . "</option>\n";
+    }
+    
+    print "</select>\n";
+}
+
+
+
+
 header("Content-Type: text/html; charset=utf-8");
  
 ?>
@@ -27,12 +56,18 @@
 
 <body id="panel-page">
 
+
 <?php readfile("panel-menu.html"); ?>
 <br>
 <?php
 
 $url = $_POST['rss_url'];
 if(!$url) $url = $_GET['rss_url'];
+
+$category_id = $_POST['rss_category_id'];
+if(!$category_id) $category_id = $_GET['rss_category_id'];
+if(!$category_id) $category_id = $FOF_CATEGORY_DEFAULT;
+
 $opml = $_POST['opml_url'];
 $file = $_POST['opml_file'];
 ?>
@@ -43,7 +78,8 @@
 <form method="post" action="add.php" enctype="multipart/form-data">
 <input type="hidden" name="MAX_FILE_SIZE" value="100000">
 
-RSS or weblog URL: <input type="text" name="rss_url" size="40" value="<?php echo $url ?>"><input type="Submit" value="Add a feed"><br><br>
+RSS or weblog URL: <input type="text" name="rss_url" size="40" value="<?php echo $url ?>"><? GetCategorylist($category_id); ?>
+<input type="Submit" value="Add a feed"><br><br>
 </form>
 
 <form method="post" action="add.php" enctype="multipart/form-data">
@@ -59,7 +95,7 @@
 </form>
 
 <?php
-if($url) fof_add_feed($url);
+if($url && $category_id) fof_add_feed($url,$category_id);
 
 if($opml)
 {
diff -ru feedonfeeds-0.1.9/CHANGELOG feedonfeeds-0.1.9.1/CHANGELOG
--- feedonfeeds-0.1.9/CHANGELOG	2004-12-17 03:42:49.000000000 +0100
+++ feedonfeeds-0.1.9.1/CHANGELOG	2005-06-15 23:28:37.000000000 +0200
@@ -1,3 +1,8 @@
+0.1.9.1
+Add Features by Bruno Adele <bruno.adele@jesuislibre.org> - 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 @@
+
 <?php
 /*
  * This file is part of FEED ON FEEDS - http://feedonfeeds.com/
@@ -11,8 +12,32 @@
  * Distributed under the GPL - see LICENSE
  *
  */
- 
 include_once("../init.php");
+
+function GetCategoryList($category_id) 
+{
+
+    global $FOF_CATEGORY_TABLE;
+    
+    print "\n<select name=\"rss_category_id\">\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 "<option value=\"" . $row['Category_ID'] . "\" $selected >" . $row['Category'] . "</option>\n";
+    }
+    
+    print "</select>\n";
+}
+
+
+
+ 
 header("Content-Type: text/html; charset=utf-8");
 
 ?>
@@ -30,6 +55,11 @@
 <?php
 $url = $_POST['rss_url'];
 if(!$url) $url = $_GET['rss_url'];
+
+$category_id = $_POST['rss_category_id'];
+if(!$category_id) $category_id = $_GET['rss_category_id'];
+if(!$category_id) $category_id = $FOF_CATEGORY_DEFAULT;
+
 $opml = $_POST['opml_url'];
 $file = $_POST['opml_file'];
 ?>
@@ -38,7 +68,8 @@
 <form method="post" action="add.php" enctype="multipart/form-data">
 <input type="hidden" name="MAX_FILE_SIZE" value="100000">
 
-RSS or weblog URL: <input type="text" name="rss_url" size="40" value="<?php echo $url ?>"><input type="Submit" value="Add a feed"><br><br>
+RSS or weblog URL: <input type="text" name="rss_url" size="40" value="<?php echo $url ?>"><? GetCategorylist($category_id); ?>
+<input type="Submit" value="Add a feed"><br><br>
 </form>
 
 <form method="post" action="add.php" enctype="multipart/form-data">
@@ -54,7 +85,7 @@
 </form>
 
 <?php
-if($url) fof_add_feed($url);
+if($url && $category_id) fof_add_feed($url,$category_id);
 
 if($opml)
 {
@@ -92,7 +123,7 @@
 ?>
 <BR>
 
-<a href="view.php">Return to new items.</a>
+<?php readfile("panel-menu.html"); ?>
 
 </body>
 </html>
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 "<td><nobr><a title=\"$title[$col]\"target=\"_self\" href=\"feeds.php?order=$col";
 
@@ -120,6 +121,7 @@
 	$items = $row['items'];
 	$agestr = $row['agestr'];
 	$agestrabbr = $row['agestrabbr'];
+        $category_id = $row['category_id'];
 
 	if(++$t % 2)
 	{
@@ -147,6 +149,15 @@
 	print "</td>";
 
 
+if ($memcategory_id!=$category_id) {
+            print  "<td>&nbsp;&nbsp;" . fof_render_category_link($row,true) . "</td>";
+            $memcategory_id=$category_id;
+        } else {
+            print  "<td>&nbsp;</td>";
+        }
+
+
+
 	print "<td><a href=\"$link\" title=\"home page\"><b>$title</b></a> <a href=\"$url\" title=\"feed URL\">(f)</a></td>";
 
 	print "<td><nobr><a href=\"update.php?feed=$id\" title=\"update\">u</a>";
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 '<div class="item">';
 	print '<div class="header">';
@@ -120,7 +122,7 @@
 
 
 
-	print "<h2><a href=\"$feed_link\" title=\"$feed_description\">$feed_title</a></h2>";
+	print "<h2><a href=\"$feed_link\" title=\"$feed_description\">$feed_title ( $category )</a></h2>";
 
 	print '<span class="meta">';
 
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 "<a href=\"$u&amp;what=all\">$items</a>)</td>";
 
 
+	if ($memcategory_id!=$category_id) {
+	    print  "<td>&nbsp;&nbsp;" . fof_render_category_link($row) . "</td>";
+	    $memcategory_id=$category_id;
+	} else {
+	    print  "<td>&nbsp;</td>";
+	}
 	print "<td>&nbsp;&nbsp;" . fof_render_feed_link($row) . "</td>";
 
 	print "<td>&nbsp;&nbsp;<a href=\"update.php?feed=$id\">update</a></td>";
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 = "<b><a href=\"view.php?category_id=$category_id\" title=\" view new  items from $category\">$category</a></b> ";
+	if ($small) {
+	    $s .= "<a href=\"view.php?category_id=$category_id&what=all&how=paged\" title=\" view all items from $category\">(a)</a>";
+	} else {    
+	    $s .= "<a href=\"view.php?category_id=$category_id&what=all&how=paged\" title=\" view all items from $category\">(all view)</a>";
+	}    
+	
+	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 "&nbsp;&nbsp;<font color=\"green\"><b>Subscribed.</b></font><br><br>";
             }
          }
@@ -492,12 +521,12 @@
    }
    else
    {
-      fof_actually_add_feed($url, $rss);
+		fof_actually_add_feed($url, $rss,$category_id);
       echo "<font color=\"green\"><b>Subscribed.</b></font><br>";
    }
 }
 
-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...<br>
 <?php
 
+
+$query = <<<EOQ
+CREATE TABLE `px_category` (
+  `Category_ID` int(11) NOT NULL auto_increment,
+  `Category` varchar(50) NOT NULL default '',
+  PRIMARY KEY  (`Category_ID`)
+) TYPE=MyISAM;
+EOQ;
+
+if(!fof_do_query($query, 1) && mysql_errno() != 1050)
+{
+        exit ("Can't create table.  MySQL says: <b>" . mysql_error() . "</b><br>" );
+}
+
+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 = <<<EOQ
 CREATE TABLE `$FOF_FEED_TABLE` (
   `id` int(11) NOT NULL auto_increment,
@@ -41,6 +67,7 @@
   `title` varchar(250) NOT NULL default '',
   `link` varchar(250) default NULL,
   `description` varchar(250) default NULL,
+  `category_ID` int(11) NOT NULL default '0',
   PRIMARY KEY  (`id`)
 ) TYPE=MyISAM;
 EOQ;
@@ -77,6 +104,12 @@
 Creating indexes...<br>
 
 <?php
+
+if(!fof_do_query("ALTER TABLE `$FOF_FEED_TABLE` ADD INDEX `category_ID` ( `category_ID` )", 1) && mysql_errno() != 1061)
+{
+	exit ("Can't create index.  MySQL says: <b>" . mysql_error() . "</b><br>" );
+}
+
 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: <b>" . mysql_error() . "</b><br>" );
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 = <<<EOQ
+DROP TABLE `$FOF_CATEGORY_TABLE`;
+EOQ;
+
+fof_do_query($query);
+
+
+$query = <<<EOQ
 DROP TABLE `$FOF_FEED_TABLE`;
 EOQ;
 
diff -ru feedonfeeds-0.1.9/view.php feedonfeeds-0.1.9.1/view.php
--- feedonfeeds-0.1.9/view.php	2004-12-16 10:57:00.000000000 +0100
+++ feedonfeeds-0.1.9.1/view.php	2005-06-14 08:24:59.000000000 +0200
@@ -67,7 +67,7 @@
 }
 
 
-$result = fof_get_items($_GET['feed'], $_GET['what'], $_GET['when'], $which, $_GET['howmany']);
+$result = fof_get_items($_GET['feed'], $_GET['what'], $_GET['when'], $which, $_GET['howmany'],"desc",$_GET['category_id']);
 
 foreach($result as $row)
 {
@@ -85,13 +85,15 @@
 	$dccreator = $row['dccreator'];
 	$dcdate = $row['dcdate'];
 	$dcsubject = $row['dcsubject'];
+	$category = $row['category'];
+	$category_id = $row['category_id'];
 
 
 	print '<div class="item">';
 	print '<div class="header">';
 
 	print "<a class=\"headline\" href=\"$item_link\">$item_title</a> ";
-	print "<a class=\"feed\" href=\"$feed_link\" title=\"$feed_description\">$feed_title</a>";
+	print "<a class=\"feed\" href=\"$feed_link\" title=\"$feed_description\">$feed_title ( $category )</a>";
 
 	print '<span class="meta">';
 

