"); $fp = fopen($cacheRead, "x+"); fclose($fp); } decho("reading internal cache state
"); $internal = fopen($cacheFile, "r"); $cacheRead = fread($internal, $cacheReadLength); fclose($internal); decho("reading inbound cache data
"); $inbound = fopen($url, "r+"); $cacheTempRead = fread($inbound, $cacheReadLength); fclose($inbound); decho("comparing
"); if((strncmp($cacheTempRead, $cacheRead, $cacheReadLength)) == 0) { $cacheTemp = implode('', file($url)); decho("Length of cached RSS is " . strlen($cacheTemp) . "
"); decho("Writing cached data to file
"); $cachefp = fopen($cacheFile, "w+"); $cacheWritten = fwrite($cachefp, $cacheTemp, strlen($cacheTemp)); fclose($cachefp); decho("$cacheWritten bytes written to cache.
"); } else { decho("cache matches external source, using internal
"); } $rss->load($cacheFile); $items = $rss->getItems(); #returns all rss items $numFeeds = 0; echo "
"; foreach($items as $story){ if($story['category']=="Tournament Announcements"){ $numFeeds++; //$text = $story['description']; //$text = strip_tags($text); //$text = preg_replace("(\[font(.+?)...)","", $text); //$text = stripBBCode($text); echo "{$story['title']}
{$story['pubDate']}
"; //echo "{$text}

"; echo "

"; } } if(!$numFeeds){ echo "No new updates for this news feed."; } echo "
"; // echo "
";
  //print_r($items);
   // echo "
"; ?>