Loading css/design.css +40 −8 Original line number Diff line number Diff line Loading @@ -25,10 +25,10 @@ CSS font-family: ubuntumono; background-color: #f0f0f0; padding: 2px; border-bottom: 5px solid #cccccc; border-bottom: 5px solid #ccc; } article p, #pageTitle, article h3, article ul{ article p, #pageTitle, article h3, article ul, article form{ max-width: 1500px; margin: 30px auto; } Loading Loading @@ -63,7 +63,6 @@ h2{ font-size: 1.5em; } h3 a{ text-decoration: none; text-shadow: 0 0 1px #69f; Loading Loading @@ -106,12 +105,9 @@ article{ background-color: #f0f0f0; } section{ } #listMenu .selected{ padding-bottom: 2px; border-bottom: 5px solid #cccccc; border-bottom: 5px solid #ccc; } article .postInfos{ Loading @@ -129,7 +125,7 @@ article .postInfos{ hr{ width: 66%; border: 1px solid #CFCFCF; border: 1px solid #ccc; } a{ Loading @@ -141,6 +137,42 @@ a:hover{ transition: color 0.3s; } input{ width: 50%; display: block; box-sizing: border-box; margin: 15px auto; padding: 10px; font-size: 1em; } input[type="text"], input[type="password"]{ background-color: white; border: none; padding-left: 13px; border-bottom: 3px solid #ccc; border-left: 0px solid #ccc; transition: border-left 0.05s, padding-left 0.05s; } input[type="text"]:hover, input[type="password"]:hover, input[type="text"]:focus, input[type="password"]:focus{ border-left: 3px solid #ccc; padding-left: 10px; transition: border-left 0.05s, padding-left 0.05s; } input[type="submit"]{ background-color: #ccc; border: none; transition: background-color 0.3s; } input[type="submit"]:hover{ background-color: #ddd; transition: background-color 0.3s; } /* ==== Loading index.php +2 −0 Original line number Diff line number Diff line <?php session_start(); require_once("site/controller/mainController.php"); require_once("site/layout/layout.php"); Loading site/controller/mainController.php +38 −6 Original line number Diff line number Diff line <?php ini_set('display_errors','on'); error_reporting(E_ALL|E_STRICT); require_once("site/model/config.php"); require_once("site/model/Base.php"); Loading Loading @@ -31,6 +29,12 @@ function getPageName(){ case 'article': return [$_GET['title'], $_GET['title']]; break; case 'patate': return ["Administration", "administration"]; break; case 'eplucher': return ["prout hihi", "eplucher"]; break; default: return ["Blog", "blog"]; break; Loading @@ -44,6 +48,7 @@ function getPageName(){ function writeMenu($pageName){ ?> <ul id="listMenu"> <?php if($pageName == "Administration"){ ?><li><h2><a href="/eplucher" class="selected">🔧</a></h2></li><?php } ?> <li><h2><a href="/" title="Blog" <?php if($pageName == "Blog"){ ?>class="selected"<?php } ?>>Blog</a></h2></li> <li><h2><a href="/about" title="À propos" <?php if($pageName == "À Propos"){ ?>class="selected"<?php } ?>>À propos</a></h2></li> <li><h2><a href="/projects" title="Projets" <?php if($pageName == "Projets"){ ?>class="selected"<?php } ?>>Projets</a></h2></li> Loading @@ -51,8 +56,6 @@ function writeMenu($pageName){ </ul> <?php } function writeBlogPage($pageName){ if($pageName[1] == "blog"){ Loading @@ -67,7 +70,7 @@ function writeBlogPage($pageName){ header("Location:/404"); } else{ $blogposts = $blog->getBlog(); $blogposts = $blog->getBlog(0); require("site/view/public/blogView.php"); } } Loading @@ -82,6 +85,35 @@ function writeProjectsPage($pageName){ require("site/view/public/projectsView.php"); } function loginAdminPage($pageName){ if(password_verify($_POST['pass'], pass) && $_POST['user'] == user){ $_SESSION['user'] = $_POST['user']; $_SESSION['pass'] = $_POST['pass']; header("Location:/patate"); } else echo "nan"; } function writeAdminPage($pageName){ if(verifyAdminConnect()) require("site/view/private/admin.php"); else{ require("site/view/private/loginFormView.php"); } } function verifyAdminConnect(){ return isset($_SESSION['user']) && $_SESSION['user'] == user && isset($_SESSION['pass']) && password_verify($_SESSION['pass'], pass); } function decoAdminPage(){ $_SESSION = array(); header("Location:/"); } $pageName = getPageName(); No newline at end of file site/layout/layout.php +12 −1 Original line number Diff line number Diff line Loading @@ -55,6 +55,17 @@ case '404': require("site/view/public/404.php"); break; case 'administration': if(isset($_POST['user']) && isset($_POST['pass'])){ loginAdminPage($pageName); } else{ writeAdminPage($pageName); } break; case 'eplucher': decoAdminPage(); break; default: # code... Loading @@ -65,7 +76,7 @@ <footer id="footer"> <p> Site créé par Corentin Bettiol - <a href="/changelog" title="changelog">Changelog</a> - <a href="/rss" title="rss">RSS</a> - v5 Site en vanilla html5/css3/php7, fait avec ♥ - <a href="/changelog" title="changelog">Changelog</a> - <a href="/rss" title="rss">RSS</a> - v5 </p> </footer> Loading site/model/BlogManager.php +7 −3 Original line number Diff line number Diff line <?php class BlogManager extends Base { public function getBlog() public function getBlog($page) { $start = $page*5; $stop = $start + 5; $db = $this->dbConnect(); $req = $db->query('SELECT * FROM l3m_blog ORDER BY id DESC LIMIT 0, 5'); $req = $db->prepare('SELECT * FROM l3m_blog ORDER BY id DESC LIMIT '. $start .', '. $stop .''); $posts = $req->fetch(); return $req; return $posts; } public function getBlogPost($link) Loading Loading
css/design.css +40 −8 Original line number Diff line number Diff line Loading @@ -25,10 +25,10 @@ CSS font-family: ubuntumono; background-color: #f0f0f0; padding: 2px; border-bottom: 5px solid #cccccc; border-bottom: 5px solid #ccc; } article p, #pageTitle, article h3, article ul{ article p, #pageTitle, article h3, article ul, article form{ max-width: 1500px; margin: 30px auto; } Loading Loading @@ -63,7 +63,6 @@ h2{ font-size: 1.5em; } h3 a{ text-decoration: none; text-shadow: 0 0 1px #69f; Loading Loading @@ -106,12 +105,9 @@ article{ background-color: #f0f0f0; } section{ } #listMenu .selected{ padding-bottom: 2px; border-bottom: 5px solid #cccccc; border-bottom: 5px solid #ccc; } article .postInfos{ Loading @@ -129,7 +125,7 @@ article .postInfos{ hr{ width: 66%; border: 1px solid #CFCFCF; border: 1px solid #ccc; } a{ Loading @@ -141,6 +137,42 @@ a:hover{ transition: color 0.3s; } input{ width: 50%; display: block; box-sizing: border-box; margin: 15px auto; padding: 10px; font-size: 1em; } input[type="text"], input[type="password"]{ background-color: white; border: none; padding-left: 13px; border-bottom: 3px solid #ccc; border-left: 0px solid #ccc; transition: border-left 0.05s, padding-left 0.05s; } input[type="text"]:hover, input[type="password"]:hover, input[type="text"]:focus, input[type="password"]:focus{ border-left: 3px solid #ccc; padding-left: 10px; transition: border-left 0.05s, padding-left 0.05s; } input[type="submit"]{ background-color: #ccc; border: none; transition: background-color 0.3s; } input[type="submit"]:hover{ background-color: #ddd; transition: background-color 0.3s; } /* ==== Loading
index.php +2 −0 Original line number Diff line number Diff line <?php session_start(); require_once("site/controller/mainController.php"); require_once("site/layout/layout.php"); Loading
site/controller/mainController.php +38 −6 Original line number Diff line number Diff line <?php ini_set('display_errors','on'); error_reporting(E_ALL|E_STRICT); require_once("site/model/config.php"); require_once("site/model/Base.php"); Loading Loading @@ -31,6 +29,12 @@ function getPageName(){ case 'article': return [$_GET['title'], $_GET['title']]; break; case 'patate': return ["Administration", "administration"]; break; case 'eplucher': return ["prout hihi", "eplucher"]; break; default: return ["Blog", "blog"]; break; Loading @@ -44,6 +48,7 @@ function getPageName(){ function writeMenu($pageName){ ?> <ul id="listMenu"> <?php if($pageName == "Administration"){ ?><li><h2><a href="/eplucher" class="selected">🔧</a></h2></li><?php } ?> <li><h2><a href="/" title="Blog" <?php if($pageName == "Blog"){ ?>class="selected"<?php } ?>>Blog</a></h2></li> <li><h2><a href="/about" title="À propos" <?php if($pageName == "À Propos"){ ?>class="selected"<?php } ?>>À propos</a></h2></li> <li><h2><a href="/projects" title="Projets" <?php if($pageName == "Projets"){ ?>class="selected"<?php } ?>>Projets</a></h2></li> Loading @@ -51,8 +56,6 @@ function writeMenu($pageName){ </ul> <?php } function writeBlogPage($pageName){ if($pageName[1] == "blog"){ Loading @@ -67,7 +70,7 @@ function writeBlogPage($pageName){ header("Location:/404"); } else{ $blogposts = $blog->getBlog(); $blogposts = $blog->getBlog(0); require("site/view/public/blogView.php"); } } Loading @@ -82,6 +85,35 @@ function writeProjectsPage($pageName){ require("site/view/public/projectsView.php"); } function loginAdminPage($pageName){ if(password_verify($_POST['pass'], pass) && $_POST['user'] == user){ $_SESSION['user'] = $_POST['user']; $_SESSION['pass'] = $_POST['pass']; header("Location:/patate"); } else echo "nan"; } function writeAdminPage($pageName){ if(verifyAdminConnect()) require("site/view/private/admin.php"); else{ require("site/view/private/loginFormView.php"); } } function verifyAdminConnect(){ return isset($_SESSION['user']) && $_SESSION['user'] == user && isset($_SESSION['pass']) && password_verify($_SESSION['pass'], pass); } function decoAdminPage(){ $_SESSION = array(); header("Location:/"); } $pageName = getPageName(); No newline at end of file
site/layout/layout.php +12 −1 Original line number Diff line number Diff line Loading @@ -55,6 +55,17 @@ case '404': require("site/view/public/404.php"); break; case 'administration': if(isset($_POST['user']) && isset($_POST['pass'])){ loginAdminPage($pageName); } else{ writeAdminPage($pageName); } break; case 'eplucher': decoAdminPage(); break; default: # code... Loading @@ -65,7 +76,7 @@ <footer id="footer"> <p> Site créé par Corentin Bettiol - <a href="/changelog" title="changelog">Changelog</a> - <a href="/rss" title="rss">RSS</a> - v5 Site en vanilla html5/css3/php7, fait avec ♥ - <a href="/changelog" title="changelog">Changelog</a> - <a href="/rss" title="rss">RSS</a> - v5 </p> </footer> Loading
site/model/BlogManager.php +7 −3 Original line number Diff line number Diff line <?php class BlogManager extends Base { public function getBlog() public function getBlog($page) { $start = $page*5; $stop = $start + 5; $db = $this->dbConnect(); $req = $db->query('SELECT * FROM l3m_blog ORDER BY id DESC LIMIT 0, 5'); $req = $db->prepare('SELECT * FROM l3m_blog ORDER BY id DESC LIMIT '. $start .', '. $stop .''); $posts = $req->fetch(); return $req; return $posts; } public function getBlogPost($link) Loading