/www/wwwroot/contract-miner.com/build/design/core/pageTop.php
$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 and badges
$profilePicImage = '';
$badgeImage = '';
$bannerImage = '';
// Get profile picture
$profileSql = $conn->prepare("SELECT mbc.badge_img_lowpix
FROM member_badges mb
JOIN member_badges_config mbc ON mbc.profilePicture_id = mb.s_badge_id
WHERE mb.userid = ? AND mb.selected = 1 AND mb.s_badge_id LIKE 'p_%'");
$profileSql->execute([$config_userid]);
if($profileSql->rowCount() > 0) {
$profilePicImage = $profileSql->fetchColumn();
}
// Get badge
$badgeSql = $conn->prepare("SELECT mbc.badge_img
FROM member_badges mb
JOIN member_badges_config mbc ON mbc.badge_id = mb.s_badge_id
WHERE mb.userid = ? AND mb.selected = 1 AND mb.s_badge_id LIKE 'u_%'");
$badgeSql->execute([$config_userid]);
if($badgeSql->rowCount() > 0) {
$badgeImage = $badgeSql->fetchColumn();
}
// Get banner
$bannerSql = $conn->prepare("SELECT mbc.badge_img_lowpix
FROM member_badges mb
JOIN member_badges_config mbc ON mbc.banner_id = mb.s_badge_id
WHERE mb.userid = ? AND mb.selected = 1 AND mb.s_badge_id LIKE 'b_%'");
$bannerSql->execute([$config_userid]);
/www/wwwroot/contract-miner.com/build/design/core/pageTop.php
$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 and badges
$profilePicImage = '';
$badgeImage = '';
$bannerImage = '';
// Get profile picture
$profileSql = $conn->prepare("SELECT mbc.badge_img_lowpix
FROM member_badges mb
JOIN member_badges_config mbc ON mbc.profilePicture_id = mb.s_badge_id
WHERE mb.userid = ? AND mb.selected = 1 AND mb.s_badge_id LIKE 'p_%'");
$profileSql->execute([$config_userid]);
if($profileSql->rowCount() > 0) {
$profilePicImage = $profileSql->fetchColumn();
}
// Get badge
$badgeSql = $conn->prepare("SELECT mbc.badge_img
FROM member_badges mb
JOIN member_badges_config mbc ON mbc.badge_id = mb.s_badge_id
WHERE mb.userid = ? AND mb.selected = 1 AND mb.s_badge_id LIKE 'u_%'");
$badgeSql->execute([$config_userid]);
if($badgeSql->rowCount() > 0) {
$badgeImage = $badgeSql->fetchColumn();
}
// Get banner
$bannerSql = $conn->prepare("SELECT mbc.badge_img_lowpix
FROM member_badges mb
JOIN member_badges_config mbc ON mbc.banner_id = mb.s_badge_id
WHERE mb.userid = ? AND mb.selected = 1 AND mb.s_badge_id LIKE 'b_%'");
$bannerSql->execute([$config_userid]);
/www/wwwroot/contract-miner.com/build/pages/service/media/overview.php
outline: none;
font-size: 15px;
transition: 0.4s;
}
.active, .accordionMedia:hover {
background-color: #3E465B;
}
.panel {
padding: 0 18px;
background-color: #1d2333;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
</style>
</head>
<body class="bg-gray-900">
<?php require_once(__BUILD_PAGE_BASE_TOP__); ?>
<div class="px-2">
<div class="max-w-[1200px]" style="margin:0 auto;">
<div class="bg-gray-800 rounded-lg p-4 mb-6">
<h2 class="text-2xl font-bold text-white mb-2">Recommended Reads</h2>
</div>
<?php
$stmt = $conn->query("SELECT * FROM blog_posts");
if($stmt->rowCount() > 0) {
?>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6 mt-6">
<div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg transition-transform duration-300 hover:transform hover:scale-105">
<img src="<?=__BUILD_IMAGES__;?>media/gettingStarted.jpg" class="w-full h-48 object-cover">
<div class="p-4">
<div class="text-gray-400 text-sm mb-2 flex items-center justify-center">
<svg xmlns="https://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="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
</div>
/www/wwwroot/contract-miner.com/routes/media.php
<?php
app()->match('GET|POST', '/media', function (): void {
require_once(__WEBSITE_CORE_ROOT__ . '/core/common_globals.php');
require_once(__WEBSITE_CORE_ROOT__ . '/build/pages/service/media/overview.php');
});
app()->match('GET|POST', '/news', function (): void {
header('Location: /media');
exit;
});
app()->match('GET|POST', '/blog', function (): void { # Blog Overview
header('Location: /media');
exit;
});
// CUSTOM BLOG POSTS
app()->match('GET|POST', '/blog/get-started', function (): void { # Blog Overview
require_once(__WEBSITE_CORE_ROOT__ . '/core/common_globals.php');
require_once(__WEBSITE_CORE_ROOT__ . '/build/pages/service/media/blogs/posts/guideGetStarted.php');
});
app()->match('GET|POST', '/blog/winter-spring', function (): void { # Blog Overview
require_once(__WEBSITE_CORE_ROOT__ . '/core/common_globals.php');
require_once(__WEBSITE_CORE_ROOT__ . '/build/pages/service/media/blogs/posts/eventWinterSpring.php');
});
app()->all('/news/{news_post_id}', function ($news_post_id): void { # News Post
if(!empty($news_post_id)) {
require_once(__WEBSITE_CORE_ROOT__ . '/core/common_globals.php');
$news_post_id = htmlspecialchars((string) $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): void { # Display Blog Post
/www/wwwroot/contract-miner.com/vendor/leafs/leaf/src/Router.php
$routesToRun = $routeToHandle;
}
foreach ($routesToRun as $currentRoute) {
static::invoke($currentRoute['handler'], $currentRoute['params']);
}
return count($routesToRun);
}
private static function invoke($handler, $params = [])
{
if (!empty($params)) {
$params = array_filter($params, function ($param) {
return $param !== null;
});
}
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");
}
// First check if is a static method, directly trying to invoke it.
// If isn't a valid static method, we will try as a normal method invocation.
if (call_user_func_array([new $controller(), $method], $params) === false) {
// Try to call the method as a non-static method. (the if does nothing, only avoids the notice)
if (forward_static_call_array([$controller, $method], $params) === false)
;
/www/wwwroot/contract-miner.com/vendor/leafs/leaf/src/Router.php
$routesToRun = $routeToHandle;
}
foreach ($routesToRun as $currentRoute) {
static::invoke($currentRoute['handler'], $currentRoute['params']);
}
return count($routesToRun);
}
private static function invoke($handler, $params = [])
{
if (!empty($params)) {
$params = array_filter($params, function ($param) {
return $param !== null;
});
}
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");
}
// First check if is a static method, directly trying to invoke it.
// If isn't a valid static method, we will try as a normal method invocation.
if (call_user_func_array([new $controller(), $method], $params) === false) {
// Try to call the method as a non-static method. (the if does nothing, only avoids the notice)
if (forward_static_call_array([$controller, $method], $params) === false)
;
/www/wwwroot/contract-miner.com/vendor/leafs/leaf/src/Router.php
* @param string|null $uri The URI to call (automatically set if nothing is passed).
*
* @return int The number of routes handled
*/
private static function handle(?array $routes = null, bool $quitAfterRun = false, ?string $uri = null): int
{
$uri = $uri ?? static::getCurrentUri();
$routeToHandle = static::findRoute($routes, $uri, $quitAfterRun);
// hacky solution to handle middleware catching all middleware with pattern (.*?)
$routesToRun = array_filter($routeToHandle, function ($route) use ($uri) {
return $route['route']['pattern'] === $uri || $route['route']['pattern'] === '/.*' || implode('/', $route['params'] ?? []) === ltrim($uri, '/');
});
if (empty($routesToRun)) {
$routesToRun = $routeToHandle;
}
foreach ($routesToRun as $currentRoute) {
static::invoke($currentRoute['handler'], $currentRoute['params']);
}
return count($routesToRun);
}
private static function invoke($handler, $params = [])
{
if (!empty($params)) {
$params = array_filter($params, function ($param) {
return $param !== null;
});
}
if (is_callable($handler)) {
call_user_func_array(
$handler,
$params
);
} elseif (stripos($handler, '@') !== false) {
list($controller, $method) = explode('@', $handler);
/www/wwwroot/contract-miner.com/vendor/leafs/leaf/src/Router.php
return static::invoke(static::$downHandler);
}
if (is_callable($callback)) {
static::hook('router.after', $callback);
}
static::callHook('router.before');
if (isset(static::$middleware[$requestedMethod])) {
static::handle(static::$middleware[$requestedMethod]);
}
static::callHook('router.before.route');
$numHandled = 0;
if (isset(static::$routes[$requestedMethod])) {
$numHandled = static::handle(
null,
true
);
}
if ($numHandled === 0) {
if (!static::$notFoundHandler) {
static::$notFoundHandler = function () {
\Leaf\Exception\General::default404();
};
}
static::invoke(static::$notFoundHandler);
}
// if it originally was a HEAD request, clean up after ourselves by emptying the output buffer
if ($_SERVER['REQUEST_METHOD'] == 'HEAD') {
ob_end_clean();
}
/www/wwwroot/contract-miner.com/vendor/leafs/leaf/src/App.php
$appMode = Config::getStatic('mode') ?? 'development';
if ($mode === $appMode) {
return $callback();
}
}
/**
* @inheritdoc
*/
public static function run(?callable $callback = null)
{
if (\class_exists('Leaf\Eien\Server') && Config::getStatic('eien.enabled')) {
server()
->wrap(function () use ($callback) {
parent::run($callback);
})
->listen();
} else {
return parent::run($callback);
}
}
}
/www/wwwroot/contract-miner.com/index.php
/***** EVENTS ROUTER *****/
require_once(__WEBSITE_CORE_ROOT__ . '/routes/events.php'); # Events Router
require_once(__WEBSITE_CORE_ROOT__ . '/routes/userAuth.php'); # User Auth Route
require_once(__WEBSITE_CORE_ROOT__ . '/routes/user.php'); # User pages (Public Profile / Leaderboards)
/***** MEDIA ROUTER - BLOGS // NEWS *****/
require_once(__WEBSITE_CORE_ROOT__ . '/routes/media.php');
/***** SERVICE PAGES *****/
require_once(__WEBSITE_CORE_ROOT__ . '/routes/service.php');
app()->run(); # Run the router