diff --git a/wizzardRedux/admin/onlinecheck.php b/wizzardRedux/admin/onlinecheck.php index 81499d2..15e5da9 100644 --- a/wizzardRedux/admin/onlinecheck.php +++ b/wizzardRedux/admin/onlinecheck.php @@ -22,9 +22,7 @@ Notes: - Vizzed Possible cookie usage TODO: Retool existing onlinecheck.php files to follow the new format. 3) check code flow to try to optimize -TODO: Most explode/implode can probably be changed to preg_match, just need to decipher them TODO: Document all required GET and POST vars for each page -TODO: Comment all of the code... TODO: VideopacNL uses a cookie to be able to access the board. This means you need to log in to the site and then copy the cookie as a param TODO: Can we run all online checks in a coherent way (in series, that is)? ------------------------------------------------------------------------------------ */ @@ -45,6 +43,7 @@ foreach ($result as $item) $dead = array( "8BitChip", "8BitCommodoreItalia", + "AcornPreservation", "Atarimania", "Cas2Rom", "Import64", @@ -55,10 +54,13 @@ $dead = array( "smartlip", ); +// If we don't have a source set, show the generic page if (!isset($_GET["source"])) { echo "

Please Choose a Site

\n"; + echo "Note: got to Apple2Online

\n"; + // List all files, auto-generate links to proper pages $files = scandir("../sites/", SCANDIR_SORT_NONE); foreach ($files as $file) @@ -71,7 +73,7 @@ if (!isset($_GET["source"])) } } - // List all sites that don't have checkers + // List all sources that don't have checkers echo "

Sites With No Checker

\n"; // Normalize the arrays because some names don't match 1:1 @@ -86,6 +88,8 @@ if (!isset($_GET["source"])) $newfiles[] = strtolower($file); } $newfiles = str_replace(".php", "", $newfiles); + + // Print out the source names with proper capitalization foreach (array_diff($newsites, $newfiles) as $key => $site) { echo $sites[$key]."
\n"; @@ -95,6 +99,7 @@ if (!isset($_GET["source"])) die(); } +/// If the checker requested doesn't exist, tell the user elseif (!file_exists("../sites/".$_GET["source"].".php")) { echo "The file you supply must be in /sites/
"; @@ -103,6 +108,7 @@ elseif (!file_exists("../sites/".$_GET["source"].".php")) die(); } +// Otherwise, we assume the soruce is good, and we attempt to load it $source = $_GET["source"]; echo "

Loading pages and links...

"; diff --git a/wizzardRedux/sites/6502dude.php b/wizzardRedux/sites/6502dude.php index f82df13..c23ec8b 100644 --- a/wizzardRedux/sites/6502dude.php +++ b/wizzardRedux/sites/6502dude.php @@ -32,11 +32,14 @@ $pages = array( 'http://armas.cbm8bit.com/ztaps.html', ); +echo "\n"; foreach ($pages as $newfile) { + echo ""; $query = get_data($newfile); // Read the whole page into one string - $query = preg_replace('/(\s+)/',' ', $query); // Remove all whitespace + $query = preg_replace('/(\s+)/',' ', $query); // Replace all whitespace with a single space $query = preg_replace('/(href=)("?)(\S+?)("?)(>)/','\1"\3"\5', $query); // Make sure all hrefs are quoted properly + $query = explode ('"; + echo "\n"; } -echo "\n"; +echo "
".$newfile."
Found new: ".$new.", old: ".$old."
\n"; + +if (sizeof($found) > 0) +{ + echo "

New files:

"; +} foreach ($found as $row) { - echo htmlspecialchars($row)."
"; - echo "".$row[0]."
"; + echo "".$row[1]."
\n"; } +echo "
\n"; + ?> \ No newline at end of file diff --git a/wizzardRedux/sites/8BitChip.php b/wizzardRedux/sites/8BitChip.php index 22e27b5..a214934 100644 --- a/wizzardRedux/sites/8BitChip.php +++ b/wizzardRedux/sites/8BitChip.php @@ -74,7 +74,7 @@ for ($xpage = 0; $xpage < $max; $xpage++) if (!$r_query[$url]) { - $found[] = array($title."{".$add."}.".$ext, $url); + $found[] = array($url, $title."{".$add."}.".$ext); $new++; } else @@ -94,21 +94,14 @@ for ($xpage = 0; $xpage < $max; $xpage++) print "new: ".$new.", old: ".$old."\n"; } -print "\nnew urls:\n\n"; -print "
";
-
-foreach ($found as $url)
+if (sizeof($found) > 0)
 {
-	print $url[1]."\n";
+	echo "

New files:

"; } -print "
";
-
-foreach ($found as $url)
+foreach ($found as $row)
 {
-	print "".$url[0]."\n";
+	echo "".$row[1]."
\n"; } -print "
"; - ?> \ No newline at end of file diff --git a/wizzardRedux/sites/ANN.php b/wizzardRedux/sites/ANN.php index f13d49c..a207286 100644 --- a/wizzardRedux/sites/ANN.php +++ b/wizzardRedux/sites/ANN.php @@ -6,53 +6,54 @@ $dirs = array( 'http://ann.hollowdreams.com/anndisks.html', ); -print "
check folders:\n\n";
-
+echo "\n";
 foreach ($dirs as $dir)
 {
-	if ($dir)
+	echo "";
+	$query = get_data($dir);
+	$query = explode(' href="', $query);
+	$query[0] = null;
+
+	$new = 0;
+	$old = 0;
+
+	foreach ($query as $row)
 	{
-		print "load: ".$dir."\n";
-		$query = get_data($dir);
-		$query = explode(' href="', $query);
-		$query[0] = null;
-	
-		$new = 0;
-		$old = 0;
-	
-		foreach ($query as $row)
+		if ($row)
 		{
-			if ($row)
+			$url = explode('"', $row);
+			$url = $url[0];
+
+			$ext = explode('.', $url);
+
+
+			if (!$r_query[$url])
 			{
-				$url = explode('"', $row);
-				$url = $url[0];
-	
-				$ext = explode('.', $url);
-	
-	
-				if (!$r_query[$url])
-				{
-					$found[] = $url;
-					$new++;
-				}
-				else
-				{
-					$old++;
-				}
-	
+				$found[] = $url;
+				$new++;
 			}
+			else
+			{
+				$old++;
+			}
+
 		}
-	
-		print "close: ".$dir."\n";
-		print "new: ".$new.", old: ".$old."\n";
 	}
+	echo "\n";
 }
 
-print "\nnew urls:\n\n";
+echo "
".$dir."Found new: ".$new.", old: ".$old."
\n"; -foreach ($found as $url) +if (sizeof($found) > 0) { - print "".$url."\n"; + echo "

New files:

"; } +foreach ($found as $row) +{ + echo "".$row."
\n"; +} + +echo "
\n"; + ?> \ No newline at end of file diff --git a/wizzardRedux/sites/AcornPreservation.php b/wizzardRedux/sites/AcornPreservation.php index 00c43a3..7e708d9 100644 --- a/wizzardRedux/sites/AcornPreservation.php +++ b/wizzardRedux/sites/AcornPreservation.php @@ -2,7 +2,7 @@ // Original code: The Wizard of DATz -$pages = Array( +$pages = array( "http://www.acornpreservation.org/main_tapes_games.html", "http://www.acornpreservation.org/main_discs_games.html", ); @@ -17,40 +17,42 @@ foreach ($pages as $page) $content = get_data($page); $content = explode('HREF="', $content); - $content[0] = null; + unset($content[0]); foreach ($content as $row) { - if ($row) - { - $url = explode('"', $row); - $url = $url[0]; - $ext = explode('.', $url); + $url = explode('"', $row); + $url = $url[0]; + $ext = explode('.', $url); - if (strtolower($ext[count($ext)-1])=='zip') + if (strtolower($ext[count($ext)-1])=='zip') + { + if (!$r_query[$url]) { - if (!$r_query[$url]) - { - $found[] = $url; - $new++; - } - else - { - $old++; - } + $found[] = $url; + $new++; } else { - $other++; + $old++; } } + else + { + $other++; + } } print "new ".$new.", old ".$old.", other ".$other."
\n"; } +if (sizeof($found) > 0) +{ + echo "

New files:

"; +} + foreach ($found as $row) { - print "".$row."
\n"; + echo "".$row."
\n"; } ?> \ No newline at end of file diff --git a/wizzardRedux/sites/AmstradESP.php b/wizzardRedux/sites/AmstradESP.php index 857a27b..7c5d462 100644 --- a/wizzardRedux/sites/AmstradESP.php +++ b/wizzardRedux/sites/AmstradESP.php @@ -28,103 +28,89 @@ $dirs = array( 'http://amstrad.es/publicaciones/publicaciones/cintas/index.html', ); -print "
check folders:\n\n";
-
+echo "\n";
 foreach ($dirs as $dir)
 {
-	if ($dir)
+	echo "";
+	$query = str_replace("\r\n", '', get_data($dir));
+	$query = explode('

', $row); + $ext = explode('<', $text[1]); + $text = explode('>', $text[0]); + $text = trim($text[1]); + $ext = trim($ext[0]); + $text = strtr($text.' ('.str_replace(', ',') (',$ext).')', $normalize_chars); + $query2 = get_data($url); + $query2 = explode('', $row); - $ext = explode('<', $text[1]); - $text = explode('>', $text[0]); - $text = trim($text[1]); - $ext = trim($ext[0]); - $text = strtr($text.' ('.str_replace(', ',') (',$ext).')', $normalize_chars); - $query2 = get_data($url); - $query2 = explode('', $dl); + $dltext = trim(strip_tags('', $dl); - $dltext = trim(strip_tags('Found new: ".$new.", old: ".$old."

\n"; } } -print "\nnew urls:\n\n"; +echo "
".$dir."
\n"; -print "
";
-
-foreach($found as $row)
+if (sizeof($found) > 0)
 {
-	print $row[0]."\n";
+	echo "

New files:

"; } -print "
";
-
-foreach($found as $row)
+foreach ($found as $row)
 {
-	print "".$row[1]."\n";
+	echo "".$row[1]."
\n"; } -print "
"; +echo "
\n"; ?> \ No newline at end of file diff --git a/wizzardRedux/sites/Apple2Online.php b/wizzardRedux/sites/Apple2Online.php index f26d6d4..c944870 100644 --- a/wizzardRedux/sites/Apple2Online.php +++ b/wizzardRedux/sites/Apple2Online.php @@ -2,8 +2,6 @@ // Original code: The Wizard of DATz -print "
";
-
 $dir = "http://apple2online.com/";
 print "load: ".$dir."\n";
 $query = get_data($dir);
diff --git a/wizzardRedux/sites/alexvampire.php b/wizzardRedux/sites/alexvampire.php
index f1a762b..e074b85 100644
--- a/wizzardRedux/sites/alexvampire.php
+++ b/wizzardRedux/sites/alexvampire.php
@@ -6,9 +6,10 @@ $newfiles = array(
 	'https://alexvampire.wordpress.com/feed/',
 );
 
+echo "\n";
 foreach ($newfiles as $newfile)
 {
-	print "load ".$newfile."
\n"; + echo ""; $query = get_data($newfile); $query = explode('', $query); $query[0] = null; @@ -34,13 +35,21 @@ foreach ($newfiles as $newfile) } } } - - foreach ($found as $row) - { - print "".$row."
\n"; - } - - print "found new:".$new.", old:".$old."
\n
\n"; + echo "\n"; } +echo "
".$newfile."Found new: ".$new.", old: ".$old."
\n"; + +if (sizeof($found) > 0) +{ + echo "

New files:

"; +} + +foreach ($found as $row) +{ + echo "".$row."
\n"; +} + +echo "
\n"; + ?> \ No newline at end of file