Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Форуми / Cotonti / Core Labs / Archive / Change Request :: Recent Items plugin

#1 01.04.2010 16:37
* 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 !!!)


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 -==

Відредаговано: ez (01.04.2010 16:44, 11 років тому)
#2 12.04.2010 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!