how to make this code run in vb4?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • baghdad4ever
    Senior Member
    • Apr 2007
    • 587
    • 4.1.x

    [Forum] how to make this code run in vb4?

    hi i use code in template to obtain certain features to certain usergroup

    in userfield_select_option template

    PHP Code:
    <if condition="THIS_SCRIPT != 'profile' OR (!in_array($profilefield[profilefieldid], array(16,17,18)) OR is_member_of($bbuserinfo, 6))">
    <
    option value="$key$selected>$val</option>

    </if> 
    and

    userfield_wrapper template

    PHP Code:
    <if condition="THIS_SCRIPT != 'profile' OR (!in_array($profilefield[profilefieldid], array(16,17,18)) OR is_member_of($bbuserinfo, 6))">
    <
    fieldset class="fieldset">
        <
    legend>$profilefield[title]</legend>
        
    $custom_field_holder
    </fieldset>


    </if> 
    how to convert these inorder to run in vb4???

    thanks
  • Dody
    Senior Member
    • Aug 2004
    • 1896
    • 3.8.x

    #2
    Originally posted by baghdad4ever
    PHP Code:
    <if condition="THIS_SCRIPT != 'profile' OR (!in_array($profilefield[profilefieldid], array(16,17,18)) OR is_member_of($bbuserinfo, 6))">
    <
    option value="$key$selected>$val</option>
    </if> 
    PHP Code:
    <vb:if condition="THIS_SCRIPT != 'profile' OR (!in_array($profilefield[profilefieldid], array(16,17,18)) OR is_member_of($bbuserinfo, 6))">
    <
    option value="$key$selected>$val</option>
    </
    vb:if> 

    PHP Code:
    <if condition="THIS_SCRIPT != 'profile' OR (!in_array($profilefield[profilefieldid], array(16,17,18)) OR is_member_of($bbuserinfo, 6))">
    <
    fieldset class="fieldset">
        <
    legend>$profilefield[title]</legend>
        
    $custom_field_holder
    </fieldset>


    </if> 
    PHP Code:
    <vb:if condition="THIS_SCRIPT != 'profile' OR (!in_array($profilefield[profilefieldid], array(16,17,18)) OR is_member_of($bbuserinfo, 6))">
     <
    fieldset class="fieldset">
         <
    legend>$profilefield[title]</legend>
         
    $custom_field_holder
     
    </fieldset>
     </
    vb:if> 
    as you can see, you only need to change if to vb:if
    while(true){
    if(
    $someone->needsHelp() && $i->canHelp()) $post->help();
    if(
    $i->findBug()) $post->bug();
    }

    Comment

    • baghdad4ever
      Senior Member
      • Apr 2007
      • 587
      • 4.1.x

      #3
      thanks dody i will try it

      i appreciate your help

      Comment

      • baghdad4ever
        Senior Member
        • Apr 2007
        • 587
        • 4.1.x

        #4
        how to convert these please


        PHP Code:
        <class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]"><if condition="$post['field16'] != '' ">
                 <
        font style="color:$post[field16];">$post[musername]</font>
                     <else />
                 
        $post[musername]
                 </if></
        a
        and this

        PHP Code:
        <if condition="$post[field5]"><img src="images/flagvv/$post[field5].png" border="0" alt="flag $post[field5]/><br /></if> 

        Comment

        • S1OPP
          Senior Member
          • Jul 2005
          • 210
          • 4.0.0

          #5
          same as before change the <if> and </if> to <vb:if> and </vb:if>

          Comment

          • Dody
            Senior Member
            • Aug 2004
            • 1896
            • 3.8.x

            #6
            PHP Code:
            <class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]"><vb:if condition="$post['field16'] != '' ">
                     <
            font style="color:$post[field16];">$post[musername]</font>
                         <
            vb:else />
                     
            $post[musername]
                     </
            vb:if></a
            PHP Code:
            <vb:if condition="$post[field5]"><img src="images/flagvv/$post[field5].png" border="0" alt="flag $post[field5]/><br /></vb:if> 
            while(true){
            if(
            $someone->needsHelp() && $i->canHelp()) $post->help();
            if(
            $i->findBug()) $post->bug();
            }

            Comment

            • baghdad4ever
              Senior Member
              • Apr 2007
              • 587
              • 4.1.x

              #7
              sorry but it doesnt work

              Comment

              • NolFito
                Senior Member
                • Nov 2006
                • 446
                • 3.8.x

                #8
                Originally posted by baghdad4ever
                how to convert these please


                PHP Code:
                <class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]"><if condition="$post['field16'] != '' ">
                         <
                font style="color:$post[field16];">$post[musername]</font>
                             <else />
                         
                $post[musername]
                         </if></
                a
                and this

                PHP Code:
                <if condition="$post[field5]"><img src="images/flagvv/$post[field5].png" border="0" alt="flag $post[field5]/><br /></if> 
                try

                PHP Code:
                <class="bigusername" href="member.php?{vb:raw session.sessionurl}u={vb:raw post.userid}"><vb:if condition="$post['field16'] != '' ">
                         <
                font style="color:{vb:raw post.field16};">{vb:raw post.musername}</font>
                             <
                vb:else />
                         {
                vb:raw post.musername}
                         </
                vb:if></a
                and
                PHP Code:
                <vb:if condition="$post['field5']"><img src="images/flagvv/{vb:raw post.field5}.png" border="0" alt="flag {vb:raw post.field5}" /><br /></vb:if> 
                "Have no fear of perfection - you'll never reach it!' -Team Skunkworkssigpic
                "I was a Hidden Treasure and loved to be known. Therefore I created the Creation that I might be known"

                Comment

                • baghdad4ever
                  Senior Member
                  • Apr 2007
                  • 587
                  • 4.1.x

                  #9
                  thanks the only one work is the last code


                  Originally posted by NolFito
                  try


                  PHP Code:
                  <vb:if condition="$post['field5']"><img src="images/flagvv/{vb:raw post.field5}.png" border="0" alt="flag {vb:raw post.field5}" /><br /></vb:if> 


                  plz can some one help with the other codes?

                  Comment

                  • baghdad4ever
                    Senior Member
                    • Apr 2007
                    • 587
                    • 4.1.x

                    #10
                    can some one help to convert these codes to get work in vb4

                    1- codes to display choose certain field to certain usergroup

                    in userfield_select_option template

                    PHP Code:
                    <if condition="THIS_SCRIPT != 'profile' OR (!in_array($profilefield[profilefieldid], array(16,17,18)) OR is_member_of($bbuserinfo, 6))">
                    <
                    option value="$key$selected>$val</option>

                    </if> 
                    and

                    userfield_wrapper template

                    PHP Code:
                    <if condition="THIS_SCRIPT != 'profile' OR (!in_array($profilefield[profilefieldid], array(16,17,18)) OR is_member_of($bbuserinfo, 6))">
                    <
                    fieldset class="fieldset">
                        <
                    legend>$profilefield[title]</legend>
                        
                    $custom_field_holder
                    </fieldset>


                    </if> 
                    2- to color username to certain usergroup

                    in postbit legacy


                    PHP Code:
                    <class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]"><if condition="$post['field16'] != '' ">
                             <
                    font style="color:$post[field16];">$post[musername]</font>
                                 <else />
                             
                    $post[musername]
                             </if></
                    a
                    thanks

                    Comment

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