Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
HirotakaDango authored Jul 1, 2024
1 parent ef59d52 commit c60607d
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 217 deletions.
4 changes: 4 additions & 0 deletions characters.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
header("Location: /characters/");
exit();
?>
4 changes: 4 additions & 0 deletions groups.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
header("Location: /groups/");
exit();
?>
8 changes: 4 additions & 4 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
<i class="bi bi-card-text fs-5"></i>
<span class="d-md-none d-lg-inline d-lg-none">Status</span>
</a>
<a class="btn bg-body-tertiary border-0 link-body-emphasis rounded-4 fw-bold p-3 w-50 d-flex justify-content-center align-items-center text-center flex-column <?php if(basename($_SERVER['PHP_SELF']) == 'tags.php') echo 'opacity-75 shadow' ?>" href="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; ?>/tags.php">
<a class="btn bg-body-tertiary border-0 link-body-emphasis rounded-4 fw-bold p-3 w-50 d-flex justify-content-center align-items-center text-center flex-column <?php if (basename($_SERVER['PHP_SELF']) == 'index.php' && strpos($_SERVER['PHP_SELF'], 'tags/') !== false) echo 'opacity-75 shadow'; ?>" href="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; ?>/tags.php">
<i class="bi bi-tags-fill fs-5"></i>
<span class="d-md-none d-lg-inline d-lg-none">Tags</span>
</a>
Expand All @@ -242,7 +242,7 @@
<i class="bi bi-compass-fill fs-5"></i>
<span class="d-md-none d-lg-inline d-lg-none">Explore</span>
</a>
<a class="btn bg-body-tertiary border-0 link-body-emphasis rounded-4 fw-bold p-3 w-50 d-flex justify-content-center align-items-center text-center flex-column <?php if(basename($_SERVER['PHP_SELF']) == 'users.php') echo 'opacity-75 shadow' ?>" href="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; ?>/users.php">
<a class="btn bg-body-tertiary border-0 link-body-emphasis rounded-4 fw-bold p-3 w-50 d-flex justify-content-center align-items-center text-center flex-column <?php if (basename($_SERVER['PHP_SELF']) == 'index.php' && strpos($_SERVER['PHP_SELF'], 'users/') !== false) echo 'opacity-75 shadow'; ?>" href="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; ?>/users.php">
<i class="bi bi-people-fill fs-5"></i>
<span class="d-md-none d-lg-inline d-lg-none">Users</span>
</a>
Expand Down Expand Up @@ -323,7 +323,7 @@
<i class="bi bi-card-text fs-5"></i>
<span class="d-lg-inline">Status</span>
</a>
<a class="btn bg-body-tertiary border-0 link-body-emphasis rounded-3 fw-bold p-3 w-50 d-flex justify-content-center align-items-center text-center flex-column <?php if(basename($_SERVER['PHP_SELF']) == 'tags.php') echo 'opacity-75 shadow' ?>" href="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; ?>/tags.php">
<a class="btn bg-body-tertiary border-0 link-body-emphasis rounded-3 fw-bold p-3 w-50 d-flex justify-content-center align-items-center text-center flex-column <?php if (basename($_SERVER['PHP_SELF']) == 'index.php' && strpos($_SERVER['PHP_SELF'], 'tags/') !== false) echo 'opacity-75 shadow'; ?>" href="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; ?>/tags.php">
<i class="bi bi-tags-fill fs-5"></i>
<span class="d-lg-inline">Tags</span>
</a>
Expand All @@ -333,7 +333,7 @@
<i class="bi bi-compass-fill fs-5"></i>
<span class="d-lg-inline">Explore</span>
</a>
<a class="btn bg-body-tertiary border-0 link-body-emphasis rounded-3 fw-bold p-3 w-50 d-flex justify-content-center align-items-center text-center flex-column <?php if(basename($_SERVER['PHP_SELF']) == 'users.php') echo 'opacity-75 shadow' ?>" href="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; ?>/users.php">
<a class="btn bg-body-tertiary border-0 link-body-emphasis rounded-3 fw-bold p-3 w-50 d-flex justify-content-center align-items-center text-center flex-column <?php if (basename($_SERVER['PHP_SELF']) == 'index.php' && strpos($_SERVER['PHP_SELF'], 'users/') !== false) echo 'opacity-75 shadow'; ?>" href="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; ?>/users.php">
<i class="bi bi-people-fill fs-5"></i>
<span class="d-lg-inline">Users</span>
</a>
Expand Down
4 changes: 4 additions & 0 deletions parodies.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
header("Location: /parodies/");
exit();
?>
33 changes: 32 additions & 1 deletion simple_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ function myFunction1() {
<!-- Parodies -->
<?php if (isset($image['parodies']) && !empty($image['parodies'])): ?>
<h6 class="card-subtitle mb-2 fw-bold"><i class="bi bi-journals"></i> Parodies</h6>
<div class="d-flex flex-wrap gap-2">
<div class="d-flex flex-wrap gap-2 mb-3">
<?php
if (!empty($image['parodies'])) {
$parodies = explode(',', $image['parodies']);
Expand All @@ -1221,6 +1221,37 @@ function myFunction1() {
?>
</div>
<?php endif; ?>

<!-- Group -->
<?php if (isset($image['group']) && !empty($image['group'])): ?>
<h6 class="card-subtitle mb-2 fw-bold"><i class="bi bi-person-fill"></i> group</h6>
<div class="d-flex flex-wrap gap-2">
<?php
if (!empty($image['group'])) {
$group = explode(',', $image['group']);
foreach ($group as $group) {
$group = trim($group);
if (!empty($group)) {
$query = "SELECT COUNT(*) FROM images WHERE `group` LIKE :group";
$groupParam = '%' . $group . '%';
$stmt = $db->prepare($query);
$stmt->bindParam(':group', $groupParam);
$stmt->execute();

$groupCount = $stmt->fetchColumn();
?>
<a href="group/?group=<?php echo urlencode($group); ?>" class="badge bg-dark text-decoration-none rounded-4 py-2">
<i class="bi bi-person-fill"></i> <?php echo htmlspecialchars($group); ?> <span class="badge bg-light text-dark"><?php echo $groupCount; ?></span>
</a>
<?php
}
}
} else {
echo "<p class='text-muted'>No group available.</p>";
}
?>
</div>
<?php endif; ?>
</div>
</div>
<div class="collapse" id="collapseExample">
Expand Down
213 changes: 3 additions & 210 deletions tags.php
Original file line number Diff line number Diff line change
@@ -1,211 +1,4 @@
<?php
require_once('auth.php');

// Connect to the SQLite database
$db = new SQLite3('database.sqlite');

// Get user's email from session or wherever it's stored
$email = $_SESSION['email'];
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>All Tags</title>
<link rel="icon" type="image/png" href="icon/favicon.png">
<?php include('bootstrapcss.php'); ?>
</head>
<body>
<?php include('header.php'); ?>
<?php include('taguserheader.php'); ?>
<div class="dropdown">
<button class="btn btn-sm fw-bold rounded-pill ms-2 mb-2 btn-outline-dark dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-images"></i> sort by
</button>
<ul class="dropdown-menu">
<li><a href="?by=ascending&category=<?php echo isset($_GET['category']) ? $_GET['category'] : 'A'; ?>&page=<?php echo isset($_GET['page']) ? $_GET['page'] : '1'; ?>" class="dropdown-item fw-bold <?php if(!isset($_GET['by']) || $_GET['by'] == 'ascending') echo 'active'; ?>">ascending</a></li>
<li><a href="?by=descending&category=<?php echo isset($_GET['category']) ? $_GET['category'] : 'A'; ?>&page=<?php echo isset($_GET['page']) ? $_GET['page'] : '1'; ?>" class="dropdown-item fw-bold <?php if(isset($_GET['by']) && $_GET['by'] == 'descending') echo 'active'; ?>">descending</a></li>
<li><a href="?by=popular&category=<?php echo isset($_GET['category']) ? $_GET['category'] : 'A'; ?>&page=<?php echo isset($_GET['page']) ? $_GET['page'] : '1'; ?>" class="dropdown-item fw-bold <?php if(isset($_GET['by']) && $_GET['by'] == 'popular') echo 'active'; ?>">popular</a></li>
<li><a href="?by=view&category=<?php echo isset($_GET['category']) ? $_GET['category'] : 'A'; ?>&page=<?php echo isset($_GET['page']) ? $_GET['page'] : '1'; ?>" class="dropdown-item fw-bold <?php if(isset($_GET['by']) && $_GET['by'] == 'view') echo 'active'; ?>">most viewed</a></li>
<li><a href="?by=least&category=<?php echo isset($_GET['category']) ? $_GET['category'] : 'A'; ?>&page=<?php echo isset($_GET['page']) ? $_GET['page'] : '1'; ?>" class="dropdown-item fw-bold <?php if(isset($_GET['by']) && $_GET['by'] == 'least') echo 'active'; ?>">least viewed</a></li>
<li><a href="?by=liked&category=<?php echo isset($_GET['category']) ? $_GET['category'] : 'A'; ?>&page=<?php echo isset($_GET['page']) ? $_GET['page'] : '1'; ?>" class="dropdown-item fw-bold <?php if(isset($_GET['by']) && $_GET['by'] == 'liked') echo 'active'; ?>">liked</a></li>
</ul>
</div>
<?php
if(isset($_GET['by'])){
$sort = $_GET['by'];

switch ($sort) {
case 'ascending':
include "tags_asc.php";
break;
case 'descending':
include "tags_desc.php";
break;
case 'popular':
include "tags_pop.php";
break;
case 'view':
include "tags_view.php";
break;
case 'least':
include "tags_least.php";
break;
case 'liked':
include "tags_like.php";
break;
}
}
else {
include "tags_asc.php"; // Include ascending by default
}

?>
<button class="z-3 btn btn-primary btn-md rounded-pill fw-bold position-fixed bottom-0 end-0 m-2" id="scrollToTopBtn" onclick="scrollToTop()"><i class="bi bi-chevron-up" style="-webkit-text-stroke: 3px;"></i></button>
<script>
// Show or hide the button based on scroll position
window.onscroll = function() {
showScrollButton();
};

// Function to show or hide the button based on scroll position
function showScrollButton() {
var scrollButton = document.getElementById("scrollToTopBtn");
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
scrollButton.style.display = "block";
} else {
scrollButton.style.display = "none";
}
}

// Function to scroll to the top of the page
function scrollToTop() {
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE, and Opera
}
</script>
<script>
function updatePlaceholder(input) {
input.setAttribute('placeholder', input.value.trim() !== '' ? input.value.trim() : 'Search by tags or title');
}
</script>
<script>
let lazyloadImages = document.querySelectorAll(".lazy-load");
let imageContainer = document.getElementById("image-container");

// Set the default placeholder image
const defaultPlaceholder = "icon/bg.png";

if ("IntersectionObserver" in window) {
let imageObserver = new IntersectionObserver(function(entries, observer) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
let image = entry.target;
image.src = image.dataset.src;
imageObserver.unobserve(image);
}
});
});

lazyloadImages.forEach(function(image) {
image.src = defaultPlaceholder; // Apply default placeholder
imageObserver.observe(image);
image.style.filter = "blur(5px)"; // Apply initial blur to all images

// Remove blur and apply custom blur to NSFW images after they load
image.addEventListener("load", function() {
image.style.filter = ""; // Remove initial blur
if (image.classList.contains("nsfw")) {
image.style.filter = "blur(4px)"; // Apply blur to NSFW images

// Add overlay with icon and text
let overlay = document.createElement("div");
overlay.classList.add("overlay", "rounded");
let icon = document.createElement("i");
icon.classList.add("bi", "bi-eye-slash-fill", "text-white");
overlay.appendChild(icon);
let text = document.createElement("span");
text.textContent = "R-18";
text.classList.add("shadowed-text", "fw-bold", "text-white");
overlay.appendChild(text);
image.parentNode.appendChild(overlay);
}
});
});
} else {
let lazyloadThrottleTimeout;

function lazyload() {
if (lazyloadThrottleTimeout) {
clearTimeout(lazyloadThrottleTimeout);
}
lazyloadThrottleTimeout = setTimeout(function() {
let scrollTop = window.pageYOffset;
lazyloadImages.forEach(function(img) {
if (img.offsetTop < window.innerHeight + scrollTop) {
img.src = img.dataset.src;
img.classList.remove("lazy-load");
}
});
lazyloadImages = Array.from(lazyloadImages).filter(function(image) {
return image.classList.contains("lazy-load");
});
if (lazyloadImages.length === 0) {
document.removeEventListener("scroll", lazyload);
window.removeEventListener("resize", lazyload);
window.removeEventListener("orientationChange", lazyload);
}
}, 20);
}

document.addEventListener("scroll", lazyload);
window.addEventListener("resize", lazyload);
window.addEventListener("orientationChange", lazyload);
}

// Infinite scrolling
let loading = false;

function loadMoreImages() {
if (loading) return;
loading = true;

// Simulate loading delay for demo purposes
setTimeout(function() {
for (let i = 0; i < 10; i++) {
if (lazyloadImages.length === 0) {
break;
}
let image = lazyloadImages[0];
imageContainer.appendChild(image);
lazyloadImages = Array.from(lazyloadImages).slice(1);
}
loading = false;
}, 1000);
}

window.addEventListener("scroll", function() {
if (window.innerHeight + window.scrollY >= imageContainer.clientHeight) {
loadMoreImages();
}
});

// Initial loading
loadMoreImages();
</script>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('../sw.js').then(function(registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function(err) {
console.log('ServiceWorker registration failed: ', err);
});
});
}
</script>
<?php include('bootstrapjs.php'); ?>
</body>
</html>
header("Location: /tags/");
exit();
?>
4 changes: 4 additions & 0 deletions users.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
header("Location: /users/");
exit();
?>
Loading

0 comments on commit c60607d

Please sign in to comment.