Merge pull request #8 from kingprapop/main

add support rom zip
This commit is contained in:
Ramaerel 2023-10-29 10:53:33 +10:00 committed by GitHub
commit ba43ff1b3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5434 additions and 2 deletions

5421
pclzip.lib.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,18 @@
//Find console
$name = basename($_GET['game']);
$ext = explode(".", $name);
$ext = end($ext);
$ext = strtolower(end($ext));
//for zipfile
if ($ext=='zip'){
$zip = new ZipArchive;
if ($zip->open("roms/".$name))
{
$names =$zip->getNameIndex(0);
$ext0 = explode(".", $names);
$ext = strtolower(end($ext));
}
}
if (in_array($ext, $nes)) { $console = 'nes'; }
else if (in_array($ext, $snes)) { $console = 'snes'; }
@ -153,4 +164,4 @@
</script>
<script src='data/loader.js'></script>
</body>
</html>
</html>