Add files via upload

This commit is contained in:
Selim B 2022-05-10 16:34:43 +02:00 committed by GitHub
parent bb933ff0fb
commit 37851b7ac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 2681 additions and 0 deletions

24
about.html Normal file
View File

@ -0,0 +1,24 @@
<div class="alert alert-danger text-center"><b>Don't make any profit from scans. You (and we) scan because we like the Manga and want to support the author, so you should, as we do, buy the Raws from your own money.</b></div>
<h1 class="text-center">About this Group?!</h1>
<div class="row">
<div class="col-sm-12">
<p>This is you place to write something about your Group... I guess? <b>Supports <i>(obviously)</i> HTML!</b></p>
</div>
<div class="col-sm-4">
<div class="well well-sm">
So just in case you don't know how Bootstrap works, you can use Bootstrap 3.4 here! <a href="https://getbootstrap.com/docs/3.4/components/" target="_blank">Click here to read the Docs and find examples of blocks you can use here.</a>
</div>
</div>
<div class="col-sm-8">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Socials</h3>
</div>
<div class="panel-body">
<li>Twitter: <a href="https://twitter.com/saintly2k" target="_blank">@saintly2k</a></li>
<li>GitHub: <a href="https://github.com/saintly2k" target="_blank">@saintly2k</a></li>
<li>PayPal: <a href="https://paypal.me/WOLFRAMEdev" target="_blank">yuki.akihabara@yandex.com</a></li>
</div>
</div>
</div>
</div>

BIN
assets/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
assets/img/logo.psd Normal file

Binary file not shown.

BIN
assets/loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 MiB

230
assets/theme.css Normal file
View File

@ -0,0 +1,230 @@
@font-face {
font-weight: 300;
font-style: normal;
font-family: 'Ubuntu';
src: url(/bootstrap/fonts/Ubuntu-L.ttf);
}
@font-face {
font-weight: 400;
font-style: normal;
font-family: 'Ubuntu';
src: url(/bootstrap/fonts/Ubuntu-R.ttf);
}
@font-face {
font-weight: 600;
font-style: normal;
font-family: 'Ubuntu';
src: url(/bootstrap/fonts/Ubuntu-M.ttf);
}
@font-face {
font-weight: 700;
font-style: bold;
font-family: 'Ubuntu';
src: url(/bootstrap/fonts/Ubuntu-B.ttf);
}
html {
scroll-behavior: smooth;
position: relative;
min-height: 100%;
}
body {
margin-bottom: 40px;
padding-top: 70px;
padding-bottom: 30px;
font-family: "Ubuntu", sans-serif;
}
.theme-dropdown .dropdown-menu {
position: static;
display: block;
margin-bottom: 20px;
}
.footer {
position: absolute;
padding: 10px 0;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 40px;
}
.display-none {
display: none;
}
.btn-file {
position: relative;
overflow: hidden;
}
.btn-file input[type=file] {
position: absolute;
top: 0;
right: 0;
min-width: 100%;
min-height: 100%;
font-size: 100px;
text-align: right;
filter: alpha(opacity=0);
opacity: 0;
background: red;
cursor: inherit;
display: block;
}
input[readonly] {
cursor: text !important;
}
#message_container {
position: fixed;
top: 70px;
z-index: 100;
height: 100px;
left: 50%;
width: 50%;
margin-left: -25%;
pointer-events: none;
}
img.captcha {
margin: 0 auto 15px auto;
display: block;
}
.td-768,
.td-992,
.td-1440,
.span-992,
.span-1440,
.li-992 {
display: none;
}
#quick_search_input {
border-radius: 4px 0 0 4px;
}
#quick_search_form {
display: 100px;
}
@media (min-width: 768px) {
.nav-label-992,
.nav-label-1440 {
display: none;
}
.td-768 {
display: table-cell;
}
#quick_search_input {
width: 50px;
}
#quick_search_form {
display: inline;
}
}
@media (min-width: 992px) {
.td-992 {
display: table-cell;
}
.nav-label-992,
.span-992 {
display: inline;
}
#quick_search_input {
width: 170px;
}
#quick_search_form {
display: inline;
}
}
@media (min-width: 1440px) {
.nav-label-1440,
.span-1440 {
display: inline;
}
.span-not-1440,
.td-not-1440 {
display: none;
}
#quick_search_input {
width: 200px;
}
#quick_search_form {
display: inline;
}
}
img.reader {
cursor: pointer;
max-width: 100%;
margin: 0 auto;
display: block;
}
img.avatar {
max-width: 100px;
max-height: 100px;
}
img.click {
cursor: pointer;
}
img.webtoon,
img.long-strip {
max-width: 100%;
display: block;
}
img.webtoon {
margin: 0 auto;
}
img.long-strip {
margin: 0 auto 10px auto;
}
a.genre,
a.genre:hover,
a.genre:focus {
color: #fff;
}
a.manga_title,
a.manga_title:hover,
a.manga_title:focus {
font-weight: bold;
}
tr.comment {
word-break: normal;
}
textarea.comment-box {
resize: vertical;
}
.readable {
}

21
config.php Normal file
View File

@ -0,0 +1,21 @@
<?php
$config = [
"title" => "MangaReader",
"logo" => "assets/img/logo.png",
"slogan" => "Read Manga online for free with no ads",
"url" => "http://localhost/mangareader/",
"theme" => 1, // choose betweeen 1-5
"start" => "2020",
"lang" => "en",
"disqus" => "mangapanzer"
];
$slave = [
"host" => "localhost",
"user" => "root",
"pass" => "",
"table" => "mangareaderx"
];
?>

23
deathnotes.txt Normal file
View File

@ -0,0 +1,23 @@
[ Type (varchar) ]
Normal Style:
Manga,
Manwha,
Manhua
Text Style:
Novel
[ Raw-Status (int) ]
1 - Unknown
2 - Announced
3 - Ongoing
4 - Hiatus
5 - Completed
6 - Canceled
[ Scan-Status (int) ]
1 - Plan to Scan
2 - In Work
3 - Scan on Hiatus
4 - Forced Hiatus (due to exposure)
5 - Completed
6 - Dropped

143
lang/en.lang.php Normal file
View File

@ -0,0 +1,143 @@
<?php
# English Language File
$lang = [
"cookie_modal" => [
"title" => "This website requires the use of Cookies!",
"content" => "Hello dear reader! This site doesn't allow you to create an account and store your reading progress there. Due to that, we use Cookies to store your reading progress. If you want to use this function, you need to accept us using Cookies. We hope you have fun reading~",
"accept" => "I accept",
"refuse" => "I refuse"
],
"menu" => [
"home" => "Home",
"releases" => "Releases",
"titles" => "Titles",
"more" => "More",
"about" => "About",
"quicksearch" => "Quicksearch",
"search" => "Search",
"account" => "Account",
"login" => "Login",
"signup" => "Signup",
"profile" => "My Profile",
"settings" => "Settings",
"logout" => "Logout",
"add_new" => "New Title",
"bookmarks" => "Bookmarks"
],
"login" => [
"error" => "Error",
"message" => "Don't have an account yet?",
"username" => "Username",
"password" => "Password",
"captcha" => "Captcha",
"cookies" => "Stay logged in (THIS USES COOKIES!)"
],
"signup" => [
"password" => "Repeat Password",
"message" => "Already have an account?",
"used_invite" => "The Invite you entered has already been used!",
"empty_invite" => "You need an invite to create an account!",
"invite" => "Invite Code"
],
"add_manga" => [
"add" => "Add Manga",
"title" => "*Manga Title",
"cover" => "Cover Image (1500x2150px)",
"alt" => "Alt Names",
"author" => "Author",
"genre" => "Genre (Seperate by comma)",
"type" => "*Reading type (Manga, Manwha, Manhua)",
"released" => "Released in Year",
"raw-st" => "*Status of Raws",
"status" => "*Status of Scanlation",
"descript" => "Description of Title (Supports HTML)",
"raw-url" => "URL to Raw",
"licensed" => "Licenser (leave empty if unlicensed)",
"official" => "URL to official Release (leave empty if none)",
"required" => "Required fiels are marked with *",
"manga" => "Manga",
"manhua" => "Manhua",
"manwha" => "Manwha",
"type_manga" => "Manga (Paged)",
"type_manhua" => "Manhua (List)",
"type_manwha" => "Manwha (List)",
"rawst" => [
1 => "Unknown",
2 => "Announced",
3 => "Ongoing",
4 => "Hiatus",
"5" => "Completed",
6 => "Canceled"
],
"scanst" => [
1 => "Plan to Scan",
2 => "In Work",
3 => "Scan on Hiatus",
4 => "Forced Hiatus (due to exposure)",
5 => "Completed",
6 => "Dropped"
],
],
"manga" => [
"alt" => "Alt. Name(s)",
"author" => "Author(s)",
"genre" => "Genre(s)",
"type" => "Reading Type",
"released" => "Released (Year)",
"raw-status" => "Status of the Raws",
"scan-status" => "Status of Scanlation",
"raw" => "Read/Buy official Raw",
"licensed" => "Please support the Author by buying the official work since it has been licensed by",
"added" => "This Manga has been added on",
"edit_title" => "Edit Title",
"add_ch" => "Add Chapter",
"unknown" => "Unknown",
"edit_chap" => "Edit Chapter"
],
"add_chapter" => [
"title" => "Add Chapter for",
"file" => "*Select ZIP/RAR File to upload",
"volume" => "Volume (Leave empty for none)",
"chapter" => "Chapter (Leave empty or 0 for Oneshot)",
"ctitle" => "Chapter Title (Leave empty for none)",
"button" => "Add Chapter"
],
"chapter" => [
"menu" => "Navigation",
"close" => "Hide",
"back_to_m" => "Back to Manga",
"bookmark" => "Bookmark",
"update_bm" => "Update Bookmark",
"remove_bm" => "Remove Bookmark",
"comments" => "To the Comments",
"next" => "Next Chapter",
"prev" => "Previous Chapter",
"oneshot" => "Oneshot"
],
"edit_chapter" => [
"title" => "Edit Chapter",
"file" => "Select new ZIP/RAR (deletes old)",
"edit" => "Edit Chapter",
"return" => "Return to Title"
],
"edit_title" => [
"title" => "Edit Title",
],
"errors" => [
"bad_username" => "Username contains bad characters!",
"bad_password" => "Password contains bad characters!",
"wrong_password" => "Password is wrong!",
"taken_username" => "This username is already taken!",
"unmatch_password" => "The passwords do not match!",
"attack" => "Are you sure you want to exist without saving?",
"captcha" => "The CAPTCHA was wrong... try again!",
"unsupported_image" => "The File you have tried to upload is NOT an Image (or it is empty)!",
"title_exists" => "The Title you are trying to add already exists with the same name!",
"used_invite" => "This Invite Code has already been used!"
]
];
?>

162
mangareaderx.sql Normal file
View File

@ -0,0 +1,162 @@
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Erstellungszeit: 10. Mai 2022 um 16:33
-- Server-Version: 10.4.22-MariaDB
-- PHP-Version: 7.4.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Datenbank: `mangareaderx`
--
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `chapters`
--
CREATE TABLE `chapters` (
`id` int(11) NOT NULL,
`mid` int(11) NOT NULL,
`slug` text NOT NULL,
`volume` int(11) DEFAULT NULL,
`chapter` int(11) NOT NULL DEFAULT 0,
`title` text DEFAULT NULL,
`user` int(11) NOT NULL,
`added` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `invites`
--
CREATE TABLE `invites` (
`id` int(11) NOT NULL,
`token` text NOT NULL,
`created` datetime NOT NULL DEFAULT current_timestamp(),
`used` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `sessions`
--
CREATE TABLE `sessions` (
`user-id` int(11) NOT NULL,
`token` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `titles`
--
CREATE TABLE `titles` (
`id` int(11) NOT NULL,
`slug` text NOT NULL,
`title` text NOT NULL,
`cover` text DEFAULT NULL,
`alt` text DEFAULT NULL,
`author` text DEFAULT NULL,
`genre` text DEFAULT NULL,
`type` varchar(10) NOT NULL,
`released` varchar(20) DEFAULT NULL,
`raw-status` int(11) NOT NULL,
`scan-status` int(11) NOT NULL,
`description` text DEFAULT NULL,
`raw-url` text DEFAULT NULL,
`licensed` varchar(50) DEFAULT NULL,
`official-url` text DEFAULT NULL,
`added` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`username` varchar(20) NOT NULL,
`password` text NOT NULL,
`active` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Indizes der exportierten Tabellen
--
--
-- Indizes für die Tabelle `chapters`
--
ALTER TABLE `chapters`
ADD PRIMARY KEY (`id`);
--
-- Indizes für die Tabelle `invites`
--
ALTER TABLE `invites`
ADD PRIMARY KEY (`id`);
--
-- Indizes für die Tabelle `titles`
--
ALTER TABLE `titles`
ADD PRIMARY KEY (`id`);
--
-- Indizes für die Tabelle `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT für exportierte Tabellen
--
--
-- AUTO_INCREMENT für Tabelle `chapters`
--
ALTER TABLE `chapters`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `invites`
--
ALTER TABLE `invites`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `titles`
--
ALTER TABLE `titles`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

View File

@ -0,0 +1,97 @@
<?php
require("../../requires.php");
$page = $lang["add_chapter"]["title"];
if($loggedin==false) {
header("Refresh: 0; url=../login");
}
$slug2 = mysqli_real_escape_string($conn, $_GET["slug"]);
$manga = $conn->query("SELECT * FROM `titles` WHERE `slug`='$slug2' LIMIT 1");
$manga = mysqli_fetch_assoc($manga);
$mid = $manga["id"];
$error = false;
$error_msg = "";
if(isset($_POST["add_chapter"])) {
$slug = generate_url();
$volume = mysqli_real_escape_string($conn, $_POST["volume"]);
$chapter = mysqli_real_escape_string($conn, $_POST["chapter"]);
$title = mysqli_real_escape_string($conn, $_POST["title"]);
if(empty($volume)) { $volume = "NULL"; } else { $volume = "'$volume'"; }
if(empty($chapter)) { $chapter = "'0'"; } else { $chapter = "'$chapter'"; }
if(empty($title)) { $title = "NULL"; } else { $title = "'$title'"; }
$target_file = "../../data/chapters/".$_FILES["archive"]["name"];
$new_file = "../../data/chapters/".$slug;
move_uploaded_file($_FILES["archive"]["tmp_name"], $target_file);
$filename = pathinfo($_FILES['archive']['name'], PATHINFO_FILENAME);
$before_file = "../../data/chapters/".$filename;
$zip = new ZipArchive;
$res = $zip->open($target_file);
$zip->extractTo('../../data/chapters/');
$zip->close();
rename($before_file, $new_file);
unlink($target_file);
$uid = $user["id"];
$conn->query("INSERT INTO `chapters`(`mid`,`slug`,`volume`,`chapter`,`title`,`user`) VALUES('$mid','$slug',$volume,$chapter,$title,'$uid')");
}
include("../parts/header.php");
?>
<?php if(!empty($manga["id"])) { ?>
<title><?= $lang["add_chapter"]["title"]." ".$manga["title"]." :: ".$config["title"] ?></title>
<?php } else { ?>
<title><?= $lang["login"]["error"]." :: ".$config["title"] ?></title>
<?php } ?>
<?php include("../parts/menu.php"); ?>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<?php if(!empty($error_msg)) { ?>
<div class="alert alert-warning alert-dismissible text-center" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong><?= $lang["login"]["error"] ?>:</strong> <?= $error_msg ?>
</div>
<?php } ?>
<div style="margin: 0 auto; width: 300px" id="login_container">
<form method="post" name="add_chapter" enctype="multipart/form-data">
<h1 class="text-center"><?= $lang["add_chapter"]["title"] ?> <a href="<?= $config["url"] ?>manga/<?= $slug2 ?>"><b><u><?= $manga["title"] ?></u></b></a></h1>
<hr>
<div class="form-group">
<label for="archive" class="sr-"><?= $lang["add_chapter"]["file"] ?></label>
<input tabindex="1" required type="file" name="archive" id="archive" class="form-control">
</div>
<div class="form-group">
<label for="chapter_vol"><?= $lang["add_chapter"]["volume"] ?> </label>
<input tabindex="2" type="number" name="volume" id="chapter_vol" class="form-control" value="<?php if(isset($_POST["volume"])) { $vol = $_POST["volume"]; echo $vol; } ?>" placeholder="<?= $lang["add_chapter"]["volume"] ?>">
</div>
<div class="form-group">
<label for="chapter_chap"><?= $lang["add_chapter"]["chapter"] ?> </label>
<input tabindex="3" type="number" name="chapter" id="chapter_chap" class="form-control" value="<?php if(isset($_POST["chapter"])) { $chap = $_POST["chapter"]; $chap++; echo $chap; } ?>" placeholder="<?= $lang["add_chapter"]["chapter"] ?>">
</div>
<div class="form-group">
<label for="chapter_title"><?= $lang["add_chapter"]["ctitle"] ?> </label>
<input tabindex="4" type="text" name="title" id="chapter_title" class="form-control" placeholder="<?= $lang["add_chapter"]["ctitle"] ?>">
</div>
<p><i><?= $lang["add_manga"]["required"] ?></i></p>
<button tabindex="5" class="btn btn-lg btn-success btn-block" type="submit" id="upload-file" name="add_chapter"><?= glyph("plus",$lang["add_chapter"]["button"]) ?> <?= $lang["add_chapter"]["button"] ?></button>
</form>
</div>
<?php include("../parts/footer.php"); ?>

View File

@ -0,0 +1,106 @@
<?php
require("../../requires.php");
$page = $lang["edit_chapter"]["title"];
if($loggedin==false) {
header("Refresh: 0; url=../login");
}
$slug2 = mysqli_real_escape_string($conn, $_GET["slug"]);
$chapter = $conn->query("SELECT * FROM `chapters` WHERE `slug`='$slug2' LIMIT 1");
$chapter = mysqli_fetch_assoc($chapter);
$mid = $chapter["mid"];
$manga = $conn->query("SELECT * FROM `titles` WHERE `id`='$mid' LIMIT 1");
$manga = mysqli_fetch_assoc($manga);
$error = false;
$error_msg = "";
if(isset($_POST["edit_chapter"])) {
$slug = generate_url();
$volume = mysqli_real_escape_string($conn, $_POST["volume"]);
$chapter = mysqli_real_escape_string($conn, $_POST["chapter"]);
$title = mysqli_real_escape_string($conn, $_POST["title"]);
if(empty($volume)) { $volume = "NULL"; } else { $volume = "'$volume'"; }
if(empty($chapter)) { $chapter = "'0'"; } else { $chapter = "'$chapter'"; }
if(empty($title)) { $title = "NULL"; } else { $title = "'$title'"; }
if(isset($_FILES["archive"]["tmp_name"]) && !empty($_FILES["archive"]["tmp_name"])) {
$target_file = "../../data/chapters/".$_FILES["archive"]["name"];
$new_file = "../../data/chapters/".$slug;
move_uploaded_file($_FILES["archive"]["tmp_name"], $target_file);
$filename = pathinfo($_FILES['archive']['name'], PATHINFO_FILENAME);
$before_file = "../../data/chapters/".$filename;
$zip = new ZipArchive;
$res = $zip->open($target_file);
$zip->extractTo('../../data/chapters/');
$zip->close();
rename($before_file, $new_file);
unlink($target_file);
} else {
$slug = $slug2;
}
$uid = $user["id"];
$conn->query("UPDATE `chapters` SET `slug`='$slug', `volume`=$volume, `chapter`=$chapter, `title`=$title, `user`='$uid' WHERE `slug`='$slug2'");
header("Refresh: 0; url=$slug");
}
include("../parts/header.php");
?>
<?php if(!empty($chapter["id"])) { ?>
<title><?= $lang["edit_chapter"]["title"]." :: ".$config["title"] ?></title>
<?php } else { ?>
<title><?= $lang["login"]["error"]." :: ".$config["title"] ?></title>
<?php } ?>
<?php include("../parts/menu.php"); ?>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<?php if(!empty($error_msg)) { ?>
<div class="alert alert-warning alert-dismissible text-center" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong><?= $lang["login"]["error"] ?>:</strong> <?= $error_msg ?>
</div>
<?php } ?>
<div style="margin: 0 auto; width: 300px" id="login_container">
<form method="post" name="edit_chapter" enctype="multipart/form-data">
<h1 class="text-center"><?= $lang["edit_chapter"]["title"] ?></h1>
<h3 class="text-center"><a href="<?= $config["url"] ?>manga/<?= $manga["slug"] ?>"><?= $lang["edit_chapter"]["return"] ?></a></h3>
<hr>
<div class="form-group">
<label for="archive" class="sr-"><?= $lang["edit_chapter"]["file"] ?></label>
<input tabindex="1" type="file" name="archive" id="archive" class="form-control">
</div>
<div class="form-group">
<label for="chapter_vol"><?= $lang["add_chapter"]["volume"] ?> </label>
<input tabindex="2" type="number" name="volume" id="chapter_vol" class="form-control" value="<?= $chapter["volume"] ?>" placeholder="<?= $lang["add_chapter"]["volume"] ?>">
</div>
<div class="form-group">
<label for="chapter_chap"><?= $lang["add_chapter"]["chapter"] ?> </label>
<input tabindex="3" type="number" name="chapter" id="chapter_chap" class="form-control" value="<?= $chapter["chapter"] ?>" placeholder="<?= $lang["add_chapter"]["chapter"] ?>">
</div>
<div class="form-group">
<label for="chapter_title"><?= $lang["add_chapter"]["ctitle"] ?> </label>
<input tabindex="4" type="text" name="title" id="chapter_title" class="form-control" placeholder="<?= $lang["add_chapter"]["ctitle"] ?>" value="<?= $chapter["title"] ?>">
</div>
<p><i><?= $lang["add_manga"]["required"] ?></i></p>
<button tabindex="5" class="btn btn-lg btn-success btn-block" type="submit" id="upload-file" name="edit_chapter"><?= glyph("pencil",$lang["edit_chapter"]["edit"]) ?> <?= $lang["edit_chapter"]["edit"] ?></button>
</form>
</div>
<?php include("../parts/footer.php"); ?>

View File

@ -0,0 +1,183 @@
<?php
require("../../requires.php");
$page = $lang["edit_title"]["title"];
if($loggedin==false) {
header("Refresh: 0; url=../login");
}
$slug2 = mysqli_real_escape_string($conn, $_GET["slug"]);
$manga = $conn->query("SELECT * FROM `titles` WHERE `slug`='$slug2' LIMIT 1");
$manga = mysqli_fetch_assoc($manga);
$error = false;
$error_msg = "";
if(isset($_POST["add_manga"])) {
$m_title = mysqli_real_escape_string($conn, $_POST["title"]);
$m_alt = mysqli_real_escape_string($conn, $_POST["alt"]);
$m_author = mysqli_real_escape_string($conn, $_POST["author"]);
$m_genre = mysqli_real_escape_string($conn, $_POST["genre"]);
$m_type = mysqli_real_escape_string($conn, $_POST["type"]);
$m_released = mysqli_real_escape_string($conn, $_POST["released"]);
$m_rawstatus = mysqli_real_escape_string($conn, $_POST["raw-status"]);
$m_scanstatus = mysqli_real_escape_string($conn, $_POST["scan-status"]);
$m_description = mysqli_real_escape_string($conn, $_POST["description"]);
$m_rawurl = mysqli_real_escape_string($conn, $_POST["raw-url"]);
$m_licensed = mysqli_real_escape_string($conn, $_POST["licensed"]);
$m_officialurl = mysqli_real_escape_string($conn, $_POST["official-url"]);
$titlecheck = $conn->query("SELECT * FROM `titles` WHERE `title`='$m_title' LIMIT 1");
$slug = $manga["slug"];
if(mysqli_num_rows($titlecheck)==1) {
$error = true;
$error_msg = $lang["errors"]["title_exists"];
}
if(empty($m_alt)) { $m_alt = "NULL"; } else { $m_alt = "'$m_alt'"; }
if(empty($m_author)) { $m_author = "NULL"; } else { $m_author = "'$m_author'"; }
if(empty($m_genre)) { $m_genre = "NULL"; } else { $m_genre = "'$m_genre'"; }
if(empty($m_released)) { $m_released = "NULL"; } else { $m_released = "'$m_released'"; }
if(empty($m_description)) { $m_description = "NULL"; } else { $m_description = "'$m_description'"; }
if(empty($m_rawurl)) { $m_rawurl = "NULL"; } else { $m_rawurl = "'$m_rawurl'"; }
if(empty($m_licensed)) { $m_licensed = "NULL"; } else { $m_licensed = "'$m_licensed'"; }
if(empty($m_officialurl)) { $m_officialurl = "NULL"; } else { $m_officialurl = "'$m_officialurl'"; }
if(isset($_FILES["cover"]["tmp_name"]) && !empty($_FILES["cover"]["tmp_name"])) {
$filename = pathinfo($_FILES['cover']['name'], PATHINFO_FILENAME);
$fileextension = pathinfo($_FILES['cover']['name'], PATHINFO_EXTENSION);
$finalfile = $filename."-".$slug.".".$fileextension;
$target_file = "../../data/covers/".$finalfile;
// Check if image file is a actual image or fake image
$check = getimagesize($_FILES["cover"]["tmp_name"]);
if($check !== false) {
//echo "File is an image - " . $check["mime"] . ".";
} else {
$error = true;
$error_msg = $lang["errors"]["unsupported_image"];
}
} else {
$finalfile = "no-cover.jpg";
}
if($error==false) {
$conn->query("INSERT INTO `titles`(`slug`,`title`,`cover`,`alt`,`author`,`genre`,`type`,`released`,`raw-status`,`scan-status`,`description`,`raw-url`,`licensed`,`official-url`) VALUES('$slug','$m_title','$finalfile',$m_alt,$m_author,$m_genre,'$m_type',$m_released,'$m_rawstatus','$m_scanstatus',$m_description,$m_rawurl,$m_licensed,$m_officialurl)");
if(isset($_FILES["cover"]["tmp_name"])) {
move_uploaded_file($_FILES["cover"]["tmp_name"], $target_file);
}
}
}
include("../parts/header.php");
?>
<title><?= $lang["edit_title"]["title"]." :: ".$config["title"] ?></title>
<?php include("../parts/menu.php"); ?>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<?php if(!empty($error_msg)) { ?>
<div class="alert alert-warning alert-dismissible text-center" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong><?= $lang["login"]["error"] ?>:</strong> <?= $error_msg ?>
</div>
<?php } ?>
<div style="margin: 0 auto; width: 300px" id="login_container">
<form method="post" id="login_form" name="add_manga" enctype="multipart/form-data">
<h1 class="text-center"><?= $lang["edit_title"]["title"] ?></h1>
<h3 class="text-center"><a href="<?= $config["url"] ?>manga/<?= $manga["slug"] ?>"><?= $lang["edit_chapter"]["return"] ?></a></h3>
<hr>
<div class="form-group">
<label for="manga_title"><?= $lang["add_manga"]["title"] ?></label>
<input required tabindex="1" type="text" name="title" id="manga_title" class="form-control" placeholder="<?= $lang["add_manga"]["title"] ?>">
</div>
<div class="form-group">
<label for="manga_cover" class="sr-"><?= $lang["add_manga"]["cover"] ?></label>
<input tabindex="2" type="file" name="cover" id="manga_cover" class="form-control">
</div>
<div class="form-group">
<label for="manga_alt"><?= $lang["add_manga"]["alt"] ?></label>
<input tabindex="3" type="text" name="alt" id="manga_alt" class="form-control" placeholder="<?= $lang["add_manga"]["alt"] ?>">
</div>
<div class="form-group">
<label for="manga_author"><?= $lang["add_manga"]["author"] ?></label>
<input tabindex="4" type="text" name="author" id="manga_author" class="form-control" placeholder="<?= $lang["add_manga"]["author"] ?>">
</div>
<div class="form-group">
<label for="manga_genre"><?= $lang["add_manga"]["genre"] ?></label>
<input tabindex="5" type="text" name="genre" id="manga_genre" class="form-control" placeholder="<?= $lang["add_manga"]["genre"] ?>">
</div>
<div class="form-group">
<label for="manga_raw-status"><?= $lang["add_manga"]["type"] ?></label>
<select required tabindex="6" class="selectpicker form-control" name="type" id="manga_type">
<option value="<?= $lang["add_manga"]["manga"] ?>" selected><?= $lang["add_manga"]["type_manga"] ?></option>
<option value="<?= $lang["add_manga"]["manwha"] ?>"><?= $lang["add_manga"]["type_manwha"] ?></option>
<option value="<?= $lang["add_manga"]["manhua"] ?>"><?= $lang["add_manga"]["type_manhua"] ?></option>
</select>
</div>
<div class="form-group">
<label for="manga_released"><?= $lang["add_manga"]["released"] ?></label>
<input tabindex="7" type="number" name="released" id="manga_released" class="form-control" placeholder="<?= $lang["add_manga"]["released"] ?>">
</div>
<div class="form-group">
<label for="manga_raw-status"><?= $lang["add_manga"]["raw-st"] ?></label>
<select tabindex="8" class="selectpicker form-control" name="raw-status" id="manga_raw-status">
<option value="1" selected><?= $lang["add_manga"]["rawst"][1] ?></option>
<option value="2"><?= $lang["add_manga"]["rawst"][2] ?></option>
<option value="3"><?= $lang["add_manga"]["rawst"][3] ?></option>
<option value="4"><?= $lang["add_manga"]["rawst"][4] ?></option>
<option value="5"><?= $lang["add_manga"]["rawst"][5] ?></option>
<option value="5"><?= $lang["add_manga"]["rawst"][6] ?></option>
</select>
</div>
<div class="form-group">
<label for="manga_scan-status"><?= $lang["add_manga"]["status"] ?></label>
<select required tabindex="9" class="selectpicker form-control" name="scan-status" id="manga_scan-status">
<option value="1"><?= $lang["add_manga"]["scanst"][1] ?></option>
<option value="2" selected><?= $lang["add_manga"]["scanst"][2] ?></option>
<option value="3"><?= $lang["add_manga"]["scanst"][3] ?></option>
<option value="4"><?= $lang["add_manga"]["scanst"][4] ?></option>
<option value="5"><?= $lang["add_manga"]["scanst"][5] ?></option>
</select>
</div>
<div class="form-group">
<label for="manga_description"><?= $lang["add_manga"]["descript"] ?></label>
<textarea tabindex="10" type="text" name="description" id="manga_description" class="form-control" placeholder="<?= $lang["add_manga"]["descript"] ?>" style="max-width:100%; height:200px"></textarea>
</div>
<div class="form-group">
<label for="manga_raw-url"><?= $lang["add_manga"]["raw-url"] ?></label>
<input tabindex="11" type="text" name="raw-url" id="manga_raw-url" class="form-control" placeholder="<?= $lang["add_manga"]["raw-url"] ?>">
</div>
<div class="form-group">
<label for="manga_licensed"><?= $lang["add_manga"]["licensed"] ?></label>
<input tabindex="12" type="text" name="licensed" id="manga_licensed" class="form-control" placeholder="<?= $lang["add_manga"]["licensed"] ?>">
</div>
<div class="form-group">
<label for="manga_official-url"><?= $lang["add_manga"]["official"] ?></label>
<input tabindex="13" type="text" name="official-url" id="manga_official-url" class="form-control" placeholder="<?= $lang["add_manga"]["official"] ?>">
</div>
<p><i><?= $lang["add_manga"]["required"] ?></i></p>
<button tabindex="14" class="btn btn-lg btn-success btn-block" type="submit" id="login_button" name="add_manga"><?= glyph("plus",$lang["add_manga"]["add"]) ?> <?= $lang["add_manga"]["add"] ?></button>
</form>
</div>
<?php include("../parts/footer.php"); ?>

View File

@ -0,0 +1,178 @@
<?php
require("../../requires.php");
$page = $lang["menu"]["add_new"];
if($loggedin==false) {
header("Refresh: 0; url=../login");
}
$error = false;
$error_msg = "";
if(isset($_POST["add_manga"])) {
$m_title = mysqli_real_escape_string($conn, $_POST["title"]);
$m_alt = mysqli_real_escape_string($conn, $_POST["alt"]);
$m_author = mysqli_real_escape_string($conn, $_POST["author"]);
$m_genre = mysqli_real_escape_string($conn, $_POST["genre"]);
$m_type = mysqli_real_escape_string($conn, $_POST["type"]);
$m_released = mysqli_real_escape_string($conn, $_POST["released"]);
$m_rawstatus = mysqli_real_escape_string($conn, $_POST["raw-status"]);
$m_scanstatus = mysqli_real_escape_string($conn, $_POST["scan-status"]);
$m_description = mysqli_real_escape_string($conn, $_POST["description"]);
$m_rawurl = mysqli_real_escape_string($conn, $_POST["raw-url"]);
$m_licensed = mysqli_real_escape_string($conn, $_POST["licensed"]);
$m_officialurl = mysqli_real_escape_string($conn, $_POST["official-url"]);
$titlecheck = $conn->query("SELECT * FROM `titles` WHERE `title`='$m_title' LIMIT 1");
$slug = generate_url();
if(mysqli_num_rows($titlecheck)==1) {
$error = true;
$error_msg = $lang["errors"]["title_exists"];
}
if(empty($m_alt)) { $m_alt = "NULL"; } else { $m_alt = "'$m_alt'"; }
if(empty($m_author)) { $m_author = "NULL"; } else { $m_author = "'$m_author'"; }
if(empty($m_genre)) { $m_genre = "NULL"; } else { $m_genre = "'$m_genre'"; }
if(empty($m_released)) { $m_released = "NULL"; } else { $m_released = "'$m_released'"; }
if(empty($m_description)) { $m_description = "NULL"; } else { $m_description = "'$m_description'"; }
if(empty($m_rawurl)) { $m_rawurl = "NULL"; } else { $m_rawurl = "'$m_rawurl'"; }
if(empty($m_licensed)) { $m_licensed = "NULL"; } else { $m_licensed = "'$m_licensed'"; }
if(empty($m_officialurl)) { $m_officialurl = "NULL"; } else { $m_officialurl = "'$m_officialurl'"; }
if(isset($_FILES["cover"]["tmp_name"]) && !empty($_FILES["cover"]["tmp_name"])) {
$filename = pathinfo($_FILES['cover']['name'], PATHINFO_FILENAME);
$fileextension = pathinfo($_FILES['cover']['name'], PATHINFO_EXTENSION);
$finalfile = $filename."-".$slug.".".$fileextension;
$target_file = "../../data/covers/".$finalfile;
// Check if image file is a actual image or fake image
$check = getimagesize($_FILES["cover"]["tmp_name"]);
if($check !== false) {
//echo "File is an image - " . $check["mime"] . ".";
} else {
$error = true;
$error_msg = $lang["errors"]["unsupported_image"];
}
} else {
$finalfile = "no-cover.jpg";
}
if($error==false) {
$conn->query("INSERT INTO `titles`(`slug`,`title`,`cover`,`alt`,`author`,`genre`,`type`,`released`,`raw-status`,`scan-status`,`description`,`raw-url`,`licensed`,`official-url`) VALUES('$slug','$m_title','$finalfile',$m_alt,$m_author,$m_genre,'$m_type',$m_released,'$m_rawstatus','$m_scanstatus',$m_description,$m_rawurl,$m_licensed,$m_officialurl)");
if(isset($_FILES["cover"]["tmp_name"])) {
move_uploaded_file($_FILES["cover"]["tmp_name"], $target_file);
}
}
}
include("../parts/header.php");
?>
<title><?= $lang["menu"]["add_new"]." :: ".$config["title"] ?></title>
<?php include("../parts/menu.php"); ?>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<?php if(!empty($error_msg)) { ?>
<div class="alert alert-warning alert-dismissible text-center" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong><?= $lang["login"]["error"] ?>:</strong> <?= $error_msg ?>
</div>
<?php } ?>
<div style="margin: 0 auto; width: 300px" id="login_container">
<form method="post" id="login_form" name="add_manga" enctype="multipart/form-data">
<h1 class="text-center"><?= $lang["menu"]["add_new"] ?></h1>
<hr>
<div class="form-group">
<label for="manga_title"><?= $lang["add_manga"]["title"] ?></label>
<input required tabindex="1" type="text" name="title" id="manga_title" class="form-control" placeholder="<?= $lang["add_manga"]["title"] ?>">
</div>
<div class="form-group">
<label for="manga_cover" class="sr-"><?= $lang["add_manga"]["cover"] ?></label>
<input tabindex="2" type="file" name="cover" id="manga_cover" class="form-control">
</div>
<div class="form-group">
<label for="manga_alt"><?= $lang["add_manga"]["alt"] ?></label>
<input tabindex="3" type="text" name="alt" id="manga_alt" class="form-control" placeholder="<?= $lang["add_manga"]["alt"] ?>">
</div>
<div class="form-group">
<label for="manga_author"><?= $lang["add_manga"]["author"] ?></label>
<input tabindex="4" type="text" name="author" id="manga_author" class="form-control" placeholder="<?= $lang["add_manga"]["author"] ?>">
</div>
<div class="form-group">
<label for="manga_genre"><?= $lang["add_manga"]["genre"] ?></label>
<input tabindex="5" type="text" name="genre" id="manga_genre" class="form-control" placeholder="<?= $lang["add_manga"]["genre"] ?>">
</div>
<div class="form-group">
<label for="manga_raw-status"><?= $lang["add_manga"]["type"] ?></label>
<select required tabindex="6" class="selectpicker form-control" name="type" id="manga_type">
<option value="<?= $lang["add_manga"]["manga"] ?>" selected><?= $lang["add_manga"]["type_manga"] ?></option>
<option value="<?= $lang["add_manga"]["manwha"] ?>"><?= $lang["add_manga"]["type_manwha"] ?></option>
<option value="<?= $lang["add_manga"]["manhua"] ?>"><?= $lang["add_manga"]["type_manhua"] ?></option>
</select>
</div>
<div class="form-group">
<label for="manga_released"><?= $lang["add_manga"]["released"] ?></label>
<input tabindex="7" type="number" name="released" id="manga_released" class="form-control" placeholder="<?= $lang["add_manga"]["released"] ?>">
</div>
<div class="form-group">
<label for="manga_raw-status"><?= $lang["add_manga"]["raw-st"] ?></label>
<select tabindex="8" class="selectpicker form-control" name="raw-status" id="manga_raw-status">
<option value="1" selected><?= $lang["add_manga"]["rawst"][1] ?></option>
<option value="2"><?= $lang["add_manga"]["rawst"][2] ?></option>
<option value="3"><?= $lang["add_manga"]["rawst"][3] ?></option>
<option value="4"><?= $lang["add_manga"]["rawst"][4] ?></option>
<option value="5"><?= $lang["add_manga"]["rawst"][5] ?></option>
<option value="5"><?= $lang["add_manga"]["rawst"][6] ?></option>
</select>
</div>
<div class="form-group">
<label for="manga_scan-status"><?= $lang["add_manga"]["status"] ?></label>
<select required tabindex="9" class="selectpicker form-control" name="scan-status" id="manga_scan-status">
<option value="1"><?= $lang["add_manga"]["scanst"][1] ?></option>
<option value="2" selected><?= $lang["add_manga"]["scanst"][2] ?></option>
<option value="3"><?= $lang["add_manga"]["scanst"][3] ?></option>
<option value="4"><?= $lang["add_manga"]["scanst"][4] ?></option>
<option value="5"><?= $lang["add_manga"]["scanst"][5] ?></option>
</select>
</div>
<div class="form-group">
<label for="manga_description"><?= $lang["add_manga"]["descript"] ?></label>
<textarea tabindex="10" type="text" name="description" id="manga_description" class="form-control" placeholder="<?= $lang["add_manga"]["descript"] ?>" style="max-width:100%; height:200px"></textarea>
</div>
<div class="form-group">
<label for="manga_raw-url"><?= $lang["add_manga"]["raw-url"] ?></label>
<input tabindex="11" type="text" name="raw-url" id="manga_raw-url" class="form-control" placeholder="<?= $lang["add_manga"]["raw-url"] ?>">
</div>
<div class="form-group">
<label for="manga_licensed"><?= $lang["add_manga"]["licensed"] ?></label>
<input tabindex="12" type="text" name="licensed" id="manga_licensed" class="form-control" placeholder="<?= $lang["add_manga"]["licensed"] ?>">
</div>
<div class="form-group">
<label for="manga_official-url"><?= $lang["add_manga"]["official"] ?></label>
<input tabindex="13" type="text" name="official-url" id="manga_official-url" class="form-control" placeholder="<?= $lang["add_manga"]["official"] ?>">
</div>
<p><i><?= $lang["add_manga"]["required"] ?></i></p>
<button tabindex="14" class="btn btn-lg btn-success btn-block" type="submit" id="login_button" name="add_manga"><?= glyph("plus",$lang["add_manga"]["add"]) ?> <?= $lang["add_manga"]["add"] ?></button>
</form>
</div>
<?php include("../parts/footer.php"); ?>

63
render/parts/captcha.php Normal file
View File

@ -0,0 +1,63 @@
<?php
session_start();
$permitted_chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ';
function generate_string($input, $strength = 10) {
$input_length = strlen($input);
$random_string = '';
for($i = 0; $i < $strength; $i++) {
$random_character = $input[mt_rand(0, $input_length - 1)];
$random_string .= $random_character;
}
return $random_string;
}
$image = imagecreatetruecolor(200, 50);
imageantialias($image, true);
$colors = [];
$red = rand(125, 175);
$green = rand(125, 175);
$blue = rand(125, 175);
for($i = 0; $i < 5; $i++) {
$colors[] = imagecolorallocate($image, $red - 20*$i, $green - 20*$i, $blue - 20*$i);
}
imagefill($image, 0, 0, $colors[0]);
for($i = 0; $i < 10; $i++) {
imagesetthickness($image, rand(2, 10));
$line_color = $colors[rand(1, 4)];
imagerectangle($image, rand(-10, 190), rand(-10, 10), rand(-10, 190), rand(40, 60), $line_color);
}
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$textcolors = [$black, $white];
//$fonts = [dirname(__FILE__).'\font.ttf'];
$fonts = [dirname(__FILE__).'\font.ttf'];
$string_length = 6;
$captcha_string = generate_string($permitted_chars, $string_length);
$_SESSION['captcha_text'] = $captcha_string;
for($i = 0; $i < $string_length; $i++) {
$letter_space = 170/$string_length;
$initial = 15;
imagettftext($image, 24, rand(-15, 15), $initial + $i*$letter_space, rand(25, 45), $textcolors[rand(0, 1)], $fonts[array_rand($fonts)], $captcha_string[$i]);
}
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>

22
render/parts/cookies.php Normal file
View File

@ -0,0 +1,22 @@
<?php
?>
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="display: block">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel"><?= $lang["cookie_modal"]["title"] ?></h4>
</div>
<div class="modal-body">
<?= $lang["cookie_modal"]["content"] ?>
</div>
<div class="modal-footer">
<form method="post" name="refuse_cookies" action="">
<button type="submit" name="refuse_cookies" class="btn btn-default"><?= $lang["cookie_modal"]["refuse"] ?></button>
<button type="submit" name="accept_cookies" class="btn btn-primary"><?= $lang["cookie_modal"]["accept"] ?></button>
</form>
</div>
</div>
</div>
</div>

BIN
render/parts/font.ttf Normal file

Binary file not shown.

12
render/parts/footer.php Normal file
View File

@ -0,0 +1,12 @@
</div>
<footer class="footer">
<p class="text-center text-muted">Copyright &copy; <?= $config["start"]."-".date("Y") ?> <a href="<?php echo $config["url"]; ?>"><?php echo $config["title"]; ?></a> | Proudly powered by <a href="https://github.com/saintly2k/FoOlSlideX" target="_blank">FoOlSlideX</a></p>
</footer>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
</body>
</html>

20
render/parts/header.php Normal file
View File

@ -0,0 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<link rel="stylesheet" href="<?= $config["url"] ?>assets/theme.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->

88
render/parts/menu.php Normal file
View File

@ -0,0 +1,88 @@
</head>
<body>
<nav id="top_nav" class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" id="home_button" href="<?= $config["url"] ?>">
<?php if(empty($config["logo"])) { ?>
<?= $config["title"] ?>
<?php } else { ?>
<img src="<?= $config["url"].$config["logo"] ?>" height="200%" style="margin-top:-9px" alt="<?= $config["title"] ?>" title="<?= $config["title"]." - ".$config["slogan"] ?>">
<?php } ?>
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav" id="nav_links">
<li class="<?php if($page==$lang["menu"]["releases"]) { echo "active"; } ?>" id="titles">
<a href="<?php echo $config["url"]; ?>"><?= glyph("th-list",$lang["menu"]["releases"]) ?> <?= $lang["menu"]["releases"] ?></a>
</li>
<li class="<?php if($page==$lang["menu"]["titles"]) { echo "active"; } ?>" id="titles">
<a href="<?php echo $config["url"]; ?>titles"><?= glyph("book",$lang["menu"]["titles"]) ?> <?= $lang["menu"]["titles"] ?></a>
</li>
<li class="<?php if($page==$lang["menu"]["bookmarks"]) { echo "active"; } ?>" id="titles">
<a href="<?php echo $config["url"]; ?>bookmarks"><?= glyph("bookmark",$lang["menu"]["bookmarks"]) ?> <?= $lang["menu"]["bookmarks"] ?></a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<?= glyph("info-sign",$lang["menu"]["more"]) ?> <span class="nav-label-1440"><?= $lang["menu"]["more"] ?></span> <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="<?php if($page==$lang["menu"]["about"]) { echo "active"; } ?>" id="about">
<a href="<?= $config["url"] ?>about"><?= glyph("question-sign",$lang["menu"]["about"]) ?> <?= $lang["menu"]["about"] ?></a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right" id="pm">
<li class="dropdown">
<?php if($loggedin==false) { ?>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?= glyph("user",$lang["menu"]["account"]) ?> <span class="nav-label-1440"><?= $lang["menu"]["account"] ?></span> <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="<?php if($page==$lang["menu"]["login"]) { echo "active"; } ?>">
<a href="<?= $config["url"] ?>login"><?= glyph("log-in",$lang["menu"]["login"]) ?> <?= $lang["menu"]["login"] ?></a>
</li>
<li class="<?php if($page==$lang["menu"]["signup"]) { echo "active"; } ?>">
<a href="<?= $config["url"] ?>signup"><?= glyph("log-in",$lang["menu"]["signup"]) ?> <?= $lang["menu"]["signup"] ?></a>
</li>
</ul>
<?php } else { ?>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?= glyph("user",$lang["menu"]["account"]) ?> <span class="nav-label-1440"><?= $user["username"] ?></span> <span class="caret"></span></a>
<ul class="dropdown-menu">
<!-- <li class="<?php if($page==$lang["menu"]["profile"]) { echo "active"; } ?>">
<a href="<?= $config["url"] ?>profile/<?= $user["id"] ?>"><?= glyph("user",$lang["menu"]["profile"]) ?> <?= $lang["menu"]["profile"] ?></a>
</li> -->
<!-- <li class="<?php if($page==$lang["menu"]["settings"]) { echo "active"; } ?>">
<a href="<?= $config["url"] ?>settings"><?= glyph("wrench",$lang["menu"]["settings"]) ?> <?= $lang["menu"]["settings"] ?></a>
</li> -->
<li class="<?php if($page==$lang["menu"]["add_new"]) { echo "active"; } ?>">
<a href="<?= $config["url"] ?>admin/new_title"><?= glyph("log-out",$lang["menu"]["add_new"]) ?> <?= $lang["menu"]["add_new"] ?></a>
</li>
<li class="<?php if($page==$lang["menu"]["logout"]) { echo "active"; } ?>">
<a href="<?= $config["url"] ?>logout"><?= glyph("log-out",$lang["menu"]["logout"]) ?> <?= $lang["menu"]["logout"] ?></a>
</li>
</ul>
<?php } ?>
</li>
</ul>
<form role="search" class="navbar-form navbar-right nav-label-992" action="titles" method="get">
<div class="input-group">
<input type="text" class="form-control quick_search_input" placeholder="<?= $lang["menu"]["quicksearch"] ?>" name="mtitle" value="<?php if(isset($_GET["mtitle"])) echo mysqli_real_escape_string($conn, $_GET["mtitle"]); ?>">
<span class="input-group-btn">
<button class="btn btn-default" type="submit" id="quick_search_button"><?= glyph("search",$lang["menu"]["search"]) ?></button>
</span>
</div>
</form>
</div>
</div>
</nav>
<div class="container">

View File

@ -0,0 +1,19 @@
<?php
require("../../requires.php");
$page = $lang["menu"]["about"];
include("../parts/header.php");
?>
<title><?= $lang["menu"]["about"]." :: ".$config["title"] ?></title>
<?php include("../parts/menu.php"); ?>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<?php include("../../about.html") ?>
<?php include("../parts/footer.php"); ?>

View File

@ -0,0 +1,92 @@
<?php
// Note to my future self: Someday I'll need to make this proccess automated...
require("../../requires.php");
$page = $lang["menu"]["bookmarks"];
include("../parts/header.php");
$titles = $conn->query("SELECT * FROM `titles` ORDER BY `title` ASC");
?>
<title><?= $lang["menu"]["bookmarks"]." :: ".$config["title"] ?></title>
<?php include("../parts/menu.php"); ?>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<div class="row">
<div class="col-sm-12">
<h2 class="text-center"><?= $lang["menu"]["bookmarks"] ?></h2>
</div>
<?php foreach($titles as $manga) { ?>
<?php if(isset($_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]) && $_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]==$manga["slug"]) { ?>
<?php $mid = $manga["id"]; $chapters = $conn->query("SELECT * FROM `chapters` WHERE `mid`='$mid' ORDER BY `chapter` DESC"); ?>
<div class="col-sm-12">
<div class="row">
<div class="col-sm-2">
<a href="<?= $config["url"] ?>manga/<?= $manga["slug"] ?>">
<img src="<?= $config["url"] ?>data/covers/<?= $manga["cover"] ?>" width="100%" alt="<?= $manga["title"] ?>" title="<?= $manga["title"] ?>">
</a>
</div>
<div class="col-sm-8">
<h2>
<?= glyph("bookmark","Bookmarked") ?>
<a href="<?= $config["url"] ?>manga/<?= $manga["slug"] ?>">
<b><u><?= $manga["title"] ?></u></b>
</a>
</h2>
<div class="table-responsive" id="latest-titles">
<table class="table table-hover table-striped">
<thead>
<th style="width:20%">Chapter</th>
<th style="width:60%;">Chapter Title</th>
<th class="text-right" style="width:20%">Added</th>
</thead>
<tbody>
<?php foreach($chapters as $chapter) { ?>
<?php if(isset($_COOKIE[$config["title"]."_chapter-".$chapter["slug"]]) && $_COOKIE[$config["title"]."_chapter-".$chapter["slug"]]==$chapter["slug"]) { ?>
<tr>
<td>
<a href="<?= $config["url"] ?>chapter/<?= $chapter["slug"] ?>">
<?php if(isset($_COOKIE[$config["title"]."_chapter-".$chapter["slug"]]) && $_COOKIE[$config["title"]."_chapter-".$chapter["slug"]]==$chapter["slug"]) echo glyph("bookmark","Bookmarked"); ?>
<?php if(empty($chapter["volume"]) && empty($chapter["chapter"])) { ?>
<?= $lang["chapter"]["oneshot"] ?>
<?php } elseif(empty($chapter["volume"]) && !empty($chapter["chapter"])) { ?>
Ch. <?= $chapter["chapter"] ?>
<?php } else { ?>
Vol. <?= $chapter["volume"] ?> Ch. <?= $chapter["chapter"] ?>
<?php } ?>
</a>
</td>
<td>
<a href="<?= $config["url"] ?>chapter/<?= $chapter["slug"] ?>">
<?php if(empty($chapter["title"])) { ?>
<?= $lang["manga"]["unknown"] ?>
<?php } else { ?>
<?= $chapter["title"] ?>
<?php } ?>
</a>
</td>
<td class="text-right"><?= $chapter["added"] ?></td>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
</div>
<div class="panel panel-default panel-body">
<?= $manga["description"] ?>
</div>
</div>
</div>
<br>
</div>
<?php } ?>
<?php } ?>
</div>
<?php include("../parts/footer.php"); ?>

View File

@ -0,0 +1,266 @@
<?php
require("../../requires.php");
$slug = mysqli_real_escape_string($conn, $_GET["slug"]);
$chapter = $conn->query("SELECT * FROM `chapters` WHERE `slug`='$slug' LIMIT 1");
$chapter = mysqli_fetch_assoc($chapter);
$mid = $chapter["mid"];
$manga = $conn->query("SELECT * FROM `titles` WHERE `id`='$mid' LIMIT 1");
$manga = mysqli_fetch_assoc($manga);
if(empty($chapter["title"])) $chapter["title"] = $lang["chapter"]["oneshot"];
include("../parts/header.php");
if(isset($_COOKIE[$config["title"]."_bookmark-".$manga["slug"]])) {
$bookmarked = true;
if(isset($_COOKIE[$config["title"]."_chapter-".$chapter["slug"]])) {
$bookmarked_ch = $_COOKIE[$config["title"]."_chapter-".$chapter["slug"]];
} else {
$bookmarked = 0;
}
} else {
$bookmarked = false;
}
$chapters = $conn->query("SELECT * FROM `chapters` WHERE `mid`='$mid' ORDER BY `chapter`ASC");
$next_chapter = $conn->query("SELECT * FROM `chapters` WHERE `mid`='$mid' AND `chapter`>'".$chapter["chapter"]."' LIMIT 1");
$prev_chapter = $conn->query("SELECT * FROM `chapters` WHERE `mid`='$mid' AND `chapter`<'".$chapter["chapter"]."' LIMIT 1");
$next_chapter = mysqli_fetch_assoc($next_chapter);
$prev_chapter = mysqli_fetch_assoc($prev_chapter);
if(isset($_POST["add_bookmark"])) {
if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"]) || $_COOKIE[$config["title"]."_cookie-consent"]==2) {
setcookie($config["title"]."_cookie-consent", false, time() - 3600, "/");
header("Refresh: 0;");
} else {
setcookie($config["title"]."_bookmark-".$manga["slug"], $manga["slug"], time()+31556926, "/");
setcookie($config["title"]."_chapter-".$chapter["slug"], $chapter["slug"], time()+31556926, "/");
header("Refresh: 0;");
}
}
if(isset($_POST["remove_bookmark"])) {
if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"]) || $_COOKIE[$config["title"]."_cookie-consent"]==2) {
setcookie($config["title"]."_cookie-consent", false, time() - 3600, "/");
header("Refresh: 0;");
} else {
// setcookie($config["title"]."_bookmark-".$manga["slug"], $manga["slug"], time() - 3600, "/");
setcookie($config["title"]."_chapter-".$chapter["slug"], $chapter["slug"], time() - 3600, "/");
header("Refresh: 0;");
}
}
if(isset($_POST["update_bookmark"])) {
if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"]) || $_COOKIE[$config["title"]."_cookie-consent"]==2) {
setcookie($config["title"]."_cookie-consent", false, time() - 3600, "/");
header("Refresh: 0;");
} else {
setcookie($config["title"]."_chapter-".$chapter["slug"], $chapter["slug"], time()+31556926, "/");
header("Refresh: 0;");
}
}
?>
<title><?php if(empty($chapter["volume"]) && empty($chapter["chapter"])) { ?> <?= $chapter["title"] ?> <?php } elseif(empty($chapter["volume"]) && !empty($chapter["chapter"])) { ?> Ch. <?= $chapter["chapter"] ?> <?php } else { ?> Vol. <?= $chapter["volume"] ?> Ch. <?= $chapter["chapter"] ?> <?php } ?> <- <?= $manga["title"] ?> :: <?= $config["title"] ?> </title>
</head>
<body>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<style>
.sidenav {
height: 100%;
position: fixed;
z-index: 1;
top: 0;
overflow-x: hidden;
padding-top: 40px;
}
.mini-submenu {
display: none;
background-color: rgba(0, 0, 0, 0);
border: 1px solid rgba(0, 0, 0, 0.9);
border-radius: 4px;
padding: 9px;
/*position: relative;*/
width: 42px;
}
.mini-submenu:hover {
cursor: pointer;
}
.mini-submenu .icon-bar {
border-radius: 1px;
display: block;
height: 2px;
width: 22px;
margin-top: 3px;
}
.mini-submenu .icon-bar {
background-color: #000;
}
#slide-submenu {
background: rgba(0, 0, 0, 0.45);
display: inline-block;
padding: 0 8px;
border-radius: 4px;
cursor: pointer;
}
</style>
<script>
$(function() {
$('#slide-submenu').on('click', function() {
$(this).closest('.list-group').fadeOut('slide', function() {
$('.mini-submenu').fadeIn();
});
});
$('.mini-submenu').on('click', function() {
$(this).next('.list-group').toggle('slide');
$('.mini-submenu').hide();
})
});
$(document).ready(function() {
$(".scroll").click(function(event) {
$('html, body').animate({
scrollTop: '+=600px'
}, 800);
});
});
</script>
<div class="container content">
<div class="row">
<div class="sidenav">
<div class="sidebar">
<div class="mini-submenu">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</div>
<div class="list-group">
<span href="#" class="list-group-item active">
<?= $lang["chapter"]["menu"] ?>
<span class="pull-right" id="slide-submenu">
<?= glyph("remove",$lang["chapter"]["close"]) ?>
</span>
</span>
<a href="<?= $config["url"] ?>manga/<?= $manga["slug"] ?>" class="list-group-item">
<?= glyph("book",$lang["chapter"]["back_to_m"]) ?> <?= $lang["chapter"]["back_to_m"] ?>
</a>
<form method="post" name="bookmark">
<?php if($bookmarked==true && $bookmarked_ch==$chapter["slug"]) { ?>
<button type="submit" name="remove_bookmark" class="list-group-item">
<?= glyph("remove",$lang["chapter"]["remove_bm"]) ?> <?= $lang["chapter"]["remove_bm"] ?>
</button>
<?php } elseif($bookmarked==true && $bookmarked_ch!=$chapter["slug"]) { ?>
<button type="submit" name="update_bookmark" class="list-group-item">
<?= glyph("refresh",$lang["chapter"]["update_bm"]) ?> <?= $lang["chapter"]["update_bm"] ?>
</button>
<?php } else { ?>
<button type="submit" name="add_bookmark" class="list-group-item">
<?= glyph("bookmark",$lang["chapter"]["bookmark"]) ?> <?= $lang["chapter"]["bookmark"] ?>
</button>
<?php } ?>
</form>
<a href="#" class="list-group-item">
<select class="selectpicker form-control" onChange="window.location.href=this.value">
<?php foreach($chapters as $chp) { ?>
<option <?php if($chp["slug"]==$chapter["slug"]) echo "selected"; ?> value="<?= $config["url"] ?>chapter/<?= $chp["slug"] ?>">
<?php if(empty($chp["volume"]) && empty($chp["chapter"])) { ?> <?= $chp["title"] ?> <?php } elseif(empty($chp["volume"]) && !empty($chp["chapter"])) { ?> Ch. <?= $chp["chapter"] ?> <?php } else { ?> Vol. <?= $chp["volume"] ?> Ch. <?= $chp["chapter"] ?> <?php } ?>
</option>
<?php } ?>
</select>
</a>
<a <?php if(!empty($prev_chapter["slug"])) { ?> href="<?= $config["url"] ?>chapter/<?= $prev_chapter["slug"] ?>" class="list-group-item" <?php } else { ?> class="list-group-item disabled" <?php } ?>>
<i class="fa fa-folder-open-o"></i> <?= $lang["chapter"]["prev"] ?>
</a>
<a <?php if(!empty($next_chapter["slug"])) { ?> href="<?= $config["url"] ?>chapter/<?= $next_chapter["slug"] ?>" class="list-group-item" <?php } else { ?> class="list-group-item disabled" <?php } ?>>
<i class="fa fa-bar-chart-o"></i> <?= $lang["chapter"]["next"] ?>
</a>
<a href="#disqus_thread" class="list-group-item">
<?= glyph("comment",$lang["chapter"]["comments"]) ?> <?= $lang["chapter"]["comments"] ?>
</a>
</div>
</div>
</div>
<div class="col-sm-12">
<h1 class="text-center"><?= $manga["title"] ?> - <?php if(empty($chapter["volume"]) && empty($chapter["chapter"])) { ?> <?= $chapter["title"] ?> <?php } elseif(empty($chapter["volume"]) && !empty($chapter["chapter"])) { ?> Ch. <?= $chapter["chapter"] ?> <?php } else { ?> Vol. <?= $chapter["volume"] ?> Ch. <?= $chapter["chapter"] ?> <?php } ?></h1>
</div>
<div class="col-sm-2"></div>
<div class="col-sm-8">
<?php $i = 1; ?>
<?php foreach(glob("../../data/chapters/".$chapter["slug"]."/*.*") as $image) { ?>
<img src="<?= $config["url"] ?>data/chapters/<?= $image ?>" alt="<?= $manga["title"] ?> <?php if(empty($chapter["volume"]) && empty($chapter["chapter"])) { ?> <?= $chapter["title"] ?> <?php } elseif(empty($chapter["volume"]) && !empty($chapter["chapter"])) { ?> Ch. <?= $chapter["chapter"] ?> <?php } else { ?> Vol. <?= $chapter["volume"] ?> Ch. <?= $chapter["chapter"] ?> <?php } ?> - Page <?= $i ?>" style="width:100%" class="scroll">
<?php $i++; ?>
<?php } ?>
</div>
<div class="col-sm-2"></div>
<div class="col-sm-12">
<br>
</div>
<div class="col-sm-6">
Previous Chapter
</div>
<div class="col-sm-6">
Next Chapter
</div>
<div class="col-sm-12">
<hr>
</div>
<div class="col-sm-12">
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document,
s = d.createElement('script');
s.src = 'https://<?= $config["disqus"] ?>.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
</div>
<?php include("../parts/footer.php"); ?>

187
render/public/home.req.php Normal file
View File

@ -0,0 +1,187 @@
<?php
require("../../requires.php");
$page = $lang["menu"]["releases"];
if(isset($_GET["logout"])) {
// Removing token from Database and destroy entire session and so on
$uid = $user["id"];
$conn->query("DELETE FROM `sessions` WHERE `user-id`='$uid'");
setcookie($config["title"]."_session", "", time() - 3600, "/", "");
session_destroy();
session_unset();
header("Refresh: 0; url=./");
}
include("../parts/header.php");
$carousels = $conn->query("SELECT * FROM `titles` ORDER BY RAND() LIMIT 5");
$latest_titles = $conn->query("SELECT * FROM `titles` ORDER BY `added` DESC");
$latest_chapters = $conn->query("SELECT * FROM `chapters` ORDER BY `added` DESC");
?>
<title><?= $config["title"]." :: ".$config["slogan"] ?></title>
<?php include("../parts/menu.php"); ?>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<div class="row">
<div class="col-sm-4">
<div id="manga-carousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<?php $c = 1; foreach($carousels as $item) { ?>
<li data-target="#carousel-example-generic" data-slide-to="0" <?php if($c==1) { ?>class="active" <?php } ?>></li>
<?php $c++; ?>
<?php } ?>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<?php $q = 1; foreach($carousels as $item) { ?>
<div class="item <?php if($q==1) { ?>active<?php } ?>">
<a href="<?= $config["url"] ?>manga/<?= $item["slug"] ?>">
<img src="data/covers/<?= $item["cover"] ?>" alt="<?= $item["title"] ?>">
<div class="carousel-caption">
<?= $item["title"] ?>
</div>
</a>
</div>
<?php $q++; ?>
<?php } ?>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#manga-carousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#manga-carousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<style>
#latest-titles {
max-height: 500px;
}
#manga-carousel {
max-height: 520px;
}
</style>
<div class="col-sm-8">
<h3 class="text-center" style="max-height:20px;padding: 0; margin: 0;">Added Titles</h3>
<div class="table-responsive" id="latest-titles">
<table class="table table-hover table-striped">
<thead>
<th style="width:5%">Type</th>
<th>Title</th>
<th class="text-right" style="width:20%">Added</th>
</thead>
<tbody>
<?php foreach($latest_titles as $item) { ?>
<tr>
<?php if($item["type"]==$lang["add_manga"]["manga"]) { ?>
<td><span class="label label-primary"><?= $lang["add_manga"]["manga"] ?></span></td>
<?php } elseif($item["type"]==$lang["add_manga"]["manwha"]) { ?>?>
<td><span class="label label-success"><?= $lang["add_manga"]["manwha"] ?></span></td>
<?php } else { ?>?>
<td><span class="label label-info"><?= $lang["add_manga"]["manhua"] ?></span></td>
<?php } ?>
<td>
<?php if(isset($_COOKIE[$config["title"]."_bookmark-".$item["slug"]]) && $_COOKIE[$config["title"]."_bookmark-".$item["slug"]]==$item["slug"]) echo glyph("bookmark","Bookmarked"); ?>
<a href="<?= $config["url"] ?>manga/<?= $item["slug"] ?>"><?= $item["title"] ?></a>
<?php if($loggedin==true) { ?>
<a href="<?= $config["url"] ?>admin/edit_title/<?= $item["slug"] ?>">
<span class="badge"><?= glyph("pencil",$lang["manga"]["edit_title"]) ?> <?= $lang["manga"]["edit_title"] ?></span>
</a>
<?php } ?>
</td>
<td><?= $item["added"] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div class="col-sm-12">
<h3 class="text-center">Released Chapters</h3>
<div class="table-responsive" id="latest-titles">
<table class="table table-hover table-striped">
<thead>
<th style="width:5%">Type</th>
<th style="width:8%">Chapter</th>
<th style="width:30%;">Chapter Title</th>
<th style="width:30%">Manga</th>
<th style="width:10%" class="text-center">Uploader</th>
<th class="text-right" style="width:20%">Added</th>
</thead>
<tbody>
<?php foreach($latest_chapters as $chapter) { ?>
<tr>
<td>
<?php $mng = $conn->query("SELECT * FROM `titles` WHERE `id`='".$chapter["mid"]."' LIMIT 1"); $mng = mysqli_fetch_assoc($mng); ?>
<?php if($mng["type"]==$lang["add_manga"]["manga"]) { ?>
<span class="label label-primary"><?= $lang["add_manga"]["manga"] ?></span>
<?php } elseif($mng["type"]==$lang["add_manga"]["manwha"]) { ?>
<span class="label label-success"><?= $lang["add_manga"]["manwha"] ?></span>
<?php } else { ?>
<span class="label label-info"><?= $lang["add_manga"]["manhua"] ?></span>
<?php } ?>
</td>
<td>
<?php if(isset($_COOKIE[$config["title"]."_chapter-".$chapter["slug"]]) && $_COOKIE[$config["title"]."_chapter-".$chapter["slug"]]==$chapter["slug"]) echo glyph("bookmark","Bookmarked"); ?>
<a href="<?= $config["url"] ?>chapter/<?= $chapter["slug"] ?>">
<?php if(empty($chapter["volume"]) && empty($chapter["chapter"])) { ?>
<?= $lang["chapter"]["oneshot"] ?>
<?php } elseif(empty($chapter["volume"]) && !empty($chapter["chapter"])) { ?>
Ch. <?= $chapter["chapter"] ?>
<?php } else { ?>
Vol. <?= $chapter["volume"] ?> Ch. <?= $chapter["chapter"] ?>
<?php } ?>
</a>
</td>
<td>
<a href="<?= $config["url"] ?>chapter/<?= $chapter["slug"] ?>">
<?php if(empty($chapter["title"])) { ?>
<?= $lang["manga"]["unknown"] ?>
<?php } else { ?>
<?= $chapter["title"] ?>
<?php } ?>
</a>
<?php if($loggedin==true) { ?>
<a href="<?= $config["url"] ?>admin/edit_chapter/<?= $chapter["slug"] ?>">
<span class="badge"><?= glyph("pencil",$lang["manga"]["edit_chap"]) ?> <?= $lang["manga"]["edit_chap"] ?></span>
</a>
<?php } ?>
</td>
<td>
<?php if(isset($_COOKIE[$config["title"]."_bookmark-".$mng["slug"]]) && $_COOKIE[$config["title"]."_bookmark-".$mng["slug"]]==$mng["slug"]) echo glyph("bookmark","Bookmarked"); ?>
<a href="<?= $config["url"] ?>manga/<?= $mng["slug"] ?>">
<?= $mng["title"] ?>
</a>
</td>
<td class="text-center">
<?php $uploader = $conn->query("SELECT * FROM `user` WHERE `id`='".$chapter["user"]."' LIMIT 1"); $uploader = mysqli_fetch_assoc($uploader); echo $uploader["username"]; ?>
</td>
<td class="text-right"><?= $item["added"] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<?php include("../parts/footer.php"); ?>

120
render/public/login.req.php Normal file
View File

@ -0,0 +1,120 @@
<?php
require("../../requires.php");
$page = $lang["menu"]["login"];
if($loggedin==true) {
header("Refresh: 0; url=./");
}
$error = false;
$error_msg = "";
if(isset($_GET["username"]) && isset($_GET["password"]) && isset($_GET["captcha_challenge"])) {
if(isset($_GET['captcha_challenge']) && $_GET['captcha_challenge'] == $_SESSION['captcha_text']) {
$username = mysqli_real_escape_string($conn, $_GET["username"]);
$password = mysqli_real_escape_string($conn, $_GET["password"]);
$check1 = preg_match('/[^.a-zA-Z0-9-_]/', $username);
$check2 = preg_match('/[^.a-zA-Z0-9-_]/', $password);
if($check2==true) {
$error = true;
$error_msg = $lang["errors"]["bad_password"];
}
if($check1==true) {
$error = true;
$error_msg = $lang["errors"]["bad_username"];
}
if($error==false) {
// Everything is fine desu~
$check = $conn->query("SELECT * FROM `user` WHERE `username`='$username' LIMIT 1");
if(mysqli_num_rows($check)==1) {
// Account exists!
$check = mysqli_fetch_assoc($check);
$check = password_verify($password, $check["password"]);
if($check==true) {
// Yay, user exists & passowrd matches!
$user = $conn->query("SELECT * FROM `user` WHERE `username`='$username' LIMIT 1");
$user = mysqli_fetch_assoc($user);
$uid = $user["id"];
$token = rand();
$token = md5($token);
setcookie("".$config["title"]."_session", $token, time()+(86400*30), "/");
$conn->query("INSERT INTO `sessions`(`user-id`,`token`) VALUES('$uid','$token')");
header("Location: ./");
} else {
// Ewww error
$error = true;
$error_msg = $lang["errors"]["wrong_password"];
}
} else {
// Username/Password doesn't match
$error = true;
$error_msg = $lang["errors"]["attack"];
}
}
} else {
$error = true;
$error_msg = $lang["errors"]["captcha"];
}
}
include("../parts/header.php");
?>
<title><?= $lang["menu"]["login"]." :: ".$config["title"] ?></title>
<?php include("../parts/menu.php"); ?>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<?php if(!empty($error_msg)) { ?>
<div class="alert alert-warning alert-dismissible text-center" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong><?= $lang["login"]["error"] ?>:</strong> <?= $error_msg ?>
</div>
<?php } ?>
<div style="margin: 0 auto; width: 300px" id="login_container">
<form method="get" id="login_form" name="login_user">
<h1 class="text-center"><?= $lang["menu"]["login"] ?></h1>
<hr>
<div class="form-group">
<label for="login_username" class="sr-only"><?= $lang["login"]["username"] ?></label>
<input tabindex="1" type="text" name="username" id="login_username" class="form-control" placeholder="<?= $lang["login"]["username"] ?>">
</div>
<div class="form-group">
<label for="login_password" class="sr-only"><?= $lang["login"]["password"] ?></label>
<input tabindex="2" type="password" name="password" id="login_password" class="form-control" placeholder="<?= $lang["login"]["password"] ?>">
</div>
<div class="form-group">
<label for="login_captcha" class="sr-only"><?= $lang["login"]["captcha"] ?></label>
<input tabindex="3" id="login_captcha" class="form-control" type="text" placeholder="<?= $lang["login"]["captcha"] ?>" name="captcha_challenge" tabindex="3" title="<?= $lang["login"]["captcha"] ?>" autocomplete="off">
<img src="render/parts/captcha.php" alt="CAPTCHA IMAGE (Click to refresh)" class="captcha-image loading" width="200px" title="Click to refresh!" style="padding-top:10px;padding-bottom:10px;margin-left:50px;margin-right:50px;">
</div>
<div class="checkbox">
<label>
<input tabindex="4" type="checkbox" name="remember_me" value="1"> <?= $lang["login"]["cookies"] ?>
</label>
</div>
<button tabindex="5" class="btn btn-lg btn-success btn-block" type="submit" id="login_button" name="user_login"><?= glyph("log-in",$lang["menu"]["login"]) ?> <?= $lang["menu"]["login"] ?></button>
<hr>
<p><?= $lang["login"]["message"] ?> <a href="<?= $config["url"] ?>signup"><?= $lang["menu"]["signup"] ?>!</a></p>
</form>
</div>
<script>
var refreshButton = document.querySelector(".captcha-image");
refreshButton.onclick = function() {
document.querySelector(".captcha-image").src = 'render/parts/captcha.php?' + Date.now();
}
</script>
<?php include("../parts/footer.php"); ?>

223
render/public/manga.req.php Normal file
View File

@ -0,0 +1,223 @@
<?php
require("../../requires.php");
//$page = $lang["menu"]["home"];
include("../parts/header.php");
$slug = mysqli_real_escape_string($conn, $_GET["slug"]);
$manga = $conn->query("SELECT * FROM `titles` WHERE `slug`='$slug' LIMIT 1");
$manga = mysqli_fetch_assoc($manga);
$mid = $manga["id"];
$chapters = $conn->query("SELECT * FROM `chapters` WHERE `mid`='$mid' ORDER BY `chapter` DESC");
if(empty($manga["author"])) $manga["author"] = $lang["manga"]["unknown"];
if(empty($manga["genre"])) $manga["genre"] = $lang["manga"]["unknown"];
if(empty($manga["author"])) $manga["author"] = $lang["manga"]["unknown"];
if(empty($manga["released"])) $manga["released"] = $lang["manga"]["unknown"];
if(empty($manga["description"])) $manga["description"] = $lang["manga"]["unknown"];
if(empty($manga["author"])) $manga["author"] = $lang["manga"]["unknown"];
if($manga["raw-status"]==1) {
$manga["raw-status"] = $lang["add_manga"]["rawst"][1];
} elseif($manga["raw-status"]==2) {
$manga["raw-status"] = $lang["add_manga"]["rawst"][2];
} elseif($manga["raw-status"]==3) {
$manga["raw-status"] = $lang["add_manga"]["rawst"][3];
} elseif($manga["raw-status"]==4) {
$manga["raw-status"] = $lang["add_manga"]["rawst"][4];
} elseif($manga["raw-status"]==5) {
$manga["raw-status"] = $lang["add_manga"]["rawst"][5];
} else {
$manga["raw-status"] = $lang["add_manga"]["rawst"][6];
}
if($manga["scan-status"]==1) {
$manga["scan-status"] = $lang["add_manga"]["scanst"][1];
} elseif($manga["scan-status"]==2) {
$manga["scan-status"] = $lang["add_manga"]["scanst"][2];
} elseif($manga["scan-status"]==3) {
$manga["scan-status"] = $lang["add_manga"]["scanst"][3];
} elseif($manga["scan-status"]==4) {
$manga["scan-status"] = $lang["add_manga"]["scanst"][4];
} elseif($manga["scan-status"]==5) {
$manga["scan-status"] = $lang["add_manga"]["scanst"][5];
} else {
$manga["scan-status"] = $lang["add_manga"]["scanst"][6];
}
if(isset($_POST["add_bookmark"])) {
if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"]) || $_COOKIE[$config["title"]."_cookie-consent"]==2) {
setcookie($config["title"]."_cookie-consent", false, time() - 3600, "/");
header("Refresh: 0;");
} else {
setcookie($config["title"]."_bookmark-".$manga["slug"], $manga["slug"], time()+31556926, "/");
header("Refresh: 0;");
}
}
if(isset($_POST["remove_bookmark"])) {
if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"]) || $_COOKIE[$config["title"]."_cookie-consent"]==2) {
setcookie($config["title"]."_cookie-consent", false, time() - 3600, "/");
header("Refresh: 0;");
} else {
setcookie($config["title"]."_bookmark-".$manga["slug"], $manga["slug"], time() - 3600, "/");
foreach($chapters as $rch) {
if(isset($_COOKIE[$config["title"]."_chapter-".$rch["slug"]])) {
setcookie($config["title"]."_chapter-".$rch["slug"], $rch["slug"], time() - 3600, "/");
}
}
header("Refresh: 0;");
}
}
?>
<?php if(!empty($manga["id"])) { ?>
<title><?= $manga["title"]." :: ".$config["title"] ?></title>
<?php } else { ?>
<title><?= $lang["login"]["error"]." :: ".$config["title"] ?></title>
<?php } ?>
<?php include("../parts/menu.php"); ?>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<div class="row">
<div class="col-sm-3">
<a href="<?= $config["url"] ?>data/covers/<?= $manga["cover"] ?>" target="_blank">
<img src="<?= $config["url"] ?>data/covers/<?= $manga["cover"] ?>" width="100%" alt="<?= $manga["title"] ?>">
</a>
</div>
<div class="col-sm-9">
<h2>
<?php if(isset($_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]) && $_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]==$manga["slug"]) { ?>
<?= glyph("bookmark","Bookmarked") ?>
<?php } ?>
<b><u><?= $manga["title"] ?></u></b>
<form method="post" name="bookmark">
<?php if($loggedin==true) { ?>
<a href="<?= $config["url"] ?>admin/edit_title/<?= $manga["slug"] ?>"><small class="badge"><?= glyph("pencil",$lang["manga"]["edit_title"]) ?> <?= $lang["manga"]["edit_title"] ?></small></a>
<a href="<?= $config["url"] ?>admin/add_chapter/<?= $manga["slug"] ?>"><small class="badge"><?= glyph("plus",$lang["manga"]["add_ch"]) ?> <?= $lang["manga"]["add_ch"] ?></small></a>
<?php } ?>
<?php if(!isset($_COOKIE[$config["title"]."_bookmark-".$manga["slug"]])) { ?>
<button type="submit" name="add_bookmark" class="badge"><?= glyph("bookmark",$lang["chapter"]["bookmark"]) ?> <?= $lang["chapter"]["bookmark"] ?></button>
<?php } else { ?>
<button type="submit" name="remove_bookmark" class="badge"><?= glyph("remove",$lang["chapter"]["remove_bm"]) ?> <?= $lang["chapter"]["remove_bm"] ?></button>
<?php } ?>
</form>
</h2>
<p><b><?= $lang["manga"]["alt"] ?>:</b> <?= $manga["alt"] ?></p>
<p><b><?= $lang["manga"]["author"] ?>:</b> <?= $manga["author"] ?></p>
<p><b><?= $lang["manga"]["genre"] ?>:</b> <?= $manga["genre"] ?></p>
<p><b><?= $lang["manga"]["type"] ?>:</b> <?= $manga["type"] ?></p>
<p><b><?= $lang["manga"]["released"] ?>:</b> <?= $manga["released"] ?></p>
<p><b><?= $lang["manga"]["raw-status"] ?>:</b> <?= $manga["raw-status"] ?></p>
<p><b><?= $lang["manga"]["scan-status"] ?>:</b> <?= $manga["scan-status"] ?></p>
<?php if(!empty($manga["raw-url"])) { ?>
<p><a href="<?= $manga["raw-url"] ?>" target="_blank"><?= $lang["manga"]["raw"] ?></a></p>
<?php } ?>
<?php if(!empty($manga["licensed"])) { ?>
<p><a href="<?= $manga["official-url"] ?>" target="_blank"><?= $lang["manga"]["licensed"] ?></a></p>
<?php } ?>
<p><i><?= $lang["manga"]["added"] ?> <?= $manga["added"] ?></i></p>
<div class="panel panel-default panel-body">
<?= $manga["description"] ?>
</div>
</div>
<div class="col-sm-12">
<div>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#chapters" aria-controls="chapters" role="tab" data-toggle="tab">Chapters</a></li>
<li role="presentation"><a href="#comments" aria-controls="comments" role="tab" data-toggle="tab">Comments</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="chapters">
<div class="table-responsive" id="latest-titles">
<table class="table table-hover table-striped">
<thead>
<th style="width:10%">Chapter</th>
<th style="width:60%;">Chapter Title</th>
<th style="width:10%" class="text-center">Uploader</th>
<th class="text-right" style="width:20%">Added</th>
</thead>
<tbody>
<?php foreach($chapters as $chapter) { ?>
<tr>
<td>
<a href="<?= $config["url"] ?>chapter/<?= $chapter["slug"] ?>">
<?php if(isset($_COOKIE[$config["title"]."_chapter-".$chapter["slug"]]) && $_COOKIE[$config["title"]."_chapter-".$chapter["slug"]]==$chapter["slug"]) echo glyph("bookmark","Bookmarked"); ?>
<?php if(empty($chapter["volume"]) && empty($chapter["chapter"])) { ?>
<?= $lang["chapter"]["oneshot"] ?>
<?php } elseif(empty($chapter["volume"]) && !empty($chapter["chapter"])) { ?>
Ch. <?= $chapter["chapter"] ?>
<?php } else { ?>
Vol. <?= $chapter["volume"] ?> Ch. <?= $chapter["chapter"] ?>
<?php } ?>
</a>
</td>
<td>
<a href="<?= $config["url"] ?>chapter/<?= $chapter["slug"] ?>">
<?php if(empty($chapter["title"])) { ?>
<?= $lang["manga"]["unknown"] ?>
<?php } else { ?>
<?= $chapter["title"] ?>
<?php } ?>
</a>
<?php if($loggedin==true) { ?>
<a href="<?= $config["url"] ?>admin/edit_chapter/<?= $chapter["slug"] ?>">
<span class="badge"><?= glyph("pencil",$lang["manga"]["edit_chap"]) ?> <?= $lang["manga"]["edit_chap"] ?></span>
</a>
<?php } ?>
</td>
<td class="text-center">
<?php $uploader = $conn->query("SELECT * FROM `user` WHERE `id`='".$chapter["user"]."' LIMIT 1"); $uploader = mysqli_fetch_assoc($uploader); echo $uploader["username"]; ?>
</td>
<td class="text-right"><?= $chapter["added"] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div role="tabpanel" class="tab-pane fade in" id="comments">
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document,
s = d.createElement('script');
s.src = 'https://<?= $config["disqus"] ?>.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
</div>
</div>
</div>
</div>
<?php include("../parts/footer.php"); ?>

View File

@ -0,0 +1,140 @@
<?php
require("../../requires.php");
$page = $lang["menu"]["login"];
if($loggedin==true) {
header("Refresh: 0; url=./");
}
$date = date('Y-m-d h:i:s');
$error = false;
$error_msg = "";
if(isset($_GET["username"]) && isset($_GET["password"]) && isset($_GET["password2"]) && isset($_GET["invite"])) {
if(isset($_GET['captcha_challenge']) && $_GET['captcha_challenge'] == $_SESSION['captcha_text']) {
$username = mysqli_real_escape_string($conn, $_GET["username"]);
$password1 = mysqli_real_escape_string($conn, $_GET["password"]);
$password2 = mysqli_real_escape_string($conn, $_GET["password2"]);
$invite = mysqli_real_escape_string($conn, $_GET["invite"]);
$check1 = preg_match('/[^.a-zA-Z0-9-_]/', $username);
$check2 = preg_match('/[^.a-zA-Z0-9-_]/', $password1);
$check3 = preg_match('/[^.a-zA-Z0-9-_]/', $password2);
$invitecheck = $conn->query("SELECT * FROM `invites` WHERE `token`='$invite' LIMIT 1");
$usercheck = $conn->query("SELECT * FROM `user` WHERE `username`='$username' LIMIT 1");
// Executing all the checks
if(empty($invite)) {
$error = true;
$error_msg = $lang["errors"]["empty_invite"];
}
if($check3==true) {
$error = true;
$error_msg = $lang["errors"]["bad_password"];
}
if($check2==true) {
$error = true;
$error_msg = $lang["errors"]["bad_password"];
}
if($check1==true) {
$error = true;
$error_msg = $lang["errors"]["bad_username"];
}
if(mysqli_num_rows($invitecheck)==1) {
$inv = mysqli_fetch_assoc($invitecheck);
if(!empty($inv["used"])) {
$error = true;
$error_msg = $lang["errors"]["used_invite"];
}
}
if(mysqli_num_rows($usercheck)==1) {
$error = true;
$error_msg = $lang["errors"]["taken_username"];
}
if($password1!=$password2) {
$error = true;
$error_msg = $lang["errors"]["unmatch_password"];
}
// Everything is right?!
if($error==false) {
// Everything is right!
$password = password_hash($password1, PASSWORD_BCRYPT);
$conn->query("UPDATE `invites` SET `used`='$date' WHERE `token`='$invite'");
$conn->query("INSERT INTO `user`(`username`,`password`) VALUES('$username','$password')");
header("Location: ./login");
}
} else {
$error = true;
$error_msg = $lang["errors"]["captcha"];
}
}
include("../parts/header.php");
?>
<title><?= $lang["menu"]["signup"]." :: ".$config["title"] ?></title>
<?php include("../parts/menu.php"); ?>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<?php if(!empty($error_msg)) { ?>
<div class="alert alert-warning alert-dismissible text-center" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong><?= $lang["login"]["error"] ?>:</strong> <?= $error_msg ?>
</div>
<?php } ?>
<div style="margin: 0 auto; width: 300px" id="login_container">
<form method="get" id="login_form" name="signup_user">
<h1 class="text-center"><?= $lang["menu"]["signup"] ?></h1>
<hr>
<div class="form-group">
<label for="login_username" class="sr-only"><?= $lang["login"]["username"] ?></label>
<input tabindex="1" type="text" name="username" id="login_username" class="form-control" maxlength="20" placeholder="<?= $lang["login"]["username"] ?>">
</div>
<div class="form-group">
<label for="login_password" class="sr-only"><?= $lang["login"]["password"] ?></label>
<input tabindex="2" type="password" name="password" id="login_password" class="form-control" placeholder="<?= $lang["login"]["password"] ?>" maxlength="50">
</div>
<div class="form-group">
<label for="login_password2" class="sr-only"><?= $lang["signup"]["password"] ?></label>
<input tabindex="3" type="password" name="password2" id="login_password2" class="form-control" placeholder="<?= $lang["signup"]["password"] ?>" maxlength="50">
</div>
<div class="form-group">
<label for="login_invite" class="sr-only"><?= $lang["signup"]["invite"] ?></label>
<input tabindex="4" type="text" name="invite" id="login_invite" class="form-control" placeholder="<?= $lang["signup"]["invite"] ?>" maxlength="50">
</div>
<div class="form-group">
<label for="login_captcha" class="sr-only"><?= $lang["login"]["captcha"] ?></label>
<input tabindex="5" id="login_captcha" class="form-control" type="text" placeholder="<?= $lang["login"]["captcha"] ?>" name="captcha_challenge" tabindex="3" title="<?= $lang["login"]["captcha"] ?>" autocomplete="off" maxlength="6">
<img src="render/parts/captcha.php" alt="CAPTCHA IMAGE (Click to refresh)" class="captcha-image loading" width="200px" title="Click to refresh!" style="padding-top:10px;padding-bottom:10px;margin-left:50px;margin-right:50px;">
</div>
<button tabindex="6" class="btn btn-lg btn-success btn-block" type="submit" id="login_button" name="signup_user"><?= glyph("plus",$lang["menu"]["signup"]) ?> <?= $lang["menu"]["signup"] ?></button>
<hr>
<p><?= $lang["signup"]["message"] ?> <a href="<?= $config["url"] ?>login"><?= $lang["menu"]["login"] ?>!</a></p>
</form>
</div>
<script>
var refreshButton = document.querySelector(".captcha-image");
refreshButton.onclick = function() {
document.querySelector(".captcha-image").src = 'render/parts/captcha.php?' + Date.now();
}
</script>
<?php include("../parts/footer.php"); ?>

View File

@ -0,0 +1,161 @@
<?php
// Note to my future self: Someday I'll need to make this proccess automated...
require("../../requires.php");
$page = $lang["menu"]["titles"];
include("../parts/header.php");
$titles_1 = $conn->query("SELECT * FROM `titles` WHERE `scan-status`='1' ORDER BY `title` ASC");
$titles_2 = $conn->query("SELECT * FROM `titles` WHERE `scan-status`='2' ORDER BY `title` ASC");
$titles_3 = $conn->query("SELECT * FROM `titles` WHERE `scan-status`='3' ORDER BY `title` ASC");
$titles_4 = $conn->query("SELECT * FROM `titles` WHERE `scan-status`='4' ORDER BY `title` ASC");
$titles_5 = $conn->query("SELECT * FROM `titles` WHERE `scan-status`='5' ORDER BY `title` ASC");
$titles_6 = $conn->query("SELECT * FROM `titles` WHERE `scan-status`='6' ORDER BY `title` ASC");
?>
<title><?= $lang["menu"]["titles"]." :: ".$config["title"] ?></title>
<?php include("../parts/menu.php"); ?>
<?php if(!isset($_COOKIE[$config["title"]."_cookie-consent"]) || empty($_COOKIE[$config["title"]."_cookie-consent"])) { include("../parts/cookies.php"); } ?>
<div class="row" onmouseover="search_manga()">
<div class="col-sm-12">
<input type="text" id="mangaSearch" class="form-control" onkeyup="search_manga()" placeholder="Search for Manga..." value="<?php if(isset($_GET["mtitle"])) echo mysqli_real_escape_string($conn, $_GET["mtitle"]); ?>">
</div>
<div id="mangaSearchList">
<div class="col-sm-12">
<h2 class="text-center"><?= $lang["add_manga"]["scanst"][1] ?></h2>
<?php foreach($titles_1 as $manga) { ?>
<div class="col-sm-2 mangaSearchItem">
<a href="<?= $config["url"] ?>manga/<?= $manga["slug"] ?>" class="thumbnail">
<p class="text-center mangaSearchText" style="position: absolute; margin-bottom:-10px;color: black; text-shadow: 0.05em 0 white, 0 0.05em white, -0.05em 0 white, 0 -0.05em white, -0.05em -0.05em white, -0.05em 0.05em white, 0.05em -0.05em white, 0.05em 0.05em white;" title="<?= $manga["title"] ?>">
<?php if(isset($_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]) && $_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]==$manga["slug"]) echo glyph("bookmark","Bookmarked"); ?>
<?= $manga["title"] ?>
</p>
<img src="<?= $config["url"] ?>data/covers/<?= $manga["cover"] ?>" width="100%" alt="<?= $manga["title"] ?>" title="<?= $manga["title"] ?>">
</a>
</div>
<?php } ?>
</div>
<div class="col-sm-12">
<hr>
</div>
<div class="col-sm-12">
<h2 class="text-center"><?= $lang["add_manga"]["scanst"][2] ?></h2>
<?php foreach($titles_2 as $manga) { ?>
<div class="col-sm-2 mangaSearchItem">
<a href="<?= $config["url"] ?>manga/<?= $manga["slug"] ?>" class="thumbnail">
<p class="text-center mangaSearchText" style="position: absolute; margin-bottom:-10px;color: black; text-shadow: 0.05em 0 white, 0 0.05em white, -0.05em 0 white, 0 -0.05em white, -0.05em -0.05em white, -0.05em 0.05em white, 0.05em -0.05em white, 0.05em 0.05em white;" title="<?= $manga["title"] ?>">
<?php if(isset($_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]) && $_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]==$manga["slug"]) echo glyph("bookmark","Bookmarked"); ?>
<?= $manga["title"] ?>
</p>
<img src="<?= $config["url"] ?>data/covers/<?= $manga["cover"] ?>" width="100%" alt="<?= $manga["title"] ?>" title="<?= $manga["title"] ?>">
</a>
</div>
<?php } ?>
</div>
<div class="col-sm-12">
<hr>
</div>
<div class="col-sm-12">
<h2 class="text-center"><?= $lang["add_manga"]["scanst"][3] ?></h2>
<?php foreach($titles_3 as $manga) { ?>
<div class="col-sm-2 mangaSearchItem">
<a href="<?= $config["url"] ?>manga/<?= $manga["slug"] ?>" class="thumbnail">
<p class="text-center mangaSearchText" style="position: absolute; margin-bottom:-10px;color: black; text-shadow: 0.05em 0 white, 0 0.05em white, -0.05em 0 white, 0 -0.05em white, -0.05em -0.05em white, -0.05em 0.05em white, 0.05em -0.05em white, 0.05em 0.05em white;" title="<?= $manga["title"] ?>">
<?php if(isset($_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]) && $_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]==$manga["slug"]) echo glyph("bookmark","Bookmarked"); ?>
<?= $manga["title"] ?>
</p>
<img src="<?= $config["url"] ?>data/covers/<?= $manga["cover"] ?>" width="100%" alt="<?= $manga["title"] ?>" title="<?= $manga["title"] ?>">
</a>
</div>
<?php } ?>
</div>
<div class="col-sm-12">
<hr>
</div>
<div class="col-sm-12">
<h2 class="text-center"><?= $lang["add_manga"]["scanst"][4] ?></h2>
<?php foreach($titles_4 as $manga) { ?>
<div class="col-sm-2 mangaSearchItem">
<a href="<?= $config["url"] ?>manga/<?= $manga["slug"] ?>" class="thumbnail">
<p class="text-center mangaSearchText" style="position: absolute; margin-bottom:-10px;color: black; text-shadow: 0.05em 0 white, 0 0.05em white, -0.05em 0 white, 0 -0.05em white, -0.05em -0.05em white, -0.05em 0.05em white, 0.05em -0.05em white, 0.05em 0.05em white;" title="<?= $manga["title"] ?>">
<?php if(isset($_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]) && $_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]==$manga["slug"]) echo glyph("bookmark","Bookmarked"); ?>
<?= $manga["title"] ?>
</p>
<img src="<?= $config["url"] ?>data/covers/<?= $manga["cover"] ?>" width="100%" alt="<?= $manga["title"] ?>" title="<?= $manga["title"] ?>">
</a>
</div>
<?php } ?>
</div>
<div class="col-sm-12">
<hr>
</div>
<div class="col-sm-12">
<h2 class="text-center"><?= $lang["add_manga"]["scanst"][5] ?></h2>
<?php foreach($titles_5 as $manga) { ?>
<div class="col-sm-2 mangaSearchItem">
<a href="<?= $config["url"] ?>manga/<?= $manga["slug"] ?>" class="thumbnail">
<p class="text-center mangaSearchText" style="position: absolute; margin-bottom:-10px;color: black; text-shadow: 0.05em 0 white, 0 0.05em white, -0.05em 0 white, 0 -0.05em white, -0.05em -0.05em white, -0.05em 0.05em white, 0.05em -0.05em white, 0.05em 0.05em white;" title="<?= $manga["title"] ?>">
<?php if(isset($_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]) && $_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]==$manga["slug"]) echo glyph("bookmark","Bookmarked"); ?>
<?= $manga["title"] ?>
</p>
<img src="<?= $config["url"] ?>data/covers/<?= $manga["cover"] ?>" width="100%" alt="<?= $manga["title"] ?>" title="<?= $manga["title"] ?>">
</a>
</div>
<?php } ?>
</div>
<div class="col-sm-12">
<hr>
</div>
<div class="col-sm-12">
<h2 class="text-center"><?= $lang["add_manga"]["scanst"][6] ?></h2>
<?php foreach($titles_6 as $manga) { ?>
<div class="col-sm-2 mangaSearchItem">
<a href="<?= $config["url"] ?>manga/<?= $manga["slug"] ?>" class="thumbnail">
<p class="text-center mangaSearchText" style="position: absolute; margin-bottom:-10px;color: black; text-shadow: 0.05em 0 white, 0 0.05em white, -0.05em 0 white, 0 -0.05em white, -0.05em -0.05em white, -0.05em 0.05em white, 0.05em -0.05em white, 0.05em 0.05em white;" title="<?= $manga["title"] ?>">
<?php if(isset($_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]) && $_COOKIE[$config["title"]."_bookmark-".$manga["slug"]]==$manga["slug"]) echo glyph("bookmark","Bookmarked"); ?>
<?= $manga["title"] ?>
</p>
<img src="<?= $config["url"] ?>data/covers/<?= $manga["cover"] ?>" width="100%" alt="<?= $manga["title"] ?>" title="<?= $manga["title"] ?>">
</a>
</div>
<?php } ?>
</div>
</div>
</div>
<script>
function search_manga() {
let input = document.getElementById('mangaSearch').value
input = input.toLowerCase();
let x = document.getElementsByClassName('mangaSearchItem');
for (i = 0; i < x.length; i++) {
if (!x[i].innerHTML.toLowerCase().includes(input)) {
x[i].style.display = "none";
} else {
x[i].style.display = "block";
}
}
}
</script>
<?php include("../parts/footer.php"); ?>

37
requires.php Normal file
View File

@ -0,0 +1,37 @@
<?php
ini_set('display_errors', 1);
session_start();
require("config.php");
require("vhs/conn.php");
require("vhs/funky.php");
if(isset($_POST["refuse_cookies"])) {
setcookie($config["title"]."_cookie-consent", "2", time()+31556926, "/");
header("Refresh: 0");
}
if(isset($_POST["accept_cookies"])) {
setcookie($config["title"]."_cookie-consent", true, time()+31556926, "/");
header("Refresh: 0");
}
if(isset($_COOKIE[$config["title"]."_cookie-consent"]) && $_COOKIE[$config["title"]."_cookie-consent"]==1) {
if(!isset($_COOKIE[$config["title"]."_lang"])) {
setcookie($config["title"]."_lang", $config["lang"], time()+31556926, "/");
header("Refresh: 0");
}
$lang = mysqli_real_escape_string($conn, $_COOKIE[$config["title"]."_lang"]);
} else {
if(!isset($_SESSION[$config["title"]."_lang"])) {
$_SESSION[$config["title"]."_lang"] = $config["lang"];
header("Refresh: 0");
}
$lang = mysqli_real_escape_string($conn, $_SESSION[$config["title"]."_lang"]);
}
require("lang/".$lang.".lang.php");
?>

32
vhs/conn.php Normal file
View File

@ -0,0 +1,32 @@
<?php
$conn = new mysqli($slave["host"],$slave["user"],$slave["pass"],$slave["table"]);
$conn->set_charset("utf8mb4");
if($conn->connect_error) {
die("Database Error: " . $conn->connect_error);
}
if((isset($_COOKIE[$config["title"]."_session"]) && !empty($_COOKIE[$config["title"]."_session"])) || (isset($_SESSION[$config["title"]."_session"]) && !empty($_SESSION[$config["title"]."_session"]))) {
if(!empty($_COOKIE[$config["title"]."_session"])) {
$token = mysqli_real_escape_string($conn, $_COOKIE[$config["title"]."_session"]);
} else {
$token = mysqli_real_escape_string($conn, $_SESSION[$config["title"]."_session"]);
}
$checking = $conn->query("SELECT * FROM `sessions` WHERE `token`='$token'");
if(mysqli_num_rows($checking)<=1) {
// Perform user-check of all data
$user = mysqli_fetch_assoc($checking);
$user = $user["user-id"];
$user = $conn->query("SELECT * FROM `user` WHERE `id`='$user' LIMIT 1");
$user = mysqli_fetch_assoc($user);
$loggedin = true;
} else {
// Invalid session! (Hacking attempt or outdated? who knows...)
$loggedin = false;
}
} else {
$loggedin = false;
}
?>

32
vhs/funky.php Normal file
View File

@ -0,0 +1,32 @@
<?php
function glyph($glyph,$gtitle = "Glyphicon") {
return "<span class=\"glyphicon glyphicon-".$glyph."\" title=\"$gtitle\" aria-hidden=\"true\"></span>";
}
function generate_url() {
function generate_string($length = 5) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
$a = generate_string(5);
$b = generate_string(5);
$c = generate_string(5);
$d = generate_string(5);
// require("../config.php");
// require("conn.php");
$string = $a."-".$b."-".$c."-".$d;
// $check = $conn->query("SELECT * FROM `titles` WHERE `slug`='$string' LIMIT 1");
// if(mysqli_num_rows($check)==1) {
//
// }
return $string;
}
?>