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)
-   -   Create Style Groups for Style Chooser (https://vborg.vbsupport.ru/showthread.php?t=63555)

Wayne Luke 04-05-2004 10:00 PM

Create Style Groups for Style Chooser
 
If you have a lot of style groups added, it can be hard to organize them in the quick style chooser located in the footer of each page. I wanted to provide a visual break between style groups so I came up with this mini modification. It requires 2 file edits and two new minor templates and a minor query.

Create the following templates:

optiongroup_start:
HTML Code:

<optgroup label="$optiontitle">
optiongroup_end:
HTML Code:

</optgroup>
Next open up includes/functions.php and find:
PHP Code:

    eval ('$stylesetlist .= "' fetch_template('option') . '";');
    
$stylesetlist .= construct_style_options($style['styleid'], $depthmark '--'false$quickchooser); 

Change that to:
PHP Code:

    if ($style['userselect'] == 1)
    {
     eval (
'$stylesetlist .= "' fetch_template('option') . '";');
     
$stylesetlist .= construct_style_options($style['styleid'], $depthmark '--'false$quickchooser);
    }
    else
    {
     eval (
'$stylesetlist .= "' fetch_template('optiongroup_start') . '";');
     
$stylesetlist .= construct_style_options($style['styleid'], $depthmark '--'false$quickchooser);
     eval (
'$stylesetlist .= "' fetch_template('optiongroup_end') . '";');
    } 

In admincp/template.php find:
PHP Code:

 print_yes_no_row($vbphrase['allow_user_selection'], 'userselect'$style['userselect']); 

and replace with:
PHP Code:

 print_yes_no_other_row($vbphrase['allow_user_selection'], 'userselect''Option Group'$style['userselect']); 

Finally run this query:
Code:

ALTER TABLE `style` CHANGE `userselect` `userselect` SMALLINT( 5 ) DEFAULT '1' NOT NULL
This modification is not phrase friendly but you could easily create a phrase for the words "Option Group" used in admincp/template.php and implement it. You can also modify the templates to apply a CSS class and style the option groups to fit your site.

Feel free to modify this to suit your needs.

A demo can be see at www.vbulletinmods.com. Just select the style chooser there.

eXtremeTim 04-06-2004 08:40 PM

Might want to see about caching thoose templates. Seeing as thats making 2 extra queries on your vbulletinmods.com site.

Zachery 04-06-2004 08:44 PM

All you need to do is add the cached templates

In global.php find

PHP Code:

    'STANDARD_REDIRECT'
    
//'board_inactive_warning'
)); 

change to
PHP Code:

    'STANDARD_REDIRECT',
    
'optiongroup_start',
    
'optiongroup_end'
    
//'board_inactive_warning'
)); 

hit save and your done, :) that should work

eXtremeTim 04-06-2004 08:50 PM

Quote:

Originally Posted by Zachery
All you need to do is add the cached templates

In global.php find

PHP Code:

    'STANDARD_REDIRECT'
    
//'board_inactive_warning'
)); 

change to
PHP Code:

    'STANDARD_REDIRECT',
    
'optiongroup_start',
    
'optiongroup_end'
    
//'board_inactive_warning'
)); 

hit save and your done, :) that should work

I know what all you had todo. I was just informing wayne here that he might want to add that part into the hack and on vbulletinmods.com.

gmarik 04-08-2004 05:40 PM

Rather much editing...

Lurk 04-13-2004 01:44 AM

Quote:

Originally Posted by gmarik
Rather much editing...

is there something i'm doing wrong?
I currently run:
vBadvanced
vBulletin 3.0.0 gold

i keep getting the error:
Code:

Parse error: parse error in /home/lurkcorp/public_html/forum/includes/functions.php on line 1864

Fatal error: Call to undefined function: is_browser() in /home/lurkcorp/public_html/forum/global.php on line 59


blubber12 04-24-2004 10:48 PM

A question or two:)...Do the skins need to be reinstalled after implementing this? And in order to have categories, I would change Option Group to dark, light, etc...? Sorry for not understanding completely

blubber12 04-25-2004 08:15 PM

ok I've been playing around with this and am clueless :(...When I go to upload a new skin, I do see yes/no/option group. If i choose it to be in option group, I get that name on the chooser, but cant choose it. I'm at a loss, how to set a category and then put the correct skins under it. Any help will be greatly appreciated.

blubber12 04-28-2004 12:43 AM

Is there any ideas out there...just a direction to point me in :)....I'm ok once i know what i'm doing
Thanks to all

blubber12 05-14-2004 11:10 PM

any ideas out there

M1th 07-14-2004 02:35 PM

I've noticed that the optiongroup_start and optiongroup_end arent cached on any pages. Just thought i'd let you know. :)

blubber12 07-19-2004 01:36 AM

any ideas out there

M1th 07-19-2004 09:57 AM

You will need to upload the style AGAIN and make it a Child style for the style you've selected to be the category option.


All times are GMT. The time now is 04:47 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.01240 seconds
  • Memory Usage 1,761KB
  • 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_html_printable
  • (8)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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