vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Maintaining two closely related style options (https://vborg.vbsupport.ru/showthread.php?t=144521)

tobias_t 04-10-2007 09:51 PM

Maintaining two closely related style options
 
This is kind of hard to sum up just in the headline.

My forum offers two style options to the users. The only difference is the font color.

I didn't want to do all manual template edits in both styles all the time, so for a while I have only made changes to the default style and disregarded the other one (knowing that few people are even aware of this option).

Now I want to get both styles on the same level again. My idea is to duplicate the current version of the default style and edit its font color, and replace the old alternate style with it (by giving it the same name).

Basically, I want to make sure that the new style ends up with the same ID as the old one, or at least automatically falls into place for people who had selected the previous alternate style.

I hope this was not too hard to follow, and that somebody can help me out with this.

Thanks, Tobias

magnus 04-10-2007 10:06 PM

Rather than having and maintaining 2 separate styles, why not just create a user option to select the font color then display proper font color using conditionals?

I may be missing something, but it seems to me you're going around the block to get next door..

WetWired 04-10-2007 10:07 PM

Export your existing style with all the template mods.
Import it, making it non-selectable.
Make your two styles children of your new parent style based on your good style.
Revert all templates in the child styles that don't need to be different between them.
Make all future template edits to the parent style.

tobias_t 04-10-2007 10:12 PM

Quote:

Originally Posted by magnus (Post 1224496)
Rather than having and maintaining 2 separate styles, why not just create a user option to select the font color then display proper font color using conditionals?

I may be missing something, but it seems to me you're going around the block to get next door..

How would you do this, and where would this option show up for users?

magnus 04-10-2007 10:21 PM

AdminCP > User Profile Fields > Add New User Profile Field

Profile Field Type: Single-Selection Menu
Title: Font Color
Description: Select the color you would like the font displayed in.
Options:
(Whatever your colors are, separated by a carriage return)
Set Default: Yes, but No First Blank Option
Field Searchable on Members List: No
Show on Members List: No

Save.


Now, in the User Profile Manager you will see your new profile field listed. Under the "name" column, you'll see a field number (ie. field12). Find (and note) the field number for the field you added.

Now, I don't know how you currently implement your font colors -- whether you hardcoded <font>, <span>, etc. tags or if you're doing it via CSS (which is preferred) -- but you can then simply add the conditional:

HTML Code:

<if condition="$bbuserinfo[fieldXX] == 'Red'">font-color: #AAAAAA;<else />font-color: #BBBBBB;</if>
Modify that however you see fit, but that's the gist of it.

Users would then be able to select it in their UserCP under Profile Options. New users would be asked during registration as well.

DiSpy 04-11-2007 01:38 PM

Is there a way to modify this so that a user can set his/her own custom font/color/size, that it defaults to whenever they make a post, in thier cp?

magnus 04-11-2007 01:57 PM

Yes. Just create more custom fields to your liking and call $bbuserinfo[fieldXX] where necessary.


All times are GMT. The time now is 09:33 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.01006 seconds
  • Memory Usage 1,727KB
  • 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)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete