FeedForAll Forum Index  
 Home  •  FAQ  •   Search   •  Register   •  Profile   •  Log in
Search found 2 matches
Author Message
Topic: Help Passing Varitable Please
Gdog

Replies: 1
Views: 14250

PostForum: RSSFilter (Creates a filtered RSS feed)   Posted: Sat Jun 05, 2010 1:58 pm   Subject: got it
Got it working. plan to use this to create sub pages for each item. With more control than the built in RSS2HTML Pro function .
=====================
<?PHP


// The URL of the feed.
$XMLfilename = "http://septicradio.libsyn.com/rss/RevJoseph";

$outputCacheTTL = 3600;
$useOutputCaching = 0;
//
// The function that decides if the current item will be used.
// return TRUE to use the itme, FALSE to not
if (!isset($_REQUEST["buildScript"])) {
Function rssFilter_useItem($currentItem) {
// the default fall through is to use the item

//$titlesss = $_GET["title"]; for production

$titlesss = "Money and Politics";

if ($currentItem->title == $titlesss) {
return TRUE;
}
return FALSE;
}
}

//
// Since we are calling rssFilter.php from here, we don't want
// to include a separate script file.
$FilterScriptFilename = "DO_NOT_INCLUDE_SCRIPT";
if (!isset($_REQUEST["buildScript"])) {
@include_once("rssFilter.php");
}




?>
Topic: Help Passing Varitable Please
Gdog

Replies: 1
Views: 14250

PostForum: RSSFilter (Creates a filtered RSS feed)   Posted: Sat Jun 05, 2010 10:04 am   Subject: Help Passing Varitable Please
Hi trying to use a variable for a parameter in the rssfilter script to no success.

This line works :
if ($currentItem->contains("~~~ItemTitle~~~","eco", 0))

This does not :
if ($currentItem->contains("~~~ItemTitle~~~",$titlesss, 0))
Full Code
+++++++
<?PHP
$titlesss = "eco";

// The URL of the feed.
$XMLfilename = "http://septicradio.libsyn.com/rss/RevJoseph";

$outputCacheTTL = 3600;
$useOutputCaching = 0;
//
// The function that decides if the current item will be used.
// return TRUE to use the itme, FALSE to not
if (!isset($_REQUEST["buildScript"])) {
Function rssFilter_useItem($currentItem) {
// the default fall through is to use the item
if ($currentItem->contains("~~~ItemTitle~~~","eco", 0)) {
return TRUE;
}
return FALSE;
}
}

//
// Since we are calling rssFilter.php from here, we don't want
// to include a separate script file.
$FilterScriptFilename = "DO_NOT_INCLUDE_SCRIPT";
if (!isset($_REQUEST["buildScript"])) {
@include_once("rssFilter.php");
}




?>

+++++++++
Thanks for any help

Gene
 

 Jump to:   


Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme