vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Adding a New Tab in Member Profile (https://vborg.vbsupport.ru/showthread.php?t=235860)

cellarius 06-20-2011 07:26 PM

Yes, I have. I described what I did different to firstpost in this thread.

Pandemikk 06-22-2011 04:09 AM

And I followed that to no avail. Perhaps you left out some information?

Lynne 06-22-2011 03:12 PM

Quote:

Originally Posted by Pandemikk (Post 2211178)
And I followed that to no avail. Perhaps you left out some information?

It is very hard to troubleshoot something when you have not posted a single line of code that you are using. If you want help, post your *exact* code (in code tags), with the hook location, and any other needed information.

Pandemikk 06-23-2011 01:33 AM

Sorry for that.


Hook Location: member_complete

PHP Code:

// ###################### TAB DATA ######################
if (isset($vbulletin->GPC['tab']))
{
    
$selected_tab $vbulletin->GPC['tab'];
}
$blockinfo['title'] = 'Battle Statistics';
$blockid 'bbebs_stats';
$taburl $memberurl fetch_seo_url('member'$prepared) . "&tab=bbebs_stats#bbebs_stats";

$templater vB_Template::create('memberinfo_tab');
    
$templater->register('selected_tab'$selected_tab);
    
$templater->register('relpath'$relpath);
    
$templater->register('blockinfo'$blockinfo);
    
$templater->register('blockid'$blockid);
    
$templater->register('taburl'$taburl);
$template_hook['profile_tabs_last'] .= $templater->render();

// ###################### MAIN SCRIPT ######################
if ($selected_tab == 'bbebs_stats')
{
    
// Irrelevant code goes here

    
$templater vB_Template::create('bbebs_memberinfo_data');
        
$templater->register('selected_tab'$selected_tab);
        
$templater->register('prepared'$prepared);
        
$templater->register('user'$user);
        
$templater->register('stats_bits'$stats_bits);
    
$template_hook['profile_tabs'] .= $templater->render();
}
?> 

It's not exactly like cellarius's, of course. Because his example fails to include any PHP code to render the actual data. The tabs worked perfectly with his code, though.

Template: bbebs_memberinfo_data

HTML Code:

<div id="view-bbebs_stats-content" class="<vb:if condition="$selected_tab == 'bbebs_stats'">selected_view_section<vb:else />view_section</vb:if>">
        <div class="blockbody">
                <!-- Irrelevant Code -->
        </div>
</div>


Pandemikk 06-27-2011 05:12 AM

Boy oh boy. I really did miss that awesome vB.org support!

cellarius 06-27-2011 06:01 AM

1 Attachment(s)
Boy oh boy. I really do miss the times when people were asking clear questions and giving relevant information and not whining and complaining all the time! Honestly, what's the matter with you?

What exactly is the problem you're having? Can you put it in one or more sentences so a person not deterred by your attitude could understand what exactly does not work for you?
Quote:

Originally Posted by Pandemikk (Post 2207425)
The tab shows up fine but when I click it nothing is shown in the box.

In what box? What do you expect to be shown?

The code you posted works perfectly fine in vB4.1.4. It creates the tab, as it should, and the tab is accessible from within the profile and it can be directly accessed by url. See screenshot - the URL entered takes me directly to the tab.



Whatever you want to show in the tab is not covered in this tutorial, and you snipped every code out that would be relevant for showing anything in whatever box as "Irrelevant".

Pandemikk 06-27-2011 08:29 AM

The irrelevant code can be anything. An echo construct. Anything. It does not show. I'm sorry that you feel that my information is not clear enough, but I am not sure how much more clear I can be.

The box that the tab shows when clicked does not display anything unless accessed directly via the link. Clicking on the tab does not show anything.

cellarius 06-27-2011 10:36 AM


Lynne 06-27-2011 01:43 PM


cellarius 06-27-2011 04:12 PM


Pandemikk 06-27-2011 08:49 PM


Lynne 06-27-2011 09:39 PM

I do not understand your comments about an echo statement. An echo will not put the text where you want it - it will put it wherever it feels like it (if at all). You need to assign the text that you want output to the $template_hook['profile_tabs'].

What does your template "bbebs_memberinfo_data" look like?

Pandemikk 06-27-2011 10:37 PM


cellarius 06-28-2011 03:52 AM


Pandemikk 06-28-2011 04:43 AM


cellarius 06-28-2011 04:52 AM

I've already written to the author of this tutorial, but received no answer so far. If he is no longer around or does not want to actualize the firstpost with the information already presented in this thread, I will post a new version myself.

Pandemikk 06-28-2011 06:25 PM

Good on you. An update is definitely needed.

cellarius 06-29-2011 07:41 PM



All times are GMT. The time now is 11:24 AM.

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.01186 seconds
  • Memory Usage 1,762KB
  • 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_html_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete