aboutsummaryrefslogtreecommitdiff
path: root/blocks/rss_agw
diff options
context:
space:
mode:
authorjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-23 12:38:13 -0500
committerjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-23 12:38:13 -0500
commitebda82d787b3620424c1dcf4336146ea06815a55 (patch)
treec05021cb36da9eff4c589e67824f237500b01149 /blocks/rss_agw
parent6c42f30a0424cbf1c1af63f21d7f5074a4653c7a (diff)
downloadbayonetcms-ebda82d787b3620424c1dcf4336146ea06815a55.tar.gz
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
Diffstat (limited to 'blocks/rss_agw')
-rw-r--r--blocks/rss_agw/index.php19
1 files changed, 9 insertions, 10 deletions
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<br/>");
+ decho("Creating RSS cache");
$fp = fopen($cacheRead, "x+");
fclose($fp);
}
- decho("reading internal cache state<br/>");
+ decho("Reading internal RSS cache state");
$internal = fopen($cacheFile, "r");
$cacheRead = fread($internal, $cacheReadLength);
fclose($internal);
- decho("reading inbound cache data<br/>");
- $inbound = fopen($url, "r+");
+ decho("Reading inbound RSS cache data");
+ $inbound = fopen($url, "r");
$cacheTempRead = fread($inbound, $cacheReadLength);
fclose($inbound);
- decho("comparing<br/>");
+ decho("Comparing RSS caches");
if((strncmp($cacheTempRead, $cacheRead, $cacheReadLength)) == 0)
{
$cacheTemp = implode('', file($url));
- decho("Length of cached RSS is " . strlen($cacheTemp) . "<br/>");
- decho("Writing cached data to file <br/>");
+ 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.<br/>");
+ decho("$cacheWritten bytes written to RSS cache.<br/>");
}
else
{
- decho("cache matches external source, using internal<br/>");
+ decho("RSS cache matches external source, using internal");
}
$rss->load($cacheFile);