From: Eloi G. <ada...@us...> - 2004-11-08 01:06:03
|
Update of /cvsroot/phpwebsite-comm/modules/article/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11723/inc Modified Files: AM_view_news.php Log Message: - The view=news display now accepts an additional switch, "show=more". If you want your news display to show only articles that *didn't* appear on the homepage, use the following URL: /index.php?module=article&view=news&show=more - A paging bug in view=news is now fixed. Index: AM_view_news.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/inc/AM_view_news.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AM_view_news.php 13 Oct 2004 02:51:43 -0000 1.8 --- AM_view_news.php 8 Nov 2004 01:05:21 -0000 1.9 *************** *** 46,49 **** --- 46,58 ---- $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']); + /* If user is just looking for additional articles that did not + * show up on the homepage, filter out those that were shown. */ + $TotalCount = $this->val['summaries_on_homepage'] + $this->val['prev_n_articles']; + if (isset($_REQUEST['show']) && $_REQUEST['order']='more' && $TotalCount>0 + && $exclusions = $GLOBALS['core']->getCol('SELECT * FROM ' . $this->sql_article_table + . ' WHERE ' . $this->get_published_sql().' AND mainarticle=0'. $this->sql_predicate + . ' AND announce ORDER BY updated_date DESC LIMIT ' . $TotalCount)) { + $result = array_diff($result, $exclusions); + } $this->pager->setData($result); $result = NULL; |