Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forums / Cotonti / Core Labs / Archive / Change Request :: Recent Items plugin

ez
#1 2010-04-01 16:37
Functionality:
* Add a way to exclude certain pagecategories from the recentitems output
* Add the page_begin and page_expire to the sql (I think this is a bug !!!)

Solution:

1) Add a config item called excludecats in the setup
excludecats=06:string:::Exclude PageCats (comma separated)

2) Modify code in recentitems.php (around line 40 or so)
/* LLS change: added exclude categories and added timefilter */
$excludecats = trim($cfg['plugin']['recentitems']['excludecats']);
$excludecats = "system". (empty($excludecats) ? "":",".$excludecats );
$timefilter = "page_begin<'".$sys['now_offset']."' AND page_expire>'".$sys['now_offset']."'";

$sql = sed_sql_query("SELECT page_id, page_alias, page_cat, page_title, page_date FROM $db_pages WHERE page_state=0 AND $timefilter AND FIND_IN_SET(page_cat,'$excludecats')<=0 ORDER by page_date DESC LIMIT $l");
/* LLS EndOfChange EOC */

Thank you.. and have fun with this idea :)

anyway... tell me what you think !!
==- I say: Keep it EZ -==

This post was edited by ez (2010-04-01 16:44, 9 years ago)
Trustmaster
#2 2010-04-12 18:59
page_begin and page_expire were originally developed for masking outdated news on index. In pages/categories it is not considered because otherwise thousands of pages on live sites will become outdated/unavailable.
May the Source be with you!