Example #1
0
<?php

require_once dirname(__FILE__) . '/../../www/config.php';
use newznab\db\Settings;
$db = new Settings();
$t = new TvRage();
//
// all rage entries with a blank description
$rows = $db->query("select ID, releasetitle from tvrage\n                            where description is null\n                            and rageID in (select distinct rageID from releases)\n                            order by ID desc");
echo "Updating " . count($rows) . " entries \n";
foreach ($rows as $row) {
    $t->refreshRageInfo($row["id"]);
    echo "Refreshing " . $row["releasetitle"] . "\n";
}
Example #2
0
<?php

require_once "config.php";
$page = new AdminPage();
$tvrage = new TvRage();
$id = 0;
// set the current action
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
switch ($action) {
    case 'update':
        $tvrage->refreshRageInfo($_GET["id"]);
        if (isset($_GET['from']) && !empty($_GET['from'])) {
            header("Location:" . $_GET['from']);
            exit;
        }
        header("Location:" . WWW_TOP . "/rage-edit.php?id=" . $_GET["id"]);
        exit;
    case 'submit':
        if ($_POST["id"] == "") {
            $imgbytes = "";
            if ($_FILES['imagedata']['size'] > 0) {
                $fileName = $_FILES['imagedata']['name'];
                $tmpName = $_FILES['imagedata']['tmp_name'];
                $fileSize = $_FILES['imagedata']['size'];
                $fileType = $_FILES['imagedata']['type'];
                //
                // check the uploaded file is actually an image.
                //
                $file_info = getimagesize($tmpName);
                if (!empty($file_info)) {
                    $fp = fopen($tmpName, 'r');