The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Quick question about vBulletin coding and syntax
Hi all,
can I use as a variable in a template: $vbphrase[$thread[prefix_plain]] In other words, the resultant should look like this when parsed: $vbphrase[NAME] where NAME = $thread[prefix_plain] Or do I need to add quotemarks or something? Many thanks in advance for all assistance! |
#2
|
||||
|
||||
I have absolutely no no idea what is is you're trying to do. For phrases, the only time you need additional values is when parameters are added.
For example, you'll see a phrase like: HTML Code:
{1} has no idea what {2} is talking about HTML Code:
<phrase 1="Gio~Logist" 2="Tim Skellet">$vbphrase[no_idea]</phrase> |
#3
|
|||
|
|||
I'll try making it clearer.
I want to call a Phrase from within a template. Therefore, $vbphrase[name] Now, the name of the vbphrase that I want to call up is determined by the variable: $thread[prefix_plain] So, I want to know, if I can write in a template: $vbphrase[$thread[prefix_plain]] Or if it has to be written differently. ______________ ETA: Sorry, I used $thread[prefix_rich] in my OP when I meant $thread[prefix_plain] |
#4
|
||||
|
||||
Well the obvious answer is just try it
You may have to put it inside curly brackets i.e. {$vbphrase[$thread[prefix_plain]]} |
#5
|
|||
|
|||
Quote:
--------------- Added [DATE]1247783972[/DATE] at [TIME]1247783972[/TIME] --------------- Tried it, in a variety of ways. Putting the whole statement, as with also the sub-variable, in curly brackets gets vBulletin to accept the statement, otherwise it is rejected as a malformed conditional. However, while the code is accepted, it does not give any results, in other words nothing at all shows. IOW: {$vbphrase[$thread[prefix_plain]]} will be accepted by the vB, but then results in nothing being displayed for it. Yes, the Phrases are already there to be called upon, so it's not a case of not displaying because of missing stuff. Any ideas, anyone? |
#6
|
||||
|
||||
IIRC, vBulletin does not like an array key than it part of an array in templates. It just doesn't work properly.
|
#7
|
|||
|
|||
Try: $vbphrase[{$thread[prefix_plain]}]
|
#8
|
|||
|
|||
Thanks, but this one also returns "Malformed conditional". Tried it again in a variety of ways, either an empty array or a malformed conditional results.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|