Announcement

Collapse
No announcement yet.

template conditional question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • template conditional question

    Hi,

    I have searched, and didn't find an answer which I could interpret...

    I want to display in the header template a conditional message, this message should only show to users who are not activated, ie: usergroup id 3

    Obviously it's going to be a message telling them to activate.

    Tim

  • #2
    Try something like:

    Code:
    <if condition="is_member_of($bbuserinfo, 3)">
    INSERT MESSAGE HERE
    </if>
    or

    Code:
    <if condition="$bbuserinfo[usergroupid] == 3">
    INSERT MESSAGE HERE
    </if>
    AikiWeb Aikido Information

    Comment


    • #3
      Just put your conditional Above this in the header template:

      PHP Code:
       <!-- logo --> 
      Something like:

      PHP Code:
      <if condition="$bbuserinfo[usergroupid] == '3'">
      Message goes here 
      <else /> 
      and then put an </if> after the closing logo line.
      vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.

      vBulletin.org's ol' Moderator

      I have a lifetime terrorist hunting permit - #091101

      chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

      Comment


      • #4
        Nice idea to have an extra highlighted message in the header for this usergroup. Very - very nice idea which I will surely use on my web site.

        Btw boofo: Congratulations

        Comment


        • #5
          Here is what I input at the top of the header template (for those interested)...

          HTML Code:
          <if condition="is_member_of($bbuserinfo, 3)">
           <table border="1" width="100%" bordercolor="#800000" cellspacing="0" cellpadding="3">
             <tr>
           	<td width="100%" valign="middle" align="center"><b><font size="4">You
           	  have not yet activated your forum account. To re-request your activation
           	  e-mail please go <a href="faq.php?s=&amp;do=search&amp;q=activation">here</a>. You may have to de-activate any SPAM protection or
           	  our mail may not get through. If you did not enter a real e-mail at
           	  registration please go to your <a href="usercp.php">user cp</a> and change it, another activation
           	  mail will then be sent to the new address.</font></b></td>
             </tr>
           </table>
           
           <p>&nbsp;</p>
           <p>&nbsp;</p>
           </if>
          The FAQ link is a bit I added about activation etc. Obviously at some point I need to move this text into a phrase so I can translate it for each language installed.

          Comment


          • #6
            Thanks, that is great! I changed the wording a little bit and added the user's name to make it a bit more personal. My wife works for a local cable company on their Internet Tech Support team and she has run into countless situations where the customer thinks that de-activate mean to un-install. And also there have been a few customers that aren't sure which computer you would be talking about with the SPAM software, theirs or the ISP's.

            This is what I have now. Let me know what you think.

            <if condition="is_member_of($bbuserinfo, 3)">
            <table border="1" width="100%" bordercolor="#800000" cellspacing="0" cellpadding="3">
            <tr>
            <td width="100%" valign="middle" align="center"><b><font size="4">You have not yet activated your forum account, $bbuserinfo[username]. To re-request your activation e-mail, please click <a href="faq.php?s=&amp;do=search&amp;q=activation"><font color="gold">here</font></a>. You may have to temporarily de-activate any SPAM protection on your computer or the activation e-mail may not get through. If you did not enter your real e-mail address at registration, please go to your <a href="usercp.php"><font color="gold">user cp</font></a> and change it. Another activation e-mail will then be sent to the new address.</font></b></td>
            </tr>
            </table>
            <p>&nbsp;</p>
            </if>
            Also, would you be willing to share the FAQ link info?
            Boofo
            Senior Member
            Last edited by Boofo; Tue 3 Feb '04, 12:06am.
            vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.

            vBulletin.org's ol' Moderator

            I have a lifetime terrorist hunting permit - #091101

            chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

            Comment


            • #7
              The second conditional example that was given will work, however shouldnt be used.

              You should use is_member_of to make sure they are not a member of that group in their aditional groups.

              Comment


              • #8
                Which conditional should we use? I'm confused with what you said about the membergroup thing.
                vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.

                vBulletin.org's ol' Moderator

                I have a lifetime terrorist hunting permit - #091101

                chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

                Comment


                • #9
                  The first was:

                  <if condition="is_member_of($bbuserinfo, 3)">
                  INSERT MESSAGE HERE
                  </if>

                  And he suggested not to use the second one.
                  Floris
                  Senior Member
                  Last edited by Floris; Tue 3 Feb '04, 12:43am.

                  Comment


                  • #10
                    Thanks for clearing that up. Is there a link that a user can click that will automatically send them an activation email or take them to a screen that can?

                    How would you add multiple usergroups to that? Like this?
                    PHP Code:
                     <if condition="is_member_of($bbuserinfo, 1,3,8,9)"
                    vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.

                    vBulletin.org's ol' Moderator

                    I have a lifetime terrorist hunting permit - #091101

                    chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

                    Comment


                    • #11
                      I now use this on vBulletin.nl:

                      Open the navbar templates and find this code:
                      Code:
                      <!-- breadcrumb, login, pm info -->
                      Above this, on a new line, add this code:
                      Code:
                      <if condition="is_member_of($bbuserinfo, 3)">
                      <table border="1" width="100%" bordercolor="#800000" cellspacing="0" cellpadding="3">
                      <tr>
                      	 <td width="100%" align="left">
                      <strong><span class="normalfont">
                      You have not yet activated your forum account, $bbuserinfo[username]! <br />
                      To request your activation e-mail, click <a href="register.php?$session[sessionurl]&amp;do=requestemail&amp;email=$bbuserinfo[email]">here</a>.<br />
                      If you did not enter your real e-mail address at registration, please go to your <a href="profile.php?$session[sessionurl]&amp;do=editpassword">$vbphrase[user_cp]</a> and change it.<br />
                      For more details about registration, please click <a href="faq.php?faq=vb_user_maintain#faq_vb_why_register">$vbphrase[faq]</a>. <br />
                      You may have to temporarily de-activate any spam protection on your computer or the activation e-mail may not get through.
                      </span></strong>
                      	 </td>
                      </tr>
                      </table>
                      <br />
                      </if>
                      Save the template and enjoy

                      This looks like this:
                      Attached Files

                      Comment


                      • #12
                        I see a couple of my suggestions about the wording were helpful.

                        Is the code in the message I posted above how you would add multiple groups?
                        vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.

                        vBulletin.org's ol' Moderator

                        I have a lifetime terrorist hunting permit - #091101

                        chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

                        Comment


                        • #13
                          No idea, actually. But that would cleanup quite a number of conditionals in my templates So I hope so

                          Comment


                          • #14
                            You cannot use the code for multiple usergroups.

                            You must add an aditional check for each one (OR is_member_of($bbuserinfo, NEXTID)).

                            Comment


                            • #15
                              Could you do an inarray with this?
                              vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.

                              vBulletin.org's ol' Moderator

                              I have a lifetime terrorist hunting permit - #091101

                              chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

                              Comment

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