예제 #1
0
 $omdb_V1 = new OMDBv1();
 #		echo "DETALLES DE PELICULA";
 $tm_info = $tmdb_V3->movieDetail($_POST['id']);
 $om_info = $omdb_V1->movieDetail($tm_info['imdb_id']);
 #		echo"<pre>";print_r($tm_info);echo"</pre>";
 #		echo"<pre>";print_r($om_info);echo"</pre>";
 $str_genres = "";
 foreach ($tm_info['genres'] as $g) {
     if (empty($str_genres)) {
         $str_genres = $g['name'];
     } else {
         $str_genres .= ' | ' . $g['name'];
     }
 }
 #		echo"<pre>";print_r($str_genres);echo"</pre>";
 $idx_title = GetIndex($tm_info['title']);
 $db = new SQLite3('videoworld.sqlite');
 $stmt = $db->prepare('INSERT INTO movies(id,imdb_id,original_title,overview,poster_path,release_date,title,imdbRating,backdrop_path,genres,actors,director,idx_title,imdbVotes) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)');
 $stmt->bindParam(1, $tm_info['id']);
 $stmt->bindParam(2, $tm_info['imdb_id']);
 $stmt->bindParam(3, $tm_info['original_title']);
 $stmt->bindParam(4, $tm_info['overview']);
 $stmt->bindParam(5, $tm_info['poster_path']);
 $stmt->bindParam(6, $tm_info['release_date']);
 $stmt->bindParam(7, $tm_info['title']);
 $stmt->bindParam(8, $om_info['imdbRating']);
 $stmt->bindParam(9, $tm_info['backdrop_path']);
 $stmt->bindParam(10, $str_genres);
 $stmt->bindParam(11, $om_info['Actors']);
 $stmt->bindParam(12, $om_info['Director']);
 $stmt->bindParam(13, $idx_title);
예제 #2
0
include_once dirname(__FILE__) . '/ressources/class.squid.inc';
include_once dirname(__FILE__) . '/ressources/class.dansguardian.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . '/framework/frame.class.inc';
include_once dirname(__FILE__) . "/ressources/class.categorize.externals.inc";
include_once dirname(__FILE__) . "/ressources/class.ccurl.inc";
include_once dirname(__FILE__) . "/ressources/class.tcpip.inc";
include_once dirname(__FILE__) . "/ressources/smtp/smtp.php";
include_once dirname(__FILE__) . '/ressources/class.mime.parser.inc';
include_once dirname(__FILE__) . '/ressources/class.rfc822.addresses.inc';
include_once dirname(__FILE__) . '/ressources/class.squid.categorize.generic.inc';
if ($argv[1] == "--push") {
    PushToRepo_alls();
    exit;
}
GetIndex();
function GetIndex()
{
    $WORKING_DIR = "/home/working_toulouse_databases";
    $WORKING_DOWNLOAD = "{$WORKING_DIR}/dowloads";
    $WORKING_UPLOAD = "{$WORKING_DIR}/uploads";
    @mkdir($WORKING_DOWNLOAD, 0755, true);
    @mkdir($WORKING_UPLOAD, 0755, true);
    $unix = new unix();
    $tar = $unix->find_program("tar");
    $catz = new mysql_catz();
    $tmpfile = $unix->FILE_TEMP();
    $tmpdir = $unix->TEMP_DIR();
    $rm = $unix->find_program("rm");
    $mainuri = "ftp://ftp.univ-tlse1.fr/pub/reseau/cache/squidguard_contrib";
    $EXEC_NICE = $unix->EXEC_NICE();
예제 #3
0
$currentSlide = filter_input(INPUT_POST, "slideNumber", FILTER_SANITIZE_NUMBER_INT);
try {
    $pdo = DataBase::GetPDO();
} catch (Exception $error) {
    echo $error;
}
$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
$sql = "SELECT * FROM `mkSlide` ORDER BY `priority` DESC, `id` ASC ";
$sth = $pdo->prepare($sql);
if (!$sth) {
    var_dump($pdo->errorInfo());
} else {
    $sth->execute();
}
$res = $sth->fetchAll();
$index = GetIndex('id', $currentSlide, $res);
$count = count($res);
$loopCount = 0;
//Check if any images to show
do {
    if ($count - 1 <= $index) {
        $index = 0;
    } else {
        $index++;
    }
} while (!InTimeArea($index, $res) && $count > $loopCount++);
//the result mus be in time area.
if ($loopCount > $count) {
    //No images to show
} else {
    $json = json_encode($res[$index], true);
예제 #4
0
<?php

include "SubIndex.php";
$db = new SQLite3('videoworld.sqlite');
$res = $db->query('SELECT id,title FROM movies');
$arr = array();
while ($row2 = $res->fetchArray(SQLITE3_ASSOC)) {
    $arr[$row2['id']] = GetIndex($row2['title']);
}
foreach ($arr as $id => $str_c02) {
    echo $str_c02;
    $stmt = $db->prepare('UPDATE movies SET idx_title=? WHERE id=?');
    $stmt->bindParam(1, $str_c02);
    $stmt->bindParam(2, $id);
    $rc = $stmt->execute();
}
$db->close();
예제 #5
0
<?php

include "SubIndex.php";
$ofs = $_POST["ofs"];
$found = 0;
$db = new SQLite3('MyVideos105.db');
$res = $db->query('SELECT idMovie,c00 FROM movie LIMIT 50 OFFSET ' . $ofs);
$arr = array();
while ($row2 = $res->fetchArray(SQLITE3_ASSOC)) {
    $found = 1;
    $arr[$row2['idMovie']] = GetIndex($row2['c00']);
}
foreach ($arr as $idMovie => $str_c02) {
    echo $str_c02 . '<BR>';
    $stmt = $db->prepare('UPDATE movie SET c02=? WHERE idMovie=?');
    $stmt->bindParam(1, $str_c02);
    $stmt->bindParam(2, $idMovie);
    $rc = $stmt->execute();
}
$db->close();
if ($found) {
    $ofs = $ofs + 50;
    echo '<script>$.post("' . $_SERVER['PHP_SELF'] . '",{ofs:' . $ofs . '},AppendBody);document.title = "Wait(' . $ofs . ') ...";</script>';
} else {
    echo '<script>document.title = "Ready!";</script>';
}