-
Notifications
You must be signed in to change notification settings - Fork 1
/
mod_kunenalatest.php
43 lines (38 loc) · 1.09 KB
/
mod_kunenalatest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* @version $Id$
* KunenaLatest Module
* @package Kunena Latest
*
* @Copyright (C)2010-2011 www.kunena.org. All rights reserved
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link http://www.kunena.org
**/
// no direct access
defined ( '_JEXEC' ) or die ( '' );
// Kunena detection and version check
$minKunenaVersion = '1.6.3';
if (!class_exists('Kunena') || Kunena::versionBuild() < 4344) {
echo JText::sprintf ( 'MOD_KUNENALATEST_KUNENA_NOT_INSTALLED', $minKunenaVersion );
return;
}
// Kunena online check
if (!Kunena::enabled()) {
echo JText::_ ( 'MOD_KUNENALATEST_KUNENA_OFFLINE' );
return;
}
// Include the kunenalatest functions only once
require_once (dirname ( __FILE__ ) . '/class.php');
$params = ( object ) $params;
// Add basic caching for visitors (3 minutes)
$klatest = new modKunenaLatest ( $params );
$user = JFactory::getUser();
if (!$user->id) {
$cache = JFactory::getCache('mod_kunenalatest', 'output');
$cache->setLifeTime(180);
if ($cache->start(md5(serialize($params)), 'mod_kunenalatest')) return;
}
$klatest->display();
if (!$user->id) {
$cache->end();
}