From 860173d98ab8432e96e1f14a238a8fc3ff2d0cb7 Mon Sep 17 00:00:00 2001 From: steveminutillo Date: Fri, 17 Aug 2007 04:08:55 +0000 Subject: [PATCH] shared items can now be filtered by feed and or tag --- shared.php | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/shared.php b/shared.php index ad506a1..288614c 100644 --- a/shared.php +++ b/shared.php @@ -29,12 +29,40 @@ $name = $prefs->get("sharedname"); $url = $prefs->get("sharedurl"); $which = ($sharing == "all") ? "all" : "shared"; -$result = fof_get_items($user, NULL, $which, NULL, 0, 100); + +if(isset($_GET['which'])) +{ + $which = ($sharing == "all") ? $_GET['which'] : "shared " . $_GET['which']; + $extratitle = " items tagged " . $_GET['which']; +} + +$feed = NULL; +if(isset($_GET['feed'])) +{ + $feed = $_GET['feed']; + $r = fof_db_get_feed_by_id($feed); + $extratitle .= " from " . $r['feed_title'] . ""; +} + +$result = fof_get_items($user, $feed, $which, NULL, 0, 100); $shared_feed = htmlspecialchars("http://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?user=$user&format=atom"); $shared_link = htmlspecialchars("http://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?user=$user"); +if(isset($_GET['which'])) +{ + $shared_feed .= '&which=' . $_GET['which']; + $shared_link .= '&which=' . $_GET['which']; +} + +if(isset($_GET['feed'])) +{ + $shared_feed .= '&feed=' . $_GET['feed']; + $shared_link .= '&feed=' . $_GET['feed']; +} + + if($format == "atom") { header("Content-Type: application/atom+xml; charset=utf-8"); @@ -42,7 +70,7 @@ echo ''; ?> - Feed on Feeds - Shared Items<?php if($name) echo " from $name" ?> + Feed on Feeds - Shared Items<?php if($name) echo " from $name"; if($extratitle) echo " " . strip_tags($extratitle) ?> Feed on Feeds $name"; ?> @@ -104,7 +132,7 @@ header("Content-Type: text/html; charset=utf-8"); - Feed on Feeds - Shared Items<?php if($name) echo " from $name" ?> + Feed on Feeds - Shared Items<?php if($name) echo " from $name"; if($extratitle) echo " " . strip_tags($extratitle) ?>