From: Eloi G. <ada...@us...> - 2004-10-13 02:52:07
|
Update of /cvsroot/phpwebsite-comm/modules/article/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11512/inc Modified Files: AM_view_news.php Log Message: Fixed bug that was creating incomplete SQL syntax Index: AM_view_news.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/inc/AM_view_news.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AM_view_news.php 10 Oct 2004 15:36:10 -0000 1.7 --- AM_view_news.php 13 Oct 2004 02:51:43 -0000 1.8 *************** *** 28,48 **** if (!empty($this->news_filter['letter'])) { $filter = ' AND title LIKE "'.$this->news_filter['letter'].'%" ORDER BY title '; ! $this->news_filter['order'] = 'ASC'; } else { $this->news_filter['letter'] = ''; $filter = ' ORDER BY updated_date '; ! $this->news_filter['order'] = 'DESC'; } /* Allow user to override display order */ if (isset($_REQUEST['order']) && $o = strtolower($_REQUEST['order'])) { if ($o=='asc') ! $this->news_filter['order'] = 'ASC'; if ($o=='desc') ! $this->news_filter['order'] = 'DESC'; } $result = $GLOBALS['core']->getCol('SELECT id FROM ' . $this->sql_article_table ! . ' WHERE ' . $this->get_published_sql().' AND mainarticle=0'.$this->sql_predicate . $filter.$this->news_filter['order']); $this->pager->setData($result); $result = NULL; --- 28,49 ---- if (!empty($this->news_filter['letter'])) { $filter = ' AND title LIKE "'.$this->news_filter['letter'].'%" ORDER BY title '; ! $sort = 'ASC'; } else { $this->news_filter['letter'] = ''; $filter = ' ORDER BY updated_date '; ! $sort = 'DESC'; } /* Allow user to override display order */ if (isset($_REQUEST['order']) && $o = strtolower($_REQUEST['order'])) { if ($o=='asc') ! $sort = 'ASC'; if ($o=='desc') ! $sort = 'DESC'; } + $this->news_filter['order'] = $filter . $sort; $result = $GLOBALS['core']->getCol('SELECT id FROM ' . $this->sql_article_table ! . ' WHERE ' . $this->get_published_sql().' AND mainarticle=0'.$this->sql_predicate . $this->news_filter['order']); $this->pager->setData($result); $result = NULL; *************** *** 54,58 **** /* Retrieve all article listings for this page */ $sql = 'SELECT * FROM ' . $this->sql_article_table ! . ' WHERE id IN ('.$data.')'. $filter.$this->news_filter['order']; if(!$result = $GLOBALS['core']->query($sql)) return; --- 55,59 ---- /* Retrieve all article listings for this page */ $sql = 'SELECT * FROM ' . $this->sql_article_table ! . ' WHERE id IN ('.$data.')'. $this->news_filter['order']; if(!$result = $GLOBALS['core']->query($sql)) return; |