View Single Post
Old 02-11-2014, 12:52 AM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Using list_difference() [see here]:
Quote:
list_difference(list1, list2, separator) – return a list made by removing from list1 any item found in list2, using a case-insensitive compare. The items in list1 and list2 are separated by separator, as are the items in the returned list.
PHP Code:
list_difference(
    
field('tags'),
    
"comma,separated,list,of,excluded,tags",
    
","

will return a new list, that contains only the items in list1 (tags field) that are not excluded using list2 ("comma,separated,list,of,excluded,tags")

So try this:
PHP Code:
program:

str_in_list(
    
list_difference(
        
field('tags'),
        
"comma,separated,list,of,excluded,tags",
        
","
    
),
    
",",
    
"First",
    
"First",
    
""


It appears that the "PHP" BBCode is better than the "CODE" BBCode for this CODE.
eschwartz is offline   Reply With Quote