Esempio n. 1
0
function ofdbscraperGetActorId($name)
{
    global $ofdbscraperServer;
    // try to guess the id -> first actor found with this name
    $url = $ofdbscraperServer . '/view.php?page=liste&Name=' . urlencode(html_entity_decode_all($name));
    $resp = httpClient($url, $cache);
    if (!$resp['success']) {
        $CLIENTERROR .= $resp['error'] . "\n";
    }
    $resp['data'] = preg_replace('/[\\r\\n\\t]/', ' ', $resp['data']);
    return preg_match('#view.php?page=person&id=([0-9]+)#i', $resp['data'], $ary) ? $ary[1] : 0;
}
Esempio n. 2
0
/**
 * Get Url to visit IMDB for a specific actor
 *
 * @author  Michael Kollmann <*****@*****.**>
 * @param   string  $name   The actor's name
 * @param   string  $id The actor's external id
 * @return  string      The visit URL
 */
function imdbActorUrl($name, $id)
{
    global $imdbServer;
    global $imdbIdPrefix;
    $path = $id ? 'name/' . urlencode($id) . '/' : 'Name?' . urlencode(html_entity_decode_all($name));
    return $imdbServer . '/' . $path;
}
Esempio n. 3
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');
Esempio n. 4
0
        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);
}
// determine default engine (first in list)
if (empty($engine)) {
    $engine = engineGetDefault();
}
// result array
$result = array();
// Undo url encoding. At this point we cannot be sure which encoding is present- either ISO from URL or UTF-8 from form subimssion. Make sure we have unicode again.
$find = html_entity_decode_all(urldecode($find));
if (!is_utf8($find)) {
    $find = utf8_encode($find);
}
switch ($engine) {
    case 'amazona2s':
        // amazona2s
        $smarty->assign('catalog', array('Books', 'Classical', 'DigitalMusic', 'DVD', 'Electronics', 'Magazines', 'Music', 'MusicTracks', 'UnboxVideo', 'VHS', 'Video', 'VideoGames'));
        if (empty($catalog)) {
            $catalog = 'DVD';
        }
        $smarty->assign('selectedcatalog', $catalog);
        if (!empty($find)) {
            $result = engineSearch($find, $engine, $catalog);
            $searchurl = engineGetSearchUrl($find, $engine);
        }
Esempio n. 5
0
/**
 * Export XML data
 *
 * @param   string  $where  WHERE clause for SQL statement
 */
function xmlexport($WHERE)
{
    global $config;
    // get data
    $result = exportData($WHERE);
    // do adultcheck
    if (is_array($result)) {
        $result = array_filter($result, create_function('$video', 'return adultcheck($video["id"]);'));
    }
    $xml = '';
    // loop over items
    foreach ($result as $item) {
        $xml_item = '';
        // loop over attributes
        foreach ($item as $key => $value) {
            if (!empty($value)) {
                if ($key != 'owner_id' && $key != 'actors') {
                    $tag = strtolower($key);
                    $xml_item .= createTag($tag, trim(html_entity_decode_all($value)));
                }
            }
        }
        // this is a hack for exporting thumbnail URLs
        if ($item['imgurl'] && $config['xml_thumbnails']) {
            $thumb = getThumbnail($item['imgurl']);
            if (preg_match('/cache/', $thumb)) {
                $xml_item .= createTag('thumbnail', trim($thumb));
            }
        }
        // genres
        if (count($row['genres'])) {
            $xml_genres = '';
            foreach ($row['genres'] as $genre) {
                $xml_genres .= createTag('genre', $genre['name']);
            }
            $xml_item .= createContainer('genres', $xml_genres);
        }
        // actors
        $actors = explode("\n", $item['actors']);
        if (count($actors)) {
            $xml_actors = '';
            foreach ($actors as $actor) {
                $xml_actor_data = '';
                $actor_data = explode("::", $actor);
                $xml_actor_data .= createTag('name', $actor_data[0]);
                $xml_actor_data .= createTag('role', $actor_data[1]);
                $xml_actor_data .= createTag('imdbid', $actor_data[2]);
                $xml_actors .= createContainer('actor', $xml_actor_data);
            }
            $xml_item .= createContainer('actors', $xml_actors);
        }
        $xml .= createContainer('item', $xml_item);
    }
    $xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n" . createContainer('catalog', $xml);
    //    header('Content-type: text/xml');
    $mime = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'application/force-download' : 'application/octet-stream';
    header('Content-type: ' . $mime);
    header('Content-length: ' . strlen($xml));
    header('Content-disposition: attachment; filename=videoDB.xml');
    echo $xml;
}