} printf("%s INFO - Testing UTC/Local conversions [1/6]...", date("Y-m-d H:i:s")); $refa = $spotnab->utc2local(); $refb = $spotnab->utc2local($spotnab->local2utc($refa)); echo $refa == $refb ? "Successful!\n" : "Failed!\n"; printf("%s INFO - Testing UTC/Local conversions [2/6]...", date("Y-m-d H:i:s")); $refa = $spotnab->local2utc(); $refb = $spotnab->local2utc($spotnab->utc2local($refa)); echo $refa == $refb ? "Successful!\n" : "Failed!\n"; printf("%s INFO - Testing UTC/Local conversions [3/6]...", date("Y-m-d H:i:s")); $refa = $spotnab->local2utc(date("Y-m-d H:i:s")); $refb = $spotnab->local2utc($spotnab->utc2local($refa)); echo $refa == $refb ? "Successful!\n" : "Failed!\n"; printf("%s INFO - Testing UTC/Local conversions [4/6]...", date("Y-m-d H:i:s")); $refa = $spotnab->utc2local(time()); $refb = $spotnab->utc2local($spotnab->local2utc($refa)); echo $refa == $refb ? "Successful!\n" : "Failed!\n"; printf("%s INFO - Testing UTC/Local conversions [5/6]...", date("Y-m-d H:i:s")); $refa = $spotnab->local2utc(time()); $refb = $spotnab->local2utc($spotnab->utc2local($refa)); echo $refa == $refb ? "Successful!\n" : "Failed!\n"; printf("%s INFO - Testing UTC/Local conversions [6/6]...", date("Y-m-d H:i:s")); $refa = $spotnab->utc2local(gmdate("Y-m-d H:i:s")); $refb = $spotnab->utc2local($spotnab->local2utc($refa)); echo $refa == $refb ? "Successful!\n" : "Failed!\n"; } if (array_key_exists("o", $options) || array_key_exists("clean-orphan-comments", $options)) { echo "Removing orphan comments..."; $spotnab = new SpotNab(); printf("%d record(s) removed.\n", $spotnab->orphan_comment_clean()); }
/** * Process Global IDs */ public function processSpotnab() { $spotnab = new \SpotNab(); $processed = $spotnab->processGID(500); if ($processed > 0) { if ($this->echooutput) { $this->pdo->log->doEcho($this->pdo->log->primary('Updating GID in releases table ' . $processed . ' release(s) updated')); } } $spotnab->auto_post_discovery(); $spotnab->fetch_discovery(); $spotnab->fetch(); $spotnab->post(); $spotnab->auto_clean(); }
<?php require_once "config.php"; $page = new AdminPage(); if (isset($_GET['id'])) { $spotnab = new SpotNab(); $spotnab->deleteSource($_GET['id']); } $referrer = $_SERVER['HTTP_REFERER']; header("Location: " . $referrer);
/** * Process Global IDs */ public function processSpotNab() { $spotnab = new SpotNab(); $processed = $spotnab->processGID(500); if ($processed > 0) { printf("PostPrc : Updating GID in releases table %d release(s) updated\n", $processed); } $spotnab->auto_post_discovery(); $spotnab->fetch_discovery(); $spotnab->fetch(); $spotnab->post(); $spotnab->auto_clean(); }
<?php require_once "config.php"; $page = new AdminPage(); $spotnab = new SpotNab(); $id = 0; // set the current action $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view'; switch ($action) { case 'add': $page->title = "Spotnab Source Add"; $source = array(); $source["description"] = ''; $row = $spotnab->getDefaultValue('spotnabsources', 'username'); $source["username"] = $row[0]["Default"]; $row = $spotnab->getDefaultValue('spotnabsources', 'useremail'); $source["useremail"] = $row[0]["Default"]; $row = $spotnab->getDefaultValue('spotnabsources', 'usenetgroup'); $source["usenetgroup"] = $row[0]["Default"]; $source["publickey"] = ''; $page->smarty->assign('source', $source); break; case 'submit': if ($_POST["id"] == "") { $ret = $spotnab->addSource($_POST['description'], $_POST['username'], $_POST['useremail'], $_POST['usenetgroup'], $_POST['publickey']); header("Location:" . WWW_TOP . "/spotnab-list.php"); } else { $ret = $spotnab->updateSource($_POST['id'], $_POST['description'], $_POST['username'], $_POST['useremail'], $_POST['usenetgroup'], $_POST['publickey']); header("Location:" . WWW_TOP . "/spotnab-list.php"); } break;
<?php require_once "config.php"; $page = new AdminPage(); $spotnab = new SpotNab(); // set the current action $toggle = isset($_REQUEST['toggle']) ? $_REQUEST['toggle'] : 'view'; if (isset($_GET["toggle"]) && isset($_GET["id"])) { $spotnab->toggleSource($_GET["id"], $_GET["toggle"]); } $page->title = "Spotnab Sources List"; //get the list of Sources $spotnab = $spotnab->getSources(); $page->smarty->assign('spotnab', $spotnab); $page->content = $page->smarty->fetch('spotnab-list.tpl'); $page->render();