Community Support Forums — WordPress® ( Users Helping Users ) — 2011-06-19T11:44:26-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=10199 2011-06-19T11:44:26-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10199&p=21144#p21144 <![CDATA[Re: scripting problem]]>

Statistics: Posted by Cristián Lávaque — June 19th, 2011, 11:44 am


]]>
2011-06-19T08:10:12-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10199&p=21136#p21136 <![CDATA[Re: scripting problem]]> Statistics: Posted by clubdesleaders — June 19th, 2011, 8:10 am


]]>
2011-06-18T23:55:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10199&p=21122#p21122 <![CDATA[Re: scripting problem]]>
Code:
[s2If current_user_cannot(access_s2member_level1)]
Opened first s2If.

[_s2If current_user_can(access_s2member_ccap_vip)]
Opened a nested _s2If.

[s2If current_user_can(access_s2member_level1)]
Opened a second s2If, without having closed the first one (including the nested _s2If).

[_s2If current_user_can(access_s2member_ccap_vip)]
Opened a second _s2If without having closed the previous _s2If.

[/s2If]
Closed the first s2If.

[s2If current_user_can(access_s2member_level1)]
Then you opened a third s2If, with all the above still open.

[/s2If]
Closed the second s2If.


I don't even know how WordPress would parse that since the nesting is all off, but it's to be expected that they won't work right and thus you'll have trouble like free members viewing content not meant for them.

Without knowing how you actually want the logic to go, if I am shown the above to fix the nesting, I'd do this:

Code:
[s2If current_user_cannot(access_s2member_level1)]
  [_s2If current_user_can(access_s2member_ccap_vip)]
  [/_s2If]
[/s2If]

[s2If current_user_can(access_s2member_level1)]
  [_s2If current_user_can(access_s2member_ccap_vip)]
  [/_s2If]
[/s2If]

[s2If current_user_can(access_s2member_level1)]
[/s2If]


This may help understand better how to do it, so you use it the way you prefer in your page.

Statistics: Posted by Cristián Lávaque — June 18th, 2011, 11:55 pm


]]>
2011-06-18T16:09:52-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10199&p=21109#p21109 <![CDATA[Re: scripting problem]]> Statistics: Posted by clubdesleaders — June 18th, 2011, 4:09 pm


]]>
2011-06-18T13:38:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10199&p=21101#p21101 <![CDATA[Re: scripting problem]]>
Code:
[s2If current_user_cannot(access_s2member_level1)]

[_s2If current_user_can(access_s2member_ccap_vip)]

[s2If current_user_can(access_s2member_level1)]

[_s2If current_user_can(access_s2member_ccap_vip)]

[/s2If]

[s2If current_user_can(access_s2member_level1)]

[/s2If]


The nesting is not correct. Only the last condition there is fine.

If you start an s2If, you need to close it before opening a new s2If. To open an s2If inside an open one you prefix it with an underdash like this _s2If.

You can't cross them like starting an s2If, then an _s2If, then closing the s2If, and then the _s2If. That's not nesting, the nested one has to be opened and closed inside the parent one.

And you have to close the ones you open.

WP Admin -> s2Member -> API / Scripting -> Using Simple Conditionals

I hope that helps. :)

Statistics: Posted by Cristián Lávaque — June 18th, 2011, 1:38 pm


]]>
2011-06-18T07:43:02-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10199&p=21092#p21092 <![CDATA[scripting problem]]>
I have 2 levels of membership :
Level 0
Level 1 with custom capabilities. One of the capabilities is vip. and the vip can download their bonuses. Other members no.
I write down this script; everything is working fine but I have an error. Member level 0 can access VIP bonus. What did I right wrong? Can anyone help me with this? Thanks

Code:
<h1 style="text-align: center;">Bienvenue, <code>[s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /].</code>dans votre espace personnel<span style="color: #000066;">
</span></h1>
<h2 style="text-align: center;"><span style="color: #339966;">Vous trouverez dans cette espace toutes les informations relatives à votre adhésion et vous pourrez également, si vous le souhaitez, changez votre mot de passe, mettre à jour votre abonnement ou télécharger vos bonus.</span></h2>
<p style="text-align: left;">Actuellement vous avez accès au statut de <code> [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /].</code></p>
<p style="text-align: left;">[s2If current_user_cannot(access_s2member_level1)]</p>
[_s2If current_user_can(access_s2member_ccap_vip)]
<p style="text-align: left;">Pour pouvoir bénéficier de tous les avantages des membres V.I.P,  passez au niveau supérieur.</p>
<p style="text-align: left;"><a href="  https://www.club-des-leaders.com/formulaire" target="_blank"><img class="aligncenter size-full wp-image-2229" title="btn_subscribeCC_LG" src="http://www.club-des-leaders.com/wp-content/uploads/btn_subscribeCC_LG.gif" alt="" width="172" height="47" /></a></p>
<p style="text-align: center;"><em><span style="text-decoration: underline;"><strong>P.S</strong></span>: Si vous souhaitez changez votre mot de passe, n'oubliez surtout pas de le réinscrire deux fois</em>.</p>
&nbsp;
<iframe src="http://www.club-des-leaders.com/?s2member_profile=1" scrolling="auto" style="width:100%; height:325px; border:1px solid #CCA94B;"></iframe>
&nbsp;
[s2If current_user_can(access_s2member_level1)]
<h4><span style="text-decoration: underline;"><em><strong>Voici vos bonus:</strong></em></span></h4>
[_s2If current_user_can(access_s2member_ccap_vip)]
<a href="http://www.club-des-leaders.com/?s2member_file_download=bonus/GuideetudeHRP.pdf" target="_blank">Étude autour de l'homme est le reflet de vos pensées. (Cliquez sur le lien et sauvegardez)</a>

<a href="http://www.club-des-leaders.com/?s2member_file_download=bonus/RDRetmanuel.pdf" target="_blank">Réfléchissez et Devenez Riche - Livre et Manuel d'apprentissage. (Cliquez et sauvegardez)</a>
[/s2If]

[s2If current_user_can(access_s2member_level1)]
<h3><span style="color: #000066;">Si vous souhaitez annulez votre adhésion, cliquez sur la bouton ci-dessous:</span></h3>
<a style="outline: none;" href="https://www.paypal.com/cgi-bin/webscr?cmd=_subscr-find&amp;alias=agnes@agnesboukaram.com">
<img style="width: auto; height: auto; border: 0pt none;" src="http://www.club-des-leaders.com/wp-content/uploads/btn_unsubscribe_LG.gif" alt="PayPal®" />
</a>[/s2If]

Statistics: Posted by clubdesleaders — June 18th, 2011, 7:43 am


]]>