Log in

View Full Version : Formatting Usernames into HTML in postbit


Andrew111888
06-12-2003, 03:09 AM
This is my first hack! Hurrah! :) :)

---------------------------------------
How to add HTML to usernames in the postbit (EASY)
by: Andrew111888
---------------------------------------
What does this hack do?
This hack allows you to format a member's username in the postbit via the Admin CP. (or User CP if you want)
Files to edit: None
Templates to edit: 1 (postbit)
Querys to Run: None
Installation Time: about three minutes.

I half-figured out how to accomplish HTML in the postbit from installing g-force2k2's Username Font Color Hack (https://vborg.vbsupport.ru/showthread.php?s=&threadid=39289) though he did not assist me in creating this hack.

I'm aware of only one other hack like this (filburt1's) but that requires running a query and multiple file edits. This gets the job I want done about 10x quicker than that hack (though I'm sure his does more than mine, such as auto-formatting by usergroup and stuff;))

Enjoy! (sorry, no screen shots available)

da prez
06-12-2003, 04:29 AM
i cannot get this to work for me.

i have tried every possible combination i can think of.Step 3------------------------------

Go to: Admin CP > Templates > Modify > postbit

Find:

<normalfont><b>$post[username]</b></normalfont><br>

----and replace with:-----

<normalfont><b>$post[field X1]$post[username]$post[field X2]</b></normalfont><br>

Replacing X1 and X2 with the appropriate values. (HTML Names 1 would be X1, HTML Names 2 would be X2)i made mine field 5 and 6, for html names 1 and 2.

but after i alter the post bit file, none of my posts show up.

all the text, user name, title and everything is missing.
just the title and two sets of new thread and reply buttons.

what the heck did i do wrong ?


- da prez

colicab-d
06-12-2003, 08:28 AM
erm is this not a template modification rather than a hack as your not changing any of the internal php code?

blackice912
06-12-2003, 08:50 AM
Yeah, this is a template edit it seems.

Dean C
06-12-2003, 08:57 AM
Yes this is a template mod. Please read the page about what constitutes a hack before posting a hack. Basically it involves the editing of one of the php files that come with vBulletin.

Therefore... moved to template mods for now :)

However this has been done MANY times before so shall i delete this?

- miSt

Andrew111888
06-12-2003, 03:08 PM
I just thought it'd be a help because when I searched through I only found one other hack allowing you to use html, and that's filburt1's hack which requires a ton of mods.

Da prez, can I see the parts of html around where you're editing, too? I want to make sure the html is correct.

da prez
06-12-2003, 04:07 PM
the error occurs before i even put any html in.

the error is right after i alter the post bit file
with the copy and paste of your code.

i like i said field x1 is field 5 and field x2 is field 6.
i view the template after altering and all looks well....

i have no idea, but probably me.

- da prez

Andrew111888
06-12-2003, 04:28 PM
Show me a portion of your postbit, including the html I told you to put in and the html before and after it.

How much HTML are you putting in for the profile fields?

Also, make sure they are in order such as-

Field 5: <u><b>
Field 6: </b></u>

da prez
06-13-2003, 03:32 AM
i did manage to make this work for me,
but i needed to remove the spaces in the $post[field x1]

i was using $post[field HTML Name 1]

i needed, (cause 5 is the field) $post[field5] and no space.

done deal.

- da prez

Haddy
09-01-2003, 05:46 AM
Odd mine just shows the text I put in the there like itll say "<u>Username</u>" *minus the ""*

Is there something different for 2.3.2?