vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How to add your own template group (https://vborg.vbsupport.ru/showthread.php?t=70165)

Logikos 10-03-2004 10:00 PM

How to add your own template group
 
1 Attachment(s)
If you would like to keep your AdminCp Area nice and clean like i do and are looking for a way to group all those custom templates that say arcade_XXXX all over the place, well lets put them in its own group.

Open includes/adminfunctions_template.php

Scroll ALL the way to the bottom and you will see the following:

PHP Code:

// template groups
$only = array
(
        
// phrased groups
        
'buddylist' => $vbphrase['group_buddy_list'],
        
'calendar' => $vbphrase['group_calendar'],
        
'faq' => $vbphrase['group_faq'],
        
'reputation' => $vbphrase['group_user_reputation'],
        
'poll' => $vbphrase['group_poll'],
        
'pm' => $vbphrase['group_private_message'],
        
'register' => $vbphrase['group_registration'],
        
'search' => $vbphrase['group_search'],
        
'usercp' => $vbphrase['group_user_control_panel'],
        
'usernote' => $vbphrase['group_user_note'],
        
'whosonline' => $vbphrase['group_whos_online'],
        
'showgroup' => $vbphrase['group_show_groups'],
        
'posticon' => $vbphrase['group_post_icon'],
        
'userfield' => $vbphrase['group_user_profile_field'],
        
'bbcode' => $vbphrase['group_bb_code_layout'],
        
'help' => $vbphrase['group_help'],
        
'editor' => $vbphrase['group_editor'],
        
'forumdisplay' => $vbphrase['group_forum_display'],
        
'forumhome' => $vbphrase['group_forum_home'],
        
'pagenav' => $vbphrase['group_page_navigation'],
        
'postbit' => $vbphrase['group_postbit'],
        
'threadbit' => $vbphrase['group_threadbit'],
        
'im_' => $vbphrase['group_instant_messaging'],
        
'memberinfo' => $vbphrase['group_member_info'],
        
'memberlist' => $vbphrase['group_members_list'],
        
'modify' => $vbphrase['group_modify_user_option'],
        
'new' => $vbphrase['group_new_posting'],
        
'showthread' => $vbphrase['group_show_thread'],
        
'smiliepopup' => $vbphrase['group_smilie_popup'],
        
'subscribe' => $vbphrase['group_subscribed_thread'],
        
'whoposted' => $vbphrase['group_who_posted'],
        
'threadadmin' => $vbphrase['group_thread_administration'],
        
'phpinclude' => $vbphrase['group_php_include_code'],
        
'navbar' => $vbphrase['group_navigation_breadcrumb'],
        
'printthread' => $vbphrase['group_printable_thread'],
        
'attachmentlist' => $vbphrase['group_attachment_list'],
        
'subscription' => $vbphrase['group_paid_subscriptions'],


        
'aaa' => 'AAA Old Backup'
); 

Above the 'aaa' => 'AAA Old Backup' You can place your groups name.

For instance if you installed the arcade hack all there templates say:

arcade_blah
arcade_blah
arcade_blah
arcade_blah

Then you would add the following above 'aaa' => 'AAA Old Backup':

PHP Code:

'arcade' => $vbphrase['arcade_hack_templates'], 

Then you would add a new phrase call arcade_hack_templates with the text Arcade Hack Templates.

Now the 'arcade => part means which templates are we going to put in this group. And only the templates that start with arcade. and the $vbphrase['arcade_hack_templates'] part is the name of the catogory/group your templates will be under.

So now you should be able to make your own. Hope this is usefull for new hackers! :)

You can download the tutorial in a .txt format below.

nexialys 10-04-2004 10:01 AM

Hum... Live_Wire.. this was released months ago.. ;)

Logikos 10-04-2004 06:02 PM

Well i did a search in the Modification Hints and Tips forum and couldn't find anything.

nexialys 10-04-2004 07:56 PM

hum.. ya... i know... someone moved it...

AnhTuanCool 10-04-2004 08:02 PM

That's okay, I saved it Live Wire :)

Dean C 10-04-2004 08:15 PM

Thanks for posting this up Ken - hopefully it'll help a few people :)

Logikos 10-04-2004 08:27 PM

Thanks everyone, got a few more usefull ones i'll be posting.

Revan 10-06-2004 10:46 PM

Well, it wont ever work ;)
PHP Code:

// WRONG!
'arcade => $vbphrase['arcade_hack_templates'], 

PHP Code:

// CORRECT!
'arcade' => $vbphrase['arcade_hack_templates'], 

Syntax Error Heaven ;)


Plus, vBulletin automatically suffixes the phrases (be they vb'ed or not) with "Templates", so yours would read "Arcade Hack Templates Templates", if you included "Templates" in the vbphrase you add
:)

Logikos 10-06-2004 11:21 PM

ahh small typo with the ' opps. fixed.

DS MrSinister 11-01-2004 03:32 PM

i cant get this to work for me. For some reason.

KW802 11-01-2004 04:16 PM

Now if somebody could only get the "adv_portal" templates do do that for vBa CMPS I'd be happy. :p

Logikos 11-01-2004 04:44 PM

Quote:

Originally Posted by KW802
Now if somebody could only get the "adv_portal" templates do do that for vBa CMPS I'd be happy. :p

Thats not hard, if you read the first post you will know how to do that.

Find:
PHP Code:

'subscription' => $vbphrase['group_paid_subscriptions'], 

Below Add:
PHP Code:

'adv_portal' => $vbphrase['vbadvanced_cmps_templates'], 

Add new phrase:
vbadvanced_cmps_templates
vBadvanced CMPS Templates

Done!

KW802 11-01-2004 04:49 PM

Quote:

Originally Posted by Live Wire
Thats not hard, if you read the first post you will know how to do that. <snip>

Actually, mine already looks like.....
Code:

'adv_portal' => 'vBadvanced CMPS',
'adv_links' => $vbphrase['group_adv_links'],

If the code you posted on your site is working to group the CMPS templates then I must've screwed something else up somewhere.

Knowing how to do it isn't the problem..... why it isn't working is. ;)

DS MrSinister 11-01-2004 05:35 PM

thanks for the help.. now i Just can't get the adv_portal templates to move. Like the ones i have added.

any ideas on it?

Natch 11-04-2004 12:44 AM

I get this problem sas well, but others with the same hack installed have it working (/me points @ Boofo and Dark_Wizard) ... so I dunno what it is: the file mods are the same...

venomx 02-25-2005 08:08 AM

This works on some but not others. Not sure why...

squawell 02-25-2005 09:59 AM

Quote:

Originally Posted by venomx
This works on some but not others. Not sure why...

agree that...sometimes works but sometimes not ...so strange:ermm:

deathemperor 02-25-2005 11:59 AM

it works for most of the cases, the only time I saw it doesn't work is when using for adv_portal. all of else works for me.

teamgofast 02-27-2005 02:03 PM

this is a great tip, cleans things up nicely, now what to do with the custom adv_portal templates?

macooper 05-27-2005 09:33 PM

I just tried this for the geek article system, and it didn't work. However, I noticed that all the templates started 'GAS_', so I used the code

PHP Code:

'GAS_' => $vbphrase['group_gas_hack'], 

which turned out to be the problem. Even though the templates started in uppercase, I had to list the filter phrase in lowercase like this

PHP Code:

'gas_' => $vbphrase['group_gas_hack'], 

Then everything worked as expected. As it wasn't obvious to me that I should always use lowercase for the filter, I thought I'd add this note.

zetetic 05-30-2005 06:26 AM

Regarding it not working with the adv_portal templates, Brian at vBadvanced said in this post that because of the way vBulletin handles things, new templates won't be grouped with the others. Maybe they'll have this fixed in 3.5...

craiovaforum 02-25-2009 08:51 PM

Heh, it's version 3.8 and almost 4 years passed without any changes. This is a big issue for boards like mine with alot of modifications and templates that start with adv_portal.

Wired1 04-02-2009 07:07 PM

Quote:

Originally Posted by craiovaforum (Post 1754637)
Heh, it's version 3.8 and almost 4 years passed without any changes. This is a big issue for boards like mine with alot of modifications and templates that start with adv_portal.

I'd guess you could do this with the hook that now exists (untested):
Quote:

if (class_exists('vBulletinHook'))
{
($hook = vBulletinHook::fetch_hook('template_groups')) ? eval($hook) : false;
}
Just make a plugin that appends a line to the end of the afforementioned array?

ChrisHasenpflug 08-08-2009 10:24 PM

Quote:

Originally Posted by Wired1 (Post 1782602)
I'd guess you could do this with the hook that now exists (untested):

Just make a plugin that appends a line to the end of the afforementioned array?

Yup, you can. Make a plugin for the "template_group" hook as follows:

PHP Code:

$only['your_prefix'] = 'Template Description'

Just did this, and it works.


All times are GMT. The time now is 01:57 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.01350 seconds
  • Memory Usage 1,800KB
  • 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
  • (1)bbcode_code_printable
  • (9)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)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