Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Create Style Groups for Style Chooser Details »»
Create Style Groups for Style Chooser
Version: 1.00, by Wayne Luke (Senior Member) Wayne Luke is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 04-05-2004 Last Update: Never Installs: 3
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 07-14-2004, 02:35 PM
M1th's Avatar
M1th M1th is offline
 
Join Date: Jul 2002
Location: UK
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've noticed that the optiongroup_start and optiongroup_end arent cached on any pages. Just thought i'd let you know.
Reply With Quote
  #13  
Old 07-19-2004, 01:36 AM
blubber12 blubber12 is offline
 
Join Date: Nov 2003
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any ideas out there
Reply With Quote
  #14  
Old 07-19-2004, 09:57 AM
M1th's Avatar
M1th M1th is offline
 
Join Date: Jul 2002
Location: UK
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:19 AM.


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.03929 seconds
  • Memory Usage 2,251KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_html
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete