vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   User Selectable Forum Width Display (https://vborg.vbsupport.ru/showthread.php?t=116752)

JusteCards 05-25-2006 09:00 PM

User Selectable Forum Width Display
 
I don't know about you but I hate having to install two styles one for a Fixed Display and one for a Fluid. Anyways this hack gets around that by making the choice of Fixed or Fluid a user choice.

Now I must state that this mod may not work with some styles that are specifically designed to be a fixed width.. it really does depend on the way they've been coded.. If you do have problems with a style and this hack post here and we'll add a list to the first post.

New Profile Field
In your Admin CP Find the User Profile Fields Menu.. Open it.. Select "Add New User Profile Field"

Now you need to add a new Profile Field with the following details.

Title: Forum Width Display

Description: Do you want the forum display to be Fixed or Fluid?

Options:
Fixed
Fluid

Set Default: Yes

Field Required: Yes

Field Editable by User: Yes

Private Field: Yes

Field Searchable on Members List: No

Show on Members List: No

Allow user to input their own value for this option: No

(Everything else can be left as default)

You now need to select your Display Page, I placed mine on Options: Other

Save your new Profile field and now take note of it's field name. (mine was field5)

New Plugin
Next your need to find the Plugin System Menu.. Open it.. Select "Add New Plugin"

Now you need to add a new Plugin with the following details.

Product: vBulletin

Hook Location: global_start

Title: Forum Width Display

Plugin PHP Code:
Code:

        if ($vbulletin->userinfo['field5'] == 'Fixed')
        {
            $stylevar['outerdivwidth'] = '780px';
            $stylevar['outertablewidth'] = '780px';
        }
        else
        {
            $stylevar['outerdivwidth'] = '97%';
            $stylevar['outertablewidth'] = '97%';
        }

You need to change the field (in mine field5) to the one you took note of in the
first part.. You can also edit the widths to your liking.

and that's it.. Users can now select whichever they like and you just need to
install one version of a style now.

BeaLzeBuB 05-26-2006 06:13 PM

first post :)


clicks install

can you add screenshots?

Kaleem 05-26-2006 06:17 PM

will check it out Thanks :)

JusteCards 05-26-2006 06:34 PM

Screenshots added, not sure if they show what you were looking for.. let me know.

yinyang 05-26-2006 10:54 PM

can you add the ability to choose or specify the width %age?

b6gm6n 05-26-2006 11:51 PM

Should work with my lapsus7 skin...

-b6

JusteCards 05-27-2006 05:50 AM

Quote:

Originally Posted by yinyang
can you add the ability to choose or specify the width %age?

mmmm.. untested, but you could change the profile field to a single line text box and then change the plugin to:
Code:

        if ($vbulletin->userinfo['field5'] != '')
        {
            $stylevar['outerdivwidth'] = $vbulletin->userinfo['field5'];
            $stylevar['outertablewidth'] = $vbulletin->userinfo['field5'];
        }

you'd need to pointout to users that the value should either be *px or *% (they'll need to add the px or % themselves)

or you can force then to either using:
Code:

        if ($vbulletin->userinfo['field5'] != '')
        {
            $stylevar['outerdivwidth'] = $vbulletin->userinfo['field5'].'px';
            $stylevar['outertablewidth'] = $vbulletin->userinfo['field5'].'px';
        }

for px or:
Code:

        if ($vbulletin->userinfo['field5'] != '')
        {
            $stylevar['outerdivwidth'] = $vbulletin->userinfo['field5'].'%';
            $stylevar['outertablewidth'] = $vbulletin->userinfo['field5'].'%';
        }

for %

Boofo 05-27-2006 06:59 AM

Would you please attach the plug-in and a text file for the instructions?

JusteCards 05-27-2006 07:08 AM

Quote:

Originally Posted by Boofo
Would you please attach the plug-in and a text file for the instructions?

Done ;)

Zia 05-27-2006 09:01 AM

helo..seems interesting..

we ars using a ffixed skin..it will work on it?

JusteCards 05-27-2006 11:05 AM

Quote:

Originally Posted by Zia
helo..seems interesting..

we ars using a ffixed skin..it will work on it?

I'm not sure, it has worked with all skins I've tested it with so far.. but might not work with a highly complex skin that uses a lot of images and css for positioning purposes.

OndaReal 05-27-2006 09:47 PM

reserved for a later use :)

jfontestad 05-29-2006 05:36 PM

Just what I was looking for :)

Installed.

Ziki 06-02-2006 12:38 PM

Doesn't even work on default style lol

JusteCards 06-02-2006 12:58 PM

Quote:

Originally Posted by ZIKI-SET
Doesn't even work on default style lol

It's worked fine in my tests on a clean install..

Could you give me some more details about the problems your having with it..

If your a bit more constructive in your comments I maybe able to help.

Ascor 08-21-2006 05:18 PM

just installed, work fine under 3.6, thank you :)

codershark 11-20-2008 10:55 AM

anyone installed under 3.7.4 ???


All times are GMT. The time now is 12:37 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.02121 seconds
  • Memory Usage 1,751KB
  • 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
  • (4)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (17)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