The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Display names
Well, I was trying to implement a "Display names" system into my forum, but it crossed my mind that a text field couldn't easily handle the HTML and stuff from usergroups.
Bascially, my question is, how would I go about editing "musername", the actual variable, to contain something like: Code:
<if condition="$post['field10']"> ALL THE STUFF WITH HTML HERE <else /> $musername </if> Code:
<if condition="$post['field10']"> $post[field10] <else /> $post[musername] </if> </a> Thanks, Danny |
#2
|
|||
|
|||
I think your condition code is missing something.
Lets assume the name field is field10 and it contains 'Mysterious' Then your code is only doing If Mysterious then ALL THE STUFF WITH HTML HERE Else Mysterious2207 Endif I think what you want to do is <!-- If name field is not empty --> <if condition="$post['field10'] !== (NULL)"> <!-- then display name --> $post['field10'] BLA BLA <else /> <!-- if name field is empty then display username markup--> $post[musername] </if> I'm not sure about that and I don't really understand what you're really trying to do. I don't know whats the value of an empty field. Is it '0'? So might want to know the default value for an empty field first D: |
#3
|
|||
|
|||
I know that, however, I need the HTML to stay from the usergroup markup. So, right now, I want to edit "musername" itself to check for field10, if that's possible.
|
#4
|
|||
|
|||
<!-- If name field is not empty -->
<if condition="$post['field10'] !== '' "> <!-- then display name --> $post['opentag'] $post['field10'] $post['closetag'] BLA BLA <else /> <!-- if name field is empty then display username markup--> $post[musername] </if> Try it, not sure =x |
#5
|
|||
|
|||
That will display opening and closing HTML then, right?
|
#6
|
|||
|
|||
Try it and lemme know!
|
#7
|
|||
|
|||
It didn't work .
By the way, the first codebox I showed was my idea of what to do with musername, I'm more fond of Java so here's what it would look like in Java: Code:
public class musername() { if(field10.doesContainText()) { showHTMLBegin(); showDisplayName(); showHTMLEnd(); } else { showHTMLBegin(); showUsername(); showHTMLEnd(); } } |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|