mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
Update ajax pages
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2017-08-07 DariusIII
|
||||
* Chg: Update ajax pages
|
||||
* Chg: Update Forum class
|
||||
* Chg: Update api page
|
||||
* Chg: Update MiscSorter
|
||||
|
||||
@@ -17,27 +17,27 @@ if (!$redata) {
|
||||
print 'No media info';
|
||||
} else {
|
||||
print "<table>\n";
|
||||
if ($redata["videocodec"] != "" && $redata["containerformat"] != "") {
|
||||
$redata["videocodec"] = $re->makeCodecPretty($redata["videocodec"]);
|
||||
print "<tr><th>Format:</th><td>" . htmlentities($redata["videocodec"], ENT_QUOTES) . " - " . htmlentities($redata["containerformat"], ENT_QUOTES) . "</td></tr>\n";
|
||||
if ($redata['videocodec'] !== '' && $redata['containerformat'] !== '') {
|
||||
$redata['videocodec'] = $re->makeCodecPretty($redata['videocodec']);
|
||||
print '<tr><th>Format:</th><td>' . htmlentities($redata['videocodec'], ENT_QUOTES) . ' - ' . htmlentities($redata['containerformat'], ENT_QUOTES) . "</td></tr>\n";
|
||||
}
|
||||
if ($redata["videoduration"] != "") {
|
||||
print "<tr><th>Duration:</th><td>" . htmlentities($redata["videoduration"], ENT_QUOTES) . "</td></tr>\n";
|
||||
if ($redata['videoduration'] !== '') {
|
||||
print '<tr><th>Duration:</th><td>' . htmlentities($redata['videoduration'], ENT_QUOTES) . "</td></tr>\n";
|
||||
}
|
||||
if ($redata["size"] != "") {
|
||||
print "<tr><th>Resolution:</th><td>" . htmlentities($redata["size"], ENT_QUOTES) . "</td></tr>\n";
|
||||
if ($redata['size'] !== '') {
|
||||
print '<tr><th>Resolution:</th><td>' . htmlentities($redata['size'], ENT_QUOTES) . "</td></tr>\n";
|
||||
}
|
||||
if ($redata["videoaspect"] != "") {
|
||||
print "<tr><th>Aspect Ratio:</th><td>" . htmlentities($redata["videoaspect"], ENT_QUOTES) . "</td></tr>\n";
|
||||
if ($redata['videoaspect'] !== '') {
|
||||
print '<tr><th>Aspect Ratio:</th><td>' . htmlentities($redata['videoaspect'], ENT_QUOTES) . "</td></tr>\n";
|
||||
}
|
||||
if ($redata["audio"] != "" && $redata["audio"] != ", ") {
|
||||
print "<tr><th>Audio Languages:</th><td>" . htmlentities($redata["audio"], ENT_QUOTES) . "</td></tr>\n";
|
||||
if ($redata['audio'] !== '' && $redata['audio'] !== ', ') {
|
||||
print '<tr><th>Audio Languages:</th><td>' . htmlentities($redata['audio'], ENT_QUOTES) . "</td></tr>\n";
|
||||
}
|
||||
if ($redata["audioformat"] != "" && $redata["audioformat"] != ", ") {
|
||||
print "<tr><th>Audio Format:</th><td>" . htmlentities($redata["audioformat"], ENT_QUOTES) . "</td></tr>\n";
|
||||
if ($redata['audioformat'] !== '' && $redata['audioformat'] !== ', ') {
|
||||
print '<tr><th>Audio Format:</th><td>' . htmlentities($redata['audioformat'], ENT_QUOTES) . "</td></tr>\n";
|
||||
}
|
||||
if ($redata["subs"] != "") {
|
||||
print "<tr><th>Subtitles:</th><td>" . htmlentities($redata["subs"], ENT_QUOTES) . "</td></tr>\n";
|
||||
if ($redata['subs'] !== '') {
|
||||
print '<tr><th>Subtitles:</th><td>' . htmlentities($redata['subs'], ENT_QUOTES) . "</td></tr>\n";
|
||||
}
|
||||
print "</table>";
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
@@ -6,15 +6,15 @@ if (!$page->users->isLoggedIn()) {
|
||||
$page->show403();
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST["id"])) {
|
||||
if (!isset($_REQUEST['id'])) {
|
||||
$page->show404();
|
||||
}
|
||||
|
||||
$pre = new PreDb(['Settings' => $page->settings]);
|
||||
$predata = $pre->getOne($_REQUEST["id"]);
|
||||
$predata = $pre->getOne($_REQUEST['id']);
|
||||
|
||||
if (!$predata) {
|
||||
print "No pre info";
|
||||
print 'No pre info';
|
||||
} else {
|
||||
print "<table>\n";
|
||||
if (isset($predata['nuked'])) {
|
||||
@@ -37,25 +37,22 @@ if (!$predata) {
|
||||
break;
|
||||
}
|
||||
if ($nuked !== '') {
|
||||
print "<tr><th>" . $nuked . ":</th><td>" . htmlentities((isset($predata['nukereason']) ? $predata['nukereason'] : ''), ENT_QUOTES) . "</td></tr>\n";
|
||||
print '<tr><th>' . $nuked . ':</th><td>' . htmlentities($predata['nukereason'] ?? '', ENT_QUOTES) . "</td></tr>\n";
|
||||
}
|
||||
}
|
||||
print "<tr><th>Title:</th><td>" . htmlentities($predata["title"], ENT_QUOTES) . "</td></tr>\n";
|
||||
if (isset($predata["category"]) && $predata["category"] != "") {
|
||||
print "<tr><th>Cat:</th><td>" . htmlentities($predata["category"], ENT_QUOTES) . "</td></tr>\n";
|
||||
print "<tr><th>Title:</th><td>" . htmlentities($predata['title'], ENT_QUOTES) . "</td></tr>\n";
|
||||
if (isset($predata['category']) && $predata['category'] !== '') {
|
||||
print '<tr><th>Cat:</th><td>' . htmlentities($predata['category'], ENT_QUOTES) . "</td></tr>\n";
|
||||
}
|
||||
print "<tr><th>Source:</th><td>" . htmlentities($predata["source"], ENT_QUOTES) . "</td></tr>\n";
|
||||
if (isset($predata["size"])) {
|
||||
if (preg_match('/\d+/', $predata["size"], $size)) {
|
||||
;
|
||||
}
|
||||
if (isset($size[0]) && $size[0] > 0) {
|
||||
print "<tr><th>Size:</th><td>" . htmlentities($predata["size"], ENT_QUOTES) . "</td></tr>\n";
|
||||
print '<tr><th>Source:</th><td>' . htmlentities($predata['source'], ENT_QUOTES) . "</td></tr>\n";
|
||||
if (isset($predata['size'])) {
|
||||
if (isset($predata['size'][0]) && $predata['size'][0] > 0) {
|
||||
print '<tr><th>Size:</th><td>' . htmlentities($predata['size'], ENT_QUOTES) . "</td></tr>\n";
|
||||
}
|
||||
}
|
||||
if (isset($predata['files'])) {
|
||||
print "<tr><th>Files:</th><td>" . htmlentities((preg_match('/F|B/', $predata['files'], $match) ? $predata["files"] : ($predata["files"] . 'MB')), ENT_QUOTES) . "</td></tr>\n";
|
||||
print '<tr><th>Files:</th><td>' . htmlentities((preg_match('/F|B/', $predata['files'], $match) ? $predata['files'] : ($predata['files'] . 'MB')), ENT_QUOTES) . "</td></tr>\n";
|
||||
}
|
||||
print "<tr><th>Pred:</th><td>" . htmlentities($predata["predate"], ENT_QUOTES) . "</td></tr>\n";
|
||||
print "</table>";
|
||||
print '<tr><th>Pred:</th><td>' . htmlentities($predata['predate'], ENT_QUOTES) . "</td></tr>\n";
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
|
||||
use App\Models\Settings;
|
||||
|
||||
if (!$page->users->isLoggedIn())
|
||||
if (!$page->users->isLoggedIn()) {
|
||||
$page->show403();
|
||||
}
|
||||
|
||||
if (isset($_GET['action']) && $_GET['action'] == "1" && isset($_GET['emailto']))
|
||||
{
|
||||
if (isset($_GET['action'], $_GET['emailto']) && (int)$_GET['action'] === 1) {
|
||||
$emailto = $_GET['emailto'];
|
||||
$ret = $page->users->sendInvite(Settings::value('site.main.title'), Settings::value('site.main.email'), $page->serverurl, $page->users->currentUserId(), $emailto);
|
||||
if (!$ret)
|
||||
print "Invite not sent.";
|
||||
else
|
||||
print "Invite sent. Alternatively paste them following link to register - ".$ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Invite not sent.";
|
||||
if (!$ret) {
|
||||
print 'Invite not sent.';
|
||||
} else {
|
||||
print 'Invite sent. Alternatively paste them following link to register - ' . $ret;
|
||||
}
|
||||
} else {
|
||||
print 'Invite not sent.';
|
||||
}
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
<?php
|
||||
use nntmux\ReleaseFiles;
|
||||
|
||||
if (!$page->users->isLoggedIn())
|
||||
if (!$page->users->isLoggedIn()) {
|
||||
$page->show403();
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST["id"]))
|
||||
if (!isset($_REQUEST['id'])) {
|
||||
$page->show404();
|
||||
}
|
||||
|
||||
$rf = new ReleaseFiles();
|
||||
$files = $rf->getByGuid($_REQUEST["id"]);
|
||||
$files = $rf->getByGuid($_REQUEST['id']);
|
||||
|
||||
if (count($files) == 0)
|
||||
print "No files";
|
||||
else
|
||||
{
|
||||
if (count($files) === 0) {
|
||||
print 'No files';
|
||||
} else {
|
||||
//print "<h3 class=\"tooltiphead\">rar archive contains...</h3>\n";
|
||||
print "<ul>\n";
|
||||
foreach ($files as $f)
|
||||
print "<li>".htmlentities($f["name"], ENT_QUOTES)." ".($f["passworded"] == 1?"<img width=\"12\" src=\"".WWW_TOP."/themes/shared/images/icons/lock.gif\" />":"")."</li>\n";
|
||||
print "</ul>";
|
||||
foreach ($files as $f) {
|
||||
print '<li>' . htmlentities($f['name'], ENT_QUOTES) . ' ' . ($f['passworded'] === 1 ? "<img width=\"12\" src=\"" . WWW_TOP . "/themes/shared/images/icons/lock.gif\" />" : '') . "</li>\n";
|
||||
}
|
||||
print '</ul>';
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
use nntmux\Category;
|
||||
use nntmux\Releases;
|
||||
|
||||
$page = new AdminPage(true);
|
||||
$page = new AdminPage();
|
||||
$releases = new Releases(['Settings' => $page->settings]);
|
||||
$category = new Category(['Settings' => $page->settings]);
|
||||
|
||||
// Set the current action.
|
||||
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
|
||||
$action = $_REQUEST['action'] ?? '';
|
||||
|
||||
// Request is for id, but guid is actually being provided
|
||||
if (isset($_REQUEST['id']) && is_array($_REQUEST['id'])) {
|
||||
@@ -26,19 +26,19 @@ switch ($action) {
|
||||
case 'doedit':
|
||||
case 'edit':
|
||||
$success = false;
|
||||
if ($action == 'doedit') {
|
||||
if ($action === 'doedit') {
|
||||
$success = $releases->updateMulti(
|
||||
$_POST["id"],
|
||||
$_POST["category"],
|
||||
$_POST["grabs"],
|
||||
$_POST["videosid"],
|
||||
$_POST["episodesid"],
|
||||
$_POST["anidbid"],
|
||||
$_POST['id'],
|
||||
$_POST['category'],
|
||||
$_POST['grabs'],
|
||||
$_POST['videosid'],
|
||||
$_POST['episodesid'],
|
||||
$_POST['anidbid'],
|
||||
$_POST['imdbid']);
|
||||
}
|
||||
$page->smarty->assign('release', $rel);
|
||||
$page->smarty->assign('success', $success);
|
||||
$page->smarty->assign('from', (isset($_POST['from']) ? $_POST['from'] : ''));
|
||||
$page->smarty->assign('from', $_POST['from'] ?? '');
|
||||
$page->smarty->assign('catlist', $category->getForSelect(false));
|
||||
$page->content = $page->smarty->fetch('ajax_release-edit.tpl');
|
||||
echo $page->content;
|
||||
|
||||
@@ -3,33 +3,30 @@
|
||||
use nntmux\Releases;
|
||||
use nntmux\Videos;
|
||||
|
||||
if (!$page->users->isLoggedIn())
|
||||
if (!$page->users->isLoggedIn()) {
|
||||
$page->show403();
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST["id"]))
|
||||
if (!isset($_REQUEST['id'])) {
|
||||
$page->show404();
|
||||
}
|
||||
|
||||
$r = new Releases();
|
||||
$rel = $r->getByGuid($_REQUEST["id"]);
|
||||
|
||||
if (!$rel)
|
||||
print "No tv info";
|
||||
else
|
||||
{
|
||||
|
||||
if (!$rel) {
|
||||
print 'No tv info';
|
||||
} else {
|
||||
print "<ul class=\"ui-tooltip-nntmux\">\n";
|
||||
print "<li>".htmlentities($rel["title"], ENT_QUOTES)."</li>\n";
|
||||
print "<li>Aired on ".date("F j, Y", strtotime($rel["firstaired"]))."</li>\n";
|
||||
print "<li>".htmlentities($rel['title'], ENT_QUOTES)."</li>\n";
|
||||
print "<li>Aired on ".date('F j, Y', strtotime($rel['firstaired']))."</li>\n";
|
||||
print "</ul>";
|
||||
|
||||
if (isset($rel["videos_id"]) && $rel["videos_id"] > 0)
|
||||
{
|
||||
if (isset($rel['videos_id']) && $rel['videos_id'] > 0) {
|
||||
$t = new Videos();
|
||||
$show = $t->getByVideoID($rel["videos_id"]);
|
||||
if (count($show) > 0)
|
||||
{
|
||||
if ($show["image"] != "0")
|
||||
print "<img class=\"shadow\" src=\"/covers/tvshows/" . $show["id"] . ".jpg\" width=\"180\"/>";
|
||||
$show = $t->getByVideoID($rel['videos_id']);
|
||||
if (count($show) > 0 && (int)$show['image'] !== 0) {
|
||||
print "<img class=\"shadow\" src=\"/covers/tvshows/" . $show['id'] . ".jpg\" width=\"180\"/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user