Example #1
0
 function getList($params)
 {
     global $mainframe;
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     $option = JRequest::getCmd('option');
     $view = JRequest::getCmd('view');
     $temp = JRequest::getString('id');
     $temp = explode(':', $temp);
     $id = $temp[0];
     $aid = $user->get('aid', 0);
     $showDate = $params->get('showDate', 0);
     $conf =& JFactory::getConfig();
     if ($option == 'com_content' && $view == 'article' && $id) {
         if ($params->get('cache_items', 0) == 1 && $conf->getValue('config.caching')) {
             $cache =& JFactory::getCache('mod_related_items', 'callback');
             $cache->setLifeTime($params->get('cache_time', $conf->getValue('config.cachetime') * 60));
             $cache->setCacheValidation(true);
             $related = $cache->get(array('modRelatedItemsHelper', 'getRelatedItemsById'), array($id, $aid, $showDate));
         } else {
             $related = modRelatedItemsHelper::getRelatedItemsById($id, $aid, $showDate);
         }
     } else {
         $related = array();
     }
     return $related;
 }
Example #2
0
<?php

/**
* @version		$Id: mod_related_items.php 14401 2010-01-26 14:10:00Z louis $
* @package		Joomla
* @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
// Include the syndicate functions only once
require_once dirname(__FILE__) . DS . 'helper.php';
$product = modRelatedItemsHelper::getList($params);
if (!count($product)) {
    return;
}
$showDate = $params->get('showDate', 0);
require JModuleHelper::getLayoutPath('mod_related_items');