vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   let users select to use legacy or not (and choice for vb menu as well) (https://vborg.vbsupport.ru/showthread.php?t=82755)

jesus likes pie 06-08-2005 10:00 PM

let users select to use legacy or not (and choice for vb menu as well)
 
(1) Create a new Custom Profile Field of the your choosing (yes/no / radio / select). I am going to use a single-selection menu for this demo. I put in two options "Top" and "Left". At the very bottom of the custom profile edit page, set the Display Page option to Options: Thread Viewing. Submit your new profile field.

(2) Now you are redirected to your list of custom profile fields. Find the new field you selected and note its Name. Mine is called field12 for example.

(3) Then I placed this in my phpinclude_start template:

PHP Code:

if($bbuserinfo['userid'])    
{    
    if(
$bbuserinfo['field12'] == 'Left')    
    {    
       
$vboptions['legacypostbit'] = 1;    
        
$vboptions['usepopups'] = 1;    
    }    
    
    else    
    {    
        
$vboptions['legacypostbit'] = 0;    
        
$vboptions['usepopups'] = 0;    
    }    
}    
    
else    
{    
    
$vboptions['legacypostbit'] = 1;
    
$vboptions['usepopups'] = 1;       


Now everyone will default to left style but can choose top style in their User CP. Anyone with left style can use vbmenu. Anyone with top stly cant use it(this is because on my forum i have a skin that wont allow vbmenu on normal style it caused errors(to enable it chnage$vboptions['usepopups'] = 0 to $vboptions['usepopups'] = 1)). You can adjust the code to default everyone to top style by enabling the vboption for postbit and then changing the above code to:

PHP Code:

if($bbuserinfo['userid'])    
{    
    if(
$bbuserinfo['field12'] == 'Top')    
    {    
       
$vboptions['legacypostbit'] = 0;    
        
$vboptions['usepopups'] = 0;    
    }    
    
    else    
    {    
        
$vboptions['legacypostbit'] = 1;    
        
$vboptions['usepopups'] = 1;    
    }    
}    
    
else    
{    
    
$vboptions['legacypostbit'] = 0;
        
$vboptions['usepopups'] = 0;       


vBMenu will be disabled if you use top
vBMenu will be enabled if you use left

I hope this mod helps people who get the same error as me

kall 06-09-2005 08:22 PM

This has actually already been released in other forms, but a php_include mod goes in minimods. :)

jesus likes pie 06-09-2005 10:09 PM

but i have modded this
some skins have errors in postbit if you try to use vbmenu
this is why i made this


All times are GMT. The time now is 08:57 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.01029 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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