vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [quick 2.0b2 hack] Specify global default style-set (https://vborg.vbsupport.ru/showthread.php?t=9535)

Mas*Mind 02-22-2001 10:00 PM

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:

PHP Code:

  // 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:

PHP Code:

  // 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 :)

02-23-2001 03:19 PM

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

chrispadfield 05-28-2001 08:09 PM

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?

Mas*Mind 05-28-2001 08:12 PM

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

Guess this thread can be moved to the 2.0 releases forum

MarkG 04-29-2002 09:41 AM

small addition:


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

find this
Code:

$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
Code:

$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");


All times are GMT. The time now is 01:11 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.01281 seconds
  • Memory Usage 1,721KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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