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 - Reloaded (https://vborg.vbsupport.ru/showthread.php?t=265971)

rgf207 04-09-2012 12:12 AM

Any ideas why this only works if "test" is used in the $taburl variable? If I change the #test to #quoted ($blockid var) nothing shows up.

PHP Code:

if (isset($vbulletin->GPC['tab']))
{
    
$selected_tab $vbulletin->GPC['tab'];
}

$blockinfo['title'] = $vbphrase['who_quoted'];
$blockid "quoted";
$taburl $memberurl fetch_seo_url('member'$prepared) . "&tab=quoted#test";

$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();  

// ### Your code to fill the tab ###
// Don't forget you need to register any variables for use in templates 

$quoted_tab_content "Congratulations, you can see me, I'm your PHP Code!";

$templater vB_Template::create('memberinfo_block_WhoQuoted');
$templater->register('selected_tab'$selected_tab);
$templater->register('quoted_tab_content'$quoted_tab_content);
$template_hook['profile_tabs'] .= $templater->render(); 

Template
HTML Code:

<div id="view-quoted" class="<vb:if condition="$selected_tab == 'quoted'">selected_view_section<vb:else />view_section</vb:if><vb:if condition="$userinfo['userid'] != $bbuserinfo['userid']"> vm_other_prof</vb:if>">
    <div class="blocksubhead subsectionhead userprof_headers userprof_headers_border">   
        <h4 class="subsectionhead-understate">Test</h4>
    </div>
    <br />This is a <b>custom tab</b> test.<br />
    {vb:raw quoted_tab_content}
</div>


DannyV 04-25-2012 08:15 PM

What should I do to have to extra tab only be shown to certain usergroups ?

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

nevermind. figured it out:
if (is_member_of($vbulletin->userinfo,x,y,z)) {
}

in the plugin
where x,y,z are the group Id's

Dave234 05-22-2012 02:08 PM

Alright, so I've got the "Gallery" tab added. Now how would I add the content? How can I add photos?

Also I notice that none of my blog entries are showing up under my "Blog" tab in my user profile. I am logged in and everything.

cellarius 05-22-2012 02:25 PM

You have the tab working - this is all this article is about.

It is not about querying whatever it is you want to show on that tab. It sure is not about general support issues (your blog tab not working). Please ask for help in your own thread in the proper forums.

Dave234 05-22-2012 04:51 PM

But the "Congratulations, you can see me, I'm your PHP Code!" is not appearing under the new tab I added.

Can you please help me to determine why? I had deleted some of the code in the memberinfo_block_statistics template and cleared out the code in the memberinfo_block_contactinfo template, because I did not like all of that ("Number of Posts per Day: 0.25" etc) content in my User Profile.

cellarius 05-23-2012 01:12 PM

If you follow the tutorial by the letter, it will be there. I cannot know what you did wrong.

Dave234 05-24-2012 03:38 PM

I copied and pasted the code you showed in my AdminCP, where you told me to.

Was that what I was supposed to do?

cellarius 05-24-2012 05:33 PM

Article updated. Obviously the template name convention was changed somewhere along the line.

The template needs to be named memberinfo_block_test now (remember to adapt the create_template call in the plugin accordingly.

Dave234 05-24-2012 11:32 PM

I did it exactly as you have it, but it does the same thing......I'm wondering if it is because I had deleted some of the code in the memberinfo_block_statistics template and cleared out the code in the memberinfo_block_contactinfo template, because I did not like all of that ("Number of Posts per Day: 0.25" etc) content in my User Profile? Could that affect it at all?

cellarius 05-25-2012 05:45 AM

You could always try and revert those templates.


All times are GMT. The time now is 04:00 PM.

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.01350 seconds
  • Memory Usage 1,744KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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