Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2007, 02:00 AM
RobDog888's Avatar
RobDog888 RobDog888 is offline
 
Join Date: Apr 2007
Location: Degabah Swamp
Posts: 293
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Create Template Group

<font color="darkgreen">How the heck do you create a template group? I searched the API docs and the site but nothing comes up.</font>
Reply With Quote
  #2  
Old 10-15-2007, 03:20 AM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in template_groups hook add..

$only['mytemplates'] = 'My Templates';

tips
* prepend all your template names with "mytemplates"
* save all templates in MASTER STYLE
Reply With Quote
  #3  
Old 10-15-2007, 03:29 AM
RobDog888's Avatar
RobDog888 RobDog888 is offline
 
Join Date: Apr 2007
Location: Degabah Swamp
Posts: 293
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But thats just it. I found this
https://vborg.vbsupport.ru/showthread.php?t=70165
which showed me that file to use and there is a hook there at the bottom

Code:
($hook = vBulletinHook::fetch_hook('template_groups')) ? eval($hook) : false;
So I figured I could make a plugin for it and just merge a few array items to the $only variable but there is no listing in the add new plugin for template_groups.

Im sure there is a way but after that would having it as a plugin create an issue as its not really physically in the table?

Thanks


--------------- Added [DATE]1192423255[/DATE] at [TIME]1192423255[/TIME] ---------------

Hmm, how about like this having the plugin use global_start.

Code:
eval('$template_hook[template_groups] .= "' . array_push($only, 'item6' =>  $vbphrase['item6']) . '";');
Im really trying to avoid manual file and template edits for my product.
Reply With Quote
  #4  
Old 10-15-2007, 03:47 AM
Andrew Green's Avatar
Andrew Green Andrew Green is offline
 
Join Date: Nov 2005
Location: Winnipeg, MB
Posts: 996
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that article is a few years old, probably doesn't do it the same way.

You don't need any file edits, just name all your templates with the same prefix and create the plugin as Princeton said.
Reply With Quote
  #5  
Old 10-15-2007, 03:53 AM
RobDog888's Avatar
RobDog888 RobDog888 is offline
 
Join Date: Apr 2007
Location: Degabah Swamp
Posts: 293
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<font color="darkgreen">Yes, I didnt even notice that. Guess too many hours on the computer today lol.

What would be the hook to use for this plugin? global_start? or cache_templates or parse_tempaltes etc?

I did name a few of my templates already like that and placed them in the User Control Panel Templates group with naming them usercp_blah but I now have to move them into this new group once the plugin is completed and I assume that will break some of my code in the php pages too. Oh well I guess I can fix it later. </font>
Reply With Quote
  #6  
Old 10-15-2007, 03:56 AM
Andrew Green's Avatar
Andrew Green Andrew Green is offline
 
Join Date: Nov 2005
Location: Winnipeg, MB
Posts: 996
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RobDog888 View Post
Yes, I didnt even notice that. Guess too many hours on the computer today lol.

What would be the hook to use for this plugin? global_start? or cache_templates or parse_tempaltes etc?

I did name a few of my templates already like that and placed them in the User Control Panel Templates group with naming them usercp_blah but I now have to move them into this new group once the plugin is completed and I assume that will break some of my code in the php pages too. Oh well I guess I can fix it later.

hook location is: "template_groups" under General Administration
Reply With Quote
  #7  
Old 10-15-2007, 04:02 AM
RobDog888's Avatar
RobDog888 RobDog888 is offline
 
Join Date: Apr 2007
Location: Degabah Swamp
Posts: 293
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Son of a ... I have been looking throughout all the templates groups looking for it. Guess I passed through the admin stuff thinking it would be somewhere else.

Now I am not sure whats going on but it removed my vBAdvanced tempalte group and they are all at parent level with no new template group that I specified. Is my code ok?

Thanks


--------------- Added [DATE]1192425307[/DATE] at [TIME]1192425307[/TIME] ---------------

Code:
eval('$template_hook[template_groups] .= "' . array_push($only, 'testgroup' =>  'Test Group') . '";');
That is the code I am using to test with. i didnt create a phrase for it yet so I just wrote it in there.

--------------- Added [DATE]1192429143[/DATE] at [TIME]1192429143[/TIME] ---------------

I checked out vBA's hook to see how they do it and theirs is like this...

Code:
$only['adv_portal'] = $vbphrase['group_adv_cmps'];
So I figured I could use the same code...
Code:
$only['test'] = 'Test';
But nada still. I even changed the execution order as they were both on 5. I changed mine to 6 and still nothing. I disabled vBA and yet still nothing.


--------------- Added [DATE]1192431724[/DATE] at [TIME]1192431724[/TIME] ---------------

I got it working with the code that was similar to vBA but the template group never showed up until I modified one template that was eventually going to go into it. Guess the template group will not show unless there is at lease one template in it.

Since thats the case, I wonder how you are supossed to do it without modifying the template record?
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 01:26 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.03571 seconds
  • Memory Usage 2,223KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete