Esempio n. 1
0
<?php

//This script will update all records in the xxxinfo table where there is no cover
require_once dirname(__FILE__) . '/../../../www/config.php';
use nzedb\db\Settings;
$pdo = new Settings();
$movie = new XXX(['Echo' => true, 'Settings' => $pdo]);
$movies = $pdo->queryDirect("SELECT title FROM xxxinfo WHERE cover = 0");
if ($movies instanceof Traversable) {
    echo $pdo->log->primary("Updating " . number_format($movies->rowCount()) . " movie covers.");
    foreach ($movies as $mov) {
        $starttime = microtime(true);
        $mov = $movie->updateXXXInfo($mov['title']);
        // sleep so that it's not ddos' the site
        $diff = floor((microtime(true) - $starttime) * 1000000);
        if (333333 - $diff > 0) {
            echo "\nsleeping\n";
            usleep(333333 - $diff);
        }
    }
    echo "\n";
}
Esempio n. 2
0
     if ($mov && isset($mov['title'])) {
         $mov['title'] = str_replace(array('/', '\\'), '', $mov['title']);
         $mov['actors'] = $movie->makeFieldLinks($mov, 'actors');
         $mov['genre'] = $movie->makeFieldLinks($mov, 'genre');
         $mov['director'] = $movie->makeFieldLinks($mov, 'director');
     } else {
         if ($traktSummary !== false) {
             $mov['title'] = str_replace(array('/', '\\'), '', $traktSummary['title']);
         } else {
             $mov = false;
         }
     }
 }
 $xxx = '';
 if ($data['xxxinfo_id'] != '' && $data['xxxinfo_id'] != 0) {
     $x = new XXX();
     $xxx = $x->getXXXInfo($data['xxxinfo_id']);
     if (isset($xxx['trailers'])) {
         $xxx['trailers'] = $x->insertSwf($xxx['classused'], $xxx['trailers']);
     }
     if ($xxx && isset($xxx['title'])) {
         $xxx['title'] = str_replace(array('/', '\\'), '', $xxx['title']);
         $xxx['actors'] = $x->makeFieldLinks($xxx, 'actors');
         $xxx['genre'] = $x->makeFieldLinks($xxx, 'genre');
         $xxx['director'] = $x->makeFieldLinks($xxx, 'director');
     } else {
         $xxx = false;
     }
 }
 $game = '';
 if ($data['gamesinfo_id'] != '') {
Esempio n. 3
0
[expect php]
[file]
<?php 
function my_autoload($name)
{
    eval('
		class ' . $name . '
		{
			function bar(){ echo "bar"; }	
		}
		');
}
spl_autoload_register("my_autoload");
//
// note
// the class must be declared within an inclusion,
// because class declaration is performed before any other code,
// so in case it would be in the same file as spl_autoload_register,
// it sould be performed before autoload initialization
//
// same in PHP
//
include "Autoload_extends.inc";
$x = new XXX();
$x->foo();
$x->bar();
Esempio n. 4
0
<?php

if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$movie = new XXX();
if (isset($_GET["id"]) && ctype_digit($_GET["id"])) {
    $mov = $movie->getXXXInfo($_GET['id']);
    if (!$mov) {
        $page->show404();
    }
    $mov['actors'] = $movie->makeFieldLinks($mov, 'actors');
    $mov['genre'] = $movie->makeFieldLinks($mov, 'genre');
    $mov['director'] = $movie->makeFieldLinks($mov, 'director');
    $page->smarty->assign('movie', $mov);
    $page->title = "Info for " . $mov['title'];
    $page->meta_title = "";
    $page->meta_keywords = "";
    $page->meta_description = "";
    $page->smarty->registerPlugin('modifier', 'ss', 'stripslashes');
    $modal = false;
    if (isset($_GET['modal'])) {
        $modal = true;
        $page->smarty->assign('modal', true);
    }
    $page->content = $page->smarty->fetch('viewxxx.tpl');
    if ($modal) {
        echo $page->content;
    } else {
        $page->render();
    }
Esempio n. 5
0
<?php

if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$movie = new XXX();
$cat = new Category();
$moviecats = $cat->getChildren(Category::CAT_PARENT_XXX);
$mtmp = array();
foreach ($moviecats as $mcat) {
    $mtmp[$mcat['id']] = $mcat;
}
$category = Category::CAT_PARENT_XXX;
if (isset($_REQUEST['t']) && array_key_exists($_REQUEST['t'], $mtmp)) {
    $category = $_REQUEST['t'] + 0;
}
$catarray = array();
$catarray[] = $category;
$page->smarty->assign('catlist', $mtmp);
$page->smarty->assign('category', $category);
$browsecount = $movie->getXXXCount($catarray, -1, $page->userdata['categoryexclusions']);
$offset = isset($_REQUEST['offset']) && ctype_digit($_REQUEST['offset']) ? $_REQUEST["offset"] : 0;
$ordering = $movie->getXXXOrdering();
$orderby = isset($_REQUEST['ob']) && in_array($_REQUEST['ob'], $ordering) ? $_REQUEST['ob'] : '';
$results = $movies = array();
$results = $movie->getXXXRange($catarray, $offset, ITEMS_PER_COVER_PAGE, $orderby, -1, $page->userdata['categoryexclusions']);
foreach ($results as $result) {
    $result['genre'] = $movie->makeFieldLinks($result, 'genre');
    $result['actors'] = $movie->makeFieldLinks($result, 'actors');
    $result['director'] = $movie->makeFieldLinks($result, 'director');
    $movies[] = $result;