Pith - miter
<?php
$l_s_time = microtime(TRUE);

$user_file = 'user/user.xml';
$user_avatar = '';
$user_bio = '';
$user_name = '';
$user_side = 'right'; 

if (file_exists($user_file)) {
	$user_get = simplexml_load_file($user_file);
	if ($user_get !== false) {
		$user_array = $user_get->xpath("/miter/user[@id='probe']");
		if (!empty($user_array)) {
			$user_avatar 		= (string)$user_array[0]->avatar;
			$user_bg 			= (string)$user_array[0]->bg;
			$user_bio 			= (string)$user_array[0]->bio;
			$user_border 		= (string)$user_array[0]->border;
			$user_faded			= (string)$user_array[0]->faded;
			$user_font_size		= (string)$user_array[0]->fontsize;
			$user_header 		= (string)$user_array[0]->header;
			$user_header_text 	= (string)$user_array[0]->headertext;
			$user_link 			= (string)$user_array[0]->link;
			$user_main_bg 		= (string)$user_array[0]->mainbg;
			$user_name 			= (string)$user_array[0]->name;
			$user_pin 			= (string)$user_array[0]->pin;
			$user_radius 		= (string)$user_array[0]->radius;
			$user_side 			= (string)$user_array[0]->side;
			$user_text 			= (string)$user_array[0]->maintext;
			$user_under_line	= (string)$user_array[0]->underline;
			$user_width_miter 	= (string)$user_array[0]->widthmiter;
			$user_width_panel 	= (string)$user_array[0]->widthpanel;
		}
	}
}

session_start();
$user_log_in = str_replace('@', '', $user_name);
$login = (isset($_SESSION['miter']) && $_SESSION['miter'] === $user_log_in) && !empty($user_log_in);

if (!function_exists('isMobile')) {
	function isMobile(): bool {
		static $cached = null;
		if ($cached !== null) {
			return $cached;
		}

		$hint = $_SERVER['HTTP_SEC_CH_UA_MOBILE'] ?? '';
		if ($hint !== '') {
			return $cached = ($hint === '?1');
		}

		$ua = $_SERVER['HTTP_USER_AGENT'] ?? '';
		if ($ua === '') {
			return $cached = false;
		}

		return $cached = (bool) preg_match(
			'~android|avantgo|blackberry|bolt|boost|cricket|docomo
			|hiptop|iemobile|ip(?:hone|[ao]d)|kindle|meego|midp|mobi
			|opera\ m(?:ob|in)i|palm|phone|playbook|silk|symbian|tablet
			|up\.(?:browser|link)|webos|windows\ (?:ce|phone)|wos~ix',
			$ua
		);
	}
}

$count_miters = glob('miters/*.txt');
$miter_count = $count_miters !== false ? count($count_miters) : 0;

$count_rasps = glob('rasps/*.txt');
$rasp_count = $count_rasps !== false ? count($count_rasps) : 0;

$count_tenons = glob('tenons/*.txt');
$tenon_count = $count_tenons !== false ? count($count_tenons) : 0;

require_once __DIR__ . '/front/views/views.php';
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<meta name="robots" content="ALL,INDEX,FOLLOW,ARCHIVE">
	<meta name="revisit-after" content="1 day">
	<meta name="description" content="<?= htmlspecialchars($user_bio, ENT_QUOTES, 'UTF-8'); ?>">
	<link rel="icon" type="image/png" href="images/<?= htmlspecialchars($user_avatar, ENT_QUOTES, 'UTF-8'); ?>">
	<link rel="shortcut" type="image/png" href="images/<?= htmlspecialchars($user_avatar, ENT_QUOTES, 'UTF-8'); ?>">
	<link rel="stylesheet" href="front/style.css">
	<link rel="stylesheet" href="user/user.css">
	<?php if (isset($_GET['pith'])): ?>
		<link rel='stylesheet' href='pith/pith.css'>
	<?php endif; ?>
	<?php if (($login ?? false) === true): ?>
		<link href='back/admin.css' rel='stylesheet'>
		<script src='back/js/delete.js'></script>
	<?php endif; ?>
	<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js"></script>
	<style><?php include 'front/style.php'; ?></style>
	<title><?php include 'front/title.php'; ?></title>
</head>
<?php if (isset($_GET['pith'])): ?>
	<body class="<?= isMobile() ? 'mobile' : 'desktop'; ?>">
		<div class="desktop_center">
			<div class="pith_column">
				<?php include 'pith/pith.php'; ?>
			</div>
		</div>
	</body>
<?php elseif (isMobile()): ?>
	<body class="mobile">
		<div class="mobile_table">
			<div class="mobile_content_td">
				<?php include 'front/direct.php'; ?>
			</div>
			<div class="mobile_panel_td">
				<?php 
				include 'front/panels.php';
				if ($login === true) {
					include 'back/menu.php';
				} 
				?>
			</div>
		</div>
	</body>
<?php else: ?>
	<body class="desktop">
		<div class="desktop_center">
			<div class="desktop_table">
				<?php if ($user_side === 'right'): ?>
					<div class="desktop_content_td_right">
						<?php include 'front/direct.php'; ?>
					</div>
					<div class="desktop_panel_td">
						<?php 
						include 'front/panels.php';
						if ($login === true) {
							include 'back/menu.php';
						} 
						?>
					</div>
				<?php else: ?>
					<div class="desktop_panel_td">
						<?php 
						include 'front/panels.php';
						if ($login === true) {
							include 'back/menu.php';
						} 
						?>
					</div>
					<div class="desktop_content_td_left">
						<?php include 'front/direct.php'; ?>
					</div>
				<?php endif; ?>
			</div>
		</div>
	</body>
<?php endif; ?>
</html>