Mercurial > defr > DualBlog
comparison includes/class.post.php @ 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 | 25c6e59f019e |
children |
comparison
equal
deleted
inserted
replaced
75:49b0a2f3a118 | 76:55582b82c43d |
---|---|
45 } | 45 } |
46 | 46 |
47 // On détermine les tags du post | 47 // On détermine les tags du post |
48 $db = Factory::getDB(); | 48 $db = Factory::getDB(); |
49 $nbTags = $db->Query(" | 49 $nbTags = $db->Query(" |
50 SELECT T.Tag | 50 SELECT T.Tag |
51 FROM Tags T, Lien_Tags_Posts L | 51 FROM Tags T, Lien_Tags_Posts L |
52 WHERE L.idMess={$infos['num_mess']} AND L.idTag = T.idTag | 52 WHERE L.idMess={$infos['num_mess']} AND L.idTag = T.idTag |
53 ORDER BY T.Tag | 53 ORDER BY T.Tag |
54 ", 2); | 54 ", 'Tags'); |
55 $tags = ''; | 55 $tags = array(); |
56 if($nbTags > 0) | 56 if($nbTags > 0) |
57 { | 57 { |
58 while(0 !== ($tag = $db->GetRow(2))) | 58 while(0 !== ($tag = $db->GetRow('Tags'))) |
59 { | 59 { |
60 $tags .= sprintf("<a href='%s'>%s</a> |", | 60 $tags[] = sprintf("<a href='%s' class='tag'>%s</a>", |
61 BLOG_URL . '/tags/' . urlencode($tag['Tag']), | 61 BLOG_URL . '/tags/' . urlencode($tag['Tag']), |
62 $tag['Tag']); | 62 $tag['Tag']); |
63 } | 63 } |
64 $tags = substr($tags, 0, -1); | 64 $tags = implode(' | ', $tags); |
65 $this->tags = $this->tpl->getDocumentFragment(); | 65 $this->tags = $this->tpl->getDocumentFragment(); |
66 $this->tags->appendXML($tags); | 66 $this->tags->appendXML($tags); |
67 } | 67 } |
68 else { | 68 else { |
69 $this->tags = 'aucun'; | 69 $this->tags = 'aucun'; |