From c5fa8af8ae160208de6bcec9930028a33fb086b6 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 31 Mar 2016 01:22:43 -0700 Subject: [PATCH] Add code swiped from generate; misc fixes --- admin/parsenointro.php | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/admin/parsenointro.php b/admin/parsenointro.php index f88dafd..5897408 100644 --- a/admin/parsenointro.php +++ b/admin/parsenointro.php @@ -7,6 +7,22 @@ Original code by Matt Nadareski (darksabre76) ini_set('max_execution_time', 6000); // Set the execution time higher because DATs can be big +// Copy these from generate.php +$header = " + + + +
+ ".htmlspecialchars($datname)." + ".htmlspecialchars($datname)." + The Wizard of DATz + ".$version." + ".$version." + The Wizard of DATz + +
\n"; +$footer = "\n
"; + // Game, Name, CRC, MD5 $roms = array(); $vals = array(); @@ -92,13 +108,33 @@ foreach ($vals as $id) sleep(5); - if ($id == "0005") + if ($id == "0010") { break; } } -var_dump($roms); +// Now output the roms +ob_end_clean(); +header('content-type: application/x-gzip'); +header('Content-Disposition: attachment; filename="Nintendo DS Scene Releases ('.date("YmdHis").').xml.gz"'); + +echo gzencode($header, 9); +foreach ($roms as &$rom) +{ + // Check for blank CRC and MD5 + $rom[2] = ($rom[2] == "0" ? "00000000" : strtolower($rom[2])); + $rom[3] = ($rom[3] == "0" ? "d41d8cd98f00b204e9800998ecf8427e" : strtolower($rom[3])); + + $state = "\t\n". + "\t\t".$rom[0]."\n". + "\t\t\n". + "\t\n"; + + echo gzencode($state, 9); +} +echo gzencode($footer, 9); +die(); function proc_data($data) {