Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
[vB4] Add new Tab at User's Profile and make it preselected
TheAdminMarket
Join Date: Jun 2013
Posts: 511

Thessaloniki, Greece
by TheAdminMarket TheAdminMarket is offline 19 Oct 2014
Rating: (1 vote - 5.00 average)

Hello,

Important: This Article will shows you the way to create your own tab in user's Profile page, set it as first or last, and if you want, make it preselected. If you already have the tabs (custom or vB default) and the only that you want is to change the default Activity tab to another tab, then Ozzy47 has released a nice and easy addon. You can find it here.

If you want to build your own tab the steps that you must follow are listing below. for easy convertion we assume that your tab name is: mytabname

1.- Create a New Plugin:

a] Name: My Profile Tab
b] Hook Location: member_complete
c] Plugin PHP code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Comments:

1.- You can use a Global phrase for $blockinfo['title']. For example:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

2.- You can choose the position of your tab. In my code above the tab will appears first of all. If you want it at the end, use as template hook: profile_tabs_last

The code above draws only the tab. Nothing more. To add content we must extend the php code and also use a template for it. Let's continue with the PHP code. Should be on the same code block above. No different plugin !!


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Now click Save and you finished with the first step. Let's continue:

2.- Create your template.

There are many articles teaching how to create a template. Here I'll show you only the data that this template must has. Don't forget to use the same template name. In our example is: my_profile_tab_template


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

3.- Cache the template

You must create a new Plugin for caching the template. Use the example data below:

a] Name: My Tab Template Cache
b] Hook Location: cache_templates
c] PHP code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

4.- Make Tab preselected (Optional)

If you want to make your tab preselected which means that from any link that someone will clicks to see user's profile, your tab should be the first in view (default is the Activity tab), add one more plugin:

a] Name: My Tab Preselected
b] Hook Location: member_build_blocks_start
c] PHP code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Views: 3198
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

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


New To Site? Need Help?

All times are GMT. The time now is 18:36.

Layout Options | Width: Wide Color: