PDA

View Full Version : Clan Tag Mod


Pro-eSports.com
02-18-2010, 03:09 PM
There was a clan tag mod for vB3.x.x where users could enter a clan tag in their profile and this clan tag was then added in red color before their username.

Like:

[vB] Mister X

Can someone link me to this mod?
Is this mod compatible to vB4.x.x?

If not then it would be great if someone could develop such a mod for vB4.

Thanks. :)

mikey1991
02-18-2010, 06:09 PM
Well for vB3 it would've been; make a clan tag profile field, and then edit your postbit template and before $post[musername] add <if condition="$post['fieldx']">$post[fieldx]</if>

I'm sure it's easy to translate that to vb4, I just can't remember the syntax anymore, lol

Pro-eSports.com
02-18-2010, 06:24 PM
Well for vB3 it would've been; make a clan tag profile field, and then edit your postbit template and before $post[musername] add <if condition="$post['fieldx']">$post[fieldx]</if>

I'm sure it's easy to translate that to vb4, I just can't remember the syntax anymore, lol

It would be awesome if you could find out. You're a coder mate. :D If not you then who?! ;)

mikey1991
02-18-2010, 07:02 PM
Well, I think it would be something like this:

<vb:if condition="$post['fieldx']">{vb:raw post.fieldx}</vb:if>{vb:raw post.username}

So go to your ACP > User Profile Field Manager > Add New User Profile Field > Profile Field Type > Single Line Text Box > Fill out all the boxes, then note the FIELDID .. Ie, it will say something liek "field7" - then go to your ACP > Styles & Templates > Style Manager > YourStyle > Edit Templates > Postbit Templates > Postbit and find {vb:raw post.username} and add before it; <vb:if condition="$post['fieldx']">{vb:raw post.fieldx}</vb:if> - where the red x is changed to your fieldid..

This isn't tried or tested, but should work.

Of course, if you want the clan tag to be RED and inside ['s, change the code accordingly, IE;

<vb:if condition="$post['fieldx']"><span style="color:red;">[{vb:raw post.fieldx}]</span></vb:if>{vb:raw post.username}

Pro-eSports.com
02-18-2010, 07:57 PM
I'll try it out now and post back with the results. Thanks for the help so far.

--------------- Added 1266531421 at 1266531421 ---------------

It gives me the following error when saving:

Parse error: syntax error, unexpected T_STRING in /.../pro-esports.com/forums/includes/adminfunctions_template.php(4667) : eval()'d code on line 53

I put the entire code into a text file and opened it with Notepad to see what's in line 53.

Line 53:

<span class="postbit_reputation" id="repdisplay_{vb:raw post.postid}_{vb:raw post.userid}">{vb:raw post.reputationdisplay}</span>

Just to make sure I haven't done anything wrong. Here is the code bit with the code you told me to add. It has a few more lines from the original postbit file so don't wonder.

<vb:if condition="$post.avatarurl">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, <vb:if condition="$post['field16']"><span style="color:red;">[{vb:raw post.field16}]</span></vb:if> {vb:raw post.username}}" />
<vb:else />

mikey1991
02-18-2010, 09:06 PM
Sorry that didn't work, like I originally said, this wasn't tried nor tested. I only have a vB4 localhost, and am not using it live, so I don't know what the error could be there, maybe someone else can reply with an answer.

toonysnn
02-18-2010, 09:12 PM
<vb:if condition="$post['userid'] > 0">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, <vb:if condition="$post['field16']"><span style="color:red;">[{vb:raw post.field16}] </span></vb:if>{vb:raw post.username}}" />
</vb:if>

That should work fine .. I can't test it at the moment, but it should work without issue.

I haven't read entirely what you want to accomplish, but going off of Mikey's comments and what I see slightly in the first post...

Pro-eSports.com
02-18-2010, 11:44 PM
Now it gives the following error message:

invalid_tag_nesting

Pro-eSports.com
04-11-2010, 05:21 PM
Bump!

leftanalog
06-04-2011, 04:34 PM
I know this thread is old... but has anyone gotten this to work?