Page 1 of 1
Simple conditionals don't work -- error
Posted:
June 22nd, 2011, 6:19 am
by openmtbmap
See attached warnings, I'm prety sure that I did everything allright. Are simple conditionals still experimental (no video tutorial) or is there simply a problem?
(all text that is inside the conditional is not displayed to anyone and dropped - logged in or logged out).
I'ld really love to have working simple conditionals.
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'is_user_loggede' not found or invalid function name in /srv/www/htdocs/wp-content/plugins/s2member/includes/classes/sc-if-conds-in.inc.php on line 125
Warning: call_user_func() expects parameter 1 to be a valid callback, function ' !is_user_loggede' not found or invalid function name in /srv/www/htdocs/wp-content/plugins/s2member/includes/classes/sc-if-conds-in.inc.php on line 125
Or
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ' current_user_can' not found or invalid function name in /srv/www/htdocs/wp-content/plugins/s2member/includes/classes/sc-if-conds-in.inc.php on line 138
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ' !current_user_can' not found or invalid function name in /srv/www/htdocs/wp-content/plugins/s2member/includes/classes/sc-if-conds-in.inc.php on line 138
Re: Simple conditionals don't work -- error
Posted:
June 22nd, 2011, 1:59 pm
by BobTabor
I have simple conditions working for me ... could you post the code you're trying to get to run? Perhaps that might shed some light on the issue.
Re: Simple conditionals don't work -- error
Posted:
June 22nd, 2011, 7:09 pm
by Cristián Lávaque
Yes, please show us your code so we can review it.
From the errors, I can tell you that the first two show the function written wrong: "is_user_loggede" instead of "is_user_logged_in".
Re: Simple conditionals don't work -- error
Posted:
June 23rd, 2011, 4:11 pm
by openmtbmap
Will do next Monday. I simply copy/pasted the functions from the s2member simple conditionals form. And I cannot see any difference between your first is_user_loggede and the instead. For me it is both identical. ???
Or is there a difference on the "". Those are really dangerous, as they are used differently according to language syntac on your system. So it's very likely a wrong one is used and not both accepted (even copy / paste can go wrong). Just like point and comma switched English/German in numbers and some other stuff.
Re: Simple conditionals don't work -- error
Posted:
June 23rd, 2011, 6:26 pm
by Cristián Lávaque
Maybe this way it'll be more noticeable:
is_user_loggede
is_user_logged_in
Re: Simple conditionals don't work -- error
Posted:
June 28th, 2011, 4:14 am
by openmtbmap
Okay, I found out the problems:
1. you cannot copy from the examples in the documentation (or better you may but only with a "copy plain text" function).
2. The examples are somehow output incorrect (loggede instead of logged_in) - so one has to look into sc_if_conds_in.inc.php to find out what the real function is called
-- Overall not userfriendly at all if no unformatted and correct examples for the code exist (and tell user to use source or html view). If this is not possible in the s2member options page, then drop the examples completly or put a warning to not copy them.
P.S. if simply copying over (also copying over to source code view will break things as missing operands like </p> may crash a novice user).
P.S.S.
This is what happens when you simply copy in the expample code (of course this won't work):
<p>[/s2If]</p>
<p><br />
<code><span style="color: #000000"><span style="color:#164A61;">[s2If is_user_loggede()]</span><br />
Content for anyone that is logged in, regardless of their Membership Level.<br />
<span style="color:#164A61;">[/s2If]</span></span></code></p>
P.S.S.S ****, I think Firefox or this forum software does not allow showing logged _ in in one word. It is ouput as loggede. I entered logged _ in (without spaces) and after submitting it, it shows as loggede instead. Therefore I also could not see any difference in the above example.
Re: Simple conditionals don't work -- error
Posted:
June 28th, 2011, 2:22 pm
by Cristián Lávaque
Got it, thanks for the update.
Note to others with this problem: If the text formatting is included when copy/pasting the code examples from the documentation to the WP editor, then go to the HTML tab of the editor and paste it there.
Re: Simple conditionals don't work -- error
Posted:
June 28th, 2011, 2:30 pm
by openmtbmap
Well that still does not solve the loggede problem - best provide the examples in an additional text file that is noted, then neither formatting nor logged_in displaying wrong will happen.
Chrome and Internet Explorer 8 do not show this problem for me. Just Firefox 4 and 5 (well have no more installation of Firefox 3 so cannot tell).
Re: Simple conditionals don't work -- error
Posted:
June 28th, 2011, 3:06 pm
by Cristián Lávaque
Could you show me screenshots of what you mean, please?
Re: Simple conditionals don't work -- error
Posted:
June 28th, 2011, 3:21 pm
by openmtbmap
Here you go. That's how it looks for me.
Uploaded with
ImageShack.us
Re: Simple conditionals don't work -- error
Posted:
June 28th, 2011, 3:28 pm
by openmtbmap
Ohhh, big sorry. I had a Firefox plugin run havoc and changing all _in to simple "e".
(plugin is called Binnen-I-be-gone and supposed to only delete /in as this is an Austrian incorrect writing annoyance of gendering words (e.g. ProfessorInnen instead of the correct Professoren)
Re: Simple conditionals don't work -- error
Posted:
June 28th, 2011, 3:38 pm
by Cristián Lávaque
Thanks for the udpate!
I'm glad you found the problem and you now can read loggede properly. Just kidding: logged_in.