static function request($url, $authid = '', $cache_time = 15) { // debug purpose only // echo 'Exec: '.time().'<br />'; // cache subfolder(group) 'Currency', cache method: callback $cache = JFactory::getCache('mod_slideshowfx_pwg', ''); // configure cache time $cache->setLifeTime($cache_time); // get cache state depending on Joomla! version if (sfxpwgStartingFromJVersion('1.6')) { $cacheactive = $cache->getCaching(); } else { $conf = JFactory::getConfig(); $cacheactive = $conf->getValue('config.caching'); } //enable caching $cache->setCaching(true); // build cache ID $cid = $url . '/' . $authid; // try toi get cache // force $cache_time = 0 for debug if ($cache_time == 0 || !($result = $cache->get($cid))) { // debug purpose only // echo 'Req: '.time().'<br />'; // no cache available send request to Google server $result = self::request_exec($url, $authid); // check result if (strpos($result, "<?xml version='1.0' encoding='UTF-8'?>") === 0) { // store valid result $cache->store($result, $cid); } } // revert cache state $cache->setCaching($cacheactive); // return the result return $result; }
<?php /*** * SlideshowFx Picasa Widget Copyright (C) 2010 www.OopsTouch.com * Author: contact@oopstouch.com * Support: http://www.oopstouch.com * License: GNU/GPLv3 (http://www.gnu.org/licenses/gpl-3.0.html) * Download: http://www.oopstouch.com ***/ // no direct access defined('_JEXEC') or die('Restricted access'); // Include the syndicate functions only once require_once dirname(__FILE__) . '/helper.php'; // include mootools framework if (sfxpwgStartingFromJVersion('1.6')) { JHtml::_('behavior.framework', true); } else { JHTML::_('behavior.mootools'); } // insert module in page modSlideshowFxPicasaWidgetHelper::insert($module->id, $params);