From 25a101d128ada4cac4e634b1c0fdd881551fd376 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sun, 7 Dec 2008 20:25:36 -0500 Subject: Redid multiple tag system This new tag system has a seperate table for tags. This way, a tag cloud can be made much more easily than if using the previous system. This changeset requires manual maintinence. --- pages/blog.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pages/blog.php') diff --git a/pages/blog.php b/pages/blog.php index 009326c..879aa0f 100755 --- a/pages/blog.php +++ b/pages/blog.php @@ -74,7 +74,7 @@ if (isset($_GET['post'])) 'RATING' => $getpost3['rating'], 'TEXT' => parseBBCode($getpost3['text']))); - $tags = unserialize($getpost3['tags']); + $tags = getTags($getpost3['id']); foreach ($tags as $tag) { $template->adds_ref_sub(0, 'TAGS', array('TAG' => $tag)); @@ -135,7 +135,7 @@ if (isset($_GET['post'])) if (isset($_GET['author'])) { $title = 'Author: ' . $_GET['author'] . ' - Blog Archive'; - $getposts = "SELECT * FROM updates WHERE author = \"" . $_GET['author'] . "\" ORDER BY id DESC"; + $getposts = "SELECT * FROM updates AS u WHERE author = \"" . $_GET['author'] . "\" ORDER BY id DESC"; $getbio = "SELECT * FROM bio WHERE username = \"" . $_GET['author'] . "\""; $getbio2 = mysql_query($getbio); $getbio3 = mysql_fetch_array($getbio2); @@ -148,10 +148,10 @@ if (isset($_GET['post'])) } elseif (isset($_GET['tag'])) { $title = 'Tag: ' . $_GET['tag'] . ' - Blog Archive'; - $getposts = "SELECT * FROM updates WHERE tags LIKE '%s:" . strlen($_GET['tag']) . ":\"" . $_GET['tag'] . "\"%' ORDER BY id DESC"; + $getposts = "SELECT * FROM updates AS u, tags AS t WHERE u.id = t.post_id AND t.post_type = \"published\" AND t.tag = \"" . $_GET['tag'] . "\" ORDER BY u.id DESC"; } else { $title = 'Blog Archive'; - $getposts = "SELECT * FROM updates ORDER BY id DESC"; + $getposts = "SELECT * FROM updates AS u ORDER BY id DESC"; } $getposts2 = mysql_query($getposts); $i=0; -- cgit 1.4.1