コード例 #1
0
ファイル: template.php プロジェクト: huya1010/videodb
/**
 * Display page using templates
 * If page content is unmodified, return HTTP 304 Not modified
 *
 * @param   string  $template Template name for main content
 */
function tpl_display($template)
{
    global $config;
    // caching enabled?
    if ($config['http_caching']) {
        require_once './core/httpcache.php';
        httpCacheCaptureStart();
    }
    tpl_display_show($template, !$config['http_caching']);
    if ($config['http_caching']) {
        httpCacheOutput($template, httpCacheCaptureEnd());
    }
}
コード例 #2
0
ファイル: index.php プロジェクト: Boris-de/videodb
tpl_list($result);
tpl_filters($filter, $showtv);
// caching enabled?
if ($config['http_caching']) {
    require_once './core/httpcache.php';
    httpCacheCaptureStart();
}
$smarty->assign('moreless', true);
// show more/less control in list view
// allow data export
foreach (array('xls', 'pdf', 'xml', 'rss') as $export) {
    if ($config[$export]) {
        $smarty->assign($export, 'index.php?');
    }
}
// display templates
smarty_display('header.tpl');
smarty_display('filters.tpl');
if (!$config['http_caching']) {
    flush();
}
if ($deleteid) {
    $smarty->assign('deleted', true);
}
// TODO smarty caching would require further efforts
smarty_display('list.tpl', get_current_user_id() . '|' . $WHERES);
smarty_display('footer.tpl');
// caching enabled?
if ($config['httpcaching']) {
    httpCacheOutput('index', httpCacheCaptureEnd());
}
コード例 #3
0
ファイル: show.php プロジェクト: huya1010/videodb
    for ($i; $i < $size - 1; $i++) {
        if ($breadcrumbs['crumbs'][$i]['id'] == $id) {
            unset($breadcrumbs['crumbs'][$size - 1]);
            break;
        }
    }
    session_set('breadcrumbs', $breadcrumbs);
}
// prepare templates
tpl_page('detailview', $video['title']);
if (!empty($id)) {
    tpl_show($video);
}
// caching enabled?
if ($config['http_caching']) {
    require_once './core/httpcache.php';
    httpCacheCaptureStart();
}
// display templates
smarty_display('header.tpl');
if (!$config['http_caching']) {
    flush();
}
if (!empty($id)) {
    smarty_display('show.tpl', $id);
}
smarty_display('footer.tpl');
// caching enabled?
if ($config['http_caching']) {
    httpCacheOutput('show' . $id, httpCacheCaptureEnd());
}