From ebda82d787b3620424c1dcf4336146ea06815a55 Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Wed, 23 Dec 2009 17:38:13 +0000 Subject: New debugging methods implements. config.php has two new options, "show_messages", and "repeat messages". If a "show_messages" is enabled any decho statements are rendered above the site footer. git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@395 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- blocks/rss_agw/index.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'blocks') diff --git a/blocks/rss_agw/index.php b/blocks/rss_agw/index.php index e59414a..4438a98 100644 --- a/blocks/rss_agw/index.php +++ b/blocks/rss_agw/index.php @@ -13,38 +13,37 @@ function stripBBCode($text_to_search) { $cacheFile = dirname(__FILE__) . "/rss.cache"; $url = 'http://www.armedglobalwarfare.com/index.php?type=rss;action=.xml;limit=150'; - if(!file_exists($cacheFile)) { - decho("creating cache
"); + decho("Creating RSS cache"); $fp = fopen($cacheRead, "x+"); fclose($fp); } - decho("reading internal cache state
"); + decho("Reading internal RSS cache state"); $internal = fopen($cacheFile, "r"); $cacheRead = fread($internal, $cacheReadLength); fclose($internal); - decho("reading inbound cache data
"); - $inbound = fopen($url, "r+"); + decho("Reading inbound RSS cache data"); + $inbound = fopen($url, "r"); $cacheTempRead = fread($inbound, $cacheReadLength); fclose($inbound); - decho("comparing
"); + decho("Comparing RSS caches"); if((strncmp($cacheTempRead, $cacheRead, $cacheReadLength)) == 0) { $cacheTemp = implode('', file($url)); - decho("Length of cached RSS is " . strlen($cacheTemp) . "
"); - decho("Writing cached data to file
"); + decho("Length of cached RSS is " . strlen($cacheTemp)); + decho("Writing cached RSS data to file"); $cachefp = fopen($cacheFile, "w+"); $cacheWritten = fwrite($cachefp, $cacheTemp, strlen($cacheTemp)); fclose($cachefp); - decho("$cacheWritten bytes written to cache.
"); + decho("$cacheWritten bytes written to RSS cache.
"); } else { - decho("cache matches external source, using internal
"); + decho("RSS cache matches external source, using internal"); } $rss->load($cacheFile); -- cgit