Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 08-08-2007, 09:48 PM
ZombieAndy's Avatar
ZombieAndy ZombieAndy is offline
 
Join Date: Oct 2004
Location: UK
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Individual Forum Colours

Ok im a coder of limited experience and ive been trying to crack this one for a long time to no avail, so im bringing it here in the hope that some of the more experienced guys will be able to help me out

I want to make a forum a certain colour when viewed from a certain style, but not others.

For example, if i have three styles, Style 1, 2 and 3.

if a user is using style 2 as their style, when they go into general discussion i want them to view it through style 3, but every other forum on my board through style 2. where-as if another member is using style 1 as their style and go into general discussion, i dont want them effected.

you guys see what im trying to do with this and does anyone know how it could be done?
Reply With Quote
  #2  
Old 08-08-2007, 10:43 PM
MeNeedHelp MeNeedHelp is offline
 
Join Date: Mar 2004
Location: Canada
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unless I do not get what you are trying to do, me thinks this would work...

if ($forumid == x AND $vbulletin->userinfo['styleid'] == y)
$vbulletin->userinfo['styleid'] = z;
Reply With Quote
  #3  
Old 08-08-2007, 10:59 PM
ZombieAndy's Avatar
ZombieAndy ZombieAndy is offline
 
Join Date: Oct 2004
Location: UK
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Call me thick if you like but what template/file is this applied to?
Reply With Quote
  #4  
Old 08-08-2007, 11:03 PM
MeNeedHelp MeNeedHelp is offline
 
Join Date: Mar 2004
Location: Canada
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could insert this in the global.php file.
($hook = vBulletinHook::fetch_hook('style_fetch')) ? eval($hook) : false;

Are your users allowed to switch styles on their own?
Reply With Quote
  #5  
Old 08-08-2007, 11:09 PM
ZombieAndy's Avatar
ZombieAndy ZombieAndy is offline
 
Join Date: Oct 2004
Location: UK
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MeNeedHelp View Post
You could insert this in the global.php file.
($hook = vBulletinHook::fetch_hook('style_fetch')) ? eval($hook) : false;

Are your users allowed to switch styles on their own?
Yes.
Reply With Quote
  #6  
Old 08-08-2007, 11:13 PM
MeNeedHelp MeNeedHelp is offline
 
Join Date: Mar 2004
Location: Canada
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then not sure whats the point of forcing a certain style on them if they can simply change it.

You will also need to override the $styleid variable in the same conditional.
I have not tested this but its a good place to start.
Good luck.
Reply With Quote
  #7  
Old 08-08-2007, 11:24 PM
ZombieAndy's Avatar
ZombieAndy ZombieAndy is offline
 
Join Date: Oct 2004
Location: UK
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MeNeedHelp View Post
Then not sure whats the point of forcing a certain style on them if they can simply change it.
The webmaster on our site (my boss) wants a specific style where when viewed, our general discussion is green and not white (standard colour).

Other question, does the second style (the one being forced) have to be an active style? i would rather our users not be able to select it.
Reply With Quote
  #8  
Old 08-08-2007, 11:42 PM
MeNeedHelp MeNeedHelp is offline
 
Join Date: Mar 2004
Location: Canada
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The style does not have to be active.

if ($forumid == 2 AND $vbulletin->userinfo['styleid'] == 1)
{
$vbulletin->userinfo['styleid'] = 2;
$styleid = 2;
}

That should work but if you want to apply this to a category you will have to expand the conditional to include the forum's children ids.
Reply With Quote
  #9  
Old 08-09-2007, 12:05 AM
ZombieAndy's Avatar
ZombieAndy ZombieAndy is offline
 
Join Date: Oct 2004
Location: UK
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats working great, thanks alot for your help man
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:06 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.06110 seconds
  • Memory Usage 2,234KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete