function getVisitorsCached($inactive, $withoutReloading = FALSE) { $activeString = "ACTIVE"; if ($inactive) { $activeString = "INACTIVE"; } $uriCount = $this->extraWatch->visit->getTotalUriCount($inactive); if (!$inactive && !$uriCount) { $host = "http://" . $_SERVER['HTTP_HOST'] . $this->extraWatch->config->getLiveSite(); $homepageContents = ExtraWatchHelper::getUrlContent($host); if (@$homepageContents && strstr($homepageContents, "agent.js") === FALSE) { echo "<span style='color: red; font-weight: bold;'>" . _EW_AGENT_NOT_PUBLISHED . "</span><br/><br/>"; } } $countCached = $this->extraWatch->cache->getCachedItem("URI_COUNT_{$activeString}", FALSE); if ($countCached != $uriCount && !$withoutReloading) { //TODO optimize add 1 || to render it all the time $visitorsOutput = $this->renderTable(FALSE, $inactive); $this->extraWatch->cache->storeCachedItem("VISITORS_CONTENT_{$activeString}", $visitorsOutput); $this->extraWatch->cache->storeCachedItem("URI_COUNT_{$activeString}", $uriCount); } else { $visitorsOutput = stripslashes($this->extraWatch->cache->getCachedItem("VISITORS_CONTENT_{$activeString}", FALSE)); } return $visitorsOutput; }