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"] = "