Helpful Information
 
 
Category: vBulletin 2.x Full Releases
[quick 2.0b2 hack] Specify global default style-set

Here's what the hack does: You can specify the stylesetid you wanna use globally when no other styleset is used by the visitor. The way it worked now was that it reverted back to the 'Default'-styleset.

It was a very quick hack, but seemed to be working very well. The option will be in the 'options-area', right below the Add template name in comments option.

Instructions:

First backup you're global.php (in the root dir, not the admin dir)

Now open up global.php (in the root dir) and look for the line:


// Will look in the user info for a style
if ($bbuserinfo['styleid']!=0) { //style specified
$styleid=$bbuserinfo['styleid'];
} else { //no style
$styleid=1;
}


replace it with:


// Will look in the user info for a style
if ($bbuserinfo['styleid']!=0) { //style specified
$styleid=$bbuserinfo['styleid'];
} else { //no style
$styleid=$defaulttplset;
}


Save global.php

The insert a new line in the 'setting' table through phpMyAdmin, with the values:

settinggroupid: 23
title: Default template-set
varname: defaulttplset
value: 1
description: Specify the templatesetid of the template-set you wanna use globally if no other set is used
optioncode:
displayorder: 2

or execute the following query:

Insert into setting (settinggroupid, title, varname, value, description, optioncode, displayorder) values('23', 'Default template-set', 'defaulttplset', '1', 'Specify the templatesetid of the template-set you wanna use globally if no other set is used', '', '2')

All done! Enjoy :)

wow, you don't leave a moment to spare already with a hack for beta 2 :)

this is "exactly" what i want. Just checking there are no changes for vb2.0 - i doubt there are considering the change but does it still work fine?

still works fine..I'm using it :)

Guess this thread can be moved to the 2.0 releases forum

small addition:


if you want your styles listed alphabetically on the drop-down box

find this
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");

and replace it with this
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid order by style.title");










privacy (GDPR)