![]() |
Default User Color?
I've started to make a hack that will allow a user to have a default post color, and not have to set it in the actual post everytime.
I'm kind of a hacking n00b, so all I've been able to do is make the profile field. Is there any way I can make a tag similar to normalfont, that is just like normalfont, except it is used only to display post test, with the specified color? (I just need to know where it's defined so I can copy it and make something new.) Thanks, CdaKnight |
You can set replacement variables in your Admin CP by going to the Replacement section, and click Modify. Then, make something up like <postfont> and the replacement being <font color=$post[fieldx]>
Change x to the number of your custom profile id. and </postfont> replacement being </font> Then, in your postbit, add <postfont> and </posfont> around $post[message]. :) |
Thanks a lot!!!!!!!!!!!!!!!
|
Hmmm. Now I'm having a problem. :(
All of my fonts default to blue. is there a way I can set a default value for the profile field? |
And I just figured out why. Its not translating $post[field5] into whatever the custom field is.
And to continue my question, I just thought of something. Is there a way to set a default if the user has nothing in the field? |
Make it easy on yourself.
Forget about the <postfont> replacement. In your postbit, use the HTML code directly like this: <font color="$post[field5]">$post[message]</font> It will work 100%. |
The replacement variables don't parse custom profile IDs since replacement variables are not php file specific. So you can use them in your replacements it looks like, unless the variable is global.
|
Is there a way to set a default? All the people who haven't set a font color are blue.
|
And I just realized its not replacing. Where I have <font color="#$post[field5]"> it has <font color="#">
|
That's because the person has not filled out Custom Profile Field 5 out - are you sure it's custom profile id 5? It should be higher than that since usually the first 5-10 are taken already.
Why use #? Why not have a custom user profile, and have your users enter either a color eg. "black, red, blue" or a hex "#000000" etc. Then use <font color="$post[fieldx]"> NOT <font color="#$post[fieldx]"> - this way you won't have font becoming blue. Also, then users can put in colors in words eg. marineblue, gold, yellow etc. |
All times are GMT. The time now is 10:48 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|