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)

ragtek 01-20-2008 08:53 PM

with:
PHP Code:

        'hook_location' => 'profile_left_first' 

possible locations:
PHP Code:

    ''                    => $vbphrase['only_in_about_me_tab'],
    
'profile_left_first'  => $vbphrase['main_column_first_tab'],
    
'profile_left_last'   => $vbphrase['main_column_last_tab'],
    
'profile_right_first' => $vbphrase['blocks_column_first'],
    
'profile_right_mini'  => $vbphrase['blocks_column_after_mini_stats'],
    
'profile_right_album' => $vbphrase['blocks_column_after_albums'],
    
'profile_right_last'  => $vbphrase['blocks_column_last']
); 


eNforce 01-26-2008 06:51 PM

For the contents of the tab how can I pull a custom profile field?

Code:

$blocklist = array_merge($blocklist, array(
        'custom' => array(
                'class' => 'custom',
                'title' => 'Custom Tab (Work in Progress)',
                'hook_location' => 'profile_left_last'
        )
));

class vB_ProfileBlock_custom extends vB_ProfileBlock
{
        var $template_name = 'memberinfo_block_custom';

        function confirm_empty_wrap()
        {
                return false;
        }

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

        function prepare_output($id = '', $options = array())
        {
                $this->block_data['custom'] = '<if condition="$userinfo[field8]"><strong>Stuff:</strong> $userinfo[field8]<br /></if> ';
        }
}

It just outputs as "$userinfo[field8]" instead of what was typed in via User CP.

marcossalazar 02-11-2008 08:57 PM

Thanks for the article!

Wayne Luke 02-23-2008 03:16 PM

Quote:

Originally Posted by eNforce (Post 1429515)
For the contents of the tab how can I pull a custom profile field?

Do something like this for your prepare_output function
Code:

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


Neutral Singh 02-25-2008 02:09 PM

How can we create similar tab like "About Me" contents of which are user editable on the page itself. This facility should have inbuilt into vbulletin as a default.

Princeton 02-28-2008 12:48 PM

just noticed this tut - outstanding!

msimplay 03-09-2008 11:42 PM

Was wondering how would i get this peice of code into a block

PHP Code:

// Champion games in profile
    
$profilegq $db->query_read("SELECT u.userid AS userid, g.gameid AS gameid, g.title AS title, g.miniimage AS image FROM " TABLE_PREFIX "arcade_games AS g LEFT JOIN " TABLE_PREFIX "user AS u ON u.userid = g.highscorerid WHERE u.userid = $userinfo[userid] ORDER BY g.title ASC");
    while (
$profileg $db->fetch_array($profilegq)){
    
$pgrow .= "<a href=\"arcade.php?do=play&gameid=$profileg[gameid]\"><img src=\"./images/arcade/$profileg[image]\" alt=\"\" title=\"Play $profileg[title]!\" border=\"0\" /></a> &nbsp;&nbsp;";
}

$acount $db->num_rows($profilegq); 


Inferno Dragon 03-11-2008 01:08 PM

Very nice tutorial indeed..thanks a lot :) but as MSimplay said above, I am also interested in adding some custom DB queries for displaying items from the DB :) is it possible?

Guest210212002 03-18-2008 09:25 PM

Quote:

Originally Posted by Wayne Luke (Post 1449384)
Do something like this for your prepare_output function
Code:

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


This doesn't work for me - the tab disappears.

Jase2 03-22-2008 09:19 PM

A great tutorial! Thanks!

One question, to get this to show you have to click the small arrow at the end; is there any way to get it too show all tabs by default, without having to click the arrow? This only happens when the 'Infraction' tab is showing too...any way to get them all show?

Regards Jason :)


All times are GMT. The time now is 02:27 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.01143 seconds
  • Memory Usage 1,751KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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