PDA

View Full Version : Change forum listing depth depending on the style


necris
07-03-2008, 08:15 AM
Anyone knows a simple (or not that simple) way to do this?

What I want to achieve is:

Depending on the style reduce the depth in forum listing in order to improve the usability for the users using certain devices to access the forums.

The solution might be as easy as find the hook and use something like the text below to set the var. If anyone have already done this any clue would be apreciated :)

$counter_aux=preg_match ( '/devicename\.domainname\.com/' , $_SERVER['HTTP_HOST']);
if($counter_aux<>0){
$nasty_var = 1; # Depth....
}

Thx

Dismounted
07-03-2008, 10:26 AM
if (STYLEID == X)
{
$vbulletin->options['WHATEVER_IT_IS'] = Y;
}

necris
07-03-2008, 06:22 PM
Thanks for the info.

Finally I came up with a solution to the problem after lurking a little in the settings table of the database (easier than expected ^^ because it have a non caotic structure).

Here i leave the code just in case anyone need it.

$counter_aux=preg_match ( '/device\.domain\.com/' , $_SERVER['HTTP_HOST']);
if($counter_aux<>0){
$vbulletin->options['forumhomedepth'] = 2; $vbulletin->options['forumdisplaydepth'] = 2;
$vbulletin->options['subforumdepth'] = 0;
}

On the hook global_setup_complete.

Dismounted
07-04-2008, 05:03 AM
Why don't you just use a compare, instead of a costly PCRE function?
if ($_SERVER['HTTP_HOST'] == 'device.domain.com')
{
$vbulletin->options['forumhomedepth'] = 2;
$vbulletin->options['forumdisplaydepth'] = 2;
$vbulletin->options['subforumdepth'] = 0;
}