vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Default User Color? (https://vborg.vbsupport.ru/showthread.php?t=45369)

CdaKnight 11-04-2002 12:42 AM

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

Erwin 11-04-2002 01:39 AM

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]. :)

CdaKnight 11-04-2002 01:46 AM

Thanks a lot!!!!!!!!!!!!!!!

CdaKnight 11-04-2002 01:55 AM

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?

CdaKnight 11-04-2002 02:00 AM

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?

Erwin 11-04-2002 02:04 AM

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%.

Erwin 11-04-2002 02:06 AM

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.

CdaKnight 11-04-2002 02:17 AM

Is there a way to set a default? All the people who haven't set a font color are blue.

CdaKnight 11-04-2002 02:27 AM

And I just realized its not replacing. Where I have <font color="#$post[field5]"> it has <font color="#">

Erwin 11-04-2002 02:37 AM

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
  • Page Generation 0.01152 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete