diff --git a/ajax/getfoldercontents.php b/ajax/getfoldercontents.php
new file mode 100644
index 0000000..e5fd11b
--- /dev/null
+++ b/ajax/getfoldercontents.php
@@ -0,0 +1,101 @@
+prepare($query);
+$sth->execute($fields);
+$comics_read = array();
+$issues_read = array();
+while ( $row = $sth->fetch(PDO::FETCH_ASSOC) ) {
+ if ( !in_array($row['comic'], $comics_read) ) $comics_read[] = $row['comic'];
+ if ( !in_array($row['issue'], $issues_read) ) $issues_read[] = $row['issue'];
+}
+
+$data = array();
+$folders = array();
+$issues = array();
+$entries = scandir($fullcompath);
+foreach ( $entries as $entry ) {
+ if ( ($entry == ".") || ($entry == "..") ) continue;
+ $info = array();
+ $info["name"] = $entry;
+ $info["namesafe"] = htmlspecialchars($entry, ENT_QUOTES);
+ if ( is_dir($fullcompath . $entry) ) {
+ $info["comname"] = (strpos($entry, " - ") !== false) ? str_replace(" - ", "
", $entry) : $entry;
+ $info["newpath"] = $compath . (($compath == "/") ? "" : "/") . $entry;
+ $info["mtime"] = filemtime($fullcompath . $entry);
+ //$info["thumburl"] = htmlentities(THUMBSDIR . $compath . (($compath == "/") ? "" : "/") . $entry, ENT_QUOTES) . ".jpg";
+ $info["thumburl"] = THUMBSDIR . $compath . (($compath == "/") ? "" : "/") . $entry . ".jpg";
+ if ( in_array($entry, $comics_read) ) {
+ $info["read"] = true;
+ $readclass = " readborder";
+ } else {
+ $info["read"] = false;
+ $readclass = "";
+ }
+ $info["div"] = "