// Initialize cache system only when it's needed
$GLOBALS['cache_instance'] = new CacheSystem();
+
+ // Did it work?
if ($GLOBALS['cache_instance']->getStatus() != 'done') {
// Failed to initialize cache sustem
addFatalMessage(__FUNCTION__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): {--CACHE_CANNOT_INITIALIZE--}');
u.userid ASC', __FILE__, __LINE__);
// Do we have entries?
-if (!SQL_HASZERONUMS($result_direct) > 0) {
+if (!SQL_HASZERONUMS($result_direct)) {
// When 'walk' through all users
while ($content = SQL_FETCHARRAY($result_direct)) {
// Init level
if (isFileReadable($FQFN)) {
$image = imagecreatefrompng($FQFN);
- sendHeader('Content-Type: image/png');
+ setContentType('image/png');
imagepng($image);
imagedestroy($image);
- }
+ } // END - if
shutdown();
} elseif (isGetRequestParameterSet('usage')) {
$FQFN = sprintf("%s%s/usage_%s.html",
imagestring($image, 5, 14, 2, $img_code, $text_color);
// Return to browser
- sendHeader('Content-Type: image/' . getConfig('img_type'));
+ setContentType('image/' . getConfig('img_type'));
// Output image with matching image factory
switch (getConfig('img_type')) {
function getMonth ($timestamp = null) {
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
- // null is time()
- if (is_null($timestamp)) $timestamp = time();
+ // If null is set, use time()
+ if (is_null($timestamp)) {
+ // Use time() which is current timestamp
+ $timestamp = time();
+ } // END - if
// Then create it
$GLOBALS[__FUNCTION__][$timestamp] = date('m', $timestamp);