Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: 1.00, by Mutt Mutt is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-08-2002 Last Update: Never Installs: 16
 
No support by the author.

I was getting my templates ready to upgrade to 2.2.2 and I came up with this idea. vbLinks set it's templates as part of the default set and needed to be changed over to custom templates.

the default templates are seperated into groups, but when you make a bunch of custom templates, wouldn't it be nice to have them be grouped as well? Anyway, it was really easy.

open template.php and scroll down to the "Start Modify" section

you'll see

$only['calendar'] = 'Calendar';
$only['emailsubject'] = 'Email Subject';
etc.

they are set up like this
$only['**begining of template title**'] = '**Group Title**';

name your template something like
links_firsttemplate
links_secondtempate

then with all the other $only[*] lines add
$only['links'] = 'vbLinks';

links is the begining of all the links templates and vbLinks is the title for the group of templates

maybe later I'll make a admin cp form to add the group titles but for now just add them to template.php


just making these changes would make the new groups show up under the default templates, but to make them appear in the custom section

find
PHP Code:
    while ($template=$DB_site->fetch_array($templates)) {
      if (!
$donecustom) {
        
$donecustom=1;
        echo 
"<b>Custom templates</b>";
      } 
right below it add
PHP Code:
      $under 0;
      
reset($only);
      while(list(
$text,$display)=each($only)) {
        if (
strpos($template[title]"$text)==1) {
          
$under $display;
          
$shortname $text;
          break;
        }
      }

        if (
$under) {
          if (
$lastunder!=$under and $lastunder and $shrink) {
            echo 
"</ul></li>\n";
            
$shrink 0;
          }

          
$lastunder $under;
          if (!
$shrink) {
            echo 
"<li><a name=\"".urlencode($shortname)."\"><b></a>$under Templates <a href=\"template.php?s=$session[sessionhash]&action=modify&expandset=$templateset[templatesetid]&group=".urlencode($shortname)."#".urlencode($shortname)."\">[expand]</a></b>\n<ul>\n";
          }
          
$shrink 1;
          if (
$group!=$shortname and $group!="all") {
            continue;
          }
        } else {
          if (
$shrink) {
            echo 
"</ul></li>\n";
          }
          
$shrink 0;
        } 
(I just grabed this from the default template section)

thats it. now your custom template will be grouped as well.

whats real nice is say you added some custom templates that should be grouped with the default ones like new error message, postbit, or getinfo templates, they will not only get grouped with that group name under custom templates, but when you expand the default postbit templates, the custom postbit templates will be expanded as well.


If I missed something let me know.

Show Your Support

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

Comments
  #2  
Old 02-09-2002, 06:06 PM
afterlab's Avatar
afterlab afterlab is offline
 
Join Date: Oct 2001
Location: Dallas, TX
Posts: 327
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice idea. I was wondering about this the other day. Thanks for sharing the hack, I look forward to installing and using it shortly.
Reply With Quote
  #3  
Old 02-09-2002, 07:30 PM
FWC's Avatar
FWC FWC is offline
 
Join Date: Oct 2001
Location: Ontario, CA
Posts: 821
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well done, Mutt! My template listings are so much cleaner now.
Reply With Quote
  #4  
Old 02-10-2002, 01:18 AM
LuBi LuBi is offline
 
Join Date: Oct 2001
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

screen shot!
Reply With Quote
  #5  
Old 02-10-2002, 12:10 PM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, here's a screen shot. I didn't think you'd need one. it looks just like the Default templates are organized
Reply With Quote
  #6  
Old 02-10-2002, 12:16 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Evil's Advocate question: does it work with FireFly's TBS hack ?
I make an extensive use of it and wouldn't create uncompatibilities...
Thnx
Reply With Quote
  #7  
Old 02-10-2002, 12:39 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Jawelin
Evil's Advocate question: does it work with FireFly's TBS hack ?
I make an extensive use of it and wouldn't create uncompatibilities...
Thnx
My hack is completely independent so you shouldn't worry.
I'm gonna install this hack myself soon (since I pretty much have more custom templates than default... I think ).

Oh, and I think it's Devil's advocate.
Reply With Quote
  #8  
Old 02-10-2002, 12:43 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Working great, good hack.
Reply With Quote
  #9  
Old 02-10-2002, 12:49 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It appears that if you group the last template under a category the category is not closed and this what happens (attached).

I couldn't care less but just thought I'd let you know.
Reply With Quote
  #10  
Old 02-10-2002, 06:23 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FireFly

My hack is completely independent so you shouldn't worry.
[...]
Oh, and I think it's Devil's advocate.
Of course...
MisTYPO!

Actually I didn't realize that groups are built only at displaying time... Though they where folders of templates...
Sorry for such a silly question
Thnx
Reply With Quote
Reply

Thread Tools

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:20 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.04612 seconds
  • Memory Usage 2,306KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_php
  • (2)bbcode_quote
  • (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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_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