PDA

View Full Version : let users select to use legacy or not (and choice for vb menu as well)


jesus likes pie
06-08-2005, 10:00 PM
(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:

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:

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