vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Help with New Profile Tab (https://vborg.vbsupport.ru/showthread.php?t=228120)

Omegatron 11-16-2009 05:45 PM

Help with New Profile Tab
 
Hey guys a little question here. Porting over a 3.8 mod done in 3.8 style rewrote the template according to vb 4.0 style turned on the mod and was trying to work out getting it to display.

Now have not dove into the php side of code too much with templater calls etc but I notices the tab is already viewable even though I am working on the code. All the html and correct variables are printed out in the html source of the page even though as noted I have not done any registering of variables etc.

http://www.reeftalk.com/forums/members/1-Chuck-S

I hit gallery tab and its empty but as noted even though the template seems to be passed fine in the html source so any ideas how to make it viewable?

Lynne 11-16-2009 06:11 PM

You just need to create the tab - this is an example from my own plugin:
hook_location - member_complete:
Code:

if ($selected_tab == 'your_variable')
{
$template_hook['profile_tab_first'] .= '<dd class="selected"><a id="your_variable-tab" href="'.$vbulletin->input->fetch_relpath().'#your_variable-content" onclick="return tabViewPicker(this);">My Tab</a></dd>';
}
else
{
$template_hook['profile_tab_first'] .= '<dd><a id="your_variable-tab" href="'.$vbulletin->input->fetch_relpath().'#your_variable-content" onclick="return tabViewPicker(this);">My Tab</a></dd>';
}


Omegatron 11-16-2009 07:12 PM

Actually not any modding needed. It was a template error really. The default vb3 way of doing things works fine. I updated my template the real issue was I mistakenly surrounded my code with a div tag because I had actually viewed the source of the page to get the layout etc instead of looking at the other templates in admin. I removed the div tag that surrounded it and it displays fine.

http://www.reeftalk.com/forums/members/1-Chuck-S

Lynne 11-16-2009 09:15 PM

Ah, so they finally fixed that. Glad to hear it. I'll have to go change mine. (In the previous versions you had to manually add the tab like I wrote above.)

Omegatron 11-16-2009 10:26 PM

<a href="http://www.reeftalk.com/forums/members/1-Chuck-S" target="_blank">http://www.reeftalk.com/forums/members/1-Chuck-S</a>

well the tab shows and works if you click it and click another all works fine

However the problem I have to begin with is if you scan down the page you see the info being printed when the selected messages tab by default displays.

If I click a tab everything is fine. Does your code help this?

Lynne 11-16-2009 10:37 PM

I haven't tried this on beta 3 yet. It was working on beta 2, but if they have fixed the issue with the tab, I will try it on beta 3 one of these days. But yes, mine was working fine and showing when it should. You do have to do something to define when it is selected though, and I have no idea what you did to define that.

Omegatron 11-16-2009 10:47 PM

well I tried your line. Did you also have to define any templates because I did not have to.

Lynne 11-16-2009 11:44 PM

Define any templates where? I use templates for some of my output, yes, if that is what you are asking.

Omegatron 11-16-2009 11:47 PM

well the old way we just did this

Code:

class vB_ProfileBlock_ppProfile extends vB_ProfileBlock
{
        var $template_name = 'memberinfo_block_ppProfile';

Can you post an example of how you did yours I am thinking I need to rewrite this thing more than it is.

Lynne 11-16-2009 11:50 PM

And you still do that. I thought you meant do I use more templates besides that for my output there. My plugin gets a list of threads, so I use a template for those threads that I go through in a while loop. Then, I use that output in the $template_name template.


All times are GMT. The time now is 04:43 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.01041 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_code_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
  • (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