FeedForAll Forum Index  
 Home  •  FAQ  •   Search   •  Register   •  Profile   •  Log in
 Help Passing Varitable Please View next topic
View previous topic
Post new topicReply to topic
Author Message
Gdog



Joined: 18 Mar 2010
Posts: 2

PostPosted: Sat Jun 05, 2010 10:04 am Reply with quoteBack to top

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
View user's profile
Gdog



Joined: 18 Mar 2010
Posts: 2

PostPosted: Sat Jun 05, 2010 1:58 pm Reply with quoteBack to top

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");
}




?>
View user's profile
Display posts from previous:      
Post new topicReply to topic


 Jump to:   



View next topic
View previous topic


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