Smarty cache, function clean bug

This commit is contained in:
saintly2k 2023-04-01 22:33:58 +02:00
parent 70c5799bd5
commit e61291558f
17 changed files with 3 additions and 3565 deletions

View File

@ -1,6 +1,6 @@
<?php
function clean($data)
function clean($data, $title = true)
{
// This function is used, to completely sanitize user-input and make any form of scripts harmless and displayable
$data = htmlspecialchars($data);
@ -8,6 +8,8 @@ function clean($data)
$data = stripslashes($data);
$data = trim($data);
$data = str_replace("'", "\'", $data);
if ($title)
$data = str_replace(".", "", $data);
return $data;
}

View File

@ -1,83 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-01-25 22:33:23
from '/var/www/html/FSX/library/themes/nucleus/parts/menu.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63d1a023e8bdf1_34634672',
'has_nocache_code' => false,
'file_dependency' =>
array (
'22408fa7a73199224a335a08dc090901dcd1e34c' =>
array (
0 => '/var/www/html/FSX/library/themes/nucleus/parts/menu.tpl',
1 => 1674682402,
2 => 'file',
),
),
'includes' =>
array (
'file:../parts/alert.tpl' => 1,
),
),false)) {
function content_63d1a023e8bdf1_34634672 (Smarty_Internal_Template $_smarty_tpl) {
?><div class="navbar bg-base-300 text-base-content">
<div class="navbar-start">
<div class="dropdown">
<label tabindex="0" class="btn btn-ghost lg:hidden">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h8m-8 6h16" />
</svg>
</label>
<ul tabindex="0" class="menu menu-compact dropdown-content mt-3 p-2 shadow-xl bg-base-100 rounded-box w-52">
<li><a href="index.php">Home</a></li>
<li><a href="releases.php">Releases</a></li>
<li><a href="titles.php">Titles</a></li>
<li><a href="bookmarks.php">Bookmarks</a></li>
<li><a href="members.php">Members</a></li>
</ul>
</div>
<a href="<?php echo $_smarty_tpl->tpl_vars['config']->value['url'];?>
" class="btn btn-ghost normal-case text-xl"><?php echo $_smarty_tpl->tpl_vars['config']->value['title'];?>
</a>
</div>
<div class="navbar-center hidden lg:flex">
<ul class="menu menu-horizontal px-1">
<li><a href="index.php">Home</a></li>
<li><a href="releases.php">Releases</a></li>
<li><a href="titles.php">Titles</a></li>
<li><a href="bookmarks.php">Bookmarks</a></li>
<li><a href="members.php">Members</a></li>
</ul>
</div>
<div class="navbar-end">
<div class="dropdown dropdown-end">
<label tabindex="0" class="btn btn-ghost btn-circle avatar">
<div class="w-10 rounded-full">
<img src="<?php if ($_smarty_tpl->tpl_vars['logged']->value) {
echo $_smarty_tpl->tpl_vars['user']->value['avatar'];
} else { ?>https://rav.h33t.moe/avatar.php?name=rileinc<?php }?>"
alt="Avatar">
</div>
</label>
<ul tabindex="0" class="mt-3 p-2 shadow menu menu-compact dropdown-content bg-base-200 rounded-box w-52">
<?php if ($_smarty_tpl->tpl_vars['logged']->value) {?>
<li><a href="#/">Profile</a></li>
<li><a href="#/" onclick="toggleCheck('userSettingsModal')">Settings</a></li>
<li><a href="#/" id="logoutButton">Logout</a></li>
<?php } else { ?>
<li><label for="loginModal">Login</label></li>
<li><label for="signupModal">Signup</label></li>
<?php }?>
</ul>
</div>
</div>
</div>
<!-- Container Begin -->
<div class="container mx-auto my-4 px-2 md:px-0">
<?php $_smarty_tpl->_subTemplateRender("file:../parts/alert.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
}
}

View File

@ -1,325 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-01-26 01:04:29
from '/var/www/html/FSX/library/themes/nucleus/pages/titles.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63d1c38d9920d2_74082449',
'has_nocache_code' => false,
'file_dependency' =>
array (
'24b3c549c459108f61be57cd4ff8cba03cc75ffd' =>
array (
0 => '/var/www/html/FSX/library/themes/nucleus/pages/titles.tpl',
1 => 1674691448,
2 => 'file',
),
),
'includes' =>
array (
'file:../parts/menu.tpl' => 1,
),
),false)) {
function content_63d1c38d9920d2_74082449 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_subTemplateRender("file:../parts/menu.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
<!-- Titles Div -->
<div class="p-4 border shadow-md rounded-xl my-4">
<h1 class="mb-4 font-bold text-2xl">
Titles - Page <?php echo $_smarty_tpl->tpl_vars['page']->value;?>
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<a href="#/" class="btn btn-sm" onclick="toggleCheck('addTitleModal');">Add Title</a>
<?php }?>
</h1>
<?php if (!empty($_smarty_tpl->tpl_vars['titles']->value)) {?>
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['titles']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<div>
<div class="card card-compact w-full bg-base-200 shadow-lg">
<figure>
<a href="title.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
">
<img src="data/covers/<?php echo $_smarty_tpl->tpl_vars['item']->value['cover'];?>
" alt="Cover">
</a>
</figure>
<div class="card-body">
<h2 class="card-title">
<a href="title.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" class="link">
<?php echo $_smarty_tpl->tpl_vars['item']->value['title'];?>
</a>
<div class="badge badge-<?php if ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 1) {?>info<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 2) {?>success<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 3) {?>warning<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 4) {?>success-content<?php } else { ?>error<?php }?>">
<?php if ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 1) {?>PLANNED<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 2) {?>Ongoing<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 3) {?>Hiatus<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 4) {?>Completed<?php } else { ?>Cancelled<?php }?>
</div>
</h2>
</div>
</div>
</div>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
<?php } else { ?>
<p>There are no Titles on this page!</p>
<?php }?>
<?php if (!empty($_smarty_tpl->tpl_vars['pagis']->value)) {?>
<div class="btn-group mx-auto pt-4">
<?php if ($_smarty_tpl->tpl_vars['page']->value > 1) {?>
<a href="?page=1" class="btn btn-sm">«</a>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['page']->value-1;?>
" class="btn btn-sm"></a>
<?php }?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['pagis']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<?php if ($_smarty_tpl->tpl_vars['page']->value != $_smarty_tpl->tpl_vars['item']->value) {?>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['item']->value;?>
" class="btn btn-sm"><?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</a>
<?php } else { ?>
<span class="btn btn-active btn-sm"><?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</span>
<?php }?>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php if ($_smarty_tpl->tpl_vars['page']->value < $_smarty_tpl->tpl_vars['totalPages']->value) {?>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['page']->value+1;?>
" class="btn btn-sm"></a>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['totalPages']->value;?>
" class="btn btn-sm">»</a>
<?php }?>
</div>
<?php }?>
</div>
<!-- /Titles Div -->
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<input type="checkbox" id="addTitleModal" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Add Title</h3>
<form method="POST" name="addTitle" id="addTitleForm">
<div class="grid grid-cols-1 gap-4">
<!-- Cover Image -->
<input type="file" id="cover" class="border border-black file-input w-full">
<img src="" alt="Cover" id="imgpreview" class="rounded-xl hidden w-full border shadow-sm">
<!-- /Cover Image -->
<!-- Title Data-->
<input name="cover" hidden>
<input type="text" placeholder="Title" name="title" class="input w-full border border-black">
<input type="text" placeholder="Alternate Names" name="alts" class="input w-full border border-black">
<label for="tagsModal" class="btn">Select Tags</label>
<input type="text" placeholder="Author/s (Seperate by comma)" name="authors" class="input w-full border border-black">
<input type="text" placeholder="Artist/s (Seperate by comma)" name="artists" class="input w-full border border-black">
<input type="text" placeholder="Original Language" name="olang" class="input w-full border border-black">
<select name="ostatus" class="select w-full border border-black">
<option disabled selected>Select original work status...</option>
<option value="1">Announced</option>
<option value="2">Releasing</option>
<option value="3">Hiatus</option>
<option value="4">Completed</option>
<option value="5">Cancelled</option>
</select>
<select name="sstatus" class="select w-full border border-black">
<option disabled selected>Select scanlation status...</option>
<option value="1">Planned</option>
<option value="2">Ongoing</option>
<option value="3">Hiatus</option>
<option value="4">Completed</option>
<option value="5">Cancelled</option>
</select>
<input type="number" placeholder="Year of Release" name="release" class="input w-full border border-black">
<input type="number" placeholder="Year of Completion" name="completion" class="input w-full border border-black">
<textarea name="summary" class="textarea w-full border border-black" placeholder="Summary"></textarea>
<!-- /Title Data -->
<!-- Tags Modal -->
<input type="checkbox" id="tagsModal" class="modal-toggle">
<div class="modal">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Select Tags</h3>
<div class="grid grid-cols-1 gap-4">
<div>
<h4 class="font-bold text-xl text-left">Format/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_format']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="format[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Warning/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_warnings']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="warning[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Theme/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_theme']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="theme[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Genre/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_genre']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="genre[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<label for="tagsModal" class="btn btn-success">Close</label>
</div>
</div>
</div>
<!-- /Tags Modal -->
<!-- Submit, Error and Close -->
<button class="btn btn-primary btn-block btn-outline" type="submit">Add!</button>
<div class="text-center hidden text-error" id="addtitle-result"></div>
<label for="addTitleModal" class="btn btn-error btn-block">Cancel</label>
<!-- /Submit, Error and Close -->
</div>
</form>
</div>
</div>
<?php echo '<script'; ?>
>
$(function() {
$("#cover").change(function(e) {
e.preventDefault();
var fd = new FormData();
var files = $("#cover")[0].files;
if (files.length > 0) {
fd.append("cover", files[0]);
$.ajax({
type: "POST",
url: "ajax\\images\\tmp.php",
data: fd,
contentType: false,
processData: false,
success: function(msg) {
let result = JSON.parse(msg);
if (result.s == true) {
let preview = document.getElementById("imgpreview");
preview.classList.remove("hidden");
preview.src = "data/tmp/" + result.msg;
document.querySelector("input[name='cover']").value =
result.msg;
} else {
alert(result.msg);
}
}
});
}
});
});
$("#cover").change(function(e) {
var allowedTypes = ["image/jpeg", "image/jpg", "image/png", "image/webp"];
var file = this.files[0];
var fileType = file.type;
if (!allowedTypes.includes(fileType)) {
alert("Upload only supports JPG, JPEG, PNG and WEBP!");
$("#cover").val("");
return false;
}
});
$("#addTitleForm").submit(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\titles\\add.php",
data: $(this).serialize(),
success: function(data) {
let result = JSON.parse(data);
if (result.s == true) {
//let text = document.getElementById("addtitle-result");
//text.classList.add("hidden");
window.location.replace("title.php?id=" + result.msg);
// Redirect to Title?
} else {
let text = document.getElementById("addtitle-result");
text.classList.remove("hidden");
text.innerHTML = "<b>Error:</b> " + result.msg;
}
}
});
return false;
});
<?php echo '</script'; ?>
>
<?php }
}
}

View File

@ -1,204 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-02-13 21:37:04
from 'C:\xamppx\htdocs\fsx\library\themes\nucleus\pages\index.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63ea9f708fcdc8_32707671',
'has_nocache_code' => false,
'file_dependency' =>
array (
'27494d4b4f1bc452b2e672f92c9df4e3b2a3e1d8' =>
array (
0 => 'C:\\xamppx\\htdocs\\fsx\\library\\themes\\nucleus\\pages\\index.tpl',
1 => 1676320611,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_63ea9f708fcdc8_32707671 (Smarty_Internal_Template $_smarty_tpl) {
?><div class="p-4 border shadow-md rounded-xl my-4">
<div class="mb-4">
<h1 class="font-bold text-2xl">
<a href="titles.php" class="link">
Recently Updated Titles
</a>
</h1>
</div>
<?php if (!empty($_smarty_tpl->tpl_vars['recentlyUpdated']->value)) {?>
<div class="carousel w-full rounded-xl border">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['recentlyUpdated']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<div id="titleSlider_<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
" class=" text-black carousel-item w-full rounded-xl backdrop-blur-sm overflow-auto"
style="background-image: url(data/covers/<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['id'];?>
.png); background-size: cover; background-position: center;">
<div
class="w-full backdrop-blur-md bg-white/30 grid grid-cols-3 md:grid-cols-6 gap-2 md:gap-4 flex items-center">
<div class="col-span-1 pl-4 py-4">
<a href="title.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['id'];?>
">
<img src="data/covers/<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['id'];?>
.png" class="rounded-xl w-full border shadow-md">
</a>
</div>
<div class="col-span-2 md:col-span-5 pr-4">
<h1 class="font-bold text-2xl">
<a href="title.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['id'];?>
"><span class="link"><?php echo $_smarty_tpl->tpl_vars['item']->value['title']['title'];?>
</span></a>
<div
class="badge shadow-md badge-<?php if ($_smarty_tpl->tpl_vars['item']->value['title']['sstatus'] == 1) {?>info<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['title']['sstatus'] == 2) {?>success<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['title']['sstatus'] == 3) {?>warning<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['title']['sstatus'] == 4) {?>success-content<?php } else { ?>error<?php }?>">
<?php if ($_smarty_tpl->tpl_vars['item']->value['title']['sstatus'] == 1) {?>Planned<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['title']['sstatus'] == 2) {?>Ongoing<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['title']['sstatus'] == 3) {?>Hiatus<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['title']['sstatus'] == 4) {?>Completed<?php } else { ?>Cancelled<?php }?>
</div>
</h1>
<p class="text-sm mb-2"><?php echo $_smarty_tpl->tpl_vars['item']->value['title']['alts'];?>
</p>
<div class="auto space-y-2 md:hidden">
<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['summary2'];?>
</div>
<div class="auto space-y-1 hidden md:block">
<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['summary1'];?>
</div>
</div>
</div>
</div>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
<div class="flex justify-center w-full pt-4 gap-2 btn-group">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['recentlyUpdated']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="#titleSlider_<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
" class="carlink btn btn-xs md:btn-sm <?php if ($_smarty_tpl->tpl_vars['key']->value == 0) {?>btn-active<?php }?>"
onclick="switchCarLink(event);" rel="mad"><?php echo $_smarty_tpl->tpl_vars['key']->value+1;?>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
<?php } else { ?>
<p>There are no Titles at the Moment!</p>
<?php }?>
</div>
<!-- Chapters Div -->
<div class="p-4 border shadow-md rounded-xl my-4">
<h1 class="mb-4 font-bold text-2xl">
<a href="releases.php" class="link">
Latest Releases
</a>
</h1>
<?php if (!empty($_smarty_tpl->tpl_vars['chapters']->value)) {?>
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 xl:grid-cols-6 gap-4">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['chapters']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<div class="w-full grid grid-cols-3 gap-2 border rounded-xl shadow-md">
<div class="col-span-1 p-2">
<a href="title.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['id'];?>
">
<img src="data/covers/<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['id'];?>
.png" alt="Cover" class="w-full rounded-md border shadow-md">
</a>
</div>
<div class="col-span-2 py-2 pr-2">
<p class="font-bold text-md">
<a href="title.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['id'];?>
" class="link" title="<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['title'];?>
">
<span class="sm:hidden">
<?php echo shorten($_smarty_tpl->tpl_vars['item']->value['title']['title'],10);?>
</span>
<span class="hidden sm:block md:hidden">
<?php echo shorten($_smarty_tpl->tpl_vars['item']->value['title']['title'],21);?>
</span>
<span class="hidden md:block lg:hidden">
<?php echo shorten($_smarty_tpl->tpl_vars['item']->value['title']['title'],17);?>
</span>
<span class="hidden lg:block xl:hidden">
<?php echo shorten($_smarty_tpl->tpl_vars['item']->value['title']['title'],12);?>
</span>
<span class="hidden xl:block 2xl:hidden">
<?php echo shorten($_smarty_tpl->tpl_vars['item']->value['title']['title'],13);?>
</span>
<span class="hidden 2xl:block">
<?php echo shorten($_smarty_tpl->tpl_vars['item']->value['title']['title'],17);?>
</span>
</a>
</p>
<div class="text-sm">
<p>
<a href="chapter.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" class="flex items-center gap-2 link"
title="<?php echo formatChapterTitle($_smarty_tpl->tpl_vars['item']->value['volume'],$_smarty_tpl->tpl_vars['item']->value['number'],"full");?>
">
<img src="https://flagcdn.com/16x12/<?php echo $_smarty_tpl->tpl_vars['item']->value['language'][1];?>
.png" alt="<?php echo $_smarty_tpl->tpl_vars['item']->value['language'][2];?>
"
class="h-3">
<?php echo formatChapterTitle($_smarty_tpl->tpl_vars['item']->value['volume'],$_smarty_tpl->tpl_vars['item']->value['number']);?>
</a>
</p>
<p>
<a href="profile.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['user']['id'];?>
"
class="link flex items-center text-center md:text-left">
<img src="<?php echo $_smarty_tpl->tpl_vars['item']->value['user']['avatar'];?>
" class="rounded-full h-5">
<span class="ml-1">
<?php echo $_smarty_tpl->tpl_vars['item']->value['user']['username'];?>
</span>
</a>
</p>
<p>
<?php echo timeAgo($_smarty_tpl->tpl_vars['item']->value['timestamp']);?>
</p>
</div>
</div>
</div>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<div class="col-span-2 md:col-span-3 lg:col-span-5 xl:col-span-6">
<a href="releases.php?page=2" class="btn w-full">
More
</a>
</div>
</div>
<?php } else { ?>
<p>There are no Chapters on this page!</p>
<?php }?>
</div>
<!-- /Chapters Div --><?php }
}

View File

@ -1,260 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-01-25 20:25:20
from '/var/www/html/FSX/library/themes/nucleus/parts/footer.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63d1822009ad01_73401378',
'has_nocache_code' => false,
'file_dependency' =>
array (
'3bac4754591447d150ae3356c6cb0fc851696246' =>
array (
0 => '/var/www/html/FSX/library/themes/nucleus/parts/footer.tpl',
1 => 1674232644,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_63d1822009ad01_73401378 (Smarty_Internal_Template $_smarty_tpl) {
?></div>
<!-- Container End -->
<?php if (!$_smarty_tpl->tpl_vars['logged']->value) {?>
<input type="checkbox" id="loginModal" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Login</h3>
<form method="POST" name="login" id="loginForm">
<div class="grid grid-cols-1 gap-4">
<input type="text" placeholder="Username" name="username" class="input w-full border border-black">
<input type="password" placeholder="Password" name="password" class="input w-full border border-black">
</div>
<div class=" mt-4">
<button class="btn btn-primary btn-block btn-outline" type="submit">Log me in!</button>
</div>
<div class="mt-4 text-error text-center hidden" id="login-result"></div>
<div class="pt-4 grid grid-cols-2 gap-4">
<label onclick="toggleCheck('loginModal'); toggleCheck('signupModal');" class="btn btn-block">To
Signup</label>
<label for="loginModal" class="btn btn-error">Cancel</label>
</div>
</form>
</div>
</div>
<input type="checkbox" id="signupModal" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Signup</h3>
<form method="POST" name="signup" id="signupForm">
<div class="grid grid-cols-1 gap-4">
<input type="text" placeholder="Username" name="username" class="input w-full border border-black">
<input type="password" placeholder="Password" name="password" class="input w-full border border-black">
<input type="password" placeholder="Repeat Password" name="password2"
class="input w-full border border-black">
<input type="email" placeholder="Email (for account-activation and recovery)" name="email"
class="input w-full border border-black">
<input type="email" placeholder="Repeat Email" name="email2" class="input w-full border border-black">
</div>
<div class="mt-4">
<button class="btn btn-primary btn-block btn-outline" type="submit">Create my account!</button>
</div>
<div class="mt-2 text-error text-center hidden" id="signup-result"></div>
<div class="pt-4 grid grid-cols-2 gap-4">
<label onclick="toggleCheck('loginModal'); toggleCheck('signupModal');" class="btn btn-block">To
Login</label>
<label for="signupModal" class="btn btn-error">Cancel</label>
</div>
</form>
</div>
</div>
<?php } else { ?>
<input type="checkbox" id="userSettingsModal" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">User Settings</h3>
<form method="POST" name="userSettings" id="userSettingsForm">
<div class="grid grid-cols-1 gap-4">
<input type="text" placeholder="Avatar URL" name="avatar" class="input w-full border border-black"
value="<?php echo $_smarty_tpl->tpl_vars['user']->value['avatar'];?>
">
<select class="select w-full border border-black" name="theme">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['config']->value['themes'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<option value="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
">Theme: <?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</option>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</select>
<select class="select w-full border border-black" name="lang">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['config']->value['langs'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<option value="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
">Language: <?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</option>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</select>
</div>
<div class="mt-4">
<button class="btn btn-primary btn-block btn-outline" type="submit">Save settings!</button>
</div>
<div class="mt-2 text-center hidden" id="usersettings-result"></div>
<div class="pt-4">
<label for="userSettingsModal" class="btn btn-error btn-block">Close</label>
</div>
</form>
</div>
</div>
<?php }?>
<?php echo '<script'; ?>
>
function toggleCheck(id) {
let box = document.getElementById(id);
box.checked = !box.checked;
}
<?php if (!$_smarty_tpl->tpl_vars['logged']->value) {?>
$("#loginForm").submit(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\account\\login.php",
data: $(this).serialize(),
success: function(data) {
if (data == "success") {
location.reload();
} else {
let text = document.getElementById("login-result");
text.classList.remove("hidden");
text.innerHTML = "<b>Error:</b> " + data;
}
}
});
return false;
});
$("#signupForm").submit(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\account\\signup.php",
data: $(this).serialize(),
success: function(data) {
if (data == "success") {
location.reload();
} else {
let text = document.getElementById("signup-result");
text.classList.remove("hidden");
text.innerHTML = "<b>Error:</b> " + data;
}
}
});
return false;
});
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['logged']->value) {?>
$("#userSettingsForm").submit(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\account\\settings.php",
data: $(this).serialize(),
success: function(data) {
let text = document.getElementById("usersettings-result");
text.classList.remove("hidden");
if (data == "success") {
text.innerHTML =
"<b>Success!</b> You may need to reload this page.";
text.classList.add("text-success");
text.classList.remove("text-error");
} else {
text.innerHTML = "<b>Error:</b> " + data;
text.classList.add("text-error");
text.classList.remove("text-success");
}
}
});
return false;
});
$("#logoutButton").click(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\account\\logout.php",
data: $(this).serialize(),
success: function(data) {
if (data == "success") {
location.reload();
} else {
alert(data);
}
}
});
return false;
});
$("#dismissAlert").click(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\alerts\\dismiss.php",
success: function(data) {
if (data == "success") {
let div = document.getElementById("topAlert");
div.classList.add("hidden");
} else {
alert(data);
}
}
});
return false;
});
<?php }
echo '</script'; ?>
>
<footer class="footer footer-center p-6 bg-base-300 text-base-content">
<div>
<p>
Copyright © <?php echo date("Y");?>
<a href="<?php echo $_smarty_tpl->tpl_vars['config']->value['url'];?>
" class="link"><?php echo $_smarty_tpl->tpl_vars['config']->value['title'];?>
</a>
<span class="hidden md:inline">-</span>
<br class="md:hidden">
Running <a href="https://github.com/saintly2k/FoOlSlideX" class="link" target="_blank">FoOlSlideX</a>
<span class="badge badge-info"><?php echo $_smarty_tpl->tpl_vars['version']->value;?>
</span>
<br class="md:hidden">
by <a href="https://github.com/saintly2k" class="link" target="_blank">Saintly2k</a> and
<a href="https://github.com/s-vhs" class="link" target="_blank">S-VHS</a>
</p>
</div>
</footer>
</body>
</html><?php }
}

View File

@ -1,68 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-01-26 16:44:27
from '/var/www/html/FSX/library/themes/nucleus/parts/header.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63d29fdb1096f5_83739452',
'has_nocache_code' => false,
'file_dependency' =>
array (
'47fcaae21443e51ae0cbc42ac0e0d0f3fc9ad2a9' =>
array (
0 => '/var/www/html/FSX/library/themes/nucleus/parts/header.tpl',
1 => 1674747865,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_63d29fdb1096f5_83739452 (Smarty_Internal_Template $_smarty_tpl) {
?><!DOCTYPE html>
<html lang="<?php echo $_smarty_tpl->tpl_vars['userlang']->value;?>
">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $_smarty_tpl->tpl_vars['pagetitle']->value;?>
</title>
<?php echo '<script'; ?>
src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"><?php echo '</script'; ?>
>
<link href="https://cdn.jsdelivr.net/npm/daisyui@2.47.0/dist/full.css" rel="stylesheet" type="text/css">
<?php echo '<script'; ?>
src="https://cdn.tailwindcss.com"><?php echo '</script'; ?>
>
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon/favicon-16x16.png">
<link rel="manifest" href="assets/favicon/site.webmanifest">
<style>
.link {
text-decoration-line: underline;
text-decoration-style: dotted;
}
.link:hover {
text-decoration-style: solid;
}
.auto a {
text-decoration-line: underline;
text-decoration-style: dotted;
}
.auto a:hover {
text-decoration-style: solid;
}
</style>
</head>
<?php }
}

View File

@ -1,70 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-01-29 20:44:34
from 'C:\xamppx\htdocs\fsx\library\themes\nucleus\parts\alert.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63d6cca2df4185_65680645',
'has_nocache_code' => false,
'file_dependency' =>
array (
'4e4c0ba52364a950f17dbdc5443ff63403ed5cf2' =>
array (
0 => 'C:\\xamppx\\htdocs\\fsx\\library\\themes\\nucleus\\parts\\alert.tpl',
1 => 1675021474,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_63d6cca2df4185_65680645 (Smarty_Internal_Template $_smarty_tpl) {
if (!empty($_smarty_tpl->tpl_vars['topAlert']->value) && !$_smarty_tpl->tpl_vars['readAlert']->value) {?>
<div class="alert alert-<?php echo $_smarty_tpl->tpl_vars['topAlert']->value['type'];?>
shadow-md" id="topAlert">
<div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
class="stroke-current flex-shrink-0 w-6 h-6">
<?php if ($_smarty_tpl->tpl_vars['topAlert']->value['type'] == "info") {?>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
<?php } elseif ($_smarty_tpl->tpl_vars['topAlert']->value['type'] == "success") {?>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
<?php } elseif ($_smarty_tpl->tpl_vars['topAlert']->value['type'] == "warning") {?>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
<?php } else { ?>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
<?php }?>
</svg>
<span><b><?php echo ucfirst($_smarty_tpl->tpl_vars['topAlert']->value['type']);?>
:</b> <?php echo $_smarty_tpl->tpl_vars['topAlert']->value['content'];?>
</span>
</div>
<?php if ($_smarty_tpl->tpl_vars['logged']->value) {?>
<div class="flex-none m-0 p-0">
<button class="btn btn-sm m-0 mikuLink" id="dismissAlert">Dismiss</button>
</div>
<?php }?>
</div>
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] == 49) {?>
<div class="alert alert-info shadow-md" id="topAlert">
<div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
class="stroke-current flex-shrink-0 w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<span><b>Info:</b> Activate your account through the Email we sent you to use all functions of <?php echo $_smarty_tpl->tpl_vars['config']->value['title'];?>
!</span>
</div>
</div>
<?php }
}
}

View File

@ -1,38 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-03-03 12:41:20
from 'C:\xamppx\htdocs\fsx\library\themes\nucleus\pages\chapter.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_6401dce0f34e28_75778377',
'has_nocache_code' => false,
'file_dependency' =>
array (
'6d0ff2e4fc78561a4d16000d0f8b6b4ff35201bb' =>
array (
0 => 'C:\\xamppx\\htdocs\\fsx\\library\\themes\\nucleus\\pages\\chapter.tpl',
1 => 1677256062,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_6401dce0f34e28_75778377 (Smarty_Internal_Template $_smarty_tpl) {
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['images']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<img src="data/chapters/<?php echo $_smarty_tpl->tpl_vars['chapter']->value['id'];?>
/<?php echo basename($_smarty_tpl->tpl_vars['item']->value);?>
" alt="Page <?php echo $_smarty_tpl->tpl_vars['key']->value+1;?>
">
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);
}
}

View File

@ -1,466 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-01-26 16:44:27
from '/var/www/html/FSX/library/themes/nucleus/pages/title.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63d29fdb319692_11407771',
'has_nocache_code' => false,
'file_dependency' =>
array (
'7334a6ac79af4e0572a216440aa2034d691eb2ba' =>
array (
0 => '/var/www/html/FSX/library/themes/nucleus/pages/title.tpl',
1 => 1674747827,
2 => 'file',
),
),
'includes' =>
array (
'file:../parts/menu.tpl' => 1,
),
),false)) {
function content_63d29fdb319692_11407771 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_subTemplateRender("file:../parts/menu.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
<!-- Title Div -->
<div class="p-4 border shadow-md rounded-xl my-4">
<div class="mb-4 md:mb-0 md:hidden">
<h1 class="font-bold text-2xl">
<?php echo $_smarty_tpl->tpl_vars['title']->value['title'];?>
<div class="badge badge-<?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 1) {?>info<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 2) {?>success<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 3) {?>warning<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 4) {?>success-content<?php } else { ?>error<?php }?>">
<?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 1) {?>Planned<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 2) {?>Ongoing<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 3) {?>Hiatus<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 4) {?>Completed<?php } else { ?>Cancelled<?php }?>
</div>
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<a href="#/" class="btn btn-sm" onclick="toggleCheck('editTitleModal');">Edit Title</a>
<?php }?>
</h1>
<p><?php echo $_smarty_tpl->tpl_vars['title']->value['alts'];?>
</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<div>
<a href="data/covers/<?php echo $_smarty_tpl->tpl_vars['title']->value['cover'];?>
" target="_blank">
<img src="data/covers/<?php echo $_smarty_tpl->tpl_vars['title']->value['cover'];?>
" alt="Cover" class="w-full rounded-xl shadow-md">
</a>
</div>
<div class="col-span-1 md:col-span-3">
<div class="hidden md:block md:mb-4">
<h1 class="font-bold text-2xl">
<?php echo $_smarty_tpl->tpl_vars['title']->value['title'];?>
<div class="badge badge-<?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 1) {?>info<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 2) {?>success<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 3) {?>warning<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 4) {?>success-content<?php } else { ?>error<?php }?>">
<?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 1) {?>Planned<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 2) {?>Ongoing<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 3) {?>Hiatus<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 4) {?>Completed<?php } else { ?>Cancelled<?php }?>
</div>
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<a href="#/" class="btn btn-sm" onclick="toggleCheck('editTitleModal');">Edit Title</a>
<?php }?>
</h1>
<p><?php echo $_smarty_tpl->tpl_vars['title']->value['alts'];?>
</p>
</div>
<div>
<h2 class="underline font-bold text-xl mb-2">Details</h2>
<p class="mb-1">
<span class="font-bold">Author/s:</span>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['authors'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['authors'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value);?>
">
<span class="badge hover:badge-info p-3">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php } else { ?>
Unknown
<?php }?>
</p>
<p class="mb-1">
<span class="font-bold">Artist/s:</span>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['artists'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['artists'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value);?>
">
<span class="badge hover:badge-info p-3">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php } else { ?>
Unknown
<?php }?>
</p>
<p class="mb-1">
<span class="font-bold">Release Year:</span>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['releaseYear'])) {?>
<?php echo $_smarty_tpl->tpl_vars['title']->value['releaseYear'];?>
<?php } else { ?>
Unknown
<?php }?>
</p>
<p class="mb-1">
<span class="font-bold">Completion Year:</span>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['completionYear'])) {?>
<?php echo $_smarty_tpl->tpl_vars['title']->value['completionYear'];?>
<?php } else { ?>
Unknown
<?php }?>
</p>
<h2 class="underline font-bold text-xl mb-2">Tags</h2>
<div class="mb-1 grid grid-cols-2 gap-4">
<div>
<p><b>Formats</b></p>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['tags']['formats'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['tags']['formats'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
">
<span class="badge hover:badge-info p-3 mb-1 border border-black shadow-md">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php }?>
</div>
<div>
<p><b>Warnings</b></p>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['tags']['warnings'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['tags']['warnings'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
">
<span class="badge hover:badge-info p-3 mb-1 border border-black shadow-md">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php }?>
</div>
<div>
<p><b>Themes</b></p>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['tags']['themes'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['tags']['themes'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
">
<span class="badge hover:badge-info p-3 mb-1 border border-black shadow-md">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php }?>
</div>
<div>
<p><b>Genres</b></p>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['tags']['genres'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['tags']['genres'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
">
<span class="badge hover:badge-info p-3 mb-1 border border-black shadow-md">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php }?>
</div>
</div>
</div>
</div>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['summary'])) {?>
<div class="md:col-span-4">
<h2 class="underline font-bold text-xl mb-2">Summary</h2>
<div class="auto">
<?php echo $_smarty_tpl->tpl_vars['title']->value['summary'];?>
</div>
</div>
<?php }?>
</div>
</div>
<!-- /Title Div -->
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<input type="checkbox" id="editTitleModal" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Edit Title</h3>
<form method="POST" name="editTitle" id="editTitleForm">
<div class="grid grid-cols-1 gap-4">
<!-- Cover Image -->
<input type="file" id="cover" class="border border-black file-input w-full">
<img src="data/covers/<?php echo $_smarty_tpl->tpl_vars['title']->value['cover'];?>
" alt="Cover" id="imgpreview" class="rounded-xl w-full border shadow-sm">
<!-- /Cover Image -->
<!-- Title Data-->
<input name="id" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['id'];?>
" hidden>
<input name="cover" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['cover'];?>
" hidden>
<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['title'];?>
" placeholder="Title" name="title" class="input w-full border border-black">
<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['alts'];?>
" placeholder="Alternate Names" name="alts" class="input w-full border border-black">
<label for="tagsModal" class="btn">Select Tags</label>
<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['authors2'];?>
" placeholder="Author/s (Seperate by comma)" name="authors" class="input w-full border border-black">
<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['artists2'];?>
" placeholder="Artist/s (Seperate by comma)" name="artists" class="input w-full border border-black">
<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['lang'];?>
" placeholder="Original Language" name="olang" class="input w-full border border-black">
<select name="ostatus" class="select w-full border border-black">
<option disabled>Select original work status...</option>
<option value="1" <?php if ($_smarty_tpl->tpl_vars['title']->value['status'] == 1) {?>selected<?php }?>>Announced</option>
<option value="2" <?php if ($_smarty_tpl->tpl_vars['title']->value['status'] == 2) {?>selected<?php }?>>Releasing</option>
<option value="3" <?php if ($_smarty_tpl->tpl_vars['title']->value['status'] == 3) {?>selected<?php }?>>Hiatus</option>
<option value="4" <?php if ($_smarty_tpl->tpl_vars['title']->value['status'] == 4) {?>selected<?php }?>>Completed</option>
<option value="5" <?php if ($_smarty_tpl->tpl_vars['title']->value['status'] == 5) {?>selected<?php }?>>Cancelled</option>
</select>
<select name="sstatus" class="select w-full border border-black">
<option disabled>Select scanlation status...</option>
<option value="1" <?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 1) {?>selected<?php }?>>Planned</option>
<option value="2" <?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 2) {?>selected<?php }?>>Ongoing</option>
<option value="3" <?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 3) {?>selected<?php }?>>Hiatus</option>
<option value="4" <?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 4) {?>selected<?php }?>>Completed</option>
<option value="5" <?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 5) {?>selected<?php }?>>Cancelled</option>
</select>
<input type="number" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['releaseYear'];?>
" placeholder="Year of Release" name="release" class="input w-full border border-black">
<input type="number" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['completionYear'];?>
" placeholder="Year of Completion" name="completion" class="input w-full border border-black">
<textarea name="summary" class="textarea w-full border border-black" placeholder="Summary"><?php echo $_smarty_tpl->tpl_vars['title']->value['summary2'];?>
</textarea>
<!-- /Title Data -->
<!-- Tags Modal -->
<input type="checkbox" id="tagsModal" class="modal-toggle">
<div class="modal">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Select Tags</h3>
<div class="grid grid-cols-1 gap-4">
<div>
<h4 class="font-bold text-xl text-left">Format/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_format']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="format[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" <?php if (in_array($_smarty_tpl->tpl_vars['item']->value['id'],$_smarty_tpl->tpl_vars['title']->value['tags']['_formats'])) {?>checked<?php }?>> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Warning/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_warnings']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="warning[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" <?php if (in_array($_smarty_tpl->tpl_vars['item']->value['id'],$_smarty_tpl->tpl_vars['title']->value['tags']['_warnings'])) {?>checked<?php }?>> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Theme/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_theme']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="theme[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" <?php if (in_array($_smarty_tpl->tpl_vars['item']->value['id'],$_smarty_tpl->tpl_vars['title']->value['tags']['_themes'])) {?>checked<?php }?>> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Genre/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_genre']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="genre[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" <?php if (in_array($_smarty_tpl->tpl_vars['item']->value['id'],$_smarty_tpl->tpl_vars['title']->value['tags']['_genres'])) {?>checked<?php }?>> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<label for="tagsModal" class="btn btn-success">Close</label>
</div>
</div>
</div>
<!-- /Tags Modal -->
<!-- Submit, Error and Close -->
<button class="btn btn-primary btn-block btn-outline" type="submit">Edit!</button>
<div class="text-center hidden text-error" id="edittitle-result"></div>
<label for="editTitleModal" class="btn btn-error btn-block">Cancel</label>
<!-- /Submit, Error and Close -->
</div>
</form>
</div>
</div>
<?php echo '<script'; ?>
>
$(function() {
$("#cover").change(function(e) {
e.preventDefault();
var fd = new FormData();
var files = $("#cover")[0].files;
if (files.length > 0) {
fd.append("cover", files[0]);
$.ajax({
type: "POST",
url: "ajax\\images\\tmp.php",
data: fd,
contentType: false,
processData: false,
success: function(msg) {
let result = JSON.parse(msg);
if (result.s == true) {
let preview = document.getElementById("imgpreview");
//preview.classList.remove("hidden");
preview.src = "data/tmp/" + result.msg;
document.querySelector("input[name='cover']").value =
result.msg;
} else {
alert(result.msg);
}
}
});
}
});
});
$("#cover").change(function(e) {
var allowedTypes = ["image/jpeg", "image/jpg", "image/png", "image/webp"];
var file = this.files[0];
var fileType = file.type;
if (!allowedTypes.includes(fileType)) {
alert("Upload only supports JPG, JPEG, PNG and WEBP!");
$("#cover").val("");
return false;
}
});
$("#editTitleForm").submit(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\titles\\edit.php",
data: $(this).serialize(),
success: function(data) {
let result = JSON.parse(data);
if (result.s == true) {
//let text = document.getElementById("addtitle-result");
//text.classList.add("hidden");
window.location.replace("title.php?id=" + result.msg);
// Redirect to Title?
} else {
let text = document.getElementById("edittitle-result");
text.classList.remove("hidden");
text.innerHTML = "<b>Error:</b> " + result.msg;
}
}
});
return false;
});
<?php echo '</script'; ?>
>
<?php }
}
}

View File

@ -1,56 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-01-25 20:25:20
from '/var/www/html/FSX/library/themes/nucleus/parts/alert.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63d1822004f5c0_68132745',
'has_nocache_code' => false,
'file_dependency' =>
array (
'85a8f46871e45e0ec0747a2d44a7b5d690e635ef' =>
array (
0 => '/var/www/html/FSX/library/themes/nucleus/parts/alert.tpl',
1 => 1674091844,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_63d1822004f5c0_68132745 (Smarty_Internal_Template $_smarty_tpl) {
if (!empty($_smarty_tpl->tpl_vars['topAlert']->value) && !$_smarty_tpl->tpl_vars['readAlert']->value) {?>
<div class="alert alert-<?php echo $_smarty_tpl->tpl_vars['topAlert']->value['type'];?>
shadow-md" id="topAlert">
<div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
class="stroke-current flex-shrink-0 w-6 h-6">
<?php if ($_smarty_tpl->tpl_vars['topAlert']->value['type'] == "info") {?>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
<?php } elseif ($_smarty_tpl->tpl_vars['topAlert']->value['type'] == "success") {?>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
<?php } elseif ($_smarty_tpl->tpl_vars['topAlert']->value['type'] == "warning") {?>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
<?php } else { ?>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
<?php }?>
</svg>
<span><b><?php echo ucfirst($_smarty_tpl->tpl_vars['topAlert']->value['type']);?>
:</b> <?php echo $_smarty_tpl->tpl_vars['topAlert']->value['content'];?>
</span>
</div>
<?php if ($_smarty_tpl->tpl_vars['logged']->value) {?>
<div class="flex-none m-0 p-0">
<button class="btn btn-sm m-0 mikuLink" id="dismissAlert">Dismiss</button>
</div>
<?php }?>
</div>
<?php }
}
}

View File

@ -1,329 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-02-13 21:28:08
from 'C:\xamppx\htdocs\fsx\library\themes\nucleus\pages\titles.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63ea9d580ad6a3_01367611',
'has_nocache_code' => false,
'file_dependency' =>
array (
'a48a9bd1400c21668af40ca584171aa806ca126b' =>
array (
0 => 'C:\\xamppx\\htdocs\\fsx\\library\\themes\\nucleus\\pages\\titles.tpl',
1 => 1676319961,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_63ea9d580ad6a3_01367611 (Smarty_Internal_Template $_smarty_tpl) {
?><!-- Titles Div -->
<div class="p-4 border shadow-md rounded-xl my-4">
<h1 class="mb-4 font-bold text-2xl">
Titles - Page <?php echo $_smarty_tpl->tpl_vars['page']->value;?>
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<a href="#/" class="btn btn-sm" onclick="toggleCheck('addTitleModal');">Add Title</a>
<?php }?>
</h1>
<?php if (!empty($_smarty_tpl->tpl_vars['titles']->value)) {?>
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['titles']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<div>
<div class="card card-compact w-full bg-base-200 shadow-lg border">
<figure>
<a href="title.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
">
<img src="data/covers/<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
.png" alt="Cover">
</a>
</figure>
<div class="card-body">
<h2 class="card-title flex">
<a href="title.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" class="link">
<?php echo $_smarty_tpl->tpl_vars['item']->value['title'];?>
</a>
</h2>
<div class="card-actions justify-end">
<span
class="badge shadow-md badge-<?php if ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 1) {?>info<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 2) {?>success<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 3) {?>warning<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 4) {?>success-content<?php } else { ?>error<?php }?>">
<?php if ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 1) {?>Planned<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 2) {?>Ongoing<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 3) {?>Hiatus<?php } elseif ($_smarty_tpl->tpl_vars['item']->value['sstatus'] == 4) {?>Completed<?php } else { ?>Cancelled<?php }?>
</span>
</div>
</div>
</div>
</div>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
<?php } else { ?>
<p>There are no Titles on this page!</p>
<?php }?>
<?php if (!empty($_smarty_tpl->tpl_vars['pagis']->value)) {?>
<div class="btn-group mx-auto pt-4">
<?php if ($_smarty_tpl->tpl_vars['page']->value > 1) {?>
<a href="?page=1" class="btn btn-sm md:btn-md shadow-md">«</a>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['page']->value-1;?>
" class="btn btn-sm md:btn-md shadow-md"></a>
<?php }?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['pagis']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<?php if ($_smarty_tpl->tpl_vars['page']->value != $_smarty_tpl->tpl_vars['item']->value) {?>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['item']->value;?>
" class="btn btn-sm md:btn-md shadow-md"><?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</a>
<?php } else { ?>
<span class="btn btn-active btn-sm md:btn-md shadow-md"><?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</span>
<?php }?>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php if ($_smarty_tpl->tpl_vars['page']->value < $_smarty_tpl->tpl_vars['totalPages']->value) {?>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['page']->value+1;?>
" class="btn btn-sm md:btn-md shadow-md"></a>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['totalPages']->value;?>
" class="btn btn-sm md:btn-md shadow-md">»</a>
<?php }?>
</div>
<?php }?>
</div>
<!-- /Titles Div -->
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<input type="checkbox" id="addTitleModal" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Add Title</h3>
<form method="POST" name="addTitle" id="addTitleForm">
<div class="grid grid-cols-1 gap-4">
<!-- Cover Image -->
<input type="file" id="cover" class="border border-black file-input w-full">
<img src="" alt="Cover" id="imgpreview" class="rounded-xl hidden w-full border shadow-sm">
<!-- /Cover Image -->
<!-- Title Data-->
<input name="cover" hidden>
<input type="text" placeholder="Title" name="title" class="input w-full border border-black">
<input type="text" placeholder="Alternate Names" name="alts" class="input w-full border border-black">
<label for="tagsModal" class="btn">Select Tags</label>
<input type="text" placeholder="Author/s (Seperate by comma)" name="authors"
class="input w-full border border-black">
<input type="text" placeholder="Artist/s (Seperate by comma)" name="artists"
class="input w-full border border-black">
<input type="text" placeholder="Original Language" name="olang"
class="input w-full border border-black">
<select name="ostatus" class="select w-full border border-black">
<option disabled selected>Select original work status...</option>
<option value="1">Announced</option>
<option value="2">Releasing</option>
<option value="3">Hiatus</option>
<option value="4">Completed</option>
<option value="5">Cancelled</option>
</select>
<select name="sstatus" class="select w-full border border-black">
<option disabled selected>Select scanlation status...</option>
<option value="1">Planned</option>
<option value="2">Ongoing</option>
<option value="3">Hiatus</option>
<option value="4">Completed</option>
<option value="5">Cancelled</option>
</select>
<input type="number" placeholder="Year of Release" name="release"
class="input w-full border border-black">
<input type="number" placeholder="Year of Completion" name="completion"
class="input w-full border border-black">
<textarea name="summary" class="textarea w-full border border-black" placeholder="Summary"></textarea>
<!-- /Title Data -->
<!-- Tags Modal -->
<input type="checkbox" id="tagsModal" class="modal-toggle">
<div class="modal">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Select Tags</h3>
<div class="grid grid-cols-1 gap-4">
<div>
<h4 class="font-bold text-xl text-left">Format/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_format']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="format[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Warning/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_warnings']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="warning[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Theme/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_theme']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="theme[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Genre/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_genre']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="genre[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<label for="tagsModal" class="btn btn-success">Close</label>
</div>
</div>
</div>
<!-- /Tags Modal -->
<!-- Submit, Error and Close -->
<button class="btn btn-primary btn-block btn-outline" type="submit">Add!</button>
<div class="text-center hidden text-error" id="addtitle-result"></div>
<label for="addTitleModal" class="btn btn-error btn-block">Cancel</label>
<!-- /Submit, Error and Close -->
</div>
</form>
</div>
</div>
<?php echo '<script'; ?>
>
$(function() {
$("#cover").change(function(e) {
e.preventDefault();
var fd = new FormData();
var files = $("#cover")[0].files;
if (files.length > 0) {
fd.append("cover", files[0]);
$.ajax({
type: "POST",
url: "ajax\\images\\tmp.php",
data: fd,
contentType: false,
processData: false,
success: function(msg) {
let result = JSON.parse(msg);
if (result.s == true) {
let preview = document.getElementById("imgpreview");
preview.classList.remove("hidden");
preview.src = "data/tmp/" + result.msg;
document.querySelector("input[name='cover']").value =
result.msg;
} else {
alert(result.msg);
}
}
});
}
});
});
$("#cover").change(function(e) {
var allowedTypes = ["image/jpeg", "image/jpg", "image/png", "image/webp"];
var file = this.files[0];
var fileType = file.type;
if (!allowedTypes.includes(fileType)) {
alert("Upload only supports JPG, JPEG, PNG and WEBP!");
$("#cover").val("");
return false;
}
});
$("#addTitleForm").submit(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\titles\\add.php",
data: $(this).serialize(),
success: function(data) {
let result = JSON.parse(data);
if (result.s == true) {
//let text = document.getElementById("addtitle-result");
//text.classList.add("hidden");
window.location.replace("title.php?id=" + result.msg);
// Redirect to Title?
} else {
let text = document.getElementById("addtitle-result");
text.classList.remove("hidden");
text.innerHTML = "<b>Error:</b> " + result.msg;
}
}
});
return false;
});
<?php echo '</script'; ?>
>
<?php }
}
}

View File

@ -1,76 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-02-13 21:31:52
from 'C:\xamppx\htdocs\fsx\library\themes\nucleus\parts\header.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63ea9e38f13809_60866877',
'has_nocache_code' => false,
'file_dependency' =>
array (
'a98a0397eb530d94c7c81ec80b6e381b750f3c54' =>
array (
0 => 'C:\\xamppx\\htdocs\\fsx\\library\\themes\\nucleus\\parts\\header.tpl',
1 => 1676320260,
2 => 'file',
),
),
'includes' =>
array (
'file:../parts/menu.tpl' => 1,
),
),false)) {
function content_63ea9e38f13809_60866877 (Smarty_Internal_Template $_smarty_tpl) {
if (((isset($_smarty_tpl->tpl_vars['rel']->value)) && $_smarty_tpl->tpl_vars['rel']->value != 'tab') || !(isset($_smarty_tpl->tpl_vars['rel']->value))) {?>
<!DOCTYPE html>
<html lang="<?php echo $_smarty_tpl->tpl_vars['userlang']->value;?>
">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $_smarty_tpl->tpl_vars['pagetitle']->value;?>
</title>
<?php echo '<script'; ?>
src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"><?php echo '</script'; ?>
>
<link href="https://cdn.jsdelivr.net/npm/daisyui@2.47.0/dist/full.css" rel="stylesheet" type="text/css">
<?php echo '<script'; ?>
src="https://cdn.tailwindcss.com"><?php echo '</script'; ?>
>
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon/favicon-16x16.png">
<link rel="manifest" href="assets/favicon/site.webmanifest">
<style>
.link {
text-decoration-line: underline;
text-decoration-style: dotted;
}
.link:hover {
text-decoration-style: solid;
}
.auto a {
text-decoration-line: underline;
text-decoration-style: dotted;
}
.auto a:hover {
text-decoration-style: solid;
}
</style>
</head>
<body data-theme="<?php echo $_smarty_tpl->tpl_vars['daisytheme']->value;?>
" onload="assignTheme('<?php echo cat($_smarty_tpl->tpl_vars['config']->value['title']);?>
_');" class="min-h-screen">
<?php $_smarty_tpl->_subTemplateRender("file:../parts/menu.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
}
}
}

View File

@ -1,100 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-02-13 21:34:16
from 'C:\xamppx\htdocs\fsx\library\themes\nucleus\parts\menu.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63ea9ec869d5f3_55016460',
'has_nocache_code' => false,
'file_dependency' =>
array (
'df20805cffa9e9a80a91ae04da2370380444c001' =>
array (
0 => 'C:\\xamppx\\htdocs\\fsx\\library\\themes\\nucleus\\parts\\menu.tpl',
1 => 1676320427,
2 => 'file',
),
),
'includes' =>
array (
'file:../parts/alert.tpl' => 1,
),
),false)) {
function content_63ea9ec869d5f3_55016460 (Smarty_Internal_Template $_smarty_tpl) {
?><input hidden readonly type="text" value="<?php echo $_smarty_tpl->tpl_vars['config']->value['title'];?>
" id="siteName">
<input hidden readonly type="text" value="<?php echo $_smarty_tpl->tpl_vars['config']->value['divider'];?>
" id="siteDivider">
<div class="navbar bg-base-300 text-base-content">
<div class="navbar-start">
<div class="dropdown">
<label tabindex="0" class="btn btn-ghost lg:hidden">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h8m-8 6h16" />
</svg>
</label>
<ul tabindex="0"
class="menu menu-compact border dropdown-content mt-3 p-2 shadow-md bg-base-100 rounded-box w-52">
<li><a href="index.php" rel="tab" ttl="Home">Home</a></li>
<li><a href="releases.php" rel="tab" ttl="Releases - Page 1">Releases</a></li>
<li><a href="titles.php" rel="tab" ttl="Titles - Page 1">Titles</a></li>
<li><a href="bookmarks.php" rel="tab" ttl="Bookmarks - Reading - Page 1">Bookmarks</a></li>
<li><a href="members.php" rel="tab" ttl="Members - Page 1">Members</a></li>
</ul>
</div>
<a href="<?php echo $_smarty_tpl->tpl_vars['config']->value['url'];?>
" class="btn btn-ghost normal-case text-xl">
<?php if (!empty($_smarty_tpl->tpl_vars['logoImage']->value)) {?>
<img src="<?php echo $_smarty_tpl->tpl_vars['logoImage']->value;?>
" alt="Logo" class="h-10">
<?php } else { ?>
<?php echo $_smarty_tpl->tpl_vars['config']->value['title'];?>
<?php }?>
</a>
</div>
<div class="navbar-center hidden lg:flex">
<ul class="menu menu-horizontal px-1">
<li><a href="index.php" rel="tab" ttl="Home">Home</a></li>
<li><a href="releases.php" rel="tab" ttl="Releases - Page 1">Releases</a></li>
<li><a href="titles.php" rel="tab" ttl="Titles - Page 1">Titles</a></li>
<li><a href="bookmarks.php" rel="tab" ttl="Bookmarks - Reading - Page 1">Bookmarks</a></li>
<li><a href="members.php" rel="tab" ttl="Members - Page 1">Members</a></li>
</ul>
</div>
<div class="navbar-end">
<div class="dropdown dropdown-end">
<label tabindex="0" class="btn btn-ghost btn-circle avatar">
<div class="w-10 rounded-full">
<img src="<?php if ($_smarty_tpl->tpl_vars['logged']->value) {
echo $_smarty_tpl->tpl_vars['user']->value['avatar'];
} else { ?>https://rav.h33t.moe/avatar.php?name=rileinc<?php }?>"
alt="Avatar">
</div>
</label>
<ul tabindex="0"
class="mt-3 p-2 shadow-md menu menu-compact dropdown-content bg-base-100 border rounded-box w-52">
<?php if ($_smarty_tpl->tpl_vars['logged']->value) {?>
<li><a href="profile.php?id=<?php echo $_smarty_tpl->tpl_vars['user']->value['id'];?>
" rel="tab"
ttl="Profile of <?php echo $_smarty_tpl->tpl_vars['user']->value['username'];?>
- Uploads - Page 1">Profile</a></li>
<li><label for="userSettingsModal">Settings</label></li>
<li><button id="logoutButton">Logout</button></li>
<?php } else { ?>
<li><label for="loginModal">Login</label></li>
<li><label for="signupModal">Signup</label></li>
<?php }?>
</ul>
</div>
</div>
</div>
<!-- Container Begin -->
<div class="container mx-auto my-4 px-2 md:px-0" id="content">
<?php $_smarty_tpl->_subTemplateRender("file:../parts/alert.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
}
}

View File

@ -1,404 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-03-30 22:40:29
from 'C:\xamppx\htdocs\fsx\library\themes\nucleus\parts\footer.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_6425f3bd406f98_76065636',
'has_nocache_code' => false,
'file_dependency' =>
array (
'e0af686df315fb33c6ea5adb09cda514c8ffa4a1' =>
array (
0 => 'C:\\xamppx\\htdocs\\fsx\\library\\themes\\nucleus\\parts\\footer.tpl',
1 => 1680208827,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_6425f3bd406f98_76065636 (Smarty_Internal_Template $_smarty_tpl) {
?></div>
<!-- Container End -->
<?php if (((isset($_smarty_tpl->tpl_vars['rel']->value)) && $_smarty_tpl->tpl_vars['rel']->value != 'tab') || !(isset($_smarty_tpl->tpl_vars['rel']->value))) {?>
<?php if (!$_smarty_tpl->tpl_vars['logged']->value) {?>
<input type="checkbox" id="loginModal" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Login</h3>
<form method="POST" name="login" id="loginForm">
<div class="grid grid-cols-1 gap-4">
<input type="text" placeholder="Username" name="username" class="input w-full border border-black">
<input type="password" placeholder="Password" name="password" class="input w-full border border-black">
</div>
<div class=" mt-4">
<button class="btn btn-primary btn-block btn-outline" type="submit">Log me in!</button>
</div>
<div class="mt-4 text-error text-center hidden" id="login-result"></div>
<div class="pt-4 grid grid-cols-2 gap-4">
<label onclick="toggleCheck('loginModal'); toggleCheck('signupModal');" class="btn btn-block">To
Signup</label>
<label for="loginModal" class="btn btn-error">Cancel</label>
</div>
</form>
</div>
</div>
<input type="checkbox" id="signupModal" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Signup</h3>
<form method="POST" name="signup" id="signupForm">
<div class="grid grid-cols-1 gap-4">
<input type="text" placeholder="Username" name="username" class="input w-full border border-black">
<input type="password" placeholder="Password" name="password" class="input w-full border border-black">
<input type="password" placeholder="Repeat Password" name="password2"
class="input w-full border border-black">
<input type="email" placeholder="Email (for account-activation and recovery)" name="email"
class="input w-full border border-black">
<input type="email" placeholder="Repeat Email" name="email2" class="input w-full border border-black">
</div>
<div class="mt-4">
<button class="btn btn-primary btn-block btn-outline" type="submit">Create my account!</button>
</div>
<div class="mt-2 text-error text-center hidden" id="signup-result"></div>
<div class="pt-4 grid grid-cols-2 gap-4">
<label onclick="toggleCheck('loginModal'); toggleCheck('signupModal');" class="btn btn-block">To
Login</label>
<label for="signupModal" class="btn btn-error">Cancel</label>
</div>
</form>
</div>
</div>
<?php } else { ?>
<input type="checkbox" id="userSettingsModal" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">User Settings</h3>
<form method="POST" name="userSettings" id="userSettingsForm">
<div class="grid grid-cols-1 gap-4">
<input type="text" placeholder="Avatar URL" name="avatar" class="input w-full border border-black"
value="<?php echo $_smarty_tpl->tpl_vars['user']->value['avatar'];?>
">
<select class="select w-full border border-black" name="theme">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['config']->value['themes'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<option value="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
">Theme: <?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</option>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</select>
</div>
<div class="mt-4">
<button class="btn btn-primary btn-block btn-outline" type="submit">Save settings!</button>
</div>
<div class="mt-2 text-center hidden" id="usersettings-result"></div>
<div class="pt-4">
<label for="userSettingsModal" class="btn btn-error btn-block">Close</label>
</div>
</form>
</div>
</div>
<?php }?>
<?php echo '<script'; ?>
>
function toggleCheck(id) {
let box = document.getElementById(id);
box.checked = !box.checked;
}
<?php if (!$_smarty_tpl->tpl_vars['logged']->value) {?>
$("#loginForm").submit(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\account\\login.php",
data: $(this).serialize(),
success: function(data) {
if (data == "success") {
location.reload();
} else {
let text = document.getElementById("login-result");
text.classList.remove("hidden");
text.innerHTML = "<b>Error:</b> " + data;
}
}
});
return false;
});
$("#signupForm").submit(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\account\\signup.php",
data: $(this).serialize(),
success: function(data) {
if (data == "success") {
location.reload();
} else {
let text = document.getElementById("signup-result");
text.classList.remove("hidden");
text.innerHTML = "<b>Error:</b> " + data;
}
}
});
return false;
});
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['logged']->value) {?>
$("#userSettingsForm").submit(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\account\\settings.php",
data: $(this).serialize(),
success: function(data) {
if (data == "success") {
location.reload();
} else {
let text = document.getElementById("usersettings-result");
text.classList.remove("hidden");
text.innerHTML = "<b>Error:</b> " + data;
text.classList.add("text-error");
text.classList.remove("text-success");
}
}
});
return false;
});
$("#logoutButton").click(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\account\\logout.php",
data: $(this).serialize(),
success: function(data) {
if (data == "success") {
location.reload();
} else {
alert("Error: " + data);
}
}
});
return false;
});
$("#dismissAlert").click(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\alerts\\dismiss.php",
success: function(data) {
if (data == "success") {
let div = document.getElementById("topAlert");
div.classList.add("hidden");
} else {
alert("Error: " + data);
}
}
});
return false;
});
<?php }?>
function setCookie(name, value) {
Cookies.set("<?php echo cat($_smarty_tpl->tpl_vars['config']->value['title']);?>
_" + name, value, { expires: 999 })
}
function updateUserLang(lang) {
<?php if ($_smarty_tpl->tpl_vars['logged']->value) {?>
$.ajax({
type: "POST",
url: "ajax\\account\\updateLang.php",
data: {
newLang: lang
},
success: function(data) {
if (data == "success") {
location.reload();
} else {
alert("Error: " + data);
}
}
});
<?php } else { ?>
location.reload();
<?php }?>
}
function toggleRead(id) {
let box = event.srcElement.id;
<?php if (!$_smarty_tpl->tpl_vars['logged']->value) {?>
alert("Error: Login to use this function!");
toggleCheck(box);
<?php } else { ?>
$.ajax({
type: "POST",
url: "ajax\\chapters\\read.php",
data: {
user: <?php echo $_smarty_tpl->tpl_vars['user']->value['id'];?>
,
chapter: id
},
success: function(data) {
if (data != "success") {
alert("Error: " + data);
toggleCheck(box);
}
}
});
<?php }?>
}
<?php echo '</script'; ?>
>
<!-- Theme Modal -->
<input type="checkbox" id="themeModal" class="modal-toggle">
<div class="modal">
<div class="modal-box w-11/12 max-w-5xl">
<h3 class="font-bold text-lg mb-4">Change Design</h3>
<?php $_smarty_tpl->_assignInScope('daisyThemes', array("light","dark","cupcake","bumblebee","emerald","corporate","synthwave","retro","cyberpunk","valentine","halloween","garden","forest","aqua","lofi","pastel","fantasy","wireframe","black","luxury","dracula","cmyk","autumn","business","acid","lemonade","night","coffee","winter"));?>
<div class="grid grid-cols-2 md:grid-cols-5 gap-1 sm:gap-2 md:gap-4">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['daisyThemes']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<div class="col-span-1 border rounded-xl p-1 md:p-2 cursor-pointer bg-base-100" data-theme="<?php echo $_smarty_tpl->tpl_vars['item']->value;?>
"
onclick="setCookie('daisytheme','<?php echo $_smarty_tpl->tpl_vars['item']->value;?>
');assignTheme('<?php echo cat($_smarty_tpl->tpl_vars['config']->value['title']);?>
_');">
<div class="grid grid-cols-5 grid-rows-2">
<div class="bg-base-200 col-start-1 row-span-1 row-start-1 rounded-tl-md"></div>
<div class="bg-base-300 col-start-1 row-start-2 rounded-bl-md"></div>
<div class="col-span-4 col-start-2 row-span-2 row-start-1 ml-2">
<span class="font-bold"><?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</span>
<div class="w-full grid grid-cols-4 gap-1 md:gap-2 mt-1 md:mt-2 text-sm">
<button class="btn btn-sm btn-primary">A</button>
<button class="btn btn-sm btn-secondary">A</button>
<button class="btn btn-sm btn-accent">A</button>
<button class="btn btn-sm btn-neutral">A</button>
</div>
</div>
</div>
</div>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<label for="themeModal" class="mt-4 md:mt-0 btn col-span-2 md:col-span-5">Close</label>
</div>
</div>
</div>
<!-- /Theme Modal -->
<!-- Language Modal -->
<input type="checkbox" id="langModal" class="modal-toggle">
<div class="modal">
<div class="modal-box w-11/12 max-w-5xl">
<h3 class="font-bold text-lg mb-4">Change Language</h3>
<div class="grid grid-cols-2 md:grid-cols-4 gap-1 sm:gap-2 md:gap-4">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['userlangs']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<div class="col-span-1 border rounded-xl text-center p-1 md:p-2 cursor-pointer bg-base-100"
onclick="setCookie('userlang','<?php echo $_smarty_tpl->tpl_vars['item']->value['code'];?>
');updateUserLang('<?php echo $_smarty_tpl->tpl_vars['item']->value['code'];?>
');">
<p class="font-bold text-xl"><?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</p>
<p>
by
<?php if (!empty($_smarty_tpl->tpl_vars['item']->value['website'])) {?>
<a href="<?php echo $_smarty_tpl->tpl_vars['item']->value['website'];?>
" target="_blank" class="link">
<?php }?>
<?php echo $_smarty_tpl->tpl_vars['item']->value['author'];?>
<?php if (!empty($_smarty_tpl->tpl_vars['item']->value['website'])) {?>
</a>
<?php }?>
</p>
<p class="italic text-sm">Updated: <?php echo $_smarty_tpl->tpl_vars['item']->value['updated'];?>
</p>
</div>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<label for="langModal" class="mt-4 md:mt-0 btn col-span-2 md:col-span-4">Close</label>
</div>
</div>
</div>
<!-- /Language Modal -->
<footer class="footer footer-center p-6 bg-base-300 text-base-content">
<div>
<p>
Copyright © <?php echo date("Y");?>
<a href="<?php echo $_smarty_tpl->tpl_vars['config']->value['url'];?>
" class="link"><?php echo $_smarty_tpl->tpl_vars['config']->value['title'];?>
</a>
<span class="hidden md:inline">|</span>
<br class="md:hidden">
Running <a href="https://github.com/saintly2k/FoOlSlideX" class="link" target="_blank">FoOlSlideX</a>
<span class="badge badge-info"><?php echo $_smarty_tpl->tpl_vars['version']->value;?>
</span>
<br class="md:hidden">
by <a href="https://github.com/saintly2k" class="link" target="_blank">Saintly2k</a> and
<a href="https://github.com/saintly2k/FoOlSlideX/graphs/contributors" class="link" target="_blank">The
Gang</a>.
<span class="hidden md:inline">|</span>
<br class="md:hidden">
<label for="themeModal" class="link">Change Design</label> or
<label for="langModal" class="link">Change Language</label>
</p>
</div>
</footer>
<!--<?php echo '<script'; ?>
src="assets/page.js"><?php echo '</script'; ?>
>-->
<?php echo '<script'; ?>
src="assets/nucleus/tabs.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
src="assets/nucleus/tags.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
src="assets/nucleus/autotheme.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
src="assets/nucleus/carousel.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
src="assets/js.cookie.js"><?php echo '</script'; ?>
>
</body>
</html>
<?php }
}
}

View File

@ -1,907 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-02-24 15:45:40
from 'C:\xamppx\htdocs\fsx\library\themes\nucleus\pages\title.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63f8cd942ed844_01359944',
'has_nocache_code' => false,
'file_dependency' =>
array (
'f30f9a1336cdea332b64c0ab64d71bb20a3923f0' =>
array (
0 => 'C:\\xamppx\\htdocs\\fsx\\library\\themes\\nucleus\\pages\\title.tpl',
1 => 1677249865,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_63f8cd942ed844_01359944 (Smarty_Internal_Template $_smarty_tpl) {
?><!-- Title Div -->
<div class="p-4 border shadow-md rounded-xl my-4">
<div class="mb-4 md:mb-0 md:hidden">
<h1 class="font-bold text-2xl">
<?php echo $_smarty_tpl->tpl_vars['title']->value['title'];?>
<div
class="badge shadow-md badge-<?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 1) {?>info<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 2) {?>success<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 3) {?>warning<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 4) {?>success-content<?php } else { ?>error<?php }?>">
<?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 1) {?>Planned<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 2) {?>Ongoing<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 3) {?>Hiatus<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 4) {?>Completed<?php } else { ?>Cancelled<?php }?>
</div>
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<button class="btn btn-sm shadow-md" onclick="toggleCheck('editTitleModal');">Edit Title</button>
<?php }?>
</h1>
<p><?php echo $_smarty_tpl->tpl_vars['title']->value['alts'];?>
</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<div>
<a href="data/covers/<?php echo $_smarty_tpl->tpl_vars['title']->value['id'];?>
.png" target="_blank">
<img src="data/covers/<?php echo $_smarty_tpl->tpl_vars['title']->value['id'];?>
.png" alt="Cover" class="w-full rounded-xl shadow-md">
</a>
</div>
<div class="col-span-1 md:col-span-3">
<div class="hidden md:block md:mb-4">
<h1 class="font-bold text-2xl">
<?php echo $_smarty_tpl->tpl_vars['title']->value['title'];?>
<div
class="badge shadow-md badge-<?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 1) {?>info<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 2) {?>success<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 3) {?>warning<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 4) {?>success-content<?php } else { ?>error<?php }?>">
<?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 1) {?>Planned<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 2) {?>Ongoing<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 3) {?>Hiatus<?php } elseif ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 4) {?>Completed<?php } else { ?>Cancelled<?php }?>
</div>
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<button class="btn btn-sm shadow-md" onclick="toggleCheck('editTitleModal');">Edit Title</button>
<?php }?>
</h1>
<p><?php echo $_smarty_tpl->tpl_vars['title']->value['alts'];?>
</p>
</div>
<div>
<h2 class="underline font-bold text-xl mb-2">Details</h2>
<p class="mb-1">
<span class="font-bold">Author/s:</span>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['authors'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['authors'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value);?>
">
<span class="badge hover:badge-info p-3 shadow-md">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php } else { ?>
Unknown
<?php }?>
</p>
<p class="mb-1">
<span class="font-bold">Artist/s:</span>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['artists'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['artists'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value);?>
">
<span class="badge hover:badge-info p-3 shadow-md">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php } else { ?>
Unknown
<?php }?>
</p>
<p class="mb-1">
<span class="font-bold">Release Year:</span>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['releaseYear'])) {?>
<?php echo $_smarty_tpl->tpl_vars['title']->value['releaseYear'];?>
<?php } else { ?>
Unknown
<?php }?>
</p>
<p class="mb-1">
<span class="font-bold">Completion Year:</span>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['completionYear'])) {?>
<?php echo $_smarty_tpl->tpl_vars['title']->value['completionYear'];?>
<?php } else { ?>
Unknown
<?php }?>
</p>
<h2 class="underline font-bold text-xl mb-2">Tags</h2>
<div class="mb-1 grid grid-cols-2 gap-4">
<div>
<p><b>Formats</b></p>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['tags']['formats'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['tags']['formats'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
">
<span class="badge hover:badge-info p-3 mb-1 border border-black shadow-md">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php }?>
</div>
<div>
<p><b>Warnings</b></p>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['tags']['warnings'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['tags']['warnings'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
">
<span class="badge hover:badge-info p-3 mb-1 border border-black shadow-md">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php }?>
</div>
<div>
<p><b>Themes</b></p>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['tags']['themes'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['tags']['themes'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
">
<span class="badge hover:badge-info p-3 mb-1 border border-black shadow-md">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php }?>
</div>
<div>
<p><b>Genres</b></p>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['tags']['genres'])) {?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['title']->value['tags']['genres'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<a href="titles.php?search=<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
">
<span class="badge hover:badge-info p-3 mb-1 border border-black shadow-md">
<?php echo trim($_smarty_tpl->tpl_vars['item']->value['name']);?>
</span>
</a>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php }?>
</div>
</div>
</div>
</div>
<?php if (!empty($_smarty_tpl->tpl_vars['title']->value['summary'])) {?>
<div class="md:col-span-4">
<h2 class="underline font-bold text-xl mb-2">Summary</h2>
<div class="auto space-y-2 md:space-y-1">
<?php echo $_smarty_tpl->tpl_vars['title']->value['summary'];?>
</div>
</div>
<?php }?>
</div>
</div>
<!-- /Title Div -->
<!-- Chapters Div -->
<div class="p-4 border shadow-md rounded-xl my-4">
<h1 class="text-xl font-bold">
<span class="underline">Chapters</span>
(<span id="chapterCount"><?php echo $_smarty_tpl->tpl_vars['chapterCount']->value;?>
</span>)
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<label for="addChapterModal" class="btn btn-sm shadow-md">
Add Chapter
</label>
<?php }?>
</h1>
<?php if (!empty($_smarty_tpl->tpl_vars['chapterLangs']->value[0]['language']['chapters'])) {?>
<div class="tabs tabs-boxed mt-4 rounded-xl shadow-md border gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['chapterLangs']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<?php if (count($_smarty_tpl->tpl_vars['chapterLangs']->value) > 1) {?>
<button class="tab tablink border rounded-md <?php if ($_smarty_tpl->tpl_vars['preflang']->value == $_smarty_tpl->tpl_vars['item']->value['language'][1]) {?>tab-active<?php }?>"
onclick="switchTab(event, 'chTab_<?php echo $_smarty_tpl->tpl_vars['item']->value['language'][1];?>
'); setCookie('preflang','<?php echo $_smarty_tpl->tpl_vars['item']->value['language'][1];?>
');">
<?php } else { ?>
<button class="tab tablink tab-active rounded-md">
<?php }?>
<img src="https://flagcdn.com/16x12/<?php echo $_smarty_tpl->tpl_vars['item']->value['language'][1];?>
.png" alt="<?php echo $_smarty_tpl->tpl_vars['item']->value['language'][2];?>
" class="h-3">
<span class="hidden md:block md:ml-1">
<?php echo $_smarty_tpl->tpl_vars['item']->value['language'][0];?>
</span>
<span class="badge ml-1 mr-0"><?php echo $_smarty_tpl->tpl_vars['item']->value['language']['count'];?>
</span>
</button>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
<!-- Chapter Tabs -->
<div class="tabcontents mt-4">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['chapterLangs']->value, '_lang', false, 'lkey', 'lname', array (
));
$_smarty_tpl->tpl_vars['_lang']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['lkey']->value => $_smarty_tpl->tpl_vars['_lang']->value) {
$_smarty_tpl->tpl_vars['_lang']->do_else = false;
?>
<?php if (count($_smarty_tpl->tpl_vars['chapterLangs']->value) > 1) {?>
<div class="tabcontent <?php if ($_smarty_tpl->tpl_vars['preflang']->value == $_smarty_tpl->tpl_vars['_lang']->value['language'][1]) {?>active<?php } else { ?>hidden<?php }?>"
id="chTab_<?php echo $_smarty_tpl->tpl_vars['_lang']->value['language'][1];?>
">
<?php }?>
<!-- Chapter Table -->
<div class="overflow-x-auto border shadow-md rounded-xl">
<table class="table table-compact w-full">
<thead>
<tr>
<th></th>
<th class="text-center">
<span class="md:hidden">&#65283;</span>
<span class="hidden md:inline">Chapter</span>
</th>
<th class="text-center">
<span class="md:hidden">&#120139;</span>
<span class="hidden md:inline">Title</span>
</th>
<th class="text-center">
<span class="md:hidden">&#64;</span>
<span class="hidden md:inline">User</span>
</th>
<th class="text-right">
<span class="md:hidden">&#10226;</span>
<span class="hidden md:inline">Date</span>
</th>
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<th></th>
<?php }?>
</tr>
</thead>
<tbody>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['_lang']->value['language']['chapters'], 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<tr class="hover">
<th>
<label class="swap swap-flip">
<input type="checkbox" onchange="toggleRead(<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
);" id="readBox<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"
<?php if ($_smarty_tpl->tpl_vars['logged']->value && in_array($_smarty_tpl->tpl_vars['item']->value['id'],$_smarty_tpl->tpl_vars['readChapters']->value)) {?>checked<?php }?>>
<div class="swap-on">&#9989;</div>
<div class="swap-off">&#10060;</div>
</label>
</th>
<td>
<a href="chapter.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" class="link">
<span class="md:hidden">
<?php echo formatChapterTitle($_smarty_tpl->tpl_vars['item']->value['volume'],$_smarty_tpl->tpl_vars['item']->value['number'],"short");?>
</span>
<span class="hidden md:inline">
<?php echo formatChapterTitle($_smarty_tpl->tpl_vars['item']->value['volume'],$_smarty_tpl->tpl_vars['item']->value['number'],"full");?>
</span>
</a>
<label class="btn btn-xs" for="editChapterModal<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
">
Edit Chapter
</label>
</td>
<td>
<a href="chapter.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" class="link">
<?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</a>
</td>
<td>
<a href="profile.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['user']['id'];?>
"
class="link flex items-center text-center md:text-left">
<img src="<?php echo $_smarty_tpl->tpl_vars['item']->value['user']['avatar'];?>
" class="rounded-full h-6">
<span class="hidden md:inline md:ml-1">
<?php echo $_smarty_tpl->tpl_vars['item']->value['user']['username'];?>
</span>
</a>
</td>
<td class="text-right">
<span class="md:hidden">
<?php echo formatDate($_smarty_tpl->tpl_vars['item']->value['timestamp']);?>
</span>
<span class="hidden md:inline">
<?php echo formatDate($_smarty_tpl->tpl_vars['item']->value['timestamp'],true);?>
</span>
</td>
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<td class="text-center">
</td>
<?php }?>
</tr>
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<input type="checkbox" id="editChapterModal<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Edit Chapter</h3>
<form method="POST" name="editChapterForm<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" id="editChapterForm<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"
enctype="multipart/form-data">
<div class="grid grid-cols-1 gap-4">
<!-- Chapter Data-->
<input name="id" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['id'];?>
" hidden>
<input name="cid" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" hidden>
<input type="file" id="zip" name="zip<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"
class="border border-black file-input w-full" title="File">
<input type="number" step=".01" placeholder="Chapter" name="number"
class="input w-full border border-black" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['number'];?>
"
title="Chapter">
<input type="number" placeholder="Volume" name="volume" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['volume'];?>
"
class="input w-full border border-black" title="Volume">
<input type="text" placeholder="Chapter Title" name="title"
class="input w-full border border-black" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
" title="Title">
<select name="language" class="select w-full border border-black"
title="Language">
<option disabled selected>Select chapter language...</option>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_langs']->value, '_item', false, '_key', '_name', array (
));
$_smarty_tpl->tpl_vars['_item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['_key']->value => $_smarty_tpl->tpl_vars['_item']->value) {
$_smarty_tpl->tpl_vars['_item']->do_else = false;
?>
<option value="<?php echo $_smarty_tpl->tpl_vars['_item']->value['name'];?>
,<?php echo $_smarty_tpl->tpl_vars['_item']->value['code'];?>
,<?php echo $_smarty_tpl->tpl_vars['_item']->value['flag'];?>
"
<?php if ($_smarty_tpl->tpl_vars['item']->value['language'][1] == $_smarty_tpl->tpl_vars['_item']->value['code']) {?>selected<?php }?>>
<?php echo $_smarty_tpl->tpl_vars['_item']->value['flag'];?>
<?php echo $_smarty_tpl->tpl_vars['_item']->value['name'];?>
</option>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</select>
<progress class="progress hidden" max="100"
id="addChapterLoadingBar<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"></progress>
<!-- /Chapter Data -->
<!-- Submit, Error and Close -->
<button class="btn btn-primary btn-block btn-outline"
type="submit">Edit!</button>
<div class="text-center hidden text-error" id="editchapter<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
-result">
</div>
<!-- /Submit, Error and Close -->
</div>
</form>
<button onclick="toggleCheck('editChapterModal<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
');"
id="editChapterModal<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
Close"
class="btn btn-error btn-block mt-4">Close</button>
</div>
</div>
<?php echo '<script'; ?>
>
$("#editChapterForm<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
").submit(function(e) {
let loading = document.getElementById("addChapterLoadingBar<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
");
let text = document.getElementById("editchapter<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
-result");
loading.classList.remove("hidden");
e.preventDefault();
$.ajax({
xhr: function() {
var xhr = new window.XMLHttpRequest();
xhr.upload.addEventListener("progress", function(evt) {
if (evt.lengthComputable) {
var percentComplete = ((evt.loaded / evt.total) * 100);
loading.setAttribute("value", percentComplete);
}
}, false);
return xhr;
},
type: "POST",
url: "ajax\\chapters\\edit.php",
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
beforeSend: function() {
loading.setAttribute("value", 0);
text.classList.add("hidden");
text.innerHTML = "";
loading.classList.remove("progress-error");
loading.classList.remove("progress-success");
},
success: function(data) {
if (data != "success") {
loading.classList.add("progress-error");
text.classList.remove("hidden");
text.innerHTML = "<b>Error:</b> " + data;
} else {
loading.classList.add("progress-success");
// Now make the close button reload
document.getElementById("editChapterModal<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
Close").setAttribute("onclick", "location.reload()");
document.getElementById("editChapterModal<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
Close").setAttribute("for", "");
}
}
});
return false;
});
<?php echo '</script'; ?>
>
<?php }?>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</tbody>
</table>
</div>
<!-- /Chapter Table -->
<?php if (count($_smarty_tpl->tpl_vars['chapterLangs']->value) > 1) {?>
</div>
<?php }?>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
<!-- /Chapter Tabs -->
<?php } else { ?>
<p class="mt-4">There are no chapters at the moment!</p>
<?php }?>
</div>
<!-- /Chapters Div -->
<!-- Comments Div -->
<div class="p-4 border shadow-md rounded-xl my-4">
<h1 class="text-xl font-bold">
<span class="underline">Comments</span>
(<span id="commentsCount"><?php echo $_smarty_tpl->tpl_vars['commentsCount']->value;?>
</span>)
</h1>
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 50) {?>
<?php }?>
</div>
<!-- /Comments Div -->
<?php if ($_smarty_tpl->tpl_vars['logged']->value && $_smarty_tpl->tpl_vars['user']->value['level'] >= 75) {?>
<input type="checkbox" id="editTitleModal" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Edit Title</h3>
<form method="POST" name="editTitle" id="editTitleForm">
<div class="grid grid-cols-1 gap-4">
<!-- Cover Image -->
<input type="file" id="cover" class="border border-black file-input w-full" title="Cover">
<img src="data/covers/<?php echo $_smarty_tpl->tpl_vars['title']->value['id'];?>
.png" alt="Cover" id="imgpreview"
class="rounded-xl w-full border shadow-sm">
<!-- /Cover Image -->
<!-- Title Data-->
<input name="id" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['id'];?>
" hidden>
<input name="cover" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['cover'];?>
" hidden>
<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['title'];?>
" placeholder="Title" name="title"
class="input w-full border border-black" title="Title">
<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['alts'];?>
" placeholder="Alternate Names" name="alts"
class="input w-full border border-black" title="Alternate Names">
<label for="tagsModal" class="btn">Select Tags</label>
<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['authors2'];?>
" placeholder="Author/s (Seperate by comma)" name="authors"
class="input w-full border border-black" title="Author/s (Seperate by comma)">
<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['artists2'];?>
" placeholder="Artist/s (Seperate by comma)" name="artists"
class="input w-full border border-black" title="Artist/s (Seperate by comma)">
<input type="text" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['lang'];?>
" placeholder="Original Language" name="olang"
class="input w-full border border-black" title="Original Language">
<select name="ostatus" class="select w-full border border-black" title="Original Work Status">
<option disabled>Select original work status...</option>
<option value="1" <?php if ($_smarty_tpl->tpl_vars['title']->value['status'] == 1) {?>selected<?php }?>>Announced</option>
<option value="2" <?php if ($_smarty_tpl->tpl_vars['title']->value['status'] == 2) {?>selected<?php }?>>Releasing</option>
<option value="3" <?php if ($_smarty_tpl->tpl_vars['title']->value['status'] == 3) {?>selected<?php }?>>Hiatus</option>
<option value="4" <?php if ($_smarty_tpl->tpl_vars['title']->value['status'] == 4) {?>selected<?php }?>>Completed</option>
<option value="5" <?php if ($_smarty_tpl->tpl_vars['title']->value['status'] == 5) {?>selected<?php }?>>Cancelled</option>
</select>
<select name="sstatus" class="select w-full border border-black" title="Scanlation Status">
<option disabled>Select scanlation status...</option>
<option value="1" <?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 1) {?>selected<?php }?>>Planned</option>
<option value="2" <?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 2) {?>selected<?php }?>>Ongoing</option>
<option value="3" <?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 3) {?>selected<?php }?>>Hiatus</option>
<option value="4" <?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 4) {?>selected<?php }?>>Completed</option>
<option value="5" <?php if ($_smarty_tpl->tpl_vars['title']->value['sstatus'] == 5) {?>selected<?php }?>>Cancelled</option>
</select>
<input type="number" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['releaseYear'];?>
" placeholder="Year of Release" name="release"
class="input w-full border border-black" title="Year of Release">
<input type="number" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['completionYear'];?>
" placeholder="Year of Completion" name="completion"
class="input w-full border border-black" title="Year of Completion">
<textarea name="summary" class="textarea w-full border border-black" title="Summary"
placeholder="Summary"><?php echo $_smarty_tpl->tpl_vars['title']->value['summary2'];?>
</textarea>
<!-- /Title Data -->
<!-- Tags Modal -->
<input type="checkbox" id="tagsModal" class="modal-toggle">
<div class="modal">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Select Tags</h3>
<div class="grid grid-cols-1 gap-4">
<div>
<h4 class="font-bold text-xl text-left">Format/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_format']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="format[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"
<?php if (in_array($_smarty_tpl->tpl_vars['item']->value['id'],$_smarty_tpl->tpl_vars['title']->value['tags']['_formats'])) {?>checked<?php }?>> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Warning/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_warnings']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="warning[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"
<?php if (in_array($_smarty_tpl->tpl_vars['item']->value['id'],$_smarty_tpl->tpl_vars['title']->value['tags']['_warnings'])) {?>checked<?php }?>> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Theme/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_theme']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="theme[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"
<?php if (in_array($_smarty_tpl->tpl_vars['item']->value['id'],$_smarty_tpl->tpl_vars['title']->value['tags']['_themes'])) {?>checked<?php }?>> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<div>
<h4 class="font-bold text-xl text-left">Genre/s</h4>
<div class="grid grid-cols-2 md:grid-cols-3 gap-1">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_genre']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<label>
<input type="checkbox" name="genre[]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
"
<?php if (in_array($_smarty_tpl->tpl_vars['item']->value['id'],$_smarty_tpl->tpl_vars['title']->value['tags']['_genres'])) {?>checked<?php }?>> <?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</label>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
</div>
<label for="tagsModal" class="btn btn-success">Close</label>
</div>
</div>
</div>
<!-- /Tags Modal -->
<!-- Submit, Error and Close -->
<button class="btn btn-primary btn-block btn-outline" type="submit">Edit!</button>
<div class="text-center hidden text-error" id="edittitle-result"></div>
<label for="editTitleModal" class="btn btn-error btn-block">Cancel</label>
<!-- /Submit, Error and Close -->
</div>
</form>
</div>
</div>
<input type="checkbox" id="addChapterModal" class="modal-toggle">
<div class="modal modal-bottom sm:modal-middle">
<div class="modal-box">
<h3 class="font-bold text-2xl text-center mb-4 underline">Add Chapter</h3>
<form method="POST" name="addChapter" id="addChapterForm" enctype="multipart/form-data">
<div class="grid grid-cols-1 gap-4">
<!-- Chapter Data-->
<input name="id" value="<?php echo $_smarty_tpl->tpl_vars['title']->value['id'];?>
" hidden>
<input type="file" id="zip" name="zip" class="border border-black file-input w-full">
<input type="number" step=".01" id="chapterNumber" placeholder="Chapter" name="number"
class="input w-full border border-black" title="Chapter">
<input type="number" id="volumeNumber" placeholder="Volume" name="volume"
class="input w-full border border-black" title="Volume">
<input type="text" id="chTitle" placeholder="Chapter Title" name="title"
class="input w-full border border-black" title="Title">
<select name="language" class="select w-full border border-black" title="Language">
<option disabled selected>Select chapter language...</option>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['upl_langs']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<option value="<?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
,<?php echo $_smarty_tpl->tpl_vars['item']->value['code'];?>
,<?php echo $_smarty_tpl->tpl_vars['item']->value['flag'];?>
">
<?php echo $_smarty_tpl->tpl_vars['item']->value['flag'];?>
<?php echo $_smarty_tpl->tpl_vars['item']->value['name'];?>
</option>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</select>
<progress class="progress hidden" max="100" id="addChapterLoadingBar"></progress>
<!-- /Chapter Data -->
<!-- Submit, Error and Close -->
<button class="btn btn-primary btn-block btn-outline" type="submit">Add!</button>
<div class="text-center hidden text-error" id="addchapter-result"></div>
<!-- /Submit, Error and Close -->
</div>
</form>
<button onclick="toggleCheck('addChapterModal');" id="addChapterModalClose"
class="btn btn-error btn-block mt-4">Close</button>
</div>
</div>
<?php echo '<script'; ?>
>
$(function() {
$("#cover").change(function(e) {
e.preventDefault();
var fd = new FormData();
var files = $("#cover")[0].files;
if (files.length > 0) {
fd.append("cover", files[0]);
$.ajax({
type: "POST",
url: "ajax\\images\\tmp.php",
data: fd,
contentType: false,
processData: false,
success: function(msg) {
let result = JSON.parse(msg);
if (result.s == true) {
let preview = document.getElementById("imgpreview");
//preview.classList.remove("hidden");
preview.src = "data/tmp/" + result.msg;
document.querySelector("input[name='cover']").value =
result.msg;
} else {
alert(result.msg);
}
}
});
}
});
});
$("#cover").change(function(e) {
var allowedTypes = ["image/jpeg", "image/jpg", "image/png", "image/webp"];
var file = this.files[0];
var fileType = file.type;
if (!allowedTypes.includes(fileType)) {
alert("Upload only supports JPG, JPEG, PNG and WEBP!");
$("#cover").val("");
return false;
}
});
$("#editTitleForm").submit(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "ajax\\titles\\edit.php",
data: $(this).serialize(),
success: function(data) {
let result = JSON.parse(data);
if (result.s == true) {
//let text = document.getElementById("addtitle-result");
//text.classList.add("hidden");
window.location.replace("title.php?id=" + result.msg);
// Redirect to Title?
} else {
let text = document.getElementById("edittitle-result");
text.classList.remove("hidden");
text.innerHTML = "<b>Error:</b> " + result.msg;
}
}
});
return false;
});
$("#addChapterForm").submit(function(e) {
let loading = document.getElementById("addChapterLoadingBar");
let text = document.getElementById("addchapter-result");
loading.classList.remove("hidden");
e.preventDefault();
$.ajax({
xhr: function() {
var xhr = new window.XMLHttpRequest();
xhr.upload.addEventListener("progress", function(evt) {
if (evt.lengthComputable) {
var percentComplete = ((evt.loaded / evt.total) * 100);
loading.setAttribute("value", percentComplete);
}
}, false);
return xhr;
},
type: "POST",
url: "ajax\\chapters\\add.php",
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
beforeSend: function() {
loading.setAttribute("value", 0);
text.classList.add("hidden");
text.innerHTML = "";
loading.classList.remove("progress-error");
loading.classList.remove("progress-success");
},
success: function(data) {
if (data != "success") {
loading.classList.add("progress-error");
text.classList.remove("hidden");
text.innerHTML = "<b>Error:</b> " + data;
} else {
loading.classList.add("progress-success");
let chIn = document.getElementById("chapterNumber");
let volIn = document.getElementById("volumeNumber");
let allChs = document.getElementById("chapterCount");
let chNum = (Number(chIn.value) + 1).toFixed(2);
let volNum = Number(volIn.value);
let chNos = Number(allChs.innerHTML) + 1;
// Reset Form
document.getElementById("chTitle").value = "";
document.getElementById("zip").value = "";
// Set all values for next chapter
chIn.value = chNum;
volIn.value = volNum;
allChs.innerHTML = chNos;
// Now make the close button reload
document.getElementById("addChapterModalClose").setAttribute("onclick",
"location.reload()");
document.getElementById("addChapterModalClose").setAttribute("for", "");
}
}
});
return false;
});
<?php echo '</script'; ?>
>
<?php }
}
}

View File

@ -1,151 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-02-13 21:26:25
from 'C:\xamppx\htdocs\fsx\library\themes\nucleus\pages\releases.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63ea9cf1e4e560_84552480',
'has_nocache_code' => false,
'file_dependency' =>
array (
'f8c86d31bf2cd189b910db90a62de7ade7cf3973' =>
array (
0 => 'C:\\xamppx\\htdocs\\fsx\\library\\themes\\nucleus\\pages\\releases.tpl',
1 => 1676319978,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_63ea9cf1e4e560_84552480 (Smarty_Internal_Template $_smarty_tpl) {
?><!-- Chapters Div -->
<div class="p-4 border shadow-md rounded-xl my-4">
<h1 class="mb-4 font-bold text-2xl">
Releases - Page <?php echo $_smarty_tpl->tpl_vars['page']->value;?>
</h1>
<?php if (!empty($_smarty_tpl->tpl_vars['chapters']->value)) {?>
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 xl:grid-cols-6 gap-4">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['chapters']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<div class="w-full grid grid-cols-3 gap-2 border rounded-xl shadow-md">
<div class="col-span-1 p-2">
<a href="title.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['id'];?>
">
<img src="data/covers/<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['id'];?>
.png" alt="Cover" class="w-full rounded-md border shadow-md">
</a>
</div>
<div class="col-span-2 py-2 pr-2">
<p class="font-bold text-md">
<a href="title.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['id'];?>
" class="link" title="<?php echo $_smarty_tpl->tpl_vars['item']->value['title']['title'];?>
">
<span class="md:hidden">
<?php echo shorten($_smarty_tpl->tpl_vars['item']->value['title']['title'],10);?>
</span>
<span class="hidden md:block lg:hidden">
<?php echo shorten($_smarty_tpl->tpl_vars['item']->value['title']['title'],18);?>
</span>
<span class="hidden lg:block xl:hidden">
<?php echo shorten($_smarty_tpl->tpl_vars['item']->value['title']['title'],13);?>
</span>
<span class="hidden xl:block 2xl:hidden">
<?php echo shorten($_smarty_tpl->tpl_vars['item']->value['title']['title'],14);?>
</span>
<span class="hidden 2xl:block">
<?php echo shorten($_smarty_tpl->tpl_vars['item']->value['title']['title'],17);?>
</span>
</a>
</p>
<div class="text-sm">
<p>
<a href="chapter.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" class="flex items-center gap-2 link" title="<?php echo formatChapterTitle($_smarty_tpl->tpl_vars['item']->value['volume'],$_smarty_tpl->tpl_vars['item']->value['number'],"full");?>
">
<img src="https://flagcdn.com/16x12/<?php echo $_smarty_tpl->tpl_vars['item']->value['language'][1];?>
.png" alt="<?php echo $_smarty_tpl->tpl_vars['item']->value['language'][2];?>
"
class="h-3">
<?php echo formatChapterTitle($_smarty_tpl->tpl_vars['item']->value['volume'],$_smarty_tpl->tpl_vars['item']->value['number']);?>
</a>
</p>
<p>
<a href="profile.php?id=<?php echo $_smarty_tpl->tpl_vars['item']->value['user']['id'];?>
"
class="link flex items-center text-center md:text-left">
<img src="<?php echo $_smarty_tpl->tpl_vars['item']->value['user']['avatar'];?>
" class="rounded-full h-5">
<span class="ml-1">
<?php echo $_smarty_tpl->tpl_vars['item']->value['user']['username'];?>
</span>
</a>
</p>
<p>
<?php echo timeAgo($_smarty_tpl->tpl_vars['item']->value['timestamp']);?>
</p>
</div>
</div>
</div>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
<?php } else { ?>
<p>There are no Chapters on this page!</p>
<?php }?>
<?php if (!empty($_smarty_tpl->tpl_vars['pagis']->value)) {?>
<!-- Pagination Div -->
<div class="btn-group mx-auto pt-4">
<?php if ($_smarty_tpl->tpl_vars['page']->value > 1) {?>
<a href="?page=1" class="btn btn-sm md:btn-md shadow-md">«</a>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['page']->value-1;?>
" class="btn btn-sm md:btn-md shadow-md"></a>
<?php }?>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['pagis']->value, 'item', false, 'key', 'name', array (
));
$_smarty_tpl->tpl_vars['item']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->do_else = false;
?>
<?php if ($_smarty_tpl->tpl_vars['page']->value != $_smarty_tpl->tpl_vars['item']->value) {?>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['item']->value;?>
" class="btn btn-sm md:btn-md shadow-md"><?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</a>
<?php } else { ?>
<span class="btn btn-active btn-sm md:btn-md shadow-md"><?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</span>
<?php }?>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<?php if ($_smarty_tpl->tpl_vars['page']->value < $_smarty_tpl->tpl_vars['totalPages']->value) {?>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['page']->value+1;?>
" class="btn btn-sm md:btn-md shadow-md"></a>
<a href="?page=<?php echo $_smarty_tpl->tpl_vars['totalPages']->value;?>
" class="btn btn-sm md:btn-md shadow-md">»</a>
<?php }?>
</div>
<!-- /Pagination Div -->
<?php }?>
</div>
<!-- /Chapters Div --><?php }
}

View File

@ -1,27 +0,0 @@
<?php
/* Smarty version 4.3.0, created on 2023-01-25 20:25:20
from '/var/www/html/FSX/library/themes/nucleus/pages/index.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.0',
'unifunc' => 'content_63d1822002b986_66782177',
'has_nocache_code' => false,
'file_dependency' =>
array (
'fb2d025cb6fc7f3da12b413c6164269ebd543fde' =>
array (
0 => '/var/www/html/FSX/library/themes/nucleus/pages/index.tpl',
1 => 1674228890,
2 => 'file',
),
),
'includes' =>
array (
'file:../parts/menu.tpl' => 1,
),
),false)) {
function content_63d1822002b986_66782177 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_subTemplateRender("file:../parts/menu.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
}
}