mirror of
https://github.com/Aviortheking/Blog_IMIE.git
synced 2025-05-05 17:17:54 +00:00
Merge branch 'master' of gitlab.com:aviortheking/blog_imie
This commit is contained in:
commit
59796c62dc
@ -12,7 +12,7 @@ CREATE TABLE posts (
|
|||||||
url VARCHAR(32),
|
url VARCHAR(32),
|
||||||
content TEXT,
|
content TEXT,
|
||||||
short varchar(256),
|
short varchar(256),
|
||||||
dt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
dt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
categorie INT,
|
categorie INT,
|
||||||
author INT
|
author INT
|
||||||
);
|
);
|
||||||
@ -70,7 +70,7 @@ INSERT INTO users (username, linkedin) VALUES ('Florian Bouillon', NULL), ('Adri
|
|||||||
INSERT INTO categories (name) VALUES ('devops'), ('ops'), ('dev'), ('digi');
|
INSERT INTO categories (name) VALUES ('devops'), ('ops'), ('dev'), ('digi');
|
||||||
|
|
||||||
-- requete 1 :
|
-- requete 1 :
|
||||||
-- recuperer 10 posts avec la categorie associé la date du post et les 256 premiers mots du contenu
|
-- recuperer 10 posts avec la categorie associé la date du post et les 256 premiers mots du contenu
|
||||||
|
|
||||||
SELECT title, short, categorie, url FROM posts
|
SELECT title, short, categorie, url FROM posts
|
||||||
LIMIT 10;
|
LIMIT 10;
|
||||||
@ -83,8 +83,8 @@ FROM post
|
|||||||
INNER JOIN users BY post.author=user.id
|
INNER JOIN users BY post.author=user.id
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
|
|
||||||
-- requette 3 : comme la 1 sauf uniquement les 6 posts les plus récents
|
-- requette 3 : comme la 1 sauf uniquement les 6 posts les plus récents
|
||||||
-- requete lancée lors sur la page d'accueil
|
-- requete lancée lors sur la page d'accueil
|
||||||
SELECT title, categories.name as categorie, dt as date, short as content
|
SELECT title, categories.name as categorie, dt as date, short as content
|
||||||
FROM posts
|
FROM posts
|
||||||
INNER JOIN categories ON categories.id=posts.categorie
|
INNER JOIN categories ON categories.id=posts.categorie
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<div class="bloc_principal">
|
<div class="bloc_principal">
|
||||||
<div class="cover-black">
|
<div class="cover-black">
|
||||||
<div class="bloc_principal_titre">
|
<div class="bloc_principal_titre">
|
||||||
<h1>Le blog des apprenants</h1>
|
<h1>L'actualité de nos campus...</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="test2">
|
<div class="test2">
|
||||||
<h2 id="titre-home">Ceci est un magnifique titre</h2>
|
<h2 id="titre-home">Ceci est un magnifique titre</h2>
|
||||||
@ -30,7 +30,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<h3 id="titre-between">Articles récents</h3>
|
<h3 id="titre-between">Articles récents</h3>
|
||||||
<div class="row articles">
|
<div class="row articles">
|
||||||
<tag type="loop" for="posts" limit="6">
|
<tag type="loop" for="posts" limit="6">
|
||||||
@ -49,14 +48,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<loop column="content" />
|
<loop column="content" />
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</tag>
|
</tag>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
<!-- <tag type="includes" file="footer" /> -->
|
<tag type="includes" file="footer" />
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ $search = function () {
|
|||||||
|
|
||||||
$router->addRoute("/^\/search\/$/", $search); // route "/search/*"
|
$router->addRoute("/^\/search\/$/", $search); // route "/search/*"
|
||||||
|
|
||||||
$post = function() {
|
$edit = function() {
|
||||||
$_POST = array_merge($_POST, $_GET); //debug uniquement
|
$_POST = array_merge($_POST, $_GET); //debug uniquement
|
||||||
var_dump($_POST);
|
var_dump($_POST);
|
||||||
/*
|
/*
|
||||||
@ -78,4 +78,4 @@ $post = function() {
|
|||||||
$prepared->execute();
|
$prepared->execute();
|
||||||
};
|
};
|
||||||
|
|
||||||
$router->addRoute("/^\/post\/" . $postCharacters . "+\/edit\/*$/", $post);
|
$router->addRoute("/^\/post\/" . $postCharacters . "+\/edit\/*$/", $edit);
|
||||||
|
@ -273,7 +273,6 @@ function loadTags($ctnt) {
|
|||||||
$head->item(0)->appendChild($t);
|
$head->item(0)->appendChild($t);
|
||||||
}
|
}
|
||||||
|
|
||||||
$test = array();
|
|
||||||
|
|
||||||
$list = $dom->getElementsByTagName("tag");
|
$list = $dom->getElementsByTagName("tag");
|
||||||
|
|
||||||
@ -281,26 +280,12 @@ function loadTags($ctnt) {
|
|||||||
while($lst = $list->item(0)) {
|
while($lst = $list->item(0)) {
|
||||||
|
|
||||||
$tgs = ucfirst($lst->getAttribute("type"));
|
$tgs = ucfirst($lst->getAttribute("type"));
|
||||||
array_push($test, $tgs);
|
|
||||||
$tg = new $tgs($dom, $lst, false);
|
$tg = new $tgs($dom, $lst, false);
|
||||||
|
|
||||||
$tg->render();
|
$tg->render();
|
||||||
// var_dump("--------- 1 ---------");
|
|
||||||
// for ($i=0; $i < $list->count(); $i++) {
|
|
||||||
// var_dump($list->item($i)->getAttribute("type"));
|
|
||||||
// }
|
|
||||||
// echo (htmlspecialchars($dom->saveHTML()));
|
|
||||||
|
|
||||||
// var_dump($list[0]->parentNode->nodeName);
|
|
||||||
|
|
||||||
$lst->parentNode->removeChild($lst);
|
$lst->parentNode->removeChild($lst);
|
||||||
|
|
||||||
// var_dump("--------- 2 ---------");
|
|
||||||
// for ($i=0; $i < $list->count(); $i++) {
|
|
||||||
// var_dump($list->item($i)->getAttribute("type"));
|
|
||||||
// }
|
|
||||||
// echo (htmlspecialchars($dom->saveHTML()));
|
|
||||||
|
|
||||||
$list = $dom->getElementsByTagName("tag");
|
$list = $dom->getElementsByTagName("tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user