The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Why aren't these conditionals working?
They work fine in 3.8.x, I added the "vb:" to them for 4.0.x but they don't work anymore... In fact they don't resolve to numbers at all, when I write "$thread[forumid]" in the template it just displays on the page "$thread[forumid]" instead of something like "2".
<vb:if condition="($foruminfo[forumid] == 2) AND ($thread[forumid] != 2)">[X]</vb:if> This is in the threadbit template... are these variables no longer available in threadbit? Edit- OK I see there is a new syntax for accessing these things in vb4 and boy does that suck big time... anyway Itried a couple things but no go, anything know how to translate the above to vb4? {vb:var thread.forumid} and such isn't working either. --------------- Added [DATE]1278208778[/DATE] at [TIME]1278208778[/TIME] --------------- Using this code: Code:
<if condition="({vb:var foruminfo.forumid} == 1) AND ({vb:var thread.forumid} != 1)"> [X]</vb:if> |
#2
|
||||
|
||||
<vb:if condition="$foruminfo[forumid] == 2 AND $thread[forumid] != 2">[X]</vb:if>
The raw variables do not work in conditions. |
#3
|
||||
|
||||
but shouldn't these work?
<if condition="({vb:var foruminfo.forumid} == 1) AND ({vb:var thread.forumid} != 1)"> [X]</vb:if> |
#4
|
||||
|
||||
No, you can not use raw variables like that in conditional statements.
|
#5
|
||||
|
||||
OK... how would I go about getting the value of those to use in a conditional?
|
#6
|
||||
|
||||
<vb:if condition="$foruminfo['forumid'] == '1' AND $thread['forumid'] != '1'">
[X] </vb:if> |
#7
|
||||
|
||||
That's what I thought in my first post (I added the single quotes around 'foumid' just in case...) but neither of those resolve in the threadbit template... am I missing something?
|
#8
|
||||
|
||||
What is it you are trying to do exactly? That might help in figuring this out. You said it worked in 3.8. Is it a hack you are trying to update or what?
|
#9
|
||||
|
||||
Yeah, this is an 'additional option' for my "All Topic" mod which I already released for vb4, it was all php code changes so it was no big deal.
This was just supposed to be a way to modify a thread title to show if a thread being listed originates in another forum, as that is what my 'all topic' mod does- displays threads from multiple forums in a single forum. The entire code for this in 3.8 was: Code:
<if condition="$vbulletin->userinfo['field5'] != 'No'"> <if condition="($foruminfo[forumid] == 1) AND ($thread[forumid] != 1)">[X]</if></if> If the all-topic system is enabled (field5) then... if the forum your viewing is the master forum (1) AND the thread's forum or origin IS NOT (1) then put "[X]" in the thread title. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|