vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to add a block on member's profile? (https://vborg.vbsupport.ru/showthread.php?t=255497)

Lautaro 12-18-2010 09:33 PM

How to add a block on member's profile?
 
Hello,

I need to add a new block on member's profiles, which template should I edit if I want my block to be above the friends block?

thanks !

Lynne 12-18-2010 10:32 PM

To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)

I think it's the MEMBERINFO template, but try the tip above and you should see.

Lautaro 12-19-2010 12:41 AM

yes, it's the MEMBERINFO template, and inside that there's this:

PHP Code:

          <vb:comment>sidebar</vb:comment>
          {
vb:raw template_hook.profile_sidebar_first}
          {
vb:raw blocks.stats_mini}
          {
vb:raw template_hook.profile_sidebar_stats}
          {
vb:raw blocks.friends_mini}
          {
vb:raw template_hook.profile_sidebar_friends}
          {
vb:raw blocks.albums}
          {
vb:raw template_hook.profile_sidebar_albums}
          {
vb:raw blocks.groups}
          {
vb:raw template_hook.profile_sidebar_groups}
          {
vb:raw blocks.visitors}
          {
vb:raw template_hook.profile_sidebar_last}
          <
vb:comment>sidebar</vb:comment

How can I add another block there?

I remember when I used vB3.8.x I simply had to create a new template, I named it template_block_name and include in that list and done, but now It's different, it wont work if I do that.

btw thanks for your help.

Lynne 12-19-2010 02:37 AM

Use one of the template_hooks - that is what they are there for. You write a plugin, render your sidebar template and then assign the results to the $template_hook.

Lautaro 12-19-2010 05:48 PM

That's exactly what I don't know how to do, would you mind explaining to me how to do this?

thanks !

Lynne 12-19-2010 05:57 PM

You need to render your template first and then assign it to the template_hook. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide

Example from his tutorial:
PHP Code:

All your code up here, and then....
/* render template and register variables */
$templater vB_Template::create('mytemplate');
    
$templater->register('my_var'$my_var);
    
$templater->register('my_array'$my_array);
$template_hook['profile_sidebar_stats'] .= $templater->render(); 



All times are GMT. The time now is 11:20 PM.

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.01775 seconds
  • Memory Usage 1,731KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete