PDA

View Full Version : Help with New Profile Tab


Omegatron
16 Nov 2009, 18:45
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
16 Nov 2009, 19:11
You just need to create the tab - this is an example from my own plugin:
hook_location - member_complete:
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
16 Nov 2009, 20:12
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
16 Nov 2009, 22:15
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
16 Nov 2009, 23:26
http://www.reeftalk.com/forums/members/1-Chuck-S

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
16 Nov 2009, 23:37
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
16 Nov 2009, 23:47
well I tried your line. Did you also have to define any templates because I did not have to.

Lynne
17 Nov 2009, 00:44
Define any templates where? I use templates for some of my output, yes, if that is what you are asking.

Omegatron
17 Nov 2009, 00:47
well the old way we just did this


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
17 Nov 2009, 00:50
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.

Omegatron
17 Nov 2009, 01:01
The issue is this my block has this being inserted by vbulletin


<div id="view-ppProfile" class="block">



Thats surrounding my memberinfo_block_ppProfile template

It is suppose to be


<div id="view-ppProfile" class="view_section">



That way its hidden until click. Now once I click a tab everything is fine so this is something minor

Lynne
17 Nov 2009, 02:50
I just did a quick test on my beta 3 using the plugin I wrote and it works just fine. I go to my profile and the new tab is there. I click on the tab and I get the correct output and the tab is not highlighted when I first get there.

Omegatron
17 Nov 2009, 10:29
Yeah I found out you need to add this into the memberinfo template so unlike 3.8 you need to hook into two locations. profile left last for the button and profile left for the content box.

<div id="view-myVariable-content" class="<vb:if condition="$selected_tab == 'myVariable'">selected_view_section<vb:else />view_section</vb:if>">
{vb:raw blocks.myVariable}
</div>

Lynne
17 Nov 2009, 15:55
Actually, I tested mine on my beta 3 suite and I only needed one plugin. I no longer needed the one for the tab since it was added automatically now (it wasn't in alpha1 through beta 2).

But, if you've got it working now, great!

Omegatron
17 Nov 2009, 17:41
Yeah the tab was never an issue ;)

The issue was as posted in post 11 vb wraps it with a block thing but if its a tab it needs a specific wrap in profile left as posted. I still need to try and code up the call to load that block I posted in 13 automatically. I just hard coded that one part for now to make sure it fixed the issue of it displaying outside of the cell and it did. Basically it needs that special class as posted with selected_view_section or view_section not block which it was doing before.

--------------- Added 1258491127 at 1258491127 ---------------

Sometimes Lynne you just need to step back grab a coffee and relax. Issue was real simple. Just had to define wrap to false in the block setup and then in the template place the div tags I noted in post 13. LOL Since vb is for the most part tableless the div id class tags are very important I have found. Since wrap is by default set to true and I had omitted the surrounding div tag it surrounded it with one that is for the sideblock instead of the proper one I needed.

The fruits of my labor can be seen here

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

The random gallery photo and gallery tab stats ;)

ageurtse
29 Dec 2009, 18:11
Omegatron, could you tell me what exactly you did, i followed the manual posted here,
http://www.vbulletin.org/forum/showthread.php?t=165554&highlight=profile%2A

but when i get to the members profile page, on the default page my content is showing.

when i hit a tab button al is ok.

do i need to alter the members.php page? or whatever.

Omegatron
31 Dec 2009, 15:03
Can you post what you did? I might be able to give a few pointers.

I simply made a new profile table how its defined. Pretty much the way it was in 3.8 series except the template calls are a little different.

I cant really post what I did because it contains copyrighted code from another company I work for. ;) Unless you own the program the tab was written for you cant access the code.

ageurtse
31 Dec 2009, 17:00
See this link for what i did so far. http://www.vbulletin.org/forum/showthread.php?t=231539