vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   [How-to] Add more tabs to the vB 3.7 profile pages (https://vborg.vbsupport.ru/showthread.php?t=165554)

rob30UK 03-26-2008 12:47 PM

I can get the tab to show custom profile fields, but i want the same fields to be removed from the about me section - how would this be achieved?

TWTCommish 03-27-2008 05:01 AM

This is quite helpful. Is there any way to add dynamic content to the tab, however? I've tried everything I can think of to achieve this, but the scope of the class won't allow for it. Is this method relegated to static content, or can this be done?

Blackhat 03-29-2008 01:35 PM

Im using this in my plugin, but the tab disappeared

Code:

        function prepare_output($id = '', $options = array())
        {
                $this->block_data['custom'] = $this->profile->userinfo['field17'] : "Stuff: $this->profile->userinfo['field17']" ? "Nothing to see here";
        }

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

ok I got it working with this code, but it looks like it wont custom html by my users like this

Code:

$blocklist = array_merge($blocklist, array(
    'customcode' => array(
        'class' => 'CustomCode',
        'title' => 'My Media',
        'hook_location' => 'profile_left_last'
    )
));

class vB_ProfileBlock_CustomCode extends vB_ProfileBlock
{
    var $template_name = 'memberinfo_block_customcode';

    function confirm_empty_wrap()
    {
        return false;
    }

    function confirm_display()
    {
        return ($this->block_data['customcode'] != '');
    }

    function prepare_output($id = '', $options = array())
    {
        $this->block_data['customcode'] = $this->profile->userinfo['field17'];
    }
}

I want my users to insert the embed code for their playlists generated at youtube

SEOvB 03-30-2008 09:02 PM

How would i add a custom template to be put inside the block?

Peterpan002 04-05-2008 04:55 PM

A very helpful article thank you, just not quite enough help for non coders like me.

I successfully created new tab and with the following code I now get output of "field 12" showing but not "field 11" instead of both showing, am also having difficulty inserting the field title in the output. A little help maybe.

Code:

$blocklist = array_merge($blocklist, array(
        'checklist' => array(
                'class' => 'checklist',
                'title' => 'Checklist (Work in Progress)',
                'hook_location' => 'profile_left_last'
        )
));

class vB_ProfileBlock_checklist extends vB_ProfileBlock
{
        var $template_name = 'memberinfo_block_checklist';

        function confirm_empty_wrap()
        {
                return false;
        }

        function confirm_display()
        {
                return ($this->block_data['checklist'] != '');
        }

        function prepare_output($id = '', $options = array())
    {
        $this->block_data['checklist'] = $this->profile->userinfo['field11'];


        $this->block_data['checklist'] = $this->profile->userinfo['field12'];
    }



}

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

I would really appreciate a little help with this as its so close to working fully - :o Bump

Makc666 04-09-2008 11:51 AM

Quote:

Originally Posted by Peterpan002 (Post 1483712)
I successfully created new tab and with the following code I now get output of "field 12" showing but not "field 11" instead of both showing, am also having difficulty inserting the field title in the output. A little help maybe.

I would really appreciate a little help with this as its so close to working fully - :o Bump

This one:
Code:

function prepare_output($id = '', $options = array())
    {
        $this->block_data['checklist'] = $this->profile->userinfo['field11'];


        $this->block_data['checklist'] = $this->profile->userinfo['field12'];
    }
}

To this one:
Code:

function prepare_output($id = '', $options = array())
    {
        $this->block_data['checklist'] = $this->profile->userinfo['field11'];
        $this->block_data['checklist'] .= $this->profile->userinfo['field12'];
    }
}

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

My question here...

In vBulletin 3.6.* I had such code in product:
Code:

<plugin active="1" executionorder=5" product="test">
<title>Test - member complete</title>
<hookname>member_complete</hookname>
<phpcode><![CDATA[if (THIS_SCRIPT == 'member')
{
        $test = "Hellow!";
        if ($vbulletin->options[test_auto])
                {
                        $footer = $test.$footer;
                }
}]]></phpcode>
</plugin>

Question: How to add $test to the new tab?

This one doesn't work:
Code:

        function prepare_output($id = '', $options = array())
        {
                $this->block_data['test'] = "$test";
        }


Peterpan002 04-09-2008 03:21 PM

Thank you Makc666.

Moving on LOL. New Tab is now outputting what I want.

Next issue and I'm sure others need to know this as well.

On the "About tab" is the option "simple link" - View your "About Me" as seen by everyone else. situated on the left which calls member.php?u=1&tab=aboutme&simple=1

I have reproduced this on my new tab which calls member.php?u=1&tab=newtab&simple=1

exept it doesnt it just reloads the main memberinfo page.

Any pointers???

Makc666 04-09-2008 07:26 PM

Quote:

Originally Posted by Peterpan002 (Post 1486776)
Next issue and I'm sure others need to know this as well.

On the "About tab" is the option "simple link" - View your "About Me" as seen by everyone else. situated on the left which calls member.php?u=1&tab=aboutme&simple=1

I have reproduced this on my new tab which calls member.php?u=1&tab=newtab&simple=1

exept it doesnt it just reloads the main memberinfo page.

Any pointers???

Show the code you are speaking about.
The code that you had added.

Peterpan002 04-09-2008 09:10 PM

My Custom template called for the tab

Code:

<div class="alt1 block_row" align="right">

<if condition="$show['simple_link']">
        <div id="simple_experience"><a class="smallfont" href="member.php?$session[sessionurl]u=$bbuserinfo[userid]&amp;tab=experience&amp;simple=1">$vbphrase[view_your_extra_options]</a></div>
</if>
<if condition="$show['edit_link']">
        <div id="simple_experience_link"><a class="smallfont" href="member.php?$session[sessionurl]u=$bbuserinfo[userid]&amp;tab="profile_left_last">$vbphrase[edit_extra_options]</a></div>
</if>



<div class="alt1 block_row" align="left">

<ul class="list_no_decoration">
        $block_data[experience]
       
                <!-------------------------Extra option profile fields-------->

<dt class="shade" id="profilefield_title_$profilefield[profilefieldid]">$profilefield[title]</dt>

<br>
<if condition="$userinfo[field11]">Field Title 11 $userinfo[field11]<br /></if>

<br>
<if condition="$userinfo[field12]">Field Title 12  $userinfo[field12]<br /></if>

<br>
<if condition="$userinfo[field14]">Field Title 14 $userinfo[field14]<br /></if>

<br>
<if condition="$userinfo[field13]">Field Title 13 <br> $userinfo[field13]<br /></if>

<br>

<if condition="$userinfo[field15]">Field Title 15 </if>
<if condition="$comma = ''"></if>

<if condition="$userinfo['field15'] & 1">
        $comma Option A
        <if condition="$comma = ', '"></if>
</if>
<if condition="$userinfo['field15'] & 2">
        $comma Option B
        <if condition="$comma = ', '"></if>
</if>
<if condition="$userinfo['field15'] & 4">
        $comma Option C
        <if condition="$comma = ', '"></if>
</if>
<if condition="$userinfo['field15'] & 8">
        $comma Option D
        <if condition="$comma = ', '"></if>
</if>
<if condition="$userinfo['field15'] & 16">
        $comma Option E
        <if condition="$comma = ', '"></if>
</if>

<br>
<br>
<if condition="$userinfo[field16]">My Yes/No answer is: $userinfo[field16]<br /></if>

<br>
<if condition="$userinfo[field17]">My Selection Menu Choice is: $userinfo[field17]<br /></if>

                       
                                               
</ul>
</div>
</div>

and the "Member_build_blocks_start plug in code to call template


Code:

$blocklist = array_merge($blocklist, array(
        'checklist' => array(
                'class' => 'experience',
                'title' => 'My Experience',
                'hook_location' => 'profile_left_last'
        )
));

class vB_ProfileBlock_experience extends vB_ProfileBlock
{
        var $template_name = 'memberinfo_block_experience';

        function confirm_empty_wrap()
        {
                return false;
        }

        function confirm_display()
        {
                return ($this->block_data['experience'] != '');
        }

        function prepare_output($id = '', $options = array())
        {
                $this->block_data['experience'] = 'My Experience:';


        }


}

:confused:

Makc666 04-10-2008 01:43 PM

Quote:

Originally Posted by Peterpan002 (Post 1486996)
My Custom template called for the tab

Sorry, but I was not able to display your template.
It always show we blank.
You can upload a ready test product for us to try if you want.


All times are GMT. The time now is 02:38 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.01620 seconds
  • Memory Usage 1,767KB
  • 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
  • (9)bbcode_code_printable
  • (3)bbcode_quote_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