PDA

View Full Version : How to add your own template group


Logikos
04 Oct 2004, 08:09
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:


// 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':


'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
04 Oct 2004, 12:01
Hum... Live_Wire.. this was released months ago.. ;)

Logikos
04 Oct 2004, 20:02
Well i did a search in the Modification Hints and Tips forum and couldn't find anything.

nexialys
04 Oct 2004, 21:56
hum.. ya... i know... someone moved it...

AnhTuanCool
04 Oct 2004, 22:02
That's okay, I saved it Live Wire :)

Dean C
04 Oct 2004, 22:15
Thanks for posting this up Ken - hopefully it'll help a few people :)

Logikos
04 Oct 2004, 22:27
Thanks everyone, got a few more usefull ones i'll be posting.

Revan
07 Oct 2004, 00:46
Well, it wont ever work ;)
// WRONG!
'arcade => $vbphrase['arcade_hack_templates'], // 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
07 Oct 2004, 01:21
ahh small typo with the ' opps. fixed.

DS MrSinister
01 Nov 2004, 17:32
i cant get this to work for me. For some reason.

KW802
01 Nov 2004, 18:16
Now if somebody could only get the "adv_portal" templates do do that for vBa CMPS I'd be happy. :p

Logikos
01 Nov 2004, 18:44
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:

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

Below Add:

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


Add new phrase:
vbadvanced_cmps_templates
vBadvanced CMPS Templates

Done!

KW802
01 Nov 2004, 18:49
Thats not hard, if you read the first post you will know how to do that. <snip>Actually, mine already looks like.....'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
01 Nov 2004, 19:35
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
04 Nov 2004, 02:44
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
25 Feb 2005, 10:08
This works on some but not others. Not sure why...

squawell
25 Feb 2005, 11:59
This works on some but not others. Not sure why...
agree that...sometimes works but sometimes not ...so strange:ermm:

deathemperor
25 Feb 2005, 13:59
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
27 Feb 2005, 16:03
this is a great tip, cleans things up nicely, now what to do with the custom adv_portal templates?

macooper
27 May 2005, 23:33
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

'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

'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
30 May 2005, 08:26
Regarding it not working with the adv_portal templates, Brian at vBadvanced said in this post (http://www.vbadvanced.com/forum/showthread.php?t=3757) 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
25 Feb 2009, 22:51
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
02 Apr 2009, 21:07
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):
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
09 Aug 2009, 00:24
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:

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

Just did this, and it works.