This commit is contained in:
2025-02-05 03:51:15 +05:30
parent c4c8ba334e
commit 7977ddc04e
31 changed files with 643 additions and 513 deletions

BIN
htdocs/.DS_Store vendored

Binary file not shown.

View File

@@ -1,9 +1,6 @@
Options -Indexes
RewriteEngine On
# Check if the request is not for an existing directory or file
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php)
RewriteCond %{REQUEST_FILENAME} !-f
# Rewrite all other URLs to index.php with the 'url' parameter
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

View File

@@ -1,5 +1,7 @@
<?php
session_start();
error_reporting(E_ALL);
ini_set('display_errors', 1);
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
@@ -11,7 +13,7 @@ if (!isset($_SESSION['user_id'])) {
<head>
<meta charset="UTF-8">
<meta charset="UTF-8">
<title>Dashboard</title>
<title>Account</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Xeorl - The All-In-One, Fully Free to Use Advanced Link Shortener and Management Tool - Equipped with Multi-layered URL encryption, URL metadata remover, Mass shrinker, Quick link and Many more! - Powered by @xodivorce...">
<link rel="icon" type="image/png" href="./assets/images/favicon-96x96.png" sizes="96x96" />
@@ -23,8 +25,7 @@ if (!isset($_SESSION['user_id'])) {
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/_home.css">
<link rel="stylesheet" href="assets/css/_dashboard.css">
<link rel="stylesheet" href="assets/css/_monetization.css">
</head>
<body>
<?php include "assets/_header.php"; ?>

Binary file not shown.

View File

@@ -0,0 +1,39 @@
<?php
if (isset($_POST['acceptCookies'])) {
setcookie("user_cookies", "accepted", time() + (86400 * 30), "/");
exit;
} elseif (isset($_POST['rejectCookies'])) {
setcookie("user_cookies", "rejected", time() + (86400 * 30), "/");
exit;
}
?>
<link rel="stylesheet" href="_cookies.css">
<div id="cookieBanner">
<p>By clicking "Accept All Cookies", you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.</p>
<button class="cookie-settings">Cookies Settings</button>
<button class="reject" onclick="setCookieChoice('reject')">Reject All</button>
<button class="accept" onclick="setCookieChoice('accept')">Accept All Cookies</button>
<span class="close" onclick="hideBanner()">×</span>
</div>
<script>
function setCookieChoice(choice) {
fetch("_cookies.php", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: choice === "accept" ? "acceptCookies=true" : "rejectCookies=true"
}).then(() => {
document.getElementById("cookieBanner").style.display = "none";
});
}
function hideBanner() {
document.getElementById("cookieBanner").style.display = "none";
}
window.onload = function() {
if (!document.cookie.includes("user_cookies")) {
document.getElementById("cookieBanner").style.display = "flex";
}
};
</script>

View File

@@ -6,33 +6,50 @@ if (session_status() === PHP_SESSION_NONE) {
<link rel="stylesheet" href="assets/css/_header.css">
<header class="header">
<div class="header-container" style="user-select: none;">
<div class="logo">
<img src="assets/images/url.png" alt="Xeorl Logo" class="logo-img">
<span>Xeorl</span>
<span class="version-number">4.1.4</span>
<div class="header-container" style="user-select: none;">
<div class="logo">
<img src="assets/images/url.png" alt="Xeorl Logo" class="logo-img">
<span>Xeorl</span>
<span class="version-number">4.1.4</span>
</div>
<!-- Burger Menu -->
<label class="burger">
<input type="checkbox" id="burger-toggle">
<span></span>
<span></span>
<span></span>
</label>
<!-- Sidebar -->
<div class="sidebar">
<nav>
<ul>
<li><a href="home.php" class="<?php echo in_array(basename($_SERVER['PHP_SELF']), ['index.php', 'home.php']) ? 'active disabled' : ''; ?>">Home</a></li>
<li><a href="monetization.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'monetization.php' ? 'active disabled' : ''; ?>">Monetization</a></li>
<?php if (isset($_SESSION['user_id'])): ?>
<li><a href="account.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'account.php' ? 'active disabled' : ''; ?>">Account</a></li>
<?php else: ?>
<li><a href="login.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'login.php' ? 'active disabled' : ''; ?>">Get-Started</a></li>
<?php endif; ?>
<li><a href="contact.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'contact.php' ? 'active disabled' : ''; ?>">Contact</a></li>
</ul>
</nav>
</div>
<!-- Regular Navigation (Hidden on Mobile) -->
<nav>
<ul>
<li><a href="home.php" class="<?php echo in_array(basename($_SERVER['PHP_SELF']), ['index.php', 'home.php']) ? 'active disabled' : ''; ?>">Home</a></li>
<li><a href="monetization.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'monetization.php' ? 'active disabled' : ''; ?>">Monetization</a></li>
<?php if (isset($_SESSION['user_id'])): ?>
<li><a href="account.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'account.php' ? 'active disabled' : ''; ?>">Account</a></li>
<?php else: ?>
<li><a href="login.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'login.php' ? 'active disabled' : ''; ?>">Get-Started</a></li>
<?php endif; ?>
<li><a href="contact.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'contact.php' ? 'active disabled' : ''; ?>">Contact</a></li>
</ul>
</nav>
</div>
<label class="burger" for="burger">
<input type="checkbox" id="burger">
<span></span>
<span></span>
<span></span>
</label> <!-- Hamburger Menu -->
<nav>
<ul>
<li><a href="index.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'index.php' ? 'active disabled' : ''; ?>">Home</a></li>
<li><a href="monetization.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'monetization.php' ? 'active disabled' : ''; ?>">Monetization</a></li>
<?php if (isset($_SESSION['user_id'])): ?>
<!-- Show Account if user is logged in -->
<li><a href="account.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'account.php' ? 'active disabled' : ''; ?>">Account</a></li>
<?php else: ?>
<!-- Show Get-Started if user is not logged in -->
<li><a href="login.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'login.php' ? 'active disabled' : ''; ?>">Get-Started</a></li>
<?php endif; ?>
<li><a href="contact.php" class="<?php echo basename($_SERVER['PHP_SELF']) == 'contact.php' ? 'active disabled' : ''; ?>">Contact</a></li>
</ul>
</nav>
</div>
</header>
<script src="assets/js/_header.js"> </script>

View File

@@ -1,12 +1,120 @@
/* General Styles */
body {
font-family: "Montserrat", sans-serif;
margin: 0;
padding: 0;
display: flex;
height: 100vh;
background-color: #ffffff;
color: #333333;
color: #111313;
}
main {
padding: 60px 20px;
text-align: center;
}
/* User Image */
.user-image {
width: 40px;
height: 40px;
margin-top: -5px;
border-radius: 50%;
margin-left: 25px;
border: 1px solid #ffffff;
}
/* Sidebar Styles */
.sidebar {
width: 20%;
background-color: #ffffff;
color: #98E5DD;
display: flex;
flex-direction: column;
border: solid 1px rgb(58, 66, 65);
padding: 20px;
}
/* Sidebar Header (Flexbox) */
.sidebar .sidebar-header {
display: flex;
flex-wrap: wrap; /* Allows wrapping when screen is small */
align-items: center; /* Ensures vertical alignment */
margin-left: -25px;
margin-right: -20px;
margin-top: 45px;
}
/* Image & Text Flexbox */
.sidebar .sidebar-header .user-image {
width: 40px;
height: 40px;
border-radius: 50%;
margin-right: 10px;
}
.user-info {
font-size: 14px;
margin-bottom: 20px;
line-height: 1.4;
color: #171c24;
}
.user-email {
color: #677583;
}
/* Sidebar Links */
.sidebar a {
text-decoration: none;
color: #171c24;
padding: 15px;
display: block;
font-size: 16px;
transition: background-color 0.3s ease; /* Keep only background-color for transition */
}
/* Main Content */
.content {
width: 80%;
padding: 20px;
}
.content h2, .content h3 {
color: #EEB58F;
}
/* Responsive Design */
@media screen and (max-width: 768px) {
body {
flex-direction: column;
}
.sidebar {
width: 100%;
height: auto;
display: flex;
flex-direction: row;
justify-content: space-around;
padding: 10px;
}
.sidebar .sidebar-header {
justify-content: flex-start;
text-align: center;
margin-left: 0;
margin-right: 0;
}
.sidebar .sidebar-header .user-image {
margin-left: 0;
margin-right: 10px;
}
.user-info {
font-size: 12px;
text-align: left;
}
.content {
width: 100%;
padding: 20px;
}
}

View File

@@ -0,0 +1,47 @@
#cookieBanner {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background: white;
box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
padding: 15px;
display: flex;
align-items: center;
justify-content: space-between;
font-family: Arial, sans-serif;
z-index: 10;
}
#cookieBanner p {
font-size: 14px;
color: #333;
margin: 0;
flex: 1;
}
button {
padding: 10px 15px;
border: 1px solid #002147;
cursor: pointer;
font-size: 14px;
border-radius: 4px;
margin: 0 5px;
}
.cookie-settings {
background: white;
color: #002147;
}
.reject, .accept {
background: #002147;
color: white;
}
.close {
font-size: 18px;
font-weight: bold;
cursor: pointer;
margin-left: 10px;
}

View File

@@ -120,11 +120,12 @@ nav ul li a.disabled {
.burger span {
display: block;
position: absolute;
height: 2.3px;
height: 2px;
width: 100%;
background: black;
background: #000;
border-radius: 9px;
opacity: 1;
z-index: 2;
left: 0;
transform: rotate(0deg);
transition: .25s ease-in-out;
@@ -164,18 +165,60 @@ nav ul li a.disabled {
left: 5px;
}
.sidebar {
position: absolute;
top: 0;
width: 100%;
height: 100vh;
background-color: #ffffff;
text-align: center;
align-items: center;
justify-content: center;
display: flex;
z-index: 1;
transition: right 0.3s ease-in-out;
padding: 20px;
}
/* Show sidebar when active */
.sidebar.active {
right: 0;
}
.sidebar ul {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 14px;
}
.sidebar ul li a {
text-decoration: none;
color: #5e6775;
font-size: 18px;
font-weight: 500;
transition: color 0.3s;
}
.sidebar ul li a:hover {
color: #272B2F;
}
/* Adjust position of the hamburger menu */
@media (max-width: 768px) {
.burger {
display: block;
margin-left: auto;
margin-right: 15px;
margin-right: 15px;
}
nav ul {
display: none;
}
.burger input:checked ~ nav ul {
display: flex;
flex-direction: column;
@@ -187,6 +230,13 @@ nav ul li a.disabled {
border-top: 1px solid #F2F2F2;
padding: 10px 0;
}
.burger input:checked ~ .sidebar {
display: block;
left: 0;
}
.sidebar {
width: 100%;
}
}
/* Adjust the logo alignment */
@@ -203,11 +253,14 @@ nav ul li a.disabled {
}
}
@media (max-width: 450px) {
@media (max-width: 485px) {
.burger {
display: block;
margin-left: auto;
margin-right: 25px;
}
.sidebar {
width: 100%;
}
}

View File

@@ -232,13 +232,12 @@ main {
.stat-icon {
width: 35px;
height: 35px;
margin-bottom: 15px;
}
.stat-item h3 {
font-size: 16px;
color: #677583;
margin-bottom: 10px;
margin-bottom: 15px;
font-weight: 600;
}

View File

@@ -0,0 +1,141 @@
body {
font-family: "Montserrat", sans-serif;
background: #ffffff;
margin: 0;
padding: 0;
}
.max-container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
width: 100%;
}
.container {
background: white;
padding: 100px;
margin-top: 50px;
border-radius: 12px;
box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
text-align: center;
width: 750px;
border-top: 5px solid #652bf6;
min-height: 350px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
h2 {
font-size: 32px;
color: rgb(43, 35, 76);
font-weight: 400;
margin-bottom: 15px;
}
.countdown-wrapper {
width: 100px;
height: 100px;
border: 2px solid rgb(70, 41, 204);
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
margin: 20px auto;
position: relative;
}
.countdown {
font-size: 16px;
font-weight: 400;
margin-top: -px;
color: rgb(70, 41, 204);
text-align: center;
}
.countdown span {
font-size: 25px;
font-weight: 400;
color: rgb(70, 41, 204);
text-align: center;
}
button {
padding: 17px 40px;
border-radius: 50px;
cursor: pointer;
border: 0;
background-color: rgb(103, 204, 129);
box-shadow: rgba(68, 68, 68, 0.572) 3px 2px 10px 0px;
color: #ffffff;
font-weight: 600;
text-transform: uppercase;
cursor: not-allowed;
font-size: 15px;
transition: all 0.5s ease;
}
button:active {
box-shadow: rgba(68, 68, 68, 0.572) 3px 2px 10px 0px;
cursor: pointer;
}
@media (max-width: 1170px){
.container{
width: 650px;
}
}
@media (max-width: 1024px){
.container{
width: 500px;
}
}
@media (max-width: 768px) {
.container {
padding: 40px 20px;
width: 85%;
}
h2 {
font-size: 26px;
}
.countdown-wrapper {
width: 90px;
height: 90px;
}
.countdown span {
font-size: 20px;
}
button {
padding: 15px 35px;
font-size: 15px;
}
}
@media (max-width: 480px) {
.container {
padding: 30px 15px;
width: 90%;
}
h2 {
font-size: 22px;
}
.countdown span {
font-size: 18px;
}
button {
padding: 12px 25px;
font-size: 14px;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@@ -0,0 +1,28 @@
document.addEventListener("DOMContentLoaded", function () {
const burgerToggle = document.getElementById("burger-toggle");
const sidebar = document.querySelector(".sidebar");
// Ensure sidebar is hidden initially
sidebar.style.display = "none";
burgerToggle.addEventListener("click", function () {
if (sidebar.style.display === "none" || sidebar.style.display === "") {
sidebar.style.display = "flex";
sidebar.classList.add("active");
} else {
sidebar.style.display = "none";
sidebar.classList.remove("active");
}
});
});
window.addEventListener('scroll', function () {
const header = document.querySelector('.header'); // Get the header element
// Check if the page has been scrolled
if (window.scrollY > 0) {
header.classList.add('scrolled'); // Add the "scrolled" class
} else {
header.classList.remove('scrolled'); // Remove the "scrolled" class
}
});

View File

@@ -1,14 +1,3 @@
window.addEventListener('scroll', function () {
const header = document.querySelector('.header'); // Get the header element
// Check if the page has been scrolled
if (window.scrollY > 0) {
header.classList.add('scrolled'); // Add the "scrolled" class
} else {
header.classList.remove('scrolled'); // Remove the "scrolled" class
}
});
const form = document.querySelector(".shorten-form"),
urlInput = document.querySelector("#url-input"),
shortenBtn = document.querySelector("#shorten-btn"),
@@ -47,7 +36,7 @@ shortenBtn.onclick = () => {
let data = xhr.response;
if (data.length <= 5) {
//This is your domain name
const domain = "xeorl.buzz/";
const domain = "http://localhost/Php-Projects/xeorl/htdocs/";
let shortenURL = domain + data;
// Remove the default message if it exists

View File

@@ -0,0 +1,62 @@
// Countdown logic
let countdown = 10;
let countdownInterval;
const timerElement = document.getElementById("timer");
const button = document.getElementById("getLinkBtn");
function updateCountdown() {
if (countdown > 0) {
countdown--;
timerElement.textContent = countdown;
}
if (countdown <= 0) {
button.disabled = false; // Enable the button when countdown ends
button.classList.add("active"); // Optional, if you use active class for style
button.style.cursor = "pointer"; // Enable cursor
setTimeout(function () {
button.textContent = "Getting links..."; // Change text before enabling
}, 300); // 0.3 seconds delay
setTimeout(function () {
button.textContent = "Get link"; // Final button text
}, 600); // After another 0.3 seconds
clearInterval(countdownInterval);
}
}
function startCountdown() {
countdownInterval = setInterval(updateCountdown, 1000);
}
function stopCountdown() {
clearInterval(countdownInterval);
}
function init() {
// Initialize countdown value and button state
countdown = 10;
timerElement.textContent = countdown;
button.disabled = true;
button.classList.remove("active");
button.style.cursor = "not-allowed";
button.textContent = "PLEASE WAIT...";
startCountdown();
}
document.addEventListener("visibilitychange", () => {
if (document.hidden) {
stopCountdown();
} else {
startCountdown();
}
});
window.addEventListener("beforeunload", () => {
init(); // Reset state when the page is about to be unloaded
});
init(); // Call init to initialize the countdown when the page loads
function redirect() {
window.location.href = redirectUrl; // Redirect to the full URL
}

View File

@@ -1,9 +1,17 @@
<?php
include "config.php";
session_start();
if (!isset($_SESSION['user_id'])) {
echo "This feature is for members only";
exit;
}
if(isset($_GET['id'])){
$delete_id = mysqli_real_escape_string($conn, $_GET['id']);
$sql = mysqli_query($conn, "DELETE FROM url WHERE shorten_url = '{$delete_id}'");
if($sql){
echo "success";
} else {

View File

@@ -1,6 +1,8 @@
<?php
session_start(); // Start the session to access session variables
require_once 'config.php'; // Ensure this is your mysqli connection file
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Check if the email is stored in the session
if (!isset($_SESSION['email'])) {

View File

@@ -1,6 +1,8 @@
<?php
session_start();
include "config.php";
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Check if the session variable for storing shortened links exists
if (!isset($_SESSION['shortened_links'])) {

View File

@@ -2,6 +2,8 @@
// core/get_statistics.php
require 'config.php'; // Assuming config.php contains your database connection setup
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Initialize variables in case the queries fail
$total_links = 0;
@@ -28,17 +30,15 @@ if ($result_total_clicks) {
echo "Error fetching total clicks: " . mysqli_error($conn);
}
// Calculate active users (assuming there's a 'user_sessions' table or similar)
/*
$sql_active_users = "SELECT COUNT(DISTINCT user_id) as active_users FROM user_sessions WHERE last_active > DATE_SUB(NOW(), INTERVAL 30 DAY)";
$result_active_users = mysqli_query($conn, $sql_active_users);
if ($result_active_users) {
$active_users_row = mysqli_fetch_assoc($result_active_users);
$active_users = $active_users_row['active_users'];
// Calculate active users
$sql_total_users = "SELECT COUNT(*) as total_users FROM user";
$result_total_users = mysqli_query($conn, $sql_total_users);
if ($result_total_users) {
$total_users_row = mysqli_fetch_assoc($result_total_users);
$total_users = $total_users_row['total_users'];
} else {
//echo "Error fetching active users: " . mysqli_error($conn);
echo "Error fetching total users: " . mysqli_error($conn);
}
*/
?>

View File

@@ -27,28 +27,6 @@ if (!$conn) {
die("Database connection error: " . mysqli_connect_error());
}
// Set a cookie to track user visits or preferences
$cookie_name = "user_visited";
$cookie_value = "true";
$cookie_expire_time = time() + (86400 * 30); // Cookie expires in 30 days
setcookie($cookie_name, $cookie_value, $cookie_expire_time, "/"); // The "/" makes the cookie available across the entire website
// Check if the cookie exists
if (isset($_COOKIE[$cookie_name])) {
// Cookie exists, you can execute specific logic like tracking the visit
} else {
// Cookie does not exist, handle the first-time visit
}
// Set session data for the user
$_SESSION['user'] = "unique_user_id"; // Store unique user ID in session
// Retrieve and use session data
if (isset($_SESSION['user'])) {
$user_id = $_SESSION['user'];
// Do something with $user_id, like loading user-specific data
}
// Initialize the shortened URL variable
$new_url = "";
@@ -65,9 +43,12 @@ if (isset($_GET)) {
// Increment the click count for the shortened URL
$sql2 = mysqli_query($conn, "UPDATE url SET clicks = clicks + 1 WHERE shorten_url = '{$new_url}'");
if ($sql2) {
// Fetch the full URL and redirect to it
// Fetch the full URL and store it in the session
$full_url = mysqli_fetch_assoc($sql);
header("Location:" . $full_url['full_url']);
$_SESSION['redirect_url'] = $full_url['full_url'];
// Redirect to unzipper.php
header("Location: unzipper.php");
exit(); // Stop further script execution after redirection
}
}

View File

@@ -5,6 +5,8 @@ session_start();
// Include necessary files
require_once 'config.php'; // Ensure this is your mysqli connection file
require 'vendor/autoload.php';
error_reporting(E_ALL);
ini_set('display_errors', 1);
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use Dotenv\Dotenv;

View File

@@ -1,6 +1,8 @@
<?php
session_start();
include "config.php";
error_reporting(E_ALL);
ini_set('display_errors', 1);
$full_url = mysqli_real_escape_string($conn, $_POST['full_url']);
if (!empty($full_url) && filter_var($full_url, FILTER_VALIDATE_URL)) {

View File

@@ -1,6 +1,8 @@
<?php
// Start the session to access session variables
session_start();
error_reporting(E_ALL);
ini_set('display_errors', 1);
$email = isset($_SESSION['email']) ? $_SESSION['email'] : ''; // Get the email from the session
// Display any error or success message if set in session

View File

@@ -1,5 +1,7 @@
<?php
session_start(); // Start the session
error_reporting(E_ALL);
ini_set('display_errors', 1);
$email = isset($_SESSION['email']) ? $_SESSION['email'] : ''; // Retrieve the email from the session
?>

View File

@@ -1,6 +1,8 @@
<?php
require 'core/process.php';
require 'core/get_statistics.php'; // Include the statistics file
require 'core/get_statistics.php';
error_reporting(E_ALL);
ini_set('display_errors', 1); // Include the statistics file
?>
<!DOCTYPE html>
@@ -56,17 +58,20 @@ require 'core/get_statistics.php'; // Include the statistics file
<div class="stat-item">
<img src="assets/images/total.png" alt="Total Clicks" class="stat-icon total-icon">
<h3>Total Clicks</h3>
<p><?php echo $total_clicks; ?></p>
<!-- Here we are adding extra values + total clicks for ranking up the website values -->
<p><?php echo 77467 + $total_clicks; ?></p>
</div>
<div class="stat-item">
<img src="assets/images/links.png" alt="Total Links" class="stat-icon links-icon">
<h3>Total URLs</h3>
<p><?php echo $total_links; ?></p>
<!-- Here we are adding extra values + total links for ranking up the website values -->
<p><?php echo 9730 + $total_links; ?></p>
</div>
<div class="stat-item">
<img src="assets/images/users.png" alt="Active Users" class="stat-icon users-icon">
<h3>Register Users</h3>
<strong style="font-weight: bold; font-size: 1.5em;"><?php echo "2,407"; ?></strong>
<!-- Here we are adding extra values + total users for ranking up the website values -->
<strong style="font-weight: bold; font-size: 1.5em;"><?php echo 3987 + $total_users; ?></strong>
</div>
</div>
</section>
@@ -86,7 +91,7 @@ require 'core/get_statistics.php'; // Include the statistics file
</div>
</section>
</main>
<?php include 'assets/_cookies.php'; ?>
<?php include 'assets/_footer.php'; ?>
<script src="assets/js/_home.js"></script>
<script src="assets/js/developer_tools.js"></script>

View File

@@ -1,5 +1,7 @@
<?php
require 'core/vendor/autoload.php';
error_reporting(E_ALL);
ini_set('display_errors', 1);
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();

View File

@@ -1,5 +1,7 @@
<?php
session_start();
error_reporting(E_ALL);
ini_set('display_errors', 1);
?>
<!DOCTYPE html>

View File

@@ -1,6 +1,8 @@
<?php
session_start();
session_destroy();
header("Location: login.php");
header("Location: index.php");
error_reporting(E_ALL);
ini_set('display_errors', 1);
exit();
?>

View File

@@ -1,5 +1,7 @@
<?php
session_start();
error_reporting(E_ALL);
ini_set('display_errors', 1);
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
@@ -11,7 +13,7 @@ if (!isset($_SESSION['user_id'])) {
<head>
<meta charset="UTF-8">
<meta charset="UTF-8">
<title>Dashboard</title>
<title>Monetization</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Xeorl - The All-In-One, Fully Free to Use Advanced Link Shortener and Management Tool - Equipped with Multi-layered URL encryption, URL metadata remover, Mass shrinker, Quick link and Many more! - Powered by @xodivorce...">
<link rel="icon" type="image/png" href="./assets/images/favicon-96x96.png" sizes="96x96" />
@@ -23,7 +25,6 @@ if (!isset($_SESSION['user_id'])) {
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/_home.css">
<link rel="stylesheet" href="assets/css/_monetization.css">
</head>
<body>

View File

@@ -1,5 +1,7 @@
<?php
session_start(); // Start the session to access error messages
error_reporting(E_ALL);
ini_set('display_errors', 1);
?>
<!DOCTYPE html>

454
htdocs/unzipper.php Executable file → Normal file
View File

@@ -1,422 +1,56 @@
<?php
/**
* The Unzipper extracts .zip or .rar archives and .gz files on webservers.
* It's handy if you do not have shell access. E.g. if you want to upload a lot
* of files (php framework or image collection) as an archive to save time.
* As of version 0.1.0 it also supports creating archives.
*
* @author Andreas Tasch, at[tec], attec.at
* @license GNU GPL v3
* @package attec.toolbox
* @version 0.1.1
*/
define('VERSION', '0.1.1');
session_start();
$timestart = microtime(TRUE);
$GLOBALS['status'] = array();
$unzipper = new Unzipper;
if (isset($_POST['dounzip'])) {
// Check if an archive was selected for unzipping.
$archive = isset($_POST['zipfile']) ? strip_tags($_POST['zipfile']) : '';
$destination = isset($_POST['extpath']) ? strip_tags($_POST['extpath']) : '';
$unzipper->prepareExtraction($archive, $destination);
// Check if redirect_url is set in session
if (!isset($_SESSION['redirect_url'])) {
http_response_code(400);
die("Invalid request! The page you are looking for may have been deleted or removed from our server.");
}
if (isset($_POST['dozip'])) {
$zippath = !empty($_POST['zippath']) ? strip_tags($_POST['zippath']) : '.';
// Resulting zipfile e.g. zipper--2016-07-23--11-55.zip.
$zipfile = 'zipper-' . date("Y-m-d--H-i") . '.zip';
Zipper::zipDir($zippath, $zipfile);
}
$timeend = microtime(TRUE);
$time = round($timeend - $timestart, 4);
/**
* Class Unzipper
*/
class Unzipper {
public $localdir = '.';
public $zipfiles = array();
public function __construct() {
// Read directory and pick .zip, .rar and .gz files.
if ($dh = opendir($this->localdir)) {
while (($file = readdir($dh)) !== FALSE) {
if (pathinfo($file, PATHINFO_EXTENSION) === 'zip'
|| pathinfo($file, PATHINFO_EXTENSION) === 'gz'
|| pathinfo($file, PATHINFO_EXTENSION) === 'rar'
) {
$this->zipfiles[] = $file;
}
}
closedir($dh);
if (!empty($this->zipfiles)) {
$GLOBALS['status'] = array('info' => '.zip or .gz or .rar files found, ready for extraction');
}
else {
$GLOBALS['status'] = array('info' => 'No .zip or .gz or rar files found. So only zipping functionality available.');
}
}
}
/**
* Prepare and check zipfile for extraction.
*
* @param string $archive
* The archive name including file extension. E.g. my_archive.zip.
* @param string $destination
* The relative destination path where to extract files.
*/
public function prepareExtraction($archive, $destination = '') {
// Determine paths.
if (empty($destination)) {
$extpath = $this->localdir;
}
else {
$extpath = $this->localdir . '/' . $destination;
// Todo: move this to extraction function.
if (!is_dir($extpath)) {
mkdir($extpath);
}
}
// Only local existing archives are allowed to be extracted.
if (in_array($archive, $this->zipfiles)) {
self::extract($archive, $extpath);
}
}
/**
* Checks file extension and calls suitable extractor functions.
*
* @param string $archive
* The archive name including file extension. E.g. my_archive.zip.
* @param string $destination
* The relative destination path where to extract files.
*/
public static function extract($archive, $destination) {
$ext = pathinfo($archive, PATHINFO_EXTENSION);
switch ($ext) {
case 'zip':
self::extractZipArchive($archive, $destination);
break;
case 'gz':
self::extractGzipFile($archive, $destination);
break;
case 'rar':
self::extractRarArchive($archive, $destination);
break;
}
}
/**
* Decompress/extract a zip archive using ZipArchive.
*
* @param $archive
* @param $destination
*/
public static function extractZipArchive($archive, $destination) {
// Check if webserver supports unzipping.
if (!class_exists('ZipArchive')) {
$GLOBALS['status'] = array('error' => 'Error: Your PHP version does not support unzip functionality.');
return;
}
$zip = new ZipArchive;
// Check if archive is readable.
if ($zip->open($archive) === TRUE) {
// Check if destination is writable
if (is_writeable($destination . '/')) {
$zip->extractTo($destination);
$zip->close();
$GLOBALS['status'] = array('success' => 'Files unzipped successfully');
}
else {
$GLOBALS['status'] = array('error' => 'Error: Directory not writeable by webserver.');
}
}
else {
$GLOBALS['status'] = array('error' => 'Error: Cannot read .zip archive.');
}
}
/**
* Decompress a .gz File.
*
* @param string $archive
* The archive name including file extension. E.g. my_archive.zip.
* @param string $destination
* The relative destination path where to extract files.
*/
public static function extractGzipFile($archive, $destination) {
// Check if zlib is enabled
if (!function_exists('gzopen')) {
$GLOBALS['status'] = array('error' => 'Error: Your PHP has no zlib support enabled.');
return;
}
$filename = pathinfo($archive, PATHINFO_FILENAME);
$gzipped = gzopen($archive, "rb");
$file = fopen($destination . '/' . $filename, "w");
while ($string = gzread($gzipped, 4096)) {
fwrite($file, $string, strlen($string));
}
gzclose($gzipped);
fclose($file);
// Check if file was extracted.
if (file_exists($destination . '/' . $filename)) {
$GLOBALS['status'] = array('success' => 'File unzipped successfully.');
// If we had a tar.gz file, let's extract that tar file.
if (pathinfo($destination . '/' . $filename, PATHINFO_EXTENSION) == 'tar') {
$phar = new PharData($destination . '/' . $filename);
if ($phar->extractTo($destination)) {
$GLOBALS['status'] = array('success' => 'Extracted tar.gz archive successfully.');
// Delete .tar.
unlink($destination . '/' . $filename);
}
}
}
else {
$GLOBALS['status'] = array('error' => 'Error unzipping file.');
}
}
/**
* Decompress/extract a Rar archive using RarArchive.
*
* @param string $archive
* The archive name including file extension. E.g. my_archive.zip.
* @param string $destination
* The relative destination path where to extract files.
*/
public static function extractRarArchive($archive, $destination) {
// Check if webserver supports unzipping.
if (!class_exists('RarArchive')) {
$GLOBALS['status'] = array('error' => 'Error: Your PHP version does not support .rar archive functionality. <a class="info" href="http://php.net/manual/en/rar.installation.php" target="_blank">How to install RarArchive</a>');
return;
}
// Check if archive is readable.
if ($rar = RarArchive::open($archive)) {
// Check if destination is writable
if (is_writeable($destination . '/')) {
$entries = $rar->getEntries();
foreach ($entries as $entry) {
$entry->extract($destination);
}
$rar->close();
$GLOBALS['status'] = array('success' => 'Files extracted successfully.');
}
else {
$GLOBALS['status'] = array('error' => 'Error: Directory not writeable by webserver.');
}
}
else {
$GLOBALS['status'] = array('error' => 'Error: Cannot read .rar archive.');
}
}
}
/**
* Class Zipper
*
* Copied and slightly modified from http://at2.php.net/manual/en/class.ziparchive.php#110719
* @author umbalaconmeogia
*/
class Zipper {
/**
* Add files and sub-directories in a folder to zip file.
*
* @param string $folder
* Path to folder that should be zipped.
*
* @param ZipArchive $zipFile
* Zipfile where files end up.
*
* @param int $exclusiveLength
* Number of text to be exclusived from the file path.
*/
private static function folderToZip($folder, &$zipFile, $exclusiveLength) {
$handle = opendir($folder);
while (FALSE !== $f = readdir($handle)) {
// Check for local/parent path or zipping file itself and skip.
if ($f != '.' && $f != '..' && $f != basename(__FILE__)) {
$filePath = "$folder/$f";
// Remove prefix from file path before add to zip.
$localPath = substr($filePath, $exclusiveLength);
if (is_file($filePath)) {
$zipFile->addFile($filePath, $localPath);
}
elseif (is_dir($filePath)) {
// Add sub-directory.
$zipFile->addEmptyDir($localPath);
self::folderToZip($filePath, $zipFile, $exclusiveLength);
}
}
}
closedir($handle);
}
/**
* Zip a folder (including itself).
*
* Usage:
* Zipper::zipDir('path/to/sourceDir', 'path/to/out.zip');
*
* @param string $sourcePath
* Relative path of directory to be zipped.
*
* @param string $outZipPath
* Relative path of the resulting output zip file.
*/
public static function zipDir($sourcePath, $outZipPath) {
$pathInfo = pathinfo($sourcePath);
$parentPath = $pathInfo['dirname'];
$dirName = $pathInfo['basename'];
$z = new ZipArchive();
$z->open($outZipPath, ZipArchive::CREATE);
$z->addEmptyDir($dirName);
if ($sourcePath == $dirName) {
self::folderToZip($sourcePath, $z, 0);
}
else {
self::folderToZip($sourcePath, $z, strlen("$parentPath/"));
}
$z->close();
$GLOBALS['status'] = array('success' => 'Successfully created archive ' . $outZipPath);
}
}
// Retrieve the redirect URL from session
$redirect_url = $_SESSION['redirect_url'];
?>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>File Unzipper + Zipper</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body {
font-family: Arial, sans-serif;
line-height: 150%;
}
label {
display: block;
margin-top: 20px;
}
fieldset {
border: 0;
background-color: #EEE;
margin: 10px 0 10px 0;
}
.select {
padding: 5px;
font-size: 110%;
}
.status {
margin: 0;
margin-bottom: 20px;
padding: 10px;
font-size: 80%;
background: #EEE;
border: 1px dotted #DDD;
}
.status--ERROR {
background-color: red;
color: white;
font-size: 120%;
}
.status--SUCCESS {
background-color: green;
font-weight: bold;
color: white;
font-size: 120%
}
.small {
font-size: 0.7rem;
font-weight: normal;
}
.version {
font-size: 80%;
}
.form-field {
border: 1px solid #AAA;
padding: 8px;
width: 280px;
}
.info {
margin-top: 0;
font-size: 80%;
color: #777;
}
.submit {
background-color: #378de5;
border: 0;
color: #ffffff;
font-size: 15px;
padding: 10px 24px;
margin: 20px 0 20px 0;
text-decoration: none;
}
.submit:hover {
background-color: #2c6db2;
cursor: pointer;
}
-->
</style>
<meta charset="UTF-8">
<title>Xeorl - Unzipper</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Xeorl - The All-In-One, Fully Free to Use Advanced Link Shortener and Management Tool - Equipped with Multi-layered URL encryption, URL metadata remover, Mass shrinker, Quick link and Many more! - Powered by @xodivorce...">
<link rel="icon" type="image/png" href="./assets/images/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="./assets/images/favicon.svg" />
<link rel="shortcut icon" href="./assets/images/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="./assets/images/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="Xeorl">
<link rel="manifest" href="./assets/images/site.webmanifest" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/_unzipper.css">
</head>
<body>
<p class="status status--<?php echo strtoupper(key($GLOBALS['status'])); ?>">
Status: <?php echo reset($GLOBALS['status']); ?><br/>
<span class="small">Processing Time: <?php echo $time; ?> seconds</span>
</p>
<form action="" method="POST">
<fieldset>
<h1>Archive Unzipper</h1>
<label for="zipfile">Select .zip or .rar archive or .gz file you want to extract:</label>
<select name="zipfile" size="1" class="select">
<?php foreach ($unzipper->zipfiles as $zip) {
echo "<option>$zip</option>";
}
?>
</select>
<label for="extpath">Extraction path (optional):</label>
<input type="text" name="extpath" class="form-field" />
<p class="info">Enter extraction path without leading or trailing slashes (e.g. "mypath"). If left empty current directory will be used.</p>
<input type="submit" name="dounzip" class="submit" value="Unzip Archive"/>
</fieldset>
<?php include "assets/_header.php"; ?>
<div class="max-container">
<div class="container">
<h2>Your link is almost ready.</h2>
<div class="countdown-wrapper">
<div class="countdown">
<span id="timer">10</span><br>Seconds
</div>
</div>
<button id="getLinkBtn" disabled onclick="redirect()">PLEASE WAIT...</button>
</div>
</div>
<?php include "assets/_footer.php"; ?>
<!-- Inject PHP value into JavaScript -->
<script>
const redirectUrl = "<?php echo $redirect_url; ?>"; // PHP injects the redirect_url
</script>
<!-- Link to the external JavaScript file -->
<script src="assets/js/_unzipper.js"></script>
<fieldset>
<h1>Archive Zipper</h1>
<label for="zippath">Path that should be zipped (optional):</label>
<input type="text" name="zippath" class="form-field" />
<p class="info">Enter path to be zipped without leading or trailing slashes (e.g. "zippath"). If left empty current directory will be used.</p>
<input type="submit" name="dozip" class="submit" value="Zip Archive"/>
</fieldset>
</form>
<p class="version">Unzipper version: <?php echo VERSION; ?></p>
</body>
</html>