Thanks for your swift reply!
Ad 1. You're right of course, and in the actual code the word "function" is there.
Ad 2. The if-else did the trick, thanks! - I hope it will continue working as I add additional conditions, see next point..
Ad 3. What I am working towards is testing against a number of conditions to see if the function should be executed. I thought the best way was to declare $callModornot and then use conditional statements to determine if it should be 0 or 1.
Basically I have three scenarios. In the first, when the value of $moap_inexclude is 'module', the function should simply execute. In the second scenario, when $moap_inexclude has a value of 'exclude', the idea is to set $callModornot to 1 and then test against a number of conditions to see if it should be set to 0. The other way around is the third scenario, when the value of $moap_inexclude is 'include', which sets $callModornot to 0 and then tests against a number of conditions to see if it should be set to 1.
I do not know if there is a smarter way to do this, but to illustrate here is the current state of progress with the second scenario:
Code:
if ($moap_inexclude == "exclude") {
$callModornot = 1;
if (
($moap_view == 0 && ($option="com_content" && $task="view")) ||
($moap_blogcat == 0 && ($option="com_content" && $task="blogcategory")) ||
($moap_cat == 0 && ($option="com_content" && $task="category")) ||
($moap_blogsect == 0 && ($option="com_content" && $task="blogsection")) ||
($moap_sect == 0 && ($option="com_content" && $task="section")) ||
($moap_content == 0 && ($option="com_content")) ||
($moap_frontcont == 0 && ($option="com_content" || $option="com_frontpage"))
) {
$callModornot = 0;
}
}