[pLog-svn] r3307 - plugins/trunk/categorybrowser
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Sun Apr 30 12:10:40 GMT 2006
Author: jondaley
Date: 2006-04-30 12:10:39 +0000 (Sun, 30 Apr 2006)
New Revision: 3307
Modified:
plugins/trunk/categorybrowser/plugincategorybrowser.class.php
Log:
resolve ambiguity in new 1.1 dbschema where articles.category_id exists.
Modified: plugins/trunk/categorybrowser/plugincategorybrowser.class.php
===================================================================
--- plugins/trunk/categorybrowser/plugincategorybrowser.class.php 2006-04-30 12:00:21 UTC (rev 3306)
+++ plugins/trunk/categorybrowser/plugincategorybrowser.class.php 2006-04-30 12:10:39 UTC (rev 3307)
@@ -44,10 +44,10 @@
// gets the article that is just before this one in
// the same category
$query = "SELECT id FROM " . $this->_prefix .
- "articles, " . $this->_prefix."article_categories_link" .
+ "articles, " . $this->_prefix."article_categories_link l" .
" WHERE date < '" . $article->getDate() .
"' AND status=1 AND blog_id = " . $blogId .
- " AND category_id = " . $categoryId .
+ " AND l.category_id = " . $categoryId .
" and article_id = id" .
" ORDER BY date DESC LIMIT 1;";
@@ -66,10 +66,10 @@
// gets the article that is just after this one in
// the same category
$query = "SELECT id FROM " . $this->_prefix .
- "articles, " . $this->_prefix."article_categories_link" .
+ "articles, " . $this->_prefix."article_categories_link l" .
" WHERE date > '" . $article->getDate() .
"' AND status=1 AND blog_id = " . $blogId .
- " AND category_id = " . $categoryId .
+ " AND l.category_id = " . $categoryId .
" and article_id = id" .
" ORDER BY date LIMIT 1;";
$result = $this->db->Execute($query);
@@ -87,9 +87,9 @@
function getFirstArticle($categoryId, $blogId){
// gets the first article in the category
$query = "SELECT id FROM " . $this->_prefix .
- "articles, " . $this->_prefix."article_categories_link" .
+ "articles, " . $this->_prefix."article_categories_link l" .
" WHERE status=1 AND blog_id = " . $blogId .
- " AND category_id = " . $categoryId .
+ " AND l.category_id = " . $categoryId .
" and article_id = id" .
" ORDER BY date LIMIT 1;";
@@ -107,9 +107,9 @@
function getLastArticle($categoryId, $blogId){
// gets the last article in the category
$query = "SELECT id FROM " . $this->_prefix .
- "articles, " . $this->_prefix."article_categories_link" .
+ "articles, " . $this->_prefix."article_categories_link l" .
" WHERE status=1 AND blog_id = " . $blogId .
- " AND category_id = " . $categoryId .
+ " AND l.category_id = " . $categoryId .
" and article_id = id" .
" ORDER BY date DESC LIMIT 1;";
More information about the pLog-svn
mailing list