Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • House_of_Crazed
    Senior Member
    • May 2004
    • 241
    • 3.0.6

    Question

    Just to double check...

    Is there a condition built in that would enable us to hide certain paid subscriptions unless they're part of a specific usergroup??

    Please say yes lol ...
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Originally posted by House_of_Crazed
    Is there a condition built in that would enable us to hide certain paid subscriptions unless they're part of a specific usergroup??
    Admin CP -> Styles & Templates -> Style Manager -> « » -> Paid Subscriptions Templates -> subscription_availablebit

    Something like this:

    Code:
    [color=red]<if condition="CONDITION IN HERE">[/color]
    
    <fieldset class="fieldset">
    	<legend>$subscription[title]</legend>
    	<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
    	<tr>
    		<td width="67%" valign="top" rowspan="2">
    			<div style="margin-bottom:$stylevar[formspacer]px"><strong>$subscription[title]</strong></div>
    			$subscription[description]
    		</td>
    		<td width="3%" rowspan="2" style="border-$stylevar[left]:1px solid $stylevar[tborder_bgcolor]">&nbsp;</td>
    		<td width="30%" valign="top">
    			$vbphrase[validity_period]:
    			<strong>$subscription[length] $subscription[units]<if condition="$show['will_extend']"><strong class="highlight">*</strong></if></strong>
    		</td>
    	</tr>
    	<tr>
    		<td valign="bottom" nowrap="nowrap">
    			$vbphrase[cost]:<br />
    			<select name="currency[$subscription[subscriptionid]]" style="width:125px">$subscription[cost]</select>
    			<input type="submit" class="button" name="subscriptionids[$subscriptionid]" value="$vbphrase[order]" style="font-weight:normal" />
    		</td>
    	</tr>
    	</table>
    </fieldset>
    
    [color=red]</if>[/color]
    You can use variables like $subscription[title] and $bbuserinfo[usergroupid] in the condition to do what you want. The exact condition depends on exactly what you want to do.

    Comment

    • House_of_Crazed
      Senior Member
      • May 2004
      • 241
      • 3.0.6

      #3
      Oh...

      Okay, let me try and explain...

      I have 6 Paid Subscriptions. 3 of them are for anyone, no problem with those 3. However, the remaining 3 is for a specific usergroup. I want to hide the remaining 3 unless they're part of the specific usergroup. I am actually not sure how the best way would be to go about doing this.

      I've tried every condition I could think of.

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        Try this for the condition:

        Code:
        <if condition="in_array($subscription[subscriptionid], array([color=red]X,Y,Z[/color])) OR is_member_of($bbuserinfo, [color=red]W[/color])">
        Where X,Y,Z is a comma separated list of subscriptionids that are available to everyone. And W is the usergroupid of the usergroup that has access to the 3 private subscriptions.

        Comment

        • House_of_Crazed
          Senior Member
          • May 2004
          • 241
          • 3.0.6

          #5
          Humm...

          At least we're closer to something, lol...

          I did that, and it hid all the subscriptions including the ones that is for anyone.

          Comment

          • Jake Bunce
            Senior Member
            • Dec 2000
            • 46598
            • 3.6.x

            #6
            It should be working. What is the exact condition you are using? Make sure you are using the subscriptionids in your:

            Admin CP -> Subscriptions -> Subscription Manager -> Edit

            You will see this at the top of the page:

            Code:
            Subscription: name (id: X)

            Comment

            • House_of_Crazed
              Senior Member
              • May 2004
              • 241
              • 3.0.6

              #7
              LOL

              My bad

              After re-checking, it works 3/4th's...

              Let me try and describe it...

              User not in specific usergroup sees the first 3 subscriptions, no problem!

              Now, if user is in the specific usergroup, they see all 6 subscriptions.

              Is that intended? LOL, because I wanted the user in the specific usergroup to see only the 3 subscriptions that's available to them.

              Comment

              • Jake Bunce
                Senior Member
                • Dec 2000
                • 46598
                • 3.6.x

                #8
                Originally posted by House_of_Crazed
                Now, if user is in the specific usergroup, they see all 6 subscriptions.

                Is that intended? LOL, because I wanted the user in the specific usergroup to see only the 3 subscriptions that's available to them.
                Yes, that was intended.

                Here is a new condition based on the new criteria:

                Code:
                <if condition="(in_array($subscription[subscriptionid], array([color=red]X,Y,Z[/color])) AND !is_member_of($bbuserinfo, [color=red]W[/color])) OR (in_array($subscription[subscriptionid], array([color=red]A,B,C[/color])) AND is_member_of($bbuserinfo, [color=red]W[/color]))">
                Where X,Y,Z is a comma separated list of subscriptionids that are available to everyone except group W. And W is the usergroupid of the usergroup that has access to the 3 private subscriptions. And A,B,C is a comma separated list of subscriptionids that are available to group W.

                Comment

                • House_of_Crazed
                  Senior Member
                  • May 2004
                  • 241
                  • 3.0.6

                  #9
                  YAY!!

                  That worked!!

                  Thank you tons!! Go and have an In-n-Out burger on yourself lol ...

                  Comment

                  • House_of_Crazed
                    Senior Member
                    • May 2004
                    • 241
                    • 3.0.6

                    #10
                    More questions on this

                    How would I go as far as adding multiple usergroups to be able to see the special subscriptions set aside? Because the members of the special subscriptions apparently can't see the same subscriptions so they could renew their subscriptions. They're seeing the default set.

                    I've tried adding is_member_of OR conditions after this one
                    HTML Code:
                    AND is_member_of($bbuserinfo, 13)
                    no go. So, maybe it's just me or whatever... I'm not sure if I used the correct code, lol.

                    Here's the code if you want the latest one.

                    HTML Code:
                     <if condition="(in_array($subscription[subscriptionid], array(2,3,4)) AND !is_member_of($bbuserinfo, 13)) OR (in_array($subscription[subscriptionid], array(5,6,7)) AND is_member_of($bbuserinfo, 13))">
                    <fieldset class="fieldset">
                    <legend>$subscription[title]</legend>
                    <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
                    <tr>
                    <td width="67%" valign="top" rowspan="2">
                    <div style="margin-bottom:$stylevar[formspacer]px"><strong>$subscription[title]</strong></div>
                    $subscription[description]
                    </td>
                    <td width="3%" rowspan="2" style="border-$stylevar[left]:1px solid $stylevar[tborder_bgcolor]">&nbsp;</td>
                    <td width="30%" valign="top">
                    $vbphrase[validity_period]:
                    <strong>$subscription[length] $subscription[units]<if condition="$show['will_extend']"><strong class="highlight">*</strong></if></strong>
                    </td>
                    </tr>
                    <tr>
                    <td valign="bottom" nowrap="nowrap">
                    $vbphrase[cost]:<br />
                    <select name="currency[$subscription[subscriptionid]]" style="width:125px">$subscription[cost]</select>
                    <input type="submit" class="button" name="subscriptionids[$subscriptionid]" value="$vbphrase[order]" style="font-weight:normal" />
                    </td>
                    </tr>
                    </table>
                    </fieldset>
                    </if>

                    Comment

                    • Jake Bunce
                      Senior Member
                      • Dec 2000
                      • 46598
                      • 3.6.x

                      #11
                      Originally posted by House_of_Crazed
                      How would I go as far as adding multiple usergroups to be able to see the special subscriptions set aside? Because the members of the special subscriptions apparently can't see the same subscriptions so they could renew their subscriptions. They're seeing the default set.
                      When a user purchases a special subscription, are they moved out of group 13? That would explain the problem.

                      If you want to allow multiple usergroupids to see the special subscriptions (and the others not), then try this condition (added the red code):

                      Code:
                      <if condition="(in_array($subscription[subscriptionid], array(2,3,4)) AND ![color=red]([/color]is_member_of($bbuserinfo, 13)[color=red] OR is_member_of($bbuserinfo, Q) OR is_member_of($bbuserinfo, R) OR is_member_of($bbuserinfo, S))[/color]) OR (in_array($subscription[subscriptionid], array(5,6,7)) AND [color=red]([/color]is_member_of($bbuserinfo, 13)[color=red] OR is_member_of($bbuserinfo, Q) OR is_member_of($bbuserinfo, R) OR is_member_of($bbuserinfo, S))[/color])">
                      Where Q, R, and S are the new usergroupids. Add or remove these blocks (within the containing (...)) for more or less usergroupids:

                      Code:
                      OR is_member_of($bbuserinfo, #)
                      That should work.

                      Comment

                      • Gr1m
                        New Member
                        • Jul 2004
                        • 10
                        • 3.0.1

                        #12
                        still working fine in 3.5.x

                        Comment

                        • Primal Rage
                          Senior Member
                          • Oct 2004
                          • 160

                          #13
                          how would i setup the condition of : IF usergroup = 12 Don't show paid subscriptions ?

                          I want to be able to block 2 specific usergroups from being able to purchase a subscription.

                          Comment

                          • Colin F
                            Senior Member
                            • May 2004
                            • 17689

                            #14
                            Next time please start your own thread for a new question.
                            If you upgrade to vBulletin 3.6.0 you can use subscription permissions to do this.
                            Best Regards
                            Colin Frei

                            Please don't contact me per PM.

                            Comment

                            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                            Working...