PDA

View Full Version : [HOW TO - vB4] Adding a New Tab in Member Profile


Dylanblitz
14 Feb 2010, 19:54
If you are using anything above vB4.0.8 then refer to cellarius' updated article.
http://www.vbulletin.org/forum/showthread.php?p=2214470

I haven't seen a tutorial on doing this and I had to do it for a mod of mine, so I figured I would share. It is actually quite a bit easier to do in vb4 then it was before.

You will need 4 templates and 2 plugins. You could reduce it down to 2 templates but mine is used for distribution so I have to account for all versions.

First Template: This will create the tab next to About Me, Friends, etc

(my_data_tab)
<dd<vb:if condition="$selected_tab == 'test'"> class="selected"</vb:if>><a id="test-tab" href="{vb:raw relpath}#test" onclick="return tabViewPicker(this);">Test</a></dd>Where the text is red you can either leave it or replace it with your own reference. Just make sure it is the same throughout.

Second Template: The data you want to show.

(my_data_data)
<div id="view-test" class="<vb:if condition="$selected_tab == 'test'">selected_view_section<vb:else />view_section</vb:if>">
<div class="blockbody">
<div class="blockrow">
<ul class="friends_list floatcontainer">
{vb:raw new_user_data}
</ul>
</div>
</div>
</div>Same thing here, change the text in red to match the previous template.

Third Template: This will create the tab next to About Me, Friends, etc (4.0.8+)

(my_data_tab_408)
<style>
#test'-tab, #test'-tab a:hover {height:25px; display:inline; background-color:transparent; margin:0px; padding:0px; text-align:center; border:none;}
a:hover#test'-tab {background:transparent;}
</style>

<dd<vb:if condition="$selected_tab == 'test''"> class="userprof_module" <vb:else /> class="userprof_moduleinactive"</vb:if>><a id="test'-tab" href="{vb:raw relpath}?tab=test'#test'-content" onclick="return tabViewPicker(this);">Test</a></dd>Where the text is red you can either leave it or replace it with your own reference. Just make sure it is the same throughout.

Fourth Template: The data you want to show (4.0.8+).

(my_data_data_408)
<div id="view-test'-content" class="<vb:if condition="$selected_tab == 'test''">selected_view_section<vb:else />view_section</vb:if>">
<div class="blockbody">
<div class="blockrow">
<ul class="friends_list floatcontainer">
{vb:raw new_user_data}
</ul>
</div>
</div>
</div>Same thing here, change the text in red to match the previous template.



Now the first plugin
Hook Location: member_build_blocks_start
Title: Whatever you want to call it
Plugin Code


if ($vbulletin->versionnumber < "4.0.8")
{
$templater = vB_Template::create('my_data_tab');
} else {
$templater = vB_Template::create('my_data_tab_408');
}

$templater->register('selected_tab', $selected_tab);
$templater->register('relpath', $relpath);

if ($vbulletin->versionnumber < "4.0.2")
{
$template_hook['profile_left_last'] .= $templater->render();
} else {
$template_hook['profile_tabs_last'] .= $templater->render();
}


//Do your processing to get your data ready here.
$new_user_data = "Data for the new tab";


if ($vbulletin->versionnumber < "4.0.8")
{
$templater = vB_Template::create('my_data_data');
} else {
$templater = vB_Template::create('my_data_data_408');
}

$templater->register('selected_tab', $selected_tab);
$templater->register('new_user_data', $new_user_data);

if ($vbulletin->versionnumber < "4.0.2")
{
$template_hook['profile_left'] .= $templater->render();
} else {
$template_hook['profile_tabs'] .= $templater->render();
}
Second plugin
Hook Location: cache_templates
Title: Whatever you want to call it

if (THIS_SCRIPT == 'member')
{
if ($vbulletin->versionnumber < "4.0.8")
{
$cache[] = 'my_data_tab';
$cache[] = 'my_data_data';
} else {
$cache[] = 'my_data_tab_408';
$cache[] = 'my_data_data_408';
}
}
And the result
http://www.vbulletin.org/forum/attachment.php?attachmentid=112330&stc=1&d=1266180760

Sarcoth
15 Feb 2010, 21:02
Thank you. I do a lot of stuff with custom profiles and this code is nice to have.

/subscribed.

I'll now look into seeing how I can get certain profilefields to appear on the new tab.

ageurtse
18 Feb 2010, 18:24
is this article written for the latest vb 4.0.2 or is this for a different version ?

i now had my mod working on vb 4.0.1 and on vb 4.0.2 this mod is working but on every tab there is a link of the tab.

so if your solution works on 4.0.2 i have to rewrite my mod :(

i don't like it that vbulletin changes on every release the way things should be done.
so a mod can't be use on several version's

Dylanblitz
18 Feb 2010, 19:21
is this article written for the latest vb 4.0.2 or is this for a different version ?

i now had my mod working on vb 4.0.1 and on vb 4.0.2 this mod is working but on every tab there is a link of the tab.

so if your solution works on 4.0.2 i have to rewrite my mod :(

i don't like it that vbulletin changes on every release the way things should be done.
so a mod can't be use on several version's

I wrote it on 4.0.0 and had others test on 4.0.1. I haven't downloaded 4.0.2 yet.
I'm going to have to bite the bullet and install it on my production box. 4.0.0 only half works for me on my dev because the CMS wont allow me to use a port other then 80. 4.0.1 doesn't work at all on my dev. I'm sure 4.0.2 will be worse for me heh.

Dylanblitz
19 Feb 2010, 21:16
ageurtse,
They changed the template hook names. I found the new hooks to use and it works fine on my test system. I updated the code in the original post.
Let me know if you have problems with it. Wish they would at least keep the old ones for a while and let us know they're going to be gone.

as7apcool
24 Feb 2010, 22:45
thanks 4 great work !

derfelix
28 Feb 2010, 04:43
very nice.. you saved my day.. !!!
just one thing..
I thought the $show array does NOT need to be registered...
$templater->register('show', $show);
havent tested here yet.. but usually on other pages it does not...

F.

Dylanblitz
28 Feb 2010, 05:49
I wasn't sure, I haven't seen a list of what is auto registered, so I usually just register everything I need in the template.

derfelix
28 Feb 2010, 06:16
well as far as I know (assume) ....
(not sure read somewhere, but sorry, cant remember where)
magic globals dont need registering,
like $template_hook, $show, $vboptions, $stylevar, $vbphrase
not sure with $template_hook, but thats easy to test..
there might be others.. would be interesting if someone knew where to find a complete list!!

F.

PS: check class_core.php line: 3959 and following: public function render
$template_hook and $show are 'magic globals'

Dylanblitz
28 Feb 2010, 06:57
Yeah would be nice to have a list of everything. I removed the $show registration from the code, thanks for the input :)

losedude
15 Mar 2010, 00:07
How would one add tabs to a custom page instead of profile page?

Dylanblitz
15 Mar 2010, 01:14
I don't remember where I found it but there is a article or mod that shows how to add tabs to a custom page for 3.x that still works for 4.x
I just looked but I couldn't find it this time around, not sure where it's at.

Link14716
16 Mar 2010, 11:39
You forgot to mention that you should cache the templates used by making a plugin on the hook cache_templates containing:
if (THIS_SCRIPT == 'member') {
$cache[] = 'my_data_tab';
$cache[] = 'my_data_data';
}

Pretty good guide otherwise.

Dylanblitz
17 Mar 2010, 07:06
You forgot to mention that you should cache the templates used by making a plugin on the hook cache_templates containing:
if (THIS_SCRIPT == 'member') {
$cache[] = 'my_data_tab';
$cache[] = 'my_data_data';
}

Pretty good guide otherwise.

Thanks, I didn't think about the cache, I added it :)

Leonard
01 May 2010, 17:47
Hey....thanks for the tutorial. Very useful!

Just one question for anyone out there who may know if this is possible. I'm trying to link directly to a tab in the member.php. By default, it will always load up the first tab. I want it to load a specific tab. How would I do this? If it is possible?

Leonard

--------------- Added 1272737152 at 1272737152 ---------------

Worked it out...

You can move the hook to member_complete and manually set the $selected_tab variable to make it select your custom tab.

mokujin
01 May 2010, 18:11
Do you know how to load the tab as AJAX like facebook? :) THanks

identitas
24 May 2010, 20:47
manually set the $selected_tab variable to make it select your custom tab.

How do i do that?

Vaupell
13 Aug 2010, 20:17
tx, worked in first go..

jeejuh
09 Sep 2010, 01:36
How do i do that?


Change the first plugin to...

Hook Location: member_complete
Plugin Code - vb4.0.2
$selected_tab = "test";

$templater = vB_Template::create('my_data_tab');
$templater->register('selected_tab', $selected_tab);
$templater->register('relpath', $relpath);
$template_hook['profile_tabs_last'] .= $templater->render();


//Do your processing to get your data ready here.
$new_user_data = "Data for the new tab";


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

gurler
01 Nov 2010, 18:35
is it possible to move ALBUM widget to the tabs ?

Dylanblitz
04 Nov 2010, 09:59
is it possible to move ALBUM widget to the tabs ?

I don't see why not. You could find the album code and replicate how they do it with plugins.

I can't look at it right now though, trying to figure out what css changes they made in 4.0.8 that makes non default tabs look jacked up.

noppid
04 Nov 2010, 19:09
I don't see why not. You could find the album code and replicate how they do it with plugins.

I can't look at it right now though, trying to figure out what css changes they made in 4.0.8 that makes non default tabs look jacked up.

There's a tracker entry about it. http://tracker.vbulletin.com/browse/VBIV-9832

I'm hoping that they will implement the suggestions from DP if enough people vote. (I have no clue how that works.) Otherwise we have to bloat mods with an added template for css and a hook.

Dylanblitz
05 Nov 2010, 19:26
There's a tracker entry about it. http://tracker.vbulletin.com/browse/VBIV-9832

I'm hoping that they will implement the suggestions from DP if enough people vote. (I have no clue how that works.) Otherwise we have to bloat mods with an added template for css and a hook.

Yeah, hopefully they take the suggestion and implement it. I changed the code, it adds 2 templates if it's something you distribute. Otherwise you can do it still with 2 templates and 2 plugins.

Might not be the best way but it's how I got it to work heh.

Hall of Famer
12 Nov 2010, 08:01
looks really cool, oh btw do you know if its possible to add iframes tags in members new profile tabs so that it links to an external site of mine without directing users away from the forum? If so, can you please show me an example of how to do this?

Dylanblitz
12 Nov 2010, 18:43
looks really cool, oh btw do you know if its possible to add iframes tags in members new profile tabs so that it links to an external site of mine without directing users away from the forum? If so, can you please show me an example of how to do this?

Should be fairly easy. I would put this in your plugin code. Replace the red text with your link.

if ($vbulletin->versionnumber < "4.0.8")
{
$templater = vB_Template::create('my_data_tab');
} else {
$templater = vB_Template::create('my_data_tab_408');
}

$templater->register('selected_tab', $selected_tab);
$templater->register('relpath', $relpath);

if ($vbulletin->versionnumber < "4.0.2")
{
$template_hook['profile_left_last'] .= $templater->render();
} else {
$template_hook['profile_tabs_last'] .= $templater->render();
}

//Do your processing to get your data ready here.
$new_user_data = "<iframe src=\"http://www.yoursite.com/your_page.html\" width=\"550\" height=\"500\" frameborder=\"0\">\n";
$new_user_data .= "<a href=\"http://www.yoursite.com/your_page.html\" target=\"ResourceWindow\">Your browser doesn't support iframe content.\n";
$new_user_data .= "Click here to go directly to included content.</a>\n";
$new_user_data .= "</iframe>\n";

if ($vbulletin->versionnumber < "4.0.8")
{
$templater = vB_Template::create('my_data_data');
} else {
$templater = vB_Template::create('my_data_data_408');
}

$templater->register('selected_tab', $selected_tab);
$templater->register('new_user_data', $new_user_data);

if ($vbulletin->versionnumber < "4.0.2")
{
$template_hook['profile_left'] .= $templater->render();
} else {
$template_hook['profile_tabs'] .= $templater->render();
}

Hall of Famer
13 Nov 2010, 23:04
Thank you so much for this reply, I will give a try on my forum soon. ^^

FreshFroot
01 Dec 2010, 19:05
Anyone got this working for 3.8.x?

Lynne
01 Dec 2010, 19:46
Anyone got this working for 3.8.x?
There is an article in the vB3 forum for this for 3.8.x. It's by Calorie.

Hippy
04 Dec 2010, 02:25
There's a tracker entry about it. http://tracker.vbulletin.com/browse/VBIV-9832

I'm hoping that they will implement the suggestions from DP if enough people vote. (I have no clue how that works.) Otherwise we have to bloat mods with an added template for css and a hook.

thanks for the info ..

this has bothered me since vb4.0.8 came out ..

prevented me from upgrading ..
lol

I just couldn't do it

I may now tho after seeing that bug reported

thanks to all that help here at vb.org
your all much appreciated

hurricane_sh
31 Dec 2010, 14:02
Anyone tried this on VB 4.1.0? My tab was added successfully, but the content is blank. I can find the content in the browser source file, but it doesn't show in the tab.

Edit: never mind, I had a typo.

BirdOPrey5
10 Jan 2011, 01:33
The two 408 templates have an error in the code, there's an extra single quote (') after the word "test" in the conditionals. You'll get an error if you try to save the templates without fixing it. Once fixed it worked great on my 4.0.8.

Edit- Actually there's quite a few extra single quotes in 408 data tab as well breaking the style, it seems there's an extra single quote after each red test in the code. Once they are all removed it works well.

computer22
09 Apr 2011, 22:18
I have a problem with my profile tab, when loading it it's displaying it like in the picture about the red line. When I click the "button" then it turns right into the correct color and format (below red line)

http://images.glua.info/?di=113023873364

Does anyone know what could cause that?

cellarius
23 May 2011, 15:04
Yep, the profile tabs template has changed a little in previous versions.

I would advise not to create a specific template for your tab - template nr. 1 (my_data_tab) in the tutorial is actually unnecessary. I call the standard memberinfo_tab instead and prefill the necessary variables. Saves you one template. PHP for this looks like that:

if (isset($vbulletin->GPC['tab']))
{
$selected_tab = $vbulletin->GPC['tab'];
}
$blockinfo['title'] = "Test Title";
$blockid = "test";
$taburl = $memberurl = fetch_seo_url('member', $prepared) . "&amp;tab=test#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();

Also, the hook where the plugin needs to reside is member_complete, not member_build_blocks_start. Else the direct link to the tab by URL (member.php?123-testuser&tab=test#test) will not work properly.

Pandemikk
14 Jun 2011, 03:34
I can't get this to work. I used the above's PHP code for the plugin and the my_data_data_408 for the template.

The tab shows up fine but when I click it nothing is shown in the box.

cellarius
14 Jun 2011, 06:15
Have you seen my post directly over yours?

Pandemikk
14 Jun 2011, 07:20
Yes, I used your PHP code for the plugin and the my_data_data_408 for the template.

Pandemikk
15 Jun 2011, 16:32
Really need some help with this. It's driving me nuts that vB still hasn't a decent article on these member profile tabs.

Pandemikk
20 Jun 2011, 05:24
++++ you +++++++ then.

cellarius
20 Jun 2011, 07:54
I'm sure that this childish behaviour is going to get you LOTS of help.

Pandemikk
20 Jun 2011, 18:43
I already tried mature and exasperated behavior to no avail. Didn't have much hope for childish, but it did lift my spirits a bit which is always a plus.

Anyway, this thread is really outdated or just full of bad code. I've managed to clean it up a little but still can not get the tab to show via its AJAX call. Going to the tab via direct link shows up fine. It's weird. Has anybody got this working yet? I'd assume so.

cellarius
20 Jun 2011, 20:26
Yes, I have. I described what I did different to firstpost in this thread.

Pandemikk
22 Jun 2011, 05:09
And I followed that to no avail. Perhaps you left out some information?

Lynne
22 Jun 2011, 16:12
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
23 Jun 2011, 02:33
Sorry for that.


Hook Location: member_complete

// ###################### 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) . "&amp;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


<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
27 Jun 2011, 06:12
Boy oh boy. I really did miss that awesome vB.org support!

cellarius
27 Jun 2011, 07:01
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?

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.


130441

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
27 Jun 2011, 09:29
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
27 Jun 2011, 11:36
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.
Now, see, had you given that detailed information immediately your error would have jumped at me just like it did now.

May I ask where from the tutorial you got that suicidal if-statement from? The one you wrapped around your template rendering code, effectively forbidding vB to execute everything within, among it the code for rendering the template for your tab?

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

Get rid of that if statement, and your code will work. Tab changing works via javascript, by hiding and unhiding elements of the page. What you do is hindering vB to create that element at the very beginning, unless the tab is called in the URL (then, and only then your if condition can be true).

Lynne
27 Jun 2011, 14:43
Boy oh boy. I really did miss that awesome vB.org support!
Some of us have other things going on in our lives - we don't live here just waiting to help ungrateful users.

cellarius
27 Jun 2011, 17:12
Some of us have other things going on in our lives - we don't live here just waiting to help ungrateful users.
A shame I can't like your post again yet...

Pandemikk
27 Jun 2011, 21:49
Some of us have other things going on in our lives - we don't live here just waiting to help ungrateful users.

I'm sorry that you feel I would be ungrateful if and when a solution was provided to my issue. I would be actually very grateful.

Now, see, had you given that detailed information immediately your error would have jumped at me just like it did now.

May I ask where from the tutorial you got that suicidal if-statement from? The one you wrapped around your template rendering code, effectively forbidding vB to execute everything within, among it the code for rendering the template for your tab?

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

Get rid of that if statement, and your code will work. Tab changing works via javascript, by hiding and unhiding elements of the page. What you do is hindering vB to create that element at the very beginning, unless the tab is called in the URL (then, and only then your if condition can be true).

I added the if condition as it made sense for the rest of the code to only be processed if the selected tab equal to bbebs_stats. I did not know the .js behaved that way.

That being said, the provided solution you offered did not work. While an echo statement will now output text, the template will not show in the appropriate box. Furthermore, whenever the direct URL is accessed the template, while shown in the box correctly, it is also shown on the bottom of the other tabs' boxes.

I appreciate your help and will try to be less cumbersome to you and Lynne.

EDIT:

I can find the appropriate content in view source.

Lynne
27 Jun 2011, 22:39
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
27 Jun 2011, 23:37
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?

You misunderstood me. The echo statement is merely to test that the actual code is being processed. Before it would not, due to the if condition as pointed out. Now it does which means that the code is actually being processed. It's a sign that the solution is getting nearer.

My template data looks like this:


<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">
<p>Sample Text</p>
</div>
</div>

As of now, the above DOES show in the both direct link and default member profile source code. However, it does not show the HTML when the tab is clicked. Accessed via direct link, it shows up fine, but the code is also shown at the bottom of other tabs.

cellarius
28 Jun 2011, 04:52
Now, given that you maintained you followed the tutorial to the letter when you demanded help...

After that funky if statement my next question is: In your div container id
<div id="view-bbebs_stats-content"Where does the part in red come from? Again, in none of the examples I can find the id suffixed with -content at that place. Remove it. Again, how should JS manipulate your page content if the id it's looking for is not present? It is absolutely essential that you maintain the naming conventions!

You may take it as an well-meant advice to first implement tutorials exactly as they are given, then make changes step by step and test after every step. So you know what breaks things. Also a good way is to look how vB does it itself, in case of your problem looking at the MEMBERINFO template is very instructive.

BTW: If you don't want to break profile customization and maintain the css styles for an integrated look, your container should look like
<div id="view-bbebs_stats" class="<vb:if condition="$selected_tab == 'bbebs_stats'">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" id="about-me">Heading</h4>
This is just a test sentence, right where that "Irrelevant Code" comment was in the template. Voilá, showing perfectly.
</div>
</div>

Pandemikk
28 Jun 2011, 05:43
Now, given that you maintained you followed the tutorial to the letter when you demanded help...

After that funky if statement my next question is: In your div container id
<div id="view-bbebs_stats-content"Where does the part in red come from? Again, in none of the examples I can find the id suffixed with -content at that place. Remove it. Again, how should JS manipulate your page content if the id it's looking for is not present? It is absolutely essential that you maintain the naming conventions!

I got it from the first post (my_data_data_408). Hopefully OP is still around and can remove that bit so that others don't suffer from this problem.


You may take it as an well-meant advice to first implement tutorials exactly as they are given, then make changes step by step and test after every step. So you know what breaks things. Also a good way is to look how vB does it itself, in case of your problem looking at the MEMBERINFO template is very instructive.

I completely agree. This is something that is true when making any changes to coding.


BTW: If you don't want to break profile customization and maintain the css styles for an integrated look, your container should look like
<div id="view-bbebs_stats" class="<vb:if condition="$selected_tab == 'bbebs_stats'">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" id="about-me">
This is just a test sentence, right where that "Irrelevant Code" comment was in the template. Voilá, showing perfectly.
</div>
</div>

Will do. Although in case anyone else is reading this, that <h4> tag needs to be closed.


Thanks for your help, cellarius. Really upset that this problem turned out to be caused by something so trivial. Thanks Lynne.

cellarius
28 Jun 2011, 05:52
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
28 Jun 2011, 19:25
Good on you. An update is definitely needed.

cellarius
29 Jun 2011, 20:41
After Dylanblitz got back to me, I did a reloaded version of this tutorial. http://www.vbulletin.org/forum/showthread.php?t=265971