XF 2.2 Converting vBulletin if statement to XF

aalbert

New member
I have a forum that we are taking over from another member in our community (they have been running it 20yrs and want to just enjoy life), and as part of the processes I am transitioning it from VB4.x to XF. Currently each board has its own header image. I have read other posts, that seem to go through similar syntax but I am unable to get it play nice. Here is syntax from the original board - any help in getting the proper XF syntax for placing it in the extra.less file would be appreciated.

Thanks.

<a href="{vb:link forumhome}">
<vb:if condition="$forumid == '39'"><img src="../images/uzi_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '82'"><img src="../images/mac_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '38'"><img src="../images/general_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '77'"><img src="../images/galil_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '44'"><img src="../images/nfa_4sale_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '45'"><img src="../images/nonnfa_4sale_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '46'"><img src="../images/parts_4sale_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '71'"><img src="../images/supporter_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '76'"><img src="../images/firearms_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '80'"><img src="../images/sten_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '86'"><img src="../images/ar_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '87'"><img src="../images/s&w_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '88'"><img src="../images/fnc_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '95'"><img src="../images/ak_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '51'"><img src="../images/ammo_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '89'"><img src="../images/everything_4sale_banner.jpg" border="0" alt="$vboptions[bbtitle]" /></vb:if>
<vb:if condition="$forumid == '55'"><img src="../images/firearms_images_banner.jpg" border="0" alt="$vboptions[bbtitle]" /></vb:if>
<vb:if condition="$forumid == '93'"><img src="../images/hk_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '50'"><img src="../images/gunsmith_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '79'"><img src="../images/other_images_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '92'"><img src="../images/reising_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '41'"><img src="../images/reviews_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '94'"><img src="../images/ruger_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '48'"><img src="../images/shoots_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == 36"><img src="../images/sitenews_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '47'"><img src="../images/steals_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '67'"><img src="../images/suppressors_banner.jpg" border="0" alt="$vboptions[bbtitle]" /></vb:if>
<vb:if condition="$forumid == '83'"><img src="../images/staff_discussion.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="$forumid == '65'"><img src="../images/staff_discussion.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
<vb:if condition="!in_array($forumid, array(39,82,38,77,44,45,46,71,76,80,86,87,88,95,51,89,55,93,50,79,92,41,94,48,36,47,67,83,65))"><img src="../images/vbulletin3_logo_white.gif" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>
 
<vb:if condition="$forumid == '39'"><img src="../images/uzi_banner.jpg" border="0" alt="{vb:raw vboptions.bbtitle}" /></vb:if>

Example
<xf:if is="$forumid == 39"><img src="../images/uzi_banner.jpg" border="0" alt="{{ $titleXXXXX|for_attr }}" /></xf:if>

So and so forth.
 
Thanks... For whatever reason that code, and other code types I have tried, don't work... I tried it with other extra.less changes, as well as by itself... Other changes to the forum have been minimal so far, but it feels like there is a conflict of some sort.


Test forum is at http://staging.uzitalk.com/forums

Original forum is at http://www.uzitalk.com/forums/ -- Basically trying to emulate the feel as much as possible to allow users a more comfortable transition.


Any help appreciated.



Contents of the extra.less below

=========================

<xf:if is="$forumid == 39"><img src="../images/uzi_banner.jpg" border="0" alt="{{ $titleXXXXX|for_attr }}" /></xf:if>

/Read and Unread icons - width statement gives padding/

.node .node-icon i { display: none; }

.node--unread .node-icon {
background-image: url('/forums/images/uzi/statusicon/forum_new-48.png');
background-repeat: no-repeat;
background-position: center;
width: 56px;
}
.node--read .node-icon {
background-image: url('/forums/images/uzi/statusicon/forum_old-48.png');
background-repeat: no-repeat;
background-position: center;
width: 56px;
}


/* Color of node text left and right side*/
.node-title a {
color: steelblue;
}

.node-extra-row a {
color: grey;
}



======================
 
Thanks... For whatever reason that code, and other code types I have tried, don't work... I tried it with other extra.less changes, as well as by itself...
Looks to me like code is an image embed and so should not go in extra.less but in the template you need it in (maybe forum_view?)

extra.less is for styling
 
Last edited:
Thank you all for the info, help, and education - I have experience with other forums, but this is my first jump into the XF platform. I ended up going with an add on that AndyB has, which fulfilled this need smoothly.

Cheers
 
Back
Top Bottom