vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Individual Forum Colours (https://vborg.vbsupport.ru/showthread.php?t=154710)

ZombieAndy 08-08-2007 09:48 PM

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?

MeNeedHelp 08-08-2007 10:43 PM

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;

ZombieAndy 08-08-2007 10:59 PM

Call me thick if you like but what template/file is this applied to?

MeNeedHelp 08-08-2007 11:03 PM

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?

ZombieAndy 08-08-2007 11:09 PM

Quote:

Originally Posted by MeNeedHelp (Post 1313138)
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.

MeNeedHelp 08-08-2007 11:13 PM

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.

ZombieAndy 08-08-2007 11:24 PM

Quote:

Originally Posted by MeNeedHelp (Post 1313145)
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.

MeNeedHelp 08-08-2007 11:42 PM

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.

ZombieAndy 08-09-2007 12:05 AM

Thats working great, thanks alot for your help man :)


All times are GMT. The time now is 01:12 AM.

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,724KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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