Пример #1
0
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>';
}
Пример #2
0
function fr_get_comic_thumb()
{
    global $fr_contentdir, $fr_selected_chapter, $fr_selected_page;
    if (file_exists('./themes/' . fr_selected_theme() . '/images/no-preview-available.png')) {
        $nopreview = 'themes/' . fr_selected_theme() . '/images/no-preview-available.png';
    } else {
        $nopreview = "themes/default/images/no-preview-available.png";
    }
    if (file_exists($fr_contentdir . "/" . fr_selected_comic() . "/thumb.png")) {
        return rawurlencode($fr_contentdir) . "/" . rawurlencode(fr_selected_comic()) . "/thumb.png";
    } else {
        if (file_exists($fr_contentdir . "/" . fr_selected_comic() . "/thumb.jpg")) {
            return rawurlencode($fr_contentdir) . "/" . rawurlencode(fr_selected_comic()) . "/thumb.jpg";
        } else {
            $temp = fr_get_chapters();
            if (!empty($temp)) {
                $fr_thechapter = max(fr_get_chapters());
                $temp2 = fr_fetch_pages(fr_selected_comic(), $fr_thechapter);
                if (empty($temp2)) {
                    return $nopreview;
                }
                $fr_thepage = min($temp2);
                return rawurlencode($fr_contentdir) . "/" . rawurlencode(fr_selected_comic()) . "/" . rawurlencode($fr_thechapter) . "/" . rawurlencode($fr_thepage);
            } else {
                return $nopreview;
            }
        }
    }
}
Пример #3
0
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);
}
// read the chapter's folder and load up all the available pages
fr_get_pages();
// prepares an URL for the next chapter, that will be needed once the user reaches the last page of the chapter.
if (($fr_next_chapter = array_search(fr_selected_chapter(), fr_available_chapters()) - 1) >= 0) {
    $fr_next_chapter = $fr_baseurl . fr_get_href($fr_selected_comic, $fr_available_chapters[$fr_next_chapter]);
} else {
    $nextchapter = $endmanga;