changeset 76:55582b82c43d

Leger changement sur les tags, tag1 |tag2 => tag1 | tag2. Techniquement, on stocke desormais un array des tags. Accessoirement, en bonus, on vire les quelques tabs qui se trouvaient dans ce fichier pour les remplacer par des espaces.
author Franck Deroche <webmaster@defr.org>
date Sun, 29 Jun 2008 22:34:01 +0200
parents 49b0a2f3a118
children a8c013fa4416
files includes/class.post.php
diffstat 1 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/includes/class.post.php	Mon Mar 31 15:07:21 2008 +0200
+++ b/includes/class.post.php	Sun Jun 29 22:34:01 2008 +0200
@@ -47,21 +47,21 @@
    // On d├ętermine les tags du post
    $db = Factory::getDB();
    $nbTags = $db->Query("
-	    SELECT T.Tag
-	    FROM Tags T, Lien_Tags_Posts L
-	    WHERE L.idMess={$infos['num_mess']} AND  L.idTag = T.idTag
-	    ORDER BY T.Tag
-      ", 2);
-   $tags = '';
+        SELECT T.Tag
+        FROM Tags T, Lien_Tags_Posts L
+        WHERE L.idMess={$infos['num_mess']} AND  L.idTag = T.idTag
+        ORDER BY T.Tag
+      ", 'Tags');
+   $tags = array();
    if($nbTags > 0)
    {
-	    while(0 !== ($tag = $db->GetRow(2)))
-	    {
-		$tags .= sprintf("<a href='%s'>%s</a> |",
-		                BLOG_URL . '/tags/' . urlencode($tag['Tag']),
-				$tag['Tag']);
-	    }
-	    $tags = substr($tags, 0, -1);
+        while(0 !== ($tag = $db->GetRow('Tags')))
+        {
+            $tags[] = sprintf("<a href='%s' class='tag'>%s</a>",
+                              BLOG_URL . '/tags/' . urlencode($tag['Tag']),
+                              $tag['Tag']);
+        }
+        $tags = implode(' | ', $tags);
         $this->tags = $this->tpl->getDocumentFragment();
         $this->tags->appendXML($tags);
    }