Commit 172b00de authored by Corentin Bettiol's avatar Corentin Bettiol 💻

oops

parent 89a7796a
......@@ -33,21 +33,19 @@ class Base
$slug = "default";
// check if the slug already exist
if($table == "blog" || $table == "project"){
$i = 1;
$old = $slug;
do{
$req = self::$db->prepare('SELECT slug FROM l3m_'. $table .' WHERE slug = ?');
$req->execute([$slug]);
$slugExist = $req->fetch();
if($slugExist)
{
$i++;
$slug = $old . "-" . $i;
}
$i = 1;
$old = $slug;
do{
$req = self::$db->prepare('SELECT slug FROM l3m_'. $table .' WHERE slug = ?');
$req->execute([$slug]);
$slugExist = $req->fetch();
if($slugExist)
{
$i++;
$slug = $old . "-" . $i;
}
while($slugExist);
}
while($slugExist);
return $slug;
}
......
......@@ -14,7 +14,7 @@ class TagManager extends Base
// on ajoute chaque tag dans les tables correspondantes
foreach ($tags as $tag)
{
$slug = $this->slugify($tag, null);
$slug = $this->slugify($tag, "tag");
$idTag = $this->exist($tag);
// si le tag n'existe pas, on l'ajoute dans la liste des tags
if(!$idTag)
......
<article>
<h3><a href="">21/03/19</a></h3>
<h3><a href="https://git.bitmycode.com/sodimel/l3m-website/commit/89a7796a6abd813c07b44c2273cd2f91e0299a4c">21/03/19</a></h3>
<ul>
<li>Ajout d'un slug pour les tags + possibilité de stocker des tags "emoji" dans la bdd</li>
<li>Ajout d'un effet de hover sur les tags</li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment