Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2014, 03:49 PM
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Location: Thessaloniki, Greece
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Member.php default tab

Hello,

Using the hook profile_tabs_first I've created a page tab with some extra user info. So far so good. As expected, it appears as first tab.

The problem is that all core links to member.php redirect to "My Activity" tab. I thought that by placing my custom tab first the links will open the 1st tab. But not.

Anyone knows how to set as default tab my custom tab? Manually changing the links to:
member.php?u={vb:raw userid}&tab=mycustomtab#mycustomtab
works fine, but it's almost impossible to change all core links.

Thank you
Reply With Quote
  #2  
Old 10-08-2014, 04:13 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Maybe you need to make your tab the default tab. In the navigation table there's a state field, and one of the bits says the tab is the default. Look in admin/navigation.php, where it does if ($_REQUEST['do'] == 'dodefault'), and maybe also in includes/functions_navigation.php.
Reply With Quote
  #3  
Old 10-08-2014, 04:26 PM
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Location: Thessaloniki, Greece
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Maybe you need to make your tab the default tab.
First of all thank you for your prompt attention. Really appreciated. I gave a look at navigation.php but I got a feeling that this file is for the site's navigation tabs, while I'm talking for the user's profile tabs.
Reply With Quote
  #4  
Old 10-08-2014, 04:28 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oops, you're right, sorry. I saw "Activity" and thought you meant the navigation tab.
Reply With Quote
  #5  
Old 10-08-2014, 04:29 PM
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Location: Thessaloniki, Greece
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

See the attached screenshot to understand for which tabs I'm talking about.
Attached Images
File Type: jpg profile_tabs.jpg (35.8 KB, 0 views)
Reply With Quote
  #6  
Old 10-08-2014, 04:36 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, in member.php there's this code:
Code:
if ($vbulletin->GPC['vmid'] AND !$vbulletin->GPC['tab'])
{
	$vbulletin->GPC['tab'] = 'visitor_messaging';
}
So maybe if you set $vbulletin->GPC['tab'] to your tab at hook member_execute_start. Like:
Code:
if (!$vbulletin->GPC['tab'])
{
	$vbulletin->GPC['tab'] = 'my_tab';
}

Edit: ...or maybe you also need to check $vbulletin->GPC['vmid'] like the code above. I don't know what that is.
Reply With Quote
  #7  
Old 10-08-2014, 04:53 PM
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Location: Thessaloniki, Greece
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll check your suggestion and I'll come back. Meanwhile I was checking the template MEMBERINFO and I found something that can helps, but still haven't tested it.
Code:
{vb:raw template_hook.profile_tabs_first}
<vb:if condition="$blocks[activitystream]"><dd<vb:if condition="$selected_tab == 'activitystream' OR $selected_tab == ''"> class="userprof_module" <vb:else /> class="userprof_moduleinactive" </vb:if>><a id="activitystream-tab" href="{vb:link member, {vb:raw userinfo}, "tab=activitystream"}#activitystream" onclick="return tabViewPicker(this);">{vb:raw activity_phrase}</a></dd></vb:if>
That OR $selected_tab == ''" I think that it makes the tab "My Activity" to be default. Tried to remove it but I got parsing error when during saving. I'll give one more try.

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

Unfortunatelly your solution does not works, so I need to try with the template. That:
Code:
$vbulletin->GPC['vmid']
means (most probably) "Visitor Message Id"
Reply With Quote
  #8  
Old 10-08-2014, 05:08 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NickTheGreek View Post
Unfortunatelly your solution does not works, so I need to try with the template. That:
Code:
$vbulletin->GPC['vmid']
means (most probably) "Visitor Message Id"
That makes sense. So what that code does is go to the visitor message tab if the url has a vmid. So you wouldn't want to check for a vmid, but it seems like you should be able to set $vbulletin->GPC['tab'] to a default.
Reply With Quote
  #9  
Old 10-08-2014, 05:40 PM
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Location: Thessaloniki, Greece
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
but it seems like you should be able to set $vbulletin->GPC['tab'] to a default.
I don't know if I must laught or cry.

To laught because from no solution we've in hands 2 solutions. Yours is better as PHP modification is easier than template. But the template also works.

To cry because even if my tab becomes default, it does not shows data. Just a blank tab. The funny is that if I click another tab and then come back to my tab it shows the data.
Reply With Quote
  #10  
Old 10-12-2014, 06:05 AM
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Location: Thessaloniki, Greece
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone??
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 04:19 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09627 seconds
  • Memory Usage 2,281KB
  • Queries Executed 14 (?)
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
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete