PDA

View Full Version : How do i edit user profile navigation tabs


DreadsUK
06-21-2014, 08:10 PM
https://vborg.vbsupport.ru/external/2014/06/33.png

At some point i've changed the default to become 'about me' But can;t for the life of me remember how i did it. I do so much, i can;t remember it all.

Just want to rearange the tabs, rename a couple and change the default to the Wall

oh, and want to delete the activity 'all and my friends' bit in the tabs

tbworld
06-22-2014, 03:24 AM
Did you use a modification or an article to add tabs? Perhaps this one?

https://vborg.vbsupport.ru/showthread.php?t=265971

I am asking to clarify how you added the tabs in the first place.

RichieBoy67
06-22-2014, 04:17 AM
To disable tabs go into admincp/general options drop down under userprofile options. You will see a list. I believe you can set your default there as well.

To change names you can use the phrasing system..

thetechgenius
06-22-2014, 05:49 AM
Like Richieboy said, you have to edit the Phrases for those profile tabs to rename them. Search the Tab Names in Phrases. Now if you want to reorder the tabs, well that's a different story, and I'm note sure about that. But I'm sure it will require a lot of edits in the correct Template.

DreadsUK
06-22-2014, 08:51 AM
Did you use a modification or an article to add tabs? Perhaps this one?

https://vborg.vbsupport.ru/showthread.php?t=265971

I am asking to clarify how you added the tabs in the first place.

That helped me find it but i dont thing this was it.

It was definitely through the plug in tho to set the default so i juat changed that. But to change the order of the tabs is unknown.

tbworld
06-22-2014, 08:55 AM
Currently looking into this for you. Sorry, was a bit back logged and needed to refill my drink. :)

Post or PM me your code for the tabs plugin. I just want to see the method you are using, I do not need to execute it.

DreadsUK
06-22-2014, 09:25 AM
Post or PM me your code for the tabs plugin.

thought i'd post it incase anyone else needed it

https://vborg.vbsupport.ru/external/2014/06/31.png

if (!$vbulletin->GPC_exists['tab'])
{
$vbulletin->GPC['tab'] = 'visitor_messaging';
}

i added visitor messaging as my default now. To add a different one, (for the courtesy of anyone reading) go to your profile page and right click on the tab you want to default.
Select 'copy link address' and paste it into a new browser address bar. The last word after the '#' on that address is what you want to copy and paste where the red lettering is in the above code.

--------------- Added 1403435476 at 1403435476 ---------------

Just found how to rearrange the standard tabs
go to templates and open MEMBERINFO. Right at the bottom of the code are the tab codes. you can just rearrange the order of the code.

Still need to work out how to put the custom tabs in the middle of the standard ones.

i now have this

https://vborg.vbsupport.ru/external/2014/06/32.png

Which looks much cleaner.

Want to get it to go My Wall, Blog, My Media, Friends, Quotes, Mentions, About Me

tbworld
06-22-2014, 11:44 AM
Thanks for sharing. It is what makes this place work and it is appreciated. :)

When I asked you to post the code, I did not clarify and I was referring to the php plugin code. (Sorry, my fault). I was going to add the following to your code so it would be a better example. :)

--------------------------------------------------------------------------------------
I will go ahead and post and we will join it up with your code later.

You most likely are rendering to:
$template_hook['profile_tabs_first'] .= $templater->render();
$template_hook['profile_tabs_last'] .= $templater->render();

Choice 1:
Since you already figured out you can just move the html code around, you could just move the hook around.

Choice 2:
Using the template hook system we can just add on to it. The "template hook array" is already registered to the template so we just need to add onto the array.


// Your existing code ...

$template_hook['profile_tabs_myhook'] .= $templater->render();

// Your existing code ...



Add to MEMBERINFO template
Add the new hook... The rest of the code is for reference

{vb:raw template_hook.profile_tabs_first}
<vb:if condition="$blocks[activitystream]">...
<vb:if condition="$blocks[visitor_messaging]">...

<!-- Add your own hook -->
{vb:raw template_hook.profile_tabs_myhook} <!-- Add This Line Only! -->
<!-- Add your own hook -->

<vb:if condition="$blocks[infractions]">...
<vb:if condition="$blocks[reputation]">...
{vb:raw template_hook.profile_tabs_last}


Use the same procedure to create multiple hooks if you need them.

ForceHSS
06-22-2014, 12:11 PM
I am sure someone could make a plugin that does this for you

DreadsUK
06-22-2014, 12:19 PM
Add to MEMBERINFO template[/B]
Add the new hook... The rest of the code is for reference

{vb:raw template_hook.profile_tabs_first}
<vb:if condition="$blocks[activitystream]">...
<vb:if condition="$blocks[visitor_messaging]">...

<!-- Add your own hook -->
{vb:raw template_hook.profile_tabs_myhook} <!-- Add This Line Only! -->
<!-- Add your own hook -->

<vb:if condition="$blocks[infractions]">...
<vb:if condition="$blocks[reputation]">...
{vb:raw template_hook.profile_tabs_last}


Use the same procedure to create multiple hooks if you need them.

Do i add this

// Your existing code ...

$template_hook['profile_tabs_myhook'] .= $templater->render();

// Your existing code ...
[B]

To the same plugin as this
if (!$vbulletin->GPC_exists['tab'])
{
$vbulletin->GPC['tab'] = 'visitor_messaging';
}

tbworld
06-22-2014, 12:29 PM
I thought you added your own "tabs". Now, that I look at your page, those tabs are coming from a modification correct? The code I was showing was applicable to your own php plugin code. If they are not your own "tabs" ignore my last post for now.

All of your mods will use similar hooks to plugin to "memberinfo.php" to render the "MEMBERINFO" template.
The hook will be "member_complete". If you go into your "ACP - Plugin Manager" you can sort on hooks (at the top of the table) and find all hooks that use "member complete".

Now one little trick that might work is modify the hook execution of this group of plugins in a descending order. Normally the hook execution is "5". Note, this will only work for plugins and not vbulletin "tabs" -- unless they are plugins, like blog or cms.

For example:
wall (execution order 6)
mentions (execution order 7)
and so on ...

You have to play around with it a bit. :)

DreadsUK
06-22-2014, 12:34 PM
Its working on my profile
http://www.dreadsuk.com/member.php?2-Elijah

but looks like other peoples profiles are screwed up

http://www.dreadsuk.com/member.php?2074-___aurora___
http://s13.postimg.org/z0x5y3iqv/Screen_shot_2014_06_22_at_14_31_40.png

--------------- Added 1403444168 at 1403444168 ---------------

I thought you added your own "tabs". Now that I look at your page, those tabs are coming from a modification correct?

yea, thats right

tbworld
06-22-2014, 12:55 PM
Clear the vbulletin cache and your browser cache, to be on the safe side.

--------------- Added 22 Jun 2014 at 07:03 ---------------

Your tabs worked on my end when I tried your links. By the way, I like the theme of your board, very unique.

webmastersun
06-22-2014, 02:38 PM
Search in forum templates or as tbworld suggested, all you need is edit html code and edit css :)

DreadsUK
06-22-2014, 03:21 PM
Ok, so in the plugin manager for the plugins i want to move, i found the line

$template_hook['profile_tabs_last'] .= $templater->render();

which i changed to
$template_hook['profile_tabs_first'] .= $templater->render();

This moves the tab to either first or last. Are they the only options or can we specify something like 'position_2' or 'tab2' something like that. do you knwo what the command would be?

tbworld
06-22-2014, 03:32 PM
Post #8, I poorly explained how to add additional template hooks. You can then modify the plugin code that uses PHP hook "member_complete" to use your new custom template hook.

I know I did a great job of making this sound difficult. I will try to rewrite this after I get some sleep on the plane.

You are on the right track, almost there :)

DreadsUK
06-22-2014, 03:39 PM
Post #8, I poorly explained how to add additional template hooks. You can then modify the plugin code that uses PHP hook "member_complete" to use your new custom template hook.

I know I did a great job of making this sound difficult. I will try to rewrite this after I get some sleep on the plane.

You are on the right track, almost there :)

thanks mate, playing around in the mean time ;)