Number of different themes $darkTheme = $darkThemes[$newTheme]; $lightTHeme = $lightThemes[$newTheme]; } else if (isset($_COOKIE['theme'])) { $theme = (int)$_COOKIE['theme'] % 2; $darkTheme = $darkThemes[$theme]; $lightTheme = $lightThemes[$theme]; } $status = ""; function markdownContent($filePath, $rootFilePath) { $markdownContent = file_get_contents($filePath); require_once $rootFilePath . 'include/parsedown.php'; $parsedown = new Parsedown(); return $parsedown->text($markdownContent); } function fillHead($rootPageURL, $pageTitle, $darkTheme, $lightTheme) { echo (''); echo (''); echo (''); echo (''); echo (''); echo ('' . $pageTitle . ''); } function fillHeader($rootPageURL, $headerTitle, $headerSubtitle) { echo ('
'); echo (''); echo (''); echo (''); echo ('
'); echo ('
'); echo ('
'); echo ('
' . $headerTitle . '
'); echo ('
' . $headerSubtitle . '
'); echo ('
'); echo ('
'); } function fillNav($rootPageURL) { echo (''); echo (''); if ($_SESSION['userLevel'] >= 3) { echo (''); } if(isset($_SESSION['userID'])) { echo (''); echo (''); echo (''); } else { echo (''); } } function fillFooter($footerText) { echo($footerText); } function sqlConnect($dbHost, $dbName, $dbUser, $dbPass) { try { $pdo = new PDO('mysql:host=' . $dbHost . ';dbname=' . $dbName . ';charset=UTF8mb4', $dbUser, $dbPass); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(Exception $e) { require('error.php'); die(); } return $pdo; } function userWidget($userPPURL, $userDisplayName, $userName, $userCertification, $badges, $rootPageURL) { echo (''); echo ('
'); echo ('
'); echo (''); echo ('
'); echo (''); echo ('
'); echo ('
'); } function listArticles($result, $rootPageURL) { foreach($result as $article) { $pubDateTime = strtotime($article['date']); $pubDate = date('d/m/Y', $pubDateTime); $articleID = $article['ID']; $articleTitle = $article['title']; $articleResume = $article['resume']; $miniatureURL = empty($article['miniature']) ? $rootPageURL . "src/img/empty.jpg" : $article['miniature']; if(isset($article['username']) && isset($article['display_name'])) { $authorLink = ' | ' . $article['display_name'] . ''; } else { $authorLink = ''; } echo('
'); echo(''); echo('
'); echo(''); echo('
'); echo('
'); echo('
'); echo('
n° ' . $articleID . ' | ' . $pubDate . '
'); echo(''); echo('
' . $articleTitle . '
'); echo('
'); echo('
' . $articleResume . '
'); echo('
'); echo('
'); } } function textInput($type, $shapePath, $name, $placeholder, $value) { echo ('
'); echo (''); echo (''); echo ('
'); } function fileInput($name) { echo ('
'); echo (''); echo ('
'); } function selectInput($name, $label, $options, $defaultValue) { echo('
'); echo(''); echo(''); echo('
'); } ?>