Forums / Unrelated / Offtopic / ignore a category in plugin recent index

ignore a category in plugin recent index

elfrenazo
#1 2012-01-20 11:16

you can ignore a category in plugin recent index ?

GHengeveld
#2 2012-01-20 14:14

With recentitems its not possible. It should be relatively simple to modify it to ignore specific categories though. Maybe you can try that and release it so we can use it in the Cotonti package?

elfrenazo
#3 2012-01-20 14:46

ok thanks for your answer

ez
#4 2012-01-20 20:08

Something like this !!
I have developed it years ago.. its ez..
By the way this code also does the time exclusion bit

	/* 2basix change: added exclude categories and added timefilter */
	// 2basix added: page_author
	$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, page_author FROM $db_pages WHERE page_state=0 AND $timefilter AND FIND_IN_SET(page_cat,'$excludecats')<=0 ORDER by page_date DESC LIMIT $l");

	$newitem = (empty($excludecats) ? "":",".$excludecats );
	/* 2basix EndOfChange EOC */
Like you see i made a new item in setup called excludecats:
something like this

excludecats=02:string:::Exclude PageCats (comma separated)
==- I say: Keep it EZ -==
GHengeveld
#5 2012-01-20 23:00

$sys['now_offset'] is replaced with $sys['now'] in recent versions of Cotonti. The one with _offset was used to work with user's timezone setting, but this has been replaced with a more global approach which doesn't need it anymore, so $sys['now_offset'] and $sys['now'] are identical.

@ez: If you fork Cotonti on Github, then make this change to the recentitems plugin and send a pull request, I can include this feature in the core package.

elfrenazo
#6 2012-01-21 04:34
#32839 ez:

Something like this !!
I have developed it years ago.. its ez..
By the way this code also does the time exclusion bit

	/* 2basix change: added exclude categories and added timefilter */
	// 2basix added: page_author
	$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, page_author FROM $db_pages WHERE page_state=0 AND $timefilter AND FIND_IN_SET(page_cat,'$excludecats')<=0 ORDER by page_date DESC LIMIT $l");

	$newitem = (empty($excludecats) ? "":",".$excludecats );
	/* 2basix EndOfChange EOC */
Like you see i made a new item in setup called excludecats:
something like this

excludecats=02:string:::Exclude PageCats (comma separated)

 where I have to put that code?
sorry no i'am programmer

ez
#7 2012-01-21 08:53

@Gert:
I have no intention to work on cotonti... i simply havent got the time.. but you are free to use this change :) its a good one that should have been there long ago..

@Elfrenazo:
This is very easy to change for the cot devs... so they can implement it.. i am not familiar with github so this will cost me too much time to do what Gert suggested..
Sorry about that...

==- I say: Keep it EZ -==
elfrenazo
#8 2012-01-21 10:40

without problems, it is not essential, thanks for your time smiley