Conditional Usergroup on Forum Block

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

    [Forum] Conditional Usergroup on Forum Block

    I want to use conditional on forum block.

    I've tried this PHP code on the forum block and it works
    PHP Code:
    $s .= '<div style="text-align:center">
    Hello World...'
    ;
    if (
    is_member_of($vbulletin->userinfo1234813)) {
    $s .= '<br /><br />
    You are a special member'
    ;
    }
    $s .= '</div>';
    return 
    $s
    But the result is getting cached, altough i have set cache life to "0".
    I don't know maybe template editing (with normal conditional tag) is a solution here instead of PHP code on forum block?

    I have looked on "block_html" template but i am not sure if i should modify there, because i thought if i modify there, all forum blocks will be affected, not on specific forum block.
  • DelphiVillage
    Senior Member
    • Apr 2002
    • 1051
    • 4.1.x

    #2
    Originally posted by semprot
    I want to use conditional on forum block.

    I've tried this PHP code on the forum block and it works
    PHP Code:
    $s .= '<div style="text-align:center">
    Hello World...'
    ;
    if (
    is_member_of($vbulletin->userinfo1234813)) {
    $s .= '<br /><br />
    You are a special member'
    ;
    }
    $s .= '</div>';
    return 
    $s
    But the result is getting cached, altough i have set cache life to "0".
    I don't know maybe template editing (with normal conditional tag) is a solution here instead of PHP code on forum block?

    I have looked on "block_html" template but i am not sure if i should modify there, because i thought if i modify there, all forum blocks will be affected, not on specific forum block.
    this can be done with template conditionals but it's syntax changed in 4.0 but check vbulletin.org examples enough there


    http://www.vbulletin.org/forum/showthread.php?t=231525 a whole list template conditionals

    Code:
    <vb if condition="is_member_of($bbuserinfo,1,2,3,4,8,13)" />
    //****
    </vb:if>
    Last edited by DelphiVillage; Sun 8 Aug '10, 3:44am.

    Comment

    • Guest

      #3
      Originally posted by DelphiVillage
      this can be done with template conditionals but it's syntax changed in 4.0 but check vbulletin.org examples enough there


      http://www.vbulletin.org/forum/showthread.php?t=231525 a whole list template conditionals

      Code:
      <vb if condition="is_member_of($bbuserinfo,1,2,3,4,8,13)" />
      //****
      </vb:if>
      Do i need to input it on forum block manager or template editor?

      Comment

      • Lynne
        Former vBulletin Support
        • Oct 2004
        • 26255

        #4
        If you want to edit the block_html but not have it effect all other blocks that use that template, then just copy the block template, say to block2_html, and edit it how you want and then when you configure your block, make sure you edit "Template to Use" to be "block2_html".

        Please don't PM or VM me for support - I only help out in the threads.
        vBulletin Manual & vBulletin 4.0 Code Documentation (API)
        Want help modifying your vbulletin forum? Head on over to vbulletin.org
        If I post CSS and you don't know where it goes, throw it into the additional.css template.

        W3Schools &lt;- awesome site for html/css help

        Comment

        • melbo
          Senior Member
          • Apr 2005
          • 517
          • 3.8.x

          #5
          Edit: I figured it out with using Block2_html.

          Nice, works great!
          Last edited by melbo; Mon 1 Nov '10, 6:40pm.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎