PDA

View Full Version : Condition Functions


Negrosoo
04-19-2009, 05:31 PM
How I can create new condition functions as in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg() is_browser() is_member_of() ??

Lynne
04-19-2009, 05:35 PM
Huh? Perhaps the manual will help - Using PHP Functions in Template Conditionals (http://www.vbulletin.com/docs/html/functions_in_conditionals)

Negrosoo
04-19-2009, 05:38 PM
Yes, I know it, thanks. But how can I create a new function as isset() that do what I want?

Lynne
04-19-2009, 05:52 PM
What do you mean create a new function? You just write one and add it (via a plugin is usually the easy way).

hook_location "whatever":
function my_function {
all your code
}

I'm just not getting your question.

Dismounted
04-20-2009, 05:59 AM
If I understand you correctly, you want to add your own function to the allowed functions list?

Negrosoo
04-20-2009, 01:24 PM
exatly

Dismounted
04-21-2009, 09:29 AM
Use the hook template_safe_functions, and add to the $safe_functions array. Note that should not be used excessively, and should only be used if absolutely required.