Ejemplo n.º 1
0
if ($days == 0) {
    if ($usr['id'] > 0) {
        $timeback = $usr['lastvisit'];
    } else {
        $days = 1;
    }
}
if ($days > 0) {
    $timeminus = $days * 86400;
    $timeback = $sys['now'] - $timeminus;
}
require_once cot_incfile('recentitems', 'plug');
$totalrecent[] = 0;
if ($cfg['plugin']['recentitems']['newpages'] && cot_module_active('page') && (empty($mode) || $mode == 'pages')) {
    require_once cot_incfile('page', 'module');
    $res = cot_build_recentpages('recentitems.pages', $timeback, $cfg['plugin']['recentitems']['itemsperpage'], $d, $pagetitlelimit, $cfg['plugin']['recentitems']['newpagestext'], $cfg['plugin']['recentitems']['rightscan']);
    $t->assign('RECENT_PAGES', $res);
}
if ($cfg['plugin']['recentitems']['newforums'] && cot_module_active('forums') && (empty($mode) || $mode == 'forums')) {
    require_once cot_incfile('forums', 'module');
    $res = cot_build_recentforums('recentitems.forums', $timeback, $cfg['plugin']['recentitems']['itemsperpage'], $d, $forumtitlelimit, $cfg['plugin']['recentitems']['rightscan']);
    $t->assign('RECENT_FORUMS', $res);
}
if ($mode != 'pages' || $mode != 'forums') {
    /* === Hook === */
    foreach (cot_getextplugins('recentitems.tags') as $pl) {
        include $pl;
    }
    /* ===== */
}
$out['subtitle'] = $L['recentitems_title'];
Ejemplo n.º 2
0
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') or die('Wrong URL');
$enforums = $t->hasTag('RECENT_FORUMS');
$enpages = $t->hasTag('RECENT_PAGES');
if ($enpages || $enforums) {
    require_once cot_incfile('recentitems', 'plug');
    if ($enpages && $cfg['plugin']['recentitems']['recentpages'] && cot_module_active('page')) {
        require_once cot_incfile('page', 'module');
        // Try to load from cache for guests
        if ($usr['id'] == 0 && $cache && (int) $cfg['plugin']['recentitems']['cache_ttl'] > 0) {
            $ri_cache_id = "{$theme}.{$lang}.pages";
            $ri_html = $cache->disk->get($ri_cache_id, 'recentitems', (int) $cfg['plugin']['recentitems']['cache_ttl']);
        }
        if (empty($ri_html)) {
            $ri_html = cot_build_recentpages('recentitems.pages.index', 'recent', $cfg['plugin']['recentitems']['maxpages'], 0, $cfg['plugin']['recentitems']['recentpagestitle'], $cfg['plugin']['recentitems']['recentpagestext'], $cfg['plugin']['recentitems']['rightscan']);
            if ($usr['id'] == 0 && $cache && (int) $cfg['plugin']['recentitems']['cache_ttl'] > 0) {
                $cache->disk->store($ri_cache_id, $ri_html, 'recentitems');
            }
        }
        $t->assign('RECENT_PAGES', $ri_html);
        unset($ri_html);
    }
    if ($enforums && $cfg['plugin']['recentitems']['recentforums'] && cot_module_active('forums')) {
        require_once cot_incfile('forums', 'module');
        // Try to load from cache for guests
        if ($usr['id'] == 0 && $cache && (int) $cfg['plugin']['recentitems']['cache_ttl'] > 0) {
            $ri_cache_id = "{$theme}.{$lang}.forums";
            $ri_html = $cache->disk->get($ri_cache_id, 'recentitems', (int) $cfg['plugin']['recentitems']['cache_ttl']);
        }
        if (empty($ri_html)) {