コード例 #1
0
ファイル: template.php プロジェクト: huya1010/videodb
/**
 * Assigns the videoinfos to the smarty engine
 */
function tpl_studioedit($studio)
{
    global $smarty, $config, $lang;
    // create a form ready quoted version for each value
    foreach (array_keys($video) as $key) {
        $video['q_' . $key] = formvar($video[$key]);
    }
    // use custom function for language
    $video['f_language'] = custom_language_input('language', $video['language']);
    // create mediatype selectbox
    $smarty->assign('mediatypes', out_mediatypes());
    if (!isset($video['mediatype'])) {
        $video['mediatype'] = $config['mediadefault'];
    }
    // prepare the custom fields
    customfields($video, 'in');
    if ($config['multiuser']) {
        $smarty->assign('owners', out_owners(array('0' => ''), check_permission(PERM_ADMIN) ? false : PERM_WRITE, true));
    }
    // item genres
    $item_genres = getItemGenres($video['id']);
    // new-style
    $smarty->assign('genres', out_genres2($item_genres));
    #dlog(out_genres2($item_genres));
    #dlog($item_genres);
    // classic
    $smarty->assign('genreselect', out_genres($item_genres));
    //2015-10-6 Alex ADD start
    // item studios
    $item_studios = getItemStudios($video['id']);
    // new-style
    $smarty->assign('studios', out_studios2($item_studios));
    // classic
    $smarty->assign('studioselect', out_studios($item_studios));
    //2015-10-6 Alex ADD end
    // assign data
    $smarty->assign('video', $video);
    // get drilldown url for visit link
    if ($video['imdbID']) {
        require_once './engines/engines.php';
        $engine = engineGetEngine($video['imdbID']);
        $smarty->assign('link', engineGetContentUrl($video['imdbID'], $engine));
        $smarty->assign('engine', $engine);
    }
    /*
        // populate autocomplete boxes
        $smarty->assign('audio_codecs', array_extract(runSQL('SELECT DISTINCT audio_codec FROM '.TBL_DATA.' WHERE audio_codec IS NOT NULL'), 'audio_codec'));
        $smarty->assign('video_codecs', array_extract(runSQL('SELECT DISTINCT video_codec FROM '.TBL_DATA.' WHERE video_codec IS NOT NULL'), 'video_codec'));
    */
    $smarty->assign('lookup', array('0' => $lang['radio_look_ignore'], '1' => $lang['radio_look_lookup'], '2' => $lang['radio_look_overwrite']));
    // needed for ajax image lookup
    $smarty->assign('engines', $config['engines']);
}
コード例 #2
0
ファイル: search.php プロジェクト: huya1010/videodb
        exit;
    }
    // store query result in session for prev/next navigation
    session_set('query_result', array_extract($result, 'id'));
}
// process asynchronous refresh
if ($ajax_render) {
    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('/"|"/', '', formvar($q)))));
}
// allow XML export
if (isset($q)) {
    $link = htmlentities($_SERVER['QUERY_STRING']);
    // encode for XHTML compliance