/www/wwwroot/contract-miner.com/build/design/core/pageTop.php
1 => '/build/image/icons/round-star-[pink].svg',
2 => '/build/image/icons/round-star-[orange].svg',
3 => '/build/image/icons/round-star-[blue].svg'
];
$veteranBadgeIcon = $veteranBadgeIcons[$cnfVeteranTier] ?? $veteranBadgeIcons[0];
}
function ordinal($number) {
if ($number == 0) return "0";
$ends = ['th','st','nd','rd','th','th','th','th','th','th'];
return ((($number % 100) >= 11) && (($number % 100) <= 13)) ? $number.'th' : $number.$ends[$number % 10];
}
// Fetch profile picture
$profilePicImage = '';
$profilePicSql = $conn->prepare("SELECT mb.s_badge_id, mbc.badge_img
FROM member_badges mb
JOIN member_badges_config mbc ON mbc.profilePicture_id = mb.s_badge_id
WHERE mb.userid = ? AND mb.selected = 1");
$profilePicSql->execute([$config_userid]);
if($profilePicSql->rowCount() > 0) {
$profilePic = $profilePicSql->fetch(PDO::FETCH_ASSOC);
$profilePicImage = $profilePic['badge_img'];
}
// Enable Sale Banner
$saleActive = false;
$pEventActive = true;
?>
<aside id="logo-sidebar" class="fixed top-0 left-0 z-40 w-[200px] h-screen pt-[75px] transition-transform -translate-x-full bg-gray-950 border-r border-gray-700 lg:-translate-x-full" aria-label="Sidebar">
<div class="h-full bg-gray-950" data-simplebar>
<?php
if(isset($_SESSION['username'])) {
?>
<div class="mb-4 px-2">
<div class="flex items-center gap-4">
<a class="no-outline" href="<?=__LINK_CONTRACTOR__ . __CONFIG_USERNAME__;?>">
/www/wwwroot/contract-miner.com/build/design/core/pageTop.php
1 => '/build/image/icons/round-star-[pink].svg',
2 => '/build/image/icons/round-star-[orange].svg',
3 => '/build/image/icons/round-star-[blue].svg'
];
$veteranBadgeIcon = $veteranBadgeIcons[$cnfVeteranTier] ?? $veteranBadgeIcons[0];
}
function ordinal($number) {
if ($number == 0) return "0";
$ends = ['th','st','nd','rd','th','th','th','th','th','th'];
return ((($number % 100) >= 11) && (($number % 100) <= 13)) ? $number.'th' : $number.$ends[$number % 10];
}
// Fetch profile picture
$profilePicImage = '';
$profilePicSql = $conn->prepare("SELECT mb.s_badge_id, mbc.badge_img
FROM member_badges mb
JOIN member_badges_config mbc ON mbc.profilePicture_id = mb.s_badge_id
WHERE mb.userid = ? AND mb.selected = 1");
$profilePicSql->execute([$config_userid]);
if($profilePicSql->rowCount() > 0) {
$profilePic = $profilePicSql->fetch(PDO::FETCH_ASSOC);
$profilePicImage = $profilePic['badge_img'];
}
// Enable Sale Banner
$saleActive = false;
$pEventActive = true;
?>
<aside id="logo-sidebar" class="fixed top-0 left-0 z-40 w-[200px] h-screen pt-[75px] transition-transform -translate-x-full bg-gray-950 border-r border-gray-700 lg:-translate-x-full" aria-label="Sidebar">
<div class="h-full bg-gray-950" data-simplebar>
<?php
if(isset($_SESSION['username'])) {
?>
<div class="mb-4 px-2">
<div class="flex items-center gap-4">
<a class="no-outline" href="<?=__LINK_CONTRACTOR__ . __CONFIG_USERNAME__;?>">
/www/wwwroot/contract-miner.com/build/pages/service/media/blogs/display-post.php
$blog_user_username = $blog_user_details['username'];
}
// We add to the page views
$stmt3 = $conn->prepare("UPDATE blog_posts SET page_views = page_views + 1 WHERE blog_id = :blog_post_id");
$stmt3->bindParam(':blog_post_id', $blog_post_id);
$stmt3->execute();
// Create and display page
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php require_once(__BUILD_COMMON_CSS__); ?>
<title><?= $blog_post_title; ?> - Blog Post</title>
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
<meta name="description" content="<?= $blog_post_title; ?>">
</head>
<body class="bg-gray-900">
<?php require_once(__BUILD_PAGE_BASE_TOP__); ?>
<div class="px-2">
<div class="max-w-[1300px] mx-auto">
<div class="bg-gray-800 rounded-lg shadow-md p-6 mb-4">
<h1 class="text-2xl md:text-3xl font-bold text-white text-center mb-2"><?= $blog_post_title; ?></h1>
<div class="flex items-center justify-center text-gray-400 text-sm mb-2">
<span class="flex items-center mr-4">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>
<?= date('d/m/Y', $blog_post_date); ?>
</span>
<span class="flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
</svg>
<?= $blog_user_username; ?>
</span>
</div>
</div>
/www/wwwroot/contract-miner.com/routes/media.php
app()->all('/news/{news_post_id}', function ($news_post_id) {
if(!empty($news_post_id)) {
require_once(__WEBSITE_CORE_ROOT__ . '/core/common_globals.php');
$news_post_id = htmlspecialchars($news_post_id);
require_once(__WEBSITE_CORE_ROOT__ . '/build/pages/service/media/news/news-post.php');
} else { header('Location: /'); exit; }
});
app()->all('/blog/{blog_post_id}', function ($blog_post_id) {
if(!empty($blog_post_id)) {
require_once(__WEBSITE_CORE_ROOT__ . '/core/common_globals.php');
$blog_post_id = htmlspecialchars($blog_post_id);
require_once(__WEBSITE_CORE_ROOT__ . '/build/pages/service/media/blogs/display-post.php');
} else { header('Location: /'); exit; }
});
?>
/www/wwwroot/contract-miner.com/vendor/leafs/router/src/Router/Core.php
}, $matches, array_keys($matches));
static::invoke($route['handler'], $params);
++$numHandled;
if ($quitAfterRun) {
break;
}
}
}
return $numHandled;
}
private static function invoke($handler, $params = [])
{
if (is_callable($handler)) {
call_user_func_array(
$handler,
$params
);
}
elseif (stripos($handler, '@') !== false) {
list($controller, $method) = explode('@', $handler);
if (!class_exists($controller)) {
trigger_error("$controller not found. Cross-check the namespace if you're sure the file exists");
}
if (!method_exists($controller, $method)) {
trigger_error("$method method not found in $controller");
}
if (call_user_func_array([new $controller(), $method], $params) === false) {
if (forward_static_call_array([$controller, $method], $params) === false);
/www/wwwroot/contract-miner.com/vendor/leafs/router/src/Router/Core.php
}, $matches, array_keys($matches));
static::invoke($route['handler'], $params);
++$numHandled;
if ($quitAfterRun) {
break;
}
}
}
return $numHandled;
}
private static function invoke($handler, $params = [])
{
if (is_callable($handler)) {
call_user_func_array(
$handler,
$params
);
}
elseif (stripos($handler, '@') !== false) {
list($controller, $method) = explode('@', $handler);
if (!class_exists($controller)) {
trigger_error("$controller not found. Cross-check the namespace if you're sure the file exists");
}
if (!method_exists($controller, $method)) {
trigger_error("$method method not found in $controller");
}
if (call_user_func_array([new $controller(), $method], $params) === false) {
if (forward_static_call_array([$controller, $method], $params) === false);
/www/wwwroot/contract-miner.com/vendor/leafs/router/src/Router/Core.php
$route['pattern'] = preg_replace('/\/{(.*?)}/', '/(.*?)', $route['pattern']);
if (preg_match_all('#^' . $route['pattern'] . '$#', $uri, $matches, PREG_OFFSET_CAPTURE)) {
$matches = array_slice($matches, 1);
$params = array_map(function ($match, $index) use ($matches) {
if (isset($matches[$index + 1]) && isset($matches[$index + 1][0]) && is_array($matches[$index + 1][0])) {
return trim(substr($match[0][0], 0, $matches[$index + 1][0][1] - $match[0][1]), '/');
}
return isset($match[0][0]) ? trim($match[0][0], '/') : null;
}, $matches, array_keys($matches));
static::invoke($route['handler'], $params);
++$numHandled;
if ($quitAfterRun) {
break;
}
}
}
return $numHandled;
}
private static function invoke($handler, $params = [])
{
if (is_callable($handler)) {
call_user_func_array(
$handler,
$params
);
}
/www/wwwroot/contract-miner.com/vendor/leafs/router/src/Router/Core.php
$middleware[0]->call();
}
}
static::callHook('router.before.route');
static::$requestedMethod = \Leaf\Http\Request::getMethod();
if (isset(static::$routeSpecificMiddleware[static::$requestedMethod])) {
static::handle(static::$routeSpecificMiddleware[static::$requestedMethod]);
}
static::callHook('router.before.dispatch');
$numHandled = 0;
if (isset(static::$routes[static::$requestedMethod])) {
$numHandled = static::handle(
static::$routes[static::$requestedMethod],
true
);
}
static::callHook('router.after.dispatch');
if ($numHandled === 0) {
if (!static::$notFoundHandler) {
if (class_exists('Leaf\App')) {
static::$notFoundHandler = function () {
\Leaf\Exception\General::default404();
};
} else {
static::$notFoundHandler = function () {
echo 'Route not found';
};
}
}
static::invoke(static::$notFoundHandler);
}
/www/wwwroot/contract-miner.com/vendor/leafs/leaf/src/App.php
if (class_exists('Leaf\Http\Cors')) {
Http\Cors::config($options);
} else {
trigger_error('Cors module not found! Run `composer require leafs/cors` to install the CORS module. This is required to configure CORS.');
}
}
public static function run(?callable $callback = null)
{
if (class_exists('Leaf\Eien\Server')) {
server()
->wrap(function () use ($callback) {
parent::run($callback);
})
->listen();
} else {
return parent::run($callback);
}
}
}
/www/wwwroot/contract-miner.com/index.php
require_once(__WEBSITE_CORE_ROOT__ . '/routes/events.php');
require_once(__WEBSITE_CORE_ROOT__ . '/routes/userAuth.php');
require_once(__WEBSITE_CORE_ROOT__ . '/routes/user.php');
require_once(__WEBSITE_CORE_ROOT__ . '/routes/media.php');
require_once(__WEBSITE_CORE_ROOT__ . '/routes/service.php');
app()->run();