Announcement

Collapse
No announcement yet.

Postbit miracles

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

  • Postbit miracles

    Hi, vBulletin!

    My problem is the following. I want to allow my users to choose between postbit and postbit_legacy templates. So, I've created a new custom pofile field, and edited my postbit template (set as default) like this:
    Code:
    <if condition="$bbuserinfo[filedX] == 'Yes'">
    Entire postbit code here
    <else />
    Entire postbit_legacy code here
    </if>
    But it doesn't work. When the first part of the code must be executed all goes fine. But when the second part must be executed posts become double templated.

    Any ideas?

  • #2
    The way I did this was to have both a postbit and a postbit_legacy template and then create a plugin using the postbit_display_complete hook that has the contents:
    PHP Code:
    global $vbulletin;
    if (
    $vbulletin->userinfo['field5'] == 'Left')
        
    $vbulletin->options['legacypostbit'] = 1;
    else if (
    $vbulletin->userinfo['field5'] == 'Top')
        
    $vbulletin->options['legacypostbit'] = 0
    It works for us.

    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


    • #3
      Thank you, U2Lynne. It works fine!

      Comment

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