Exemplo n.º 1
0
/**
 * Assigns the videoinfos to the smarty engine
 *
 * @param   array   associative array containing the item data
 */
function tpl_show($video)
{
    global $smarty, $config;
    // imageurl
    $video['imgurl'] = getThumbnail($video['imgurl'], $video['title']);
    // make soft linebreaks:
    $video['filename'] = preg_replace('/(_|\\.|-)/', '$1<wbr />', $video['filename']);
    // split comma-separated countries, prevent empty array
    $video['country'] = preg_split('/,\\s*/', $video['country'], -1, PREG_SPLIT_NO_EMPTY);
    // split comma-separated multiple languages, prevent empty array
    $video['language'] = preg_split('/,\\s*/', $video['language'], -1, PREG_SPLIT_NO_EMPTY);
    // humanreadable filesize:
    $video['filesize'] = round($video['filesize'] / (1024 * 1024), 2);
    // break plot and comment
    $video['plot'] = nl2br($video['plot']);
    $video['comment'] = nl2br($video['comment']);
    // cast
    $video['cast'] = prepare_cast($video['actors']);
    // prepare the custom fields
    customfields($video, 'out');
    // hide owner if not using multi-user
    if (!$config['multiuser']) {
        unset($video['owner']);
    }
    // get drilldown url for image
    if ($video['imdbID']) {
        require_once './engines/engines.php';
        $smarty->assign('link', engineGetContentUrl($video['imdbID'], engineGetEngine($video['imdbID'])));
    }
    // add episodes information
    if (is_array($video['episodes'])) {
        // allow multiple columns
        $smarty->assign('listcolumns', session_get('listcolumns'));
    }
    $smarty->assign('castcolumns', $config['castcolumns']);
    $smarty->assign('video', $video);
    // get genre ids and names
    $smarty->assign('genres', getItemGenres($video['id'], true));
    //2015-10-6 Alex ADD start
    // get studio ids and names
    $smarty->assign('studios', getItemStudios($video['id'], true));
    //2015-10-6 Alex ADD end
    // make engines available
    $smarty->assign('engines', $config['engine']);
    // allow XML export
    foreach (array('xls', 'pdf', 'xml') as $export) {
        if ($config[$export]) {
            $smarty->assign($export, 'show.php?id=' . $video['id'] . '&amp;');
        }
    }
    // new-style way of exporting
    // $smarty->assign('exports', listExports('show.php?id='.$video['id'].'&amp;'));
}
Exemplo n.º 2
0
    ajax_render();
}
// prepare templates
tpl_page('search', $q);
tpl_list($result);
$smarty->assign('q', $q);
$smarty->assign('q_q', formvar($q));
$smarty->assign('search_fields', $search_fields);
$smarty->assign('genreselect', out_genres($genres));
$smarty->assign('genres', out_genres2($genres));
//2015-10-6 Alex ADD start
$smarty->assign('studioselect', out_studios($studios));
$smarty->assign('studios', out_studios2($studios));
//2015-10-6 Alex ADD end
$smarty->assign('engine', $config['engine']);
$smarty->assign('actors', prepare_cast($actors));
// person search?
if ($isname && $config['actorpics']) {
    $smarty->assign('imgurl', getActorThumbnail(urldecode(preg_replace('/&quot;|"/', '', formvar($q)))));
}
// allow XML export
if (isset($q)) {
    $link = htmlentities($_SERVER['QUERY_STRING']);
    // encode for XHTML compliance
    if ($link) {
        $link .= '&amp;';
    }
    $link = 'search.php?' . $link;
    if ($config['xls']) {
        $smarty->assign('xls', $link);
    }