The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
Hi,
I'm hoping this is the correct forum for asking this. I have added a custom profile field with a single-selection radio button with the options "No" and "Yes". These are field22 and No is set as default. The option will make the user choose if he wants to see a latest threads box or not. I have tried the following: Code:
<vb:if condition="$post['field22']=='No'"> code for showing the box here <vb:elseif condition="$post['field22']=='Yes'" /> </vb:if> I would really appreciate if someone could tell me where I got it wrong, or if there is another way to do this. I have also tried switching No and Yes with the same result. Thanks in advance
|
|
#2
|
|||
|
|||
|
try 0 in place of No and 1 in place of yes.
|
|
#3
|
|||
|
|||
|
What template did you add your code to?
|
|
#4
|
||||
|
||||
|
Tried that, but still have the same problem.
The code is added to a custom template made by the mod showing the latest threads on my forums. The template is named "MARCO1 Latest Forum Threads" The code is as follows: Code:
<li class="forumbit_nopost L1" id="cat{vb:raw forum.forumid}">
<div class="tcatBar">
<div class="tcatLeft"><div class="tcatRight foruminfo L1 collapse">
<h2>
<span class="forumtitle">{vb:raw vboptions.MARCO1_latesttablename}</span>
</h2>
</div></div>
</div>
<!-- End Forum tcat Heading ForumThemes -->
<!-- Start Forum thead Heading ForumThemes -->
<div class="forumbitBody">
<div class="thead_bar">
<div class="theadrow table">
<div class="forumbit_nopost L1">
<!--ticker-->
<div id="ticker-wrapper" class="no-js">
<ul id="js-news" class="js-hidden">
<script type="text/javascript" src="{vb:raw vboptions.bburl}/external.php?&type=js"></script>
<script type="text/javascript">
<!--
for (var i = 0; i < threads.length; i++)
{
document.write('<li><b><a href="{vb:raw vboptions.bburl}/showthread.php?t=' + threads[i]['threadid'] + '">' + threads[i]['title'] + '</a></b>' + ' ' + '<span style="color: #323232;">Posted By:</span>'+ ' ' + threads[i]['poster'] + '</a>' + '</li>');
}
//-->
</script>
</ul>
</div>
<!--ticker-->
</div>
</div>
</div>
</div>
</div>
<div class="bottomBar"><div class="bottomBarLeft"><div class="bottomBarRight"> </div></div></div>
</li>
You can see the box in action underneath the navbar here http://www.radioctrl.com/forum.php Would the conditionals work if this was added to the navbar template instead, or would that break the script? |
|
#5
|
|||
|
|||
|
Quote:
HTML Code:
<vb:if condition="$bbuserinfo['field22']=='No'"> code for showing the box here </vb:if> (there's no reason to have an 'else' unless you want to insert some alternative HTML). |
|
#6
|
||||
|
||||
|
Thanks for looking into this, kh99
![]() It's working perfectly now. $bbuserinfo did the trick! Thanks a million! Edit: Added the elseif conditional to make it show for guests as well. Good times! |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|