Ejemplo n.º 1
0
/**
 * Update item list asynchronously
 *
 * @author  Andreas Goetz   <*****@*****.**>
 */
function ajax_render()
{
    global $smarty, $result;
    // add some delay for debugging
    if ($config['debug'] && $_SERVER['SERVER_ADDR'] == '127.0.0.1') {
        usleep(rand(200, 1000) * 1000);
    }
    // load languages and config into Smarty
    tpl_language();
    $content = $smarty->fetch('lookup_ajax.tpl');
    header('X-JSON: ' . json_encode(array('count' => count($result))));
    exit($content);
}
Ejemplo n.º 2
0
/**
 * Update item list asynchronously
 *
 * @author  Andreas Goetz   <*****@*****.**>
 */
function ajax_render()
{
    global $smarty, $result, $filter;
    global $pageno, $totalpages, $totalresults;
    // TODO Smarty caching would require further efforts $smarty->caching = 1;
    #    if (!$smarty->is_cached('list.tpl', get_current_user_id().'|'.$filter.$pageno)) {
    // add some delay for debugging
    if ($config['debug'] && $_SERVER['SERVER_ADDR'] == '127.0.0.1') {
        usleep(rand(200, 1000) * 1000);
    }
    // load languages and config into Smarty
    tpl_language();
    tpl_list($result);
    // TODO consider pagination
    $content = $smarty->fetch('list.tpl', get_current_user_id() . '|' . $filter . $pageno);
    header('X-JSON: ' . json_encode(array('totalresults' => $totalresults ? $totalresults : count($result), 'maxpageno' => $totalpages)));
    exit($content);
}
Ejemplo n.º 3
0
/**
 * Prepare standard page templates
 */
function tpl_page($help = '', $title = '')
{
    tpl_language();
    tpl_header($help, $title);
    tpl_footer();
}
Ejemplo n.º 4
0
<?php

/**
 * Movie Trailers View
 *
 * Shows available youtube trailers
 *
 * @package videoDB
 * @author  Andreas Goetz   <*****@*****.**>
 * @version $Id: trailer.php,v 1.4 2009/04/04 16:25:58 andig2 Exp $
 */
require_once './core/functions.php';
require_once './engines/youtube.php';
// decode entities to care for numeric html escapes of JS single quotes
$trailer = youtubeSearch(html_entity_decode_all($title));
// prepare templates
tpl_language();
tpl_header();
$smarty->assign('trailer', $trailer);
// display templates
smarty_display('trailer.tpl');