- fix loading version number from renamed internal assets
- remove various php notice/warnings from the webserver logs
This commit is contained in:
Jon Atkins 2013-05-03 05:39:54 +01:00
parent 48a7a688f8
commit 9575e4b4c2
4 changed files with 24 additions and 13 deletions

View File

@ -86,6 +86,8 @@ $pages = Array (
'donate' => '<i class="icon-gift"></i> Donate', 'donate' => '<i class="icon-gift"></i> Donate',
); );
$page = 'home';
if ( array_key_exists ( 'page', $_REQUEST ) )
$page = $_REQUEST['page']; $page = $_REQUEST['page'];
if ( ! array_key_exists ( $page, $pages ) ) if ( ! array_key_exists ( $page, $pages ) )
$page = "home"; $page = "home";

View File

@ -17,15 +17,21 @@ function getMobileVersion ( $apkfile )
$archive = $apkinfo->getApkArchive(); $archive = $apkinfo->getApkArchive();
$iitc_file = "assets/total-conversion-build.user.js";
if ( $archive->statName ( $iitc_file ) === FALSE );
$iitc_file = "assets/iitc.js";
$stream = $archive->getStream ( $iitc_file ); $stream = $archive->getStream ( "assets/total-conversion-build.user.js" );
if ( ! $stream )
$stream = $archive->getStream ( "assets/iitc.js" );
if ( $stream )
{
$header = loadUserScriptHeader ( $stream ); $header = loadUserScriptHeader ( $stream );
$result['iitc_version'] = $header['@version']; $result['iitc_version'] = $header['@version'];
}
else
{
$result['iitc_version'] = 'unknown';
}
return $result; return $result;
} }
@ -40,7 +46,7 @@ function iitcMobileDownload ( $apkfile )
# we need an absolute link for the QR Code # we need an absolute link for the QR Code
# get the URL of this page itself # get the URL of this page itself
$pageurl = ($_SERVER['HTTPS'] ? "https" : "http")."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $pageurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? "https" : "http")."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$apkurl = url_to_absolute ( $pageurl, $apkfile ); $apkurl = url_to_absolute ( $pageurl, $apkfile );
?> ?>

View File

@ -26,7 +26,7 @@ function loadUserScriptHeader($file)
} }
} }
fclose ( $f ); fclose ( $file );
return $result; return $result;
} }

View File

@ -19,10 +19,13 @@ include_once ( "code/desktop-download.php" );
$path = "test"; $path = "test";
if ( array_key_exists ( 'build', $_REQUEST ) )
{
if ( $_REQUEST['build'] == 'experimental' ) if ( $_REQUEST['build'] == 'experimental' )
$path = "experimental"; $path = "experimental";
if ( $_REQUEST['build'] == 'dev' ) if ( $_REQUEST['build'] == 'dev' )
$path = "dev"; $path = "dev";
}
if ( $path != "test" ) if ( $path != "test" )
print "<div class=\"alert alert-block alert-error\"><b>NOTE</b>: A non-standard test build, <b>$path</b>, is currently selected. The notes <b>may not apply!</b> <a href=\"?page=test\">Return to the standard test build</a>.</div>"; print "<div class=\"alert alert-block alert-error\"><b>NOTE</b>: A non-standard test build, <b>$path</b>, is currently selected. The notes <b>may not apply!</b> <a href=\"?page=test\">Return to the standard test build</a>.</div>";