function fr_list_comics() { global $fr_contentdir, $fr_selected_comic; $temp = array(); if ($fr_selected_comic == "") { $temp = fr_available_comics(); } else { $temp[0] = $fr_selected_comic; } echo '<div class="theList">'; foreach ($temp as $key => $value) { $fr_selected_comic = $value; fr_get_chapters(); $temp_chapters = fr_available_chapters(); echo "<div class='listed'>"; if (!empty($temp_chapters)) { fr_dropdown_chapters(); } echo "<a href='" . fr_get_href($value) . "'><table class='thumb'><tr><td><img src='" . fr_get_comic_thumb($value) . "'/></td></tr></table></a>" . "<a href='" . fr_get_href($value) . "'><h3 class='title'>" . $value . "</h3></a>"; if (!empty($temp_chapters)) { echo "<a href='" . fr_get_href($value, max(fr_available_chapters())) . "'> <h5 class='ultimo'> Last release: " . max(fr_available_chapters()) . " »</h5></a>"; } else { echo "No chapters available."; } echo "<br/><div class='descrip'>" . fr_get_comic_description($value) . "</div>" . "</div>"; } echo '</div>'; }
fr_get_functions(); // stops the script if there's no content folder at all, and tells to create one if (!is_dir($fr_contentdir)) { fr_get_error("missing_content_folder"); die(0); } // reads the content folder and loads up all the available comics fr_get_comics(); // if no comics were found, show that there are no comics in this reader if (empty($fr_available_comics)) { fr_get_error("no_comic_available"); die(0); } // look in the URL query if there's a selected comic. If there is, keep going. Else, show a comic selection list. // if there's no match with the comic name, show the comic list. if (isset($_GET['manga']) && arraycontains(fr_available_comics(), stripslashes($_GET['manga']))) { $fr_selected_comic = stripslashes($_GET['manga']); } else { fr_get_comicSelect(); exit(1); } // reads the comic's folder and loads up all the available chapters fr_get_chapters(); // look in the URL query if there's a selected chapter. If there is, keep going. Else, show a chapter selection list. // if there's no match with the chapter name, show the chapter list. if (isset($_GET['chapter']) && arraycontains(fr_available_chapters(), stripslashes($_GET['chapter']))) { $fr_selected_chapter = stripslashes($_GET['chapter']); } else { fr_get_chapterSelect(); exit(1); }