PDA

View Full Version : RSS Ticker Help Initializing ticker....



delantian
10-12-2006, 09:20 PM
1) Script Title: Advanced RSS Ticker (Ajax invocation)


2) Script URL (on DD):http://www.dynamicdrive.com/dynamicindex17/rsstickerajax/index.htm

3) Describe problem: i am running windows server and using iis 6.0 and i have enables read write to the cache folder anyone have any idea why this wont load? its stuck on "Initializing ticker....."

ddadmin
10-12-2006, 11:13 PM
Do you have an online example of the problem? I gather the server that's hosting the php files of this script (ie: lastrss.php) are properly configured to run PHP scripts?

delantian
10-13-2006, 12:08 AM
example? here is the url http://www.noobage.com/test/demo.htm
i am running windows server and using iis, i installed it just like it says but it will not initialize. im not sure what ajax is, is that something that needs to be enabled on my server you think?

blm126
10-13-2006, 02:32 AM
The server appears to support PHP.

delantian
10-13-2006, 07:24 AM
so any idea whay its stuck on initializing ticker....? the server supports php i am using phpbb with no problem..

ddadmin
10-13-2006, 12:00 PM
Well the URL http://www.noobage.com/test/lastrss/bridge.php?id=CNN doesn't load, which tells me something is wrong at the first stage, which is bridge.php trying to retrieve your RSS file for "CNN." You need to find out why the URL just stalls.

delantian
10-13-2006, 01:59 PM
this is the demo file script that is exactly the same as the demo on the DD page where i got the script. i am using microsoft server with iis 6.0. my guess is that the problem is on the server end, is ajax something that needs to be intalled or enabled? or is it automatic when php refrences it? its the only thing i can think of.

blm126
10-13-2006, 05:26 PM
No, AJAX is client side. The problem lies in the PHP script. What version of PHP are you using? Are you in safe mode? To get this information create a file named info.php. Inside it put


<?php
phpinfo();
?>

Save this on your server somewhere and give us the link.

delantian
10-13-2006, 05:38 PM
http://www.noobage.com/phpinfo.php

djr33
10-13-2006, 06:07 PM
On first glance, php seems to be configured correctly. Not sure what's going on.

By the way, AJAX is a fancy name for using javascript to load pages/files in the background. You can use "AJAX" to load some outside html into a div, for example. It's pretty complex, and that's likely all you need to know for now. It's interesting, though.

delantian
10-13-2006, 06:30 PM
ok then its not ajax that was the only thing i could think of but if thats not an issue i dont know why it wont load. im guessing it an issue with the server. im using iis 6.0 windoes server. any ideas anyone?

ddadmin
10-13-2006, 06:59 PM
I have no idea how being on a Windows server affects or changes the way PHP is run. I don't think it would have any effect though.

This script relies on LastRSS to fetch the feeds. I think the problem is that your server cannot even run LastRSS (http://lastrss.webdot.cz/). Can you try to see if you can install LastRSS on its own and display some feeds (statically)? I believe that's where your problem lies.

delantian
10-14-2006, 02:09 PM
i think it is a problem with the server too, any idea how to fix? im using windows server iis 6.0. here the url to the bridge file. i dont know what it means. http://www.noobage.com/test/lastrss/bridge.php

delantian
10-14-2006, 02:20 PM
could it be that this version of php is not compatable? http://www.noobage.com/phpinfo.php

ddadmin
10-14-2006, 08:41 PM
Hi:
Well, getting an error message at http://www.noobage.com/test/lastrss/bridge.php (without the id parameter) is normal, as the script expects an ID parameter. Looking at your phpinfo.php page, everything looks to be in order. Usually one would look for "allow_url_fopen" being set to "on", which is the case here.

Are you sure your cache directory is set correctly, and chmodded to "777"? Inside scrollerbridge.php, the cache directory is set via the line:


$rss->cache_dir = 'cache'; //path to cache directory on your server relative to scrollerbridge.php. Chmod 777!

blm126
10-14-2006, 08:44 PM
You don't chmod on windows. Users always have all powers.

delantian
10-15-2006, 01:57 PM
here is the error

<b>Notice</b>: Undefined index: id in <b>c:\inetpub\wwwroot\test\lastrss\bridge.php</b> on line <b>32</b><br />
Error: Can't find requested RSS in list.

the lines are this.

32 $rssid=$_GET['id'];
33 $rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("Error: Can't find requested RSS in list.");

i have enabled write to the cache directory, i thkn the problme is on the server im using iis with this version of php. http://www.noobage.com/phpinfo.php could the php version be the problem? i dont want to upgrade php because my message board is not compatable with php5.0. is my theory about php version not possible? so i can rule it out.

blm126
10-15-2006, 03:18 PM
No, I don't think it is your PHP version. Try this.
Open bridge.php(with a plain text editor like notepad) and find this line


$rss->cache_dir = 'cache'; //path to cache directory on your server from this script. Chmod 777!

Replace it with


$rss->cache_dir = ''; //path to cache directory on your server from this script. Chmod 777!

This should help us find the problem

delantian
10-15-2006, 04:07 PM
--thanks to everyone for help thus far !!

i change the cache to "''" and still same error. it is not writing a file into the cache to be retrieved for some reason i think that you are on the right path in that it is not finding the cache directory to write to or not able to write to it for some reason. the line 32 where it is looking for the "id" (file that the rss feed is written) is not there. the php process of writing is not happenning. think it could be an issue with iss? i maybe need to enable an action that allows it to work. of course i use phpbb for message board and it has no problem writting on my server. hmmmmm cant figure this one out. ive been working on this problem for 4 days. any other ideas?

by the way in iis you cant chmod to 777 but i have enabled writing to this directory. is that the problem? anyone use iis?

blm126
10-15-2006, 06:24 PM
When you access bridge.php you have to supply the id. Like so.
http://www.noobage.com/test/lastrss/bridge.php?id=CNN
Is the file still updated with the modification I posted? If so that means the problem is not in the directory permissions, and probably is in the Parse function

delantian
10-15-2006, 07:01 PM
i did the mod changed 'cache' to '' when i follow the url you listed nothing loads. niether with the mod or without the mod this url doesnt work http://www.noobage.com/test/lastrss/bridge.php?id=CNN is it the bridge.php or the lastrss.php file that actually writes to the cache folder? i think that it is not doing it and i dont think it is a permission problem. i think that if the rss.xml file was being written then the bridge.php would load it but it is not there. dont know why i have intalled this exactly like it is instructed on my server it is the demo.htm and then the .js file then a folder called lastrss/ then the cache folder the bridge and lastrss files. i havent changed anything. then demo should work.

blm126
10-15-2006, 09:33 PM
No that doesn't mean the demo should work. There are so many things that could have possibly gone wrong. What we do know is that the cache isn't the problem. That leads me to believe that your server is either blocking the outgoing connections(which would be very odd), or you have changed something(other than what I said) on accident. Could you post the contents of lastRSS.php on your server

delantian
10-15-2006, 10:24 PM
btw the pausing rss script has same error i have not changed anything on either script. and i have deleted and reinstalled it and get same error. the files are exactly how they are from the download. here is lastrss.php

<?php
/*
======================================================================
lastRSS 0.9.1

Simple yet powerfull PHP class to parse RSS files.

by Vojtech Semecky, webmaster @ webdot . cz

Latest version, features, manual and examples:
http://lastrss.webdot.cz/

----------------------------------------------------------------------
LICENSE

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

To read the license please visit http://www.gnu.org/copyleft/gpl.html
======================================================================
*/

/**
* lastRSS
* Simple yet powerfull PHP class to parse RSS files.
*/
class lastRSS {
// -------------------------------------------------------------------
// Public properties
// -------------------------------------------------------------------
var $default_cp = 'UTF-8';
var $CDATA = 'nochange';
var $cp = '';
var $items_limit = 0;
var $stripHTML = False;
var $date_format = '';

// -------------------------------------------------------------------
// Private variables
// -------------------------------------------------------------------
var $channeltags = array ('title', 'link', 'description', 'language', 'copyright', 'managingEditor', 'webMaster', 'lastBuildDate', 'rating', 'docs');
var $itemtags = array('title', 'link', 'description', 'author', 'category', 'comments', 'enclosure', 'guid', 'pubDate', 'source');
var $imagetags = array('title', 'url', 'link', 'width', 'height');
var $textinputtags = array('title', 'description', 'name', 'link');

// -------------------------------------------------------------------
// Parse RSS file and returns associative array.
// -------------------------------------------------------------------
function Get ($rss_url) {
// If CACHE ENABLED
if ($this->cache_dir != '') {
$cache_file = $this->cache_dir . '/rsscache_' . md5($rss_url);
$timedif = @(time() - filemtime($cache_file));
if ($timedif < $this->cache_time) {
// cached file is fresh enough, return cached array
$result = unserialize(join('', file($cache_file)));
// set 'cached' to 1 only if cached file is correct
if ($result) $result['cached'] = 1;
} else {
// cached file is too old, create new
$result = $this->Parse($rss_url);
$serialized = serialize($result);
if ($f = @fopen($cache_file, 'w')) {
fwrite ($f, $serialized, strlen($serialized));
fclose($f);
}
if ($result) $result['cached'] = 0;
}
}
// If CACHE DISABLED >> load and parse the file directly
else {
$result = $this->Parse($rss_url);
if ($result) $result['cached'] = 0;
}
// return result
return $result;
}

// -------------------------------------------------------------------
// Modification of preg_match(); return trimed field with index 1
// from 'classic' preg_match() array output
// -------------------------------------------------------------------
function my_preg_match ($pattern, $subject) {
// start regullar expression
preg_match($pattern, $subject, $out);

// if there is some result... process it and return it
if(isset($out[1])) {
// Process CDATA (if present)
if ($this->CDATA == 'content') { // Get CDATA content (without CDATA tag)
$out[1] = strtr($out[1], array('<![CDATA['=>'', ']]>'=>''));
} elseif ($this->CDATA == 'strip') { // Strip CDATA
$out[1] = strtr($out[1], array('<![CDATA['=>'', ']]>'=>''));
}

// If code page is set convert character encoding to required
if ($this->cp != '')
//$out[1] = $this->MyConvertEncoding($this->rsscp, $this->cp, $out[1]);
$out[1] = iconv($this->rsscp, $this->cp.'//TRANSLIT', $out[1]);
// Return result
return trim($out[1]);
} else {
// if there is NO result, return empty string
return '';
}
}

// -------------------------------------------------------------------
// Replace HTML entities &something; by real characters
// -------------------------------------------------------------------
function unhtmlentities ($string) {
// Get HTML entities table
$trans_tbl = get_html_translation_table (HTML_ENTITIES, ENT_QUOTES);
// Flip keys<==>values
$trans_tbl = array_flip ($trans_tbl);
// Add support for &apos; entity (missing in HTML_ENTITIES)
$trans_tbl += array('&apos;' => "'");
// Replace entities by values
return strtr ($string, $trans_tbl);
}

// -------------------------------------------------------------------
// Parse() is private method used by Get() to load and parse RSS file.
// Don't use Parse() in your scripts - use Get($rss_file) instead.
// -------------------------------------------------------------------
function Parse ($rss_url) {
// Open and load RSS file
if ($f = @fopen($rss_url, 'r')) {
$rss_content = '';
while (!feof($f)) {
$rss_content .= fgets($f, 4096);
}
fclose($f);

// Parse document encoding
$result['encoding'] = $this->my_preg_match("'encoding=[\'\"](.*?)[\'\"]'si", $rss_content);
// if document codepage is specified, use it
if ($result['encoding'] != '')
{ $this->rsscp = $result['encoding']; } // This is used in my_preg_match()
// otherwise use the default codepage
else
{ $this->rsscp = $this->default_cp; } // This is used in my_preg_match()

// Parse CHANNEL info
preg_match("'<channel.*?>(.*?)</channel>'si", $rss_content, $out_channel);
foreach($this->channeltags as $channeltag)
{
$temp = $this->my_preg_match("'<$channeltag.*?>(.*?)</$channeltag>'si", $out_channel[1]);
if ($temp != '') $result[$channeltag] = $temp; // Set only if not empty
}
// If date_format is specified and lastBuildDate is valid
if ($this->date_format != '' && ($timestamp = strtotime($result['lastBuildDate'])) !==-1) {
// convert lastBuildDate to specified date format
$result['lastBuildDate'] = date($this->date_format, $timestamp);
}

// Parse TEXTINPUT info
preg_match("'<textinput(|[^>]*[^/])>(.*?)</textinput>'si", $rss_content, $out_textinfo);
// This a little strange regexp means:
// Look for tag <textinput> with or without any attributes, but skip truncated version <textinput /> (it's not beggining tag)
if (isset($out_textinfo[2])) {
foreach($this->textinputtags as $textinputtag) {
$temp = $this->my_preg_match("'<$textinputtag.*?>(.*?)</$textinputtag>'si", $out_textinfo[2]);
if ($temp != '') $result['textinput_'.$textinputtag] = $temp; // Set only if not empty
}
}
// Parse IMAGE info
preg_match("'<image.*?>(.*?)</image>'si", $rss_content, $out_imageinfo);
if (isset($out_imageinfo[1])) {
foreach($this->imagetags as $imagetag) {
$temp = $this->my_preg_match("'<$imagetag.*?>(.*?)</$imagetag>'si", $out_imageinfo[1]);
if ($temp != '') $result['image_'.$imagetag] = $temp; // Set only if not empty
}
}
// Parse ITEMS
preg_match_all("'<item(| .*?)>(.*?)</item>'si", $rss_content, $items);
$rss_items = $items[2];
$i = 0;
$result['items'] = array(); // create array even if there are no items
foreach($rss_items as $rss_item) {
// If number of items is lower then limit: Parse one item
if ($i < $this->items_limit || $this->items_limit == 0) {
foreach($this->itemtags as $itemtag) {
$temp = $this->my_preg_match("'<$itemtag.*?>(.*?)</$itemtag>'si", $rss_item);
if ($temp != '') $result['items'][$i][$itemtag] = $temp; // Set only if not empty
}
// Strip HTML tags and other bull**** from DESCRIPTION
if ($this->stripHTML && $result['items'][$i]['description'])
$result['items'][$i]['description'] = strip_tags($this->unhtmlentities(strip_tags($result['items'][$i]['description'])));
// Strip HTML tags and other bull**** from TITLE
if ($this->stripHTML && $result['items'][$i]['title'])
$result['items'][$i]['title'] = strip_tags($this->unhtmlentities(strip_tags($result['items'][$i]['title'])));
// If date_format is specified and pubDate is valid
if ($this->date_format != '' && ($timestamp = strtotime($result['items'][$i]['pubDate'])) !==-1) {
// convert pubDate to specified date format
$result['items'][$i]['pubDate'] = date($this->date_format, $timestamp);
}
// Item counter
$i++;
}
}

$result['items_count'] = $i;
return $result;
}
else // Error in opening return False
{
return False;
}
}
}

?>

thanks for all your help so far i really appreciate it!

delantian
10-15-2006, 10:38 PM
also here is the bridge.php in case yo want to see it. i reput in the 'cache'. i took it out and got same error.

<?php

/*
======================================================================
LastRSS bridge script- By Dynamic Drive (http://www.dynamicdrive.com)
Communicates between LastRSS.php to Advanced Ajax ticker script using Ajax. Returns RSS feed in XML format
Created: Feb 9th, 2006. Updated: Feb 9th, 2006
======================================================================
*/

header('Content-type: text/xml');

// include lastRSS
include "lastRSS.php"; //path to lastRSS.php on your server from this script ("bridge.php")

// Create lastRSS object
$rss = new lastRSS;
$rss->cache_dir = 'cache'; //path to cache directory on your server from this script. Chmod 777!
$rss->date_format = 'M d, Y g:i:s A'; //date format of RSS item. See PHP date() function for possible input.

// List of RSS URLs
$rsslist=array(
"CNN" => "http://rss.cnn.com/rss/cnn_topstories.rss",
"BBC" => "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml",
//"news.com" => "http://news.com.com/2547-1_3-0-5.xml",
//"slashdot" => "http://rss.slashdot.org/Slashdot/slashdot",
//"dynamicdrive" => "http://www.dynamicdrive.com/export.php?type=new"
);

////Beginners don't need to configure past here////////////////////

$rssid=$_GET['id'];
$rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("Error: Can't find requested RSS in list.");

// -------------------------------------------------------------------
// outputRSS_XML()- Outputs the "title", "link", "description", and "pubDate" elements of an RSS feed in XML format
// -------------------------------------------------------------------

function outputRSS_XML($url) {
global $rss;
$cacheseconds=(int) $_GET["cachetime"]; //typecast "cachetime" parameter as integer (0 or greater)
$rss->cache_time = $cacheseconds;
if ($rs = $rss->get($url)) {
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<rss version=\"2.0\">\n<channel>\n";
foreach ($rs['items'] as $item) {
echo "<item>\n<link>$item[link]</link>\n<title>$item[title]</title>\n<description>$item[description]</description>\n<pubDate>$item[pubDate]</pubDate>\n</item>\n\n";
}
echo "</channel></rss>";
if ($rs['items_count'] <= 0) { echo "<li>Sorry, no items found in the RSS file :-(</li>"; }
}
else {
echo "Sorry: It's not possible to reach RSS file $url\n<br />";
// you will probably hide this message in a live version
}
}

// ===============================================================================

outputRSS_XML($rssurl);

?>
and here is my rssticker.js


// -------------------------------------------------------------------
// Advanced RSS Ticker (Ajax invocation) core file
// Author: Dynamic Drive (http://www.dynamicdrive.com)
// -------------------------------------------------------------------

//Relative URL syntax:
var lastrssbridgeurl="lastrss/bridge.php"

//Absolute URL syntax. Uncomment below line if you wish to use an absolute reference:
//var lastrssbridgeurl="http://"+window.location.hostname+"/lastrss/bridge.php"

////////////No need to edit beyond here//////////////

function createAjaxObj(){
var httprequest=false
if (window.XMLHttpRequest){ // if Mozilla, Safari etc
httprequest=new XMLHttpRequest()
if (httprequest.overrideMimeType)
httprequest.overrideMimeType('text/xml')
}
else if (window.ActiveXObject){ // if IE
try {
httprequest=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e){
try{
httprequest=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){}
}
}
return httprequest
}

// -------------------------------------------------------------------
// Main RSS Ticker Object function
// rssticker_ajax(RSS_id, cachetime, divId, divClass, delay, optionallogicswitch)
// -------------------------------------------------------------------

function rssticker_ajax(RSS_id, cachetime, divId, divClass, delay, logicswitch){
this.RSS_id=RSS_id //Array key indicating which RSS feed to display
this.cachetime=cachetime //Time to cache feed, in minutes. 0=no cache.
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.logicswitch=(typeof logicswitch!="undefined")? logicswitch : ""
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over ticker (and pause it if it is)
this.pointer=0
this.opacitysetting=0.2 //Opacity value when reset. Internal use.
this.title=[], this.link=[], this.description=[], this.pubdate=[] //Arrays to hold each component of an RSS item
this.ajaxobj=createAjaxObj()
document.write('<div id="'+divId+'" class="'+divClass+'" >Initializing ticker...</div>')
if (window.getComputedStyle) //detect if moz-opacity is defined in external CSS for specified class
this.mozopacityisdefined=(window.getComputedStyle(document.getElementById(this.tickerid), "").getPropertyValue("-moz-opacity")==1)? 0 : 1
this.getAjaxcontent()
}

// -------------------------------------------------------------------
// getAjaxcontent()- Makes asynchronous GET request to "bridge.php" with the supplied parameters
// -------------------------------------------------------------------

rssticker_ajax.prototype.getAjaxcontent=function(){
if (this.ajaxobj){
var instanceOfTicker=this
var parameters="id="+encodeURIComponent(this.RSS_id)+"&cachetime="+this.cachetime+"&bustcache="+new Date().getTime()
this.ajaxobj.onreadystatechange=function(){instanceOfTicker.initialize()}
this.ajaxobj.open('GET', lastrssbridgeurl+"?"+parameters, true)
this.ajaxobj.send(null)
}
}

// -------------------------------------------------------------------
// initialize()- Initialize ticker method.
// -Gets contents of RSS content and parse it using JavaScript DOM methods
// -------------------------------------------------------------------

rssticker_ajax.prototype.initialize=function(){
if (this.ajaxobj.readyState == 4){ //if request of file completed
if (this.ajaxobj.status==200){ //if request was successful
var xmldata=this.ajaxobj.responseXML
if(xmldata.getElementsByTagName("item").length==0){ //if no <item> elements found in returned content
document.getElementById(this.tickerid).innerHTML="<b>Error</b> fetching remote RSS feed!<br />"+this.ajaxobj.responseText
return
}
var instanceOfTicker=this
this.feeditems=xmldata.getElementsByTagName("item")
//Cycle through RSS XML object and store each peice of an item inside a corresponding array
for (var i=0; i<this.feeditems.length; i++){
this.title[i]=this.feeditems[i].getElementsByTagName("title")[0].firstChild.nodeValue
this.link[i]=this.feeditems[i].getElementsByTagName("link")[0].firstChild.nodeValue
this.description[i]=this.feeditems[i].getElementsByTagName("description")[0].firstChild.nodeValue
this.pubdate[i]=this.feeditems[i].getElementsByTagName("pubDate")[0].firstChild.nodeValue
}
document.getElementById(this.tickerid).onmouseover=function(){instanceOfTicker.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){instanceOfTicker.mouseoverBol=0}
this.rotatemsg()
}
}
}

// -------------------------------------------------------------------
// rotatemsg()- Rotate through RSS messages and displays them
// -------------------------------------------------------------------

rssticker_ajax.prototype.rotatemsg=function(){
var instanceOfTicker=this
if (this.mouseoverBol==1) //if mouse is currently over ticker, do nothing (pause it)
setTimeout(function(){instanceOfTicker.rotatemsg()}, 100)
else{ //else, construct item, show and rotate it!
var tickerDiv=document.getElementById(this.tickerid)
var linktitle='<div class="rsstitle"><a href="'+this.link[this.pointer]+'">'+this.title[this.pointer]+'</a></div>'
var description='<div class="rssdescription">'+this.description[this.pointer]+'</div>'
var feeddate='<div class="rssdate">'+this.pubdate[this.pointer]+'</div>'
if (this.logicswitch.indexOf("description")==-1) description=""
if (this.logicswitch.indexOf("date")==-1) feeddate=""
var tickercontent=linktitle+feeddate+description //STRING FOR FEED CONTENTS
this.fadetransition("reset") //FADE EFFECT- RESET OPACITY
tickerDiv.innerHTML=tickercontent
this.fadetimer1=setInterval(function(){instanceOfTicker.fadetransition('up', 'fadetimer1')}, 100) //FADE EFFECT- PLAY IT
this.pointer=(this.pointer<this.feeditems.length-1)? this.pointer+1 : 0
setTimeout(function(){instanceOfTicker.rotatemsg()}, this.delay) //update container every second
}
}

// -------------------------------------------------------------------
// fadetransition()- cross browser fade method for IE5.5+ and Mozilla/Firefox
// -------------------------------------------------------------------

rssticker_ajax.prototype.fadetransition=function(fadetype, timerid){
var tickerDiv=document.getElementById(this.tickerid)
if (fadetype=="reset")
this.opacitysetting=0.2
if (tickerDiv.filters && tickerDiv.filters[0]){
if (typeof tickerDiv.filters[0].opacity=="number") //IE6+
tickerDiv.filters[0].opacity=this.opacitysetting*100
else //IE 5.5
tickerDiv.style.filter="alpha(opacity="+this.opacitysetting*100+")"
}
else if (typeof tickerDiv.style.MozOpacity!="undefined" && this.mozopacityisdefined){
tickerDiv.style.MozOpacity=this.opacitysetting
}
if (fadetype=="up")
this.opacitysetting+=0.2
if (fadetype=="up" && this.opacitysetting>=1)
clearInterval(this[timerid])
}

ddadmin
10-16-2006, 01:24 AM
If your "cache" directory remains empty even when calling bridge.php with a parameter (ie: ?id=CNN), a directory write permission issue would seem to be the problem here. Somehow I recall that on a Windows server, you need to specify the full path when specifying paths, so something like:


$rss->cache_dir = 'c:\Windows\cache';

That's just an example, but the path would start with c: and go from there. Give that a try.

delantian
10-16-2006, 02:33 PM
i tried everything i think that 'cache' is correct. isnt that the code to pull the xml file? there is no file there thats the error right? is it the lastrss fiel that actually writes a parsed .xml file to cache? i think that is my problem if it was writing it i think the bridge would get it fine with the parameter 'cache'. is this the code that writes? and it it correct?

// -------------------------------------------------------------------
// Parse RSS file and returns associative array.
// -------------------------------------------------------------------
function Get ($rss_url) {
// If CACHE ENABLED
if ($this->cache_dir != '') {
$cache_file = $this->cache_dir . '/rsscache_' . md5($rss_url);
$timedif = @(time() - filemtime($cache_file));
if ($timedif < $this->cache_time) {
// cached file is fresh enough, return cached array
$result = unserialize(join('', file($cache_file)));
// set 'cached' to 1 only if cached file is correct
if ($result) $result['cached'] = 1;
} else {
// cached file is too old, create new
$result = $this->Parse($rss_url);
$serialized = serialize($result);
if ($f = @fopen($cache_file, 'w')) {
fwrite ($f, $serialized, strlen($serialized));
fclose($f);
}
if ($result) $result['cached'] = 0;
}
}

is this where the code where the xml file is suppose to write to the cache? is this line correct? $cache_file = $this->cache_dir . '/rsscache_' .

delantian
10-16-2006, 03:57 PM
how bout this...can you disable the cache function?

blm126
10-16-2006, 07:45 PM
Yes, you can disable the cache function. That is what I had you do earlier.

delantian
10-16-2006, 09:02 PM
oh im sorry, i get it the changing of 'cache' to '' was disabling it. the full path that you are reffering to (c:/inetpu/wwwroot....) would be in the lastrss.php file right? isnt that what writes to the cache then the bridge retrieves it right?

blm126
10-17-2006, 12:18 AM
No,lastrss.php is a support file. All the configuration is done in bridge.php

delantian
10-17-2006, 03:07 PM
anyone use iis 6.0 that might have any ideas? i am sure that the problem is with iis. i have tried everything i can think of but nothing. i use phpbb perfectly so i dont think it is a problem with php. it has to be a server setting, i dont get it. thanks if anyone can help i really want an rss news ticker and i want to parse on my server dont know why it wont work.

blm126
10-17-2006, 08:05 PM
Not many people here have IIS 6. I'm guessing it is a PHP-IIS combination problem, but these are usually well documented, and I couldn't find anything. Here is another small test to see if we can find the problem.
Create a file file_test.php. Inside it put


<?php
error_reporting(E_ALL);
echo file_get_contents('http://rss.cnn.com/rss/cnn_topstories.rss');
?>

upload it to your server, and run it. If it works it should spit out a bunch of XML. If not post the error you get.

delantian
10-17-2006, 09:36 PM
it doesnt load.
http://www.noobage.com/test/testfile.php

ive looked everywhere on the net, im losing my mind ive been trying to get this to work for 4 days now. i cant believe no one has tried to install this on iis. the script is awsome it exactly what i want.

would i have to enable gci or gui just to these files or soemthing? im using phpbb and it works awsome i dont know why i am having this problem.

blm126
10-17-2006, 10:06 PM
Do you have a firewall installed on this server? I'm guessing that the firewall is blocking outgoing connections. That last test proves what is wrong...just not how to fix it.