Example #1
0
    }
}
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'];
$totalpages = max($totalrecent);
$days = $days > 0 ? "&days=" . $days : "";
$mode = !empty($mode) ? "&mode=" . $mode : "";
$pagenav = cot_pagenav('plug', 'e=recentitems' . $days . $mode, $d, $totalpages, $cfg['plugin']['recentitems']['itemsperpage']);
$t->assign(array('PAGE_PAGENAV' => $pagenav['main'], 'PAGE_PAGEPREV' => $pagenav['prev'], 'PAGE_PAGENEXT' => $pagenav['next']));
Example #2
0
        // 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)) {
            $ri_html = cot_build_recentforums('recentitems.forums.index', 'recent', $cfg['plugin']['recentitems']['maxtopics'], 0, $cfg['plugin']['recentitems']['recentforumstitle'], $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_FORUMS', $ri_html);
        unset($ri_html);
    }
}