function printStartForm() { global $tomeurl; ?> <p>This script has been developed by Adam Benson (precarious_panther@bigpond.com), based on the tvtome script by Andreas Gohr.</p> <p>You can use it to add television series in part, or in whole to your videodb collection (Place this file in your 'contrib' folder). It will find the episode information, including an episode image (which you can alternatively specify yourself), and automatically add all the checked episodes to your database with correct Cast, Plot, Image, and etc.</p> <p>This is Version 1.0 of this script, and therefore may have some bugs that need ironing out. Next version I will solve the hassle of having to manually add disk id's.</p> <p>To add a series, enter the TVTOME root episode address in the box below.</p> <form method="post"> <table> <tr> <td>TV-Tome Episode Root</td> <td><input type="text" name="tomeurl" value="<?php echo formvar($tomeurl); ?> "></td> <td>e.g. <code>http://www.tvtome.com/StargateSG1/</code> (See <a href="http://www.tvtome.com" target="_blank">tvtome.com</a>)</td> </tr> <tr> <td colspan="3" align="center"> <input type="submit" value="Look Up Episodes!"> </td> </tr> </table> </form> <hr/> <?php }
/** * 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']); }
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 if ($link) { $link .= '&'; } $link = 'search.php?' . $link; if ($config['xls']) { $smarty->assign('xls', $link); } if ($config['xml']) { $smarty->assign('xml', $link); }
/** * Prepare customfields */ function setup_mkCustoms() { global $config; global $allcustomtypes; $setup_custom = ''; for ($i = 1; $i < 5; $i++) { $setup_custom .= $i . '. <input type="text" size="20" name="custom' . $i . '" id="custom' . $i . '" value="' . formvar($config['custom' . $i]) . '"/>'; $setup_custom .= '<select name="custom' . $i . 'type">'; foreach ($allcustomtypes as $ctype) { $selected = $ctype == $config['custom' . $i . 'type'] ? ' selected="selected"' : ''; $setup_custom .= '<option value="' . $ctype . '"' . $selected . '>' . $ctype . '</option>'; } $setup_custom .= '</select>'; $setup_custom .= "<br />\n"; } return $setup_custom; }
/** * Custom Type: BBFC * * Show the BBFC rating of a movie * Based on the MPAA ratings above * * @author Colin Ogilvie <*****@*****.**> */ function custom_bbfc_input($cn, $cv) { global $config; global $imdbdata; global $id; if (empty($cv) || $config['lookupdefault'] > 0) { $cv = $imdbdata['bbfc']; if (!empty($imdbdata['bbfc'])) { $bbfc .= $imdbdata['bbfc']; } //we need to save our self here! if (!empty($id) && $cv != '') { $qcv = addslashes($cv); $UPDATE = "UPDATE " . TBL_DATA . " SET {$cn} = '{$qcv}' WHERE id = {$id}"; runSQL($UPDATE); } } $output = '<input type="text" size="10" maxlength="4" name="' . $cn . '" id="' . $cn . '" value="' . formvar($cv) . '" />'; $output .= " <a href='#' onclick='document.edi." . $cn . ".value=\"U\"'>U</a>"; $output .= " <a href='#' onclick='document.edi." . $cn . ".value=\"12\"'>12</a>"; $output .= " <a href='#' onclick='document.edi." . $cn . ".value=\"12A\"'>12A</a>"; $output .= " <a href='#' onclick='document.edi." . $cn . ".value=\"15\"'>15</a>"; $output .= " <a href='#' onclick='document.edi." . $cn . ".value=\"18\"'>18</a>"; $output .= " <a href='#' onclick='document.edi." . $cn . ".value=\"PG\"'>PG</a>"; return $output; }
/** * Prepare lookup template */ function tpl_lookup($find, $engine, $searchtype) { global $smarty, $config; $find = trim($find); $smarty->assign('find', $find); $smarty->assign('q_find', formvar($find)); $smarty->assign('engine', $engine); $tpl = array(); foreach (engine_get_capable_engines($searchtype) as $eng => $enabled) { // url- make sure this is non-unicode $tpl[$eng]['url'] = 'lookup.php?find=' . urlencode(utf8_smart_decode($find)) . '&engine=' . $eng . '&searchtype=' . $searchtype; // title $tpl[$eng]['name'] = $config['engines'][$eng]['name']; } $smarty->assign('engines', $tpl); }
function save() { global $form_eps; global $form_tvcomid; global $form_id; global $form_subtitle; global $form_plot; global $form_year; global $form_director; global $form_cast; global $form_rating; global $form_coverurl; global $form_genres; global $form_fastmode; global $cfg_rating_col; print '<h2>Updating database...</h2>'; $fastmode = formvar($form_fastmode); foreach ($form_eps as $ep) { $id = $form_id[$ep]; if (empty($id)) { continue; } $tvcomid = addslashes($form_tvcomid[$ep]); $subtitle = addslashes($form_subtitle[$ep]); $plot = addslashes($form_plot[$ep]); $year = addslashes($form_year[$ep]); $director = addslashes($form_director[$ep]); $cast = addslashes($form_cast[$ep]); $rating = addslashes($form_rating[$ep]); $coverurl = addslashes($form_coverurl[$ep]); if (!$fastmode) { $genres = mapGenres(explode(", ", addslashes($form_genres[$ep]))); } print $form_subtitle[$ep] . '... '; $SQL = "UPDATE " . TBL_DATA . "\n SET imdbID = '{$tvcomid}',\n istv = 1,\n lastupdate = NOW()"; if (!$fastmode) { $SQL .= ", plot = '{$plot}',\n year = '{$year}',\n director = '{$director}',\n actors = '{$cast}'"; if (!empty($cfg_rating_col)) { $SQL .= ", {$cfg_rating_col} = '{$rating}'"; } if (!empty($coverurl)) { $SQL .= ", imgurl = '{$coverurl}'"; } } $SQL .= " WHERE id = {$id}"; runSQL($SQL); // Genres if (!$fastmode && !empty($genres)) { $genre_ids = array(); foreach ($genres as $g) { if ($gid = getGenreId($g)) { $genre_ids[] = $gid; } } setItemGenres($id, $genre_ids); } print "done.<br>\n"; } print '<p>back to <a href="tvtome.php">the importer</a> or to <a href="../index.php">the movies</a></p>'; }