1
0

ProgramsList+ProgramsView+ProgramsDownload

This commit is contained in:
2020-01-16 11:34:01 +01:00
parent cdec6903f6
commit e1851fce69
9 changed files with 186 additions and 208 deletions

View File

@@ -1,21 +1,29 @@
<?php
require_once (__DIR__ . '/../internals/base.php');
require_once (__DIR__ . '/../internals/programs.php');
require_once (__DIR__ . '/../internals/ParsedownCustom.php');
require_once (__DIR__ . '/../internals/website.php');
$internalname = $OPTIONS['id'];
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
/** @var URLRoute $ROUTE */ global $ROUTE;
/** @var Website $SITE */ global $SITE;
?>
$prog = Programs::getProgramByInternalName($internalname);
if ($prog === NULL) httpError(404, 'Program not found');
<?php
$progid = $ROUTE->parameter['id'];
// This page is only for old links.
// Current version does use direct links
$prog = $SITE->modules->Programs()->getProgramByInternalName($progid);
if ($prog === null) { $FRAME_OPTIONS->setForced404("Program not found"); return; }
foreach (Programs::getURLs($prog) as $xurl)
$FRAME_OPTIONS->title = null;
$FRAME_OPTIONS->canonical_url = null;
$FRAME_OPTIONS->activeHeader = null;
$FRAME_OPTIONS->frame = 'nocontent_frame.php';
foreach ($SITE->modules->Programs()->getURLs($prog) as $xurl)
{
if ($xurl['type'] === 'download') { header('Location: ' . $xurl['href']); exit; }
if ($xurl['type'] === 'playstore') { header('Location: ' . $xurl['href']); exit; }
if ($xurl['type'] === 'amazonappstore') { header('Location: ' . $xurl['href']); exit; }
if ($xurl['type'] === 'windowsstore') { header('Location: ' . $xurl['href']); exit; }
if ($xurl['type'] === 'itunesstore') { header('Location: ' . $xurl['href']); exit; }
}
if ($xurl['type'] === 'download') { $FRAME_OPTIONS->setForcedRedirect($xurl['href']); return; }
if ($xurl['type'] === 'playstore') { $FRAME_OPTIONS->setForcedRedirect($xurl['href']); return; }
if ($xurl['type'] === 'amazonappstore') { $FRAME_OPTIONS->setForcedRedirect($xurl['href']); return; }
if ($xurl['type'] === 'windowsstore') { $FRAME_OPTIONS->setForcedRedirect($xurl['href']); return; }
if ($xurl['type'] === 'itunesstore') { $FRAME_OPTIONS->setForcedRedirect($xurl['href']); return; }
}
?>