Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

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

#23898 1. April 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 -==

Dieser Beitrag wurde von ez (am 1. April 2010, 16:44, vor 11 Jahre) bearbeitet