vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Cannot get content of template properly from plugin (https://vborg.vbsupport.ru/showthread.php?t=258837)

SiteTalkZone 02-14-2011 05:09 AM

Cannot get content of template properly from plugin
 
I use vB4.1

I'd like replace current block friend in MEMBERINFO template by another block with some changing about addition content.

I found the sidebar in MEMBERINFO template, like that:
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>

I write a new plugin by following code (hook location is member_build_blocks_start):
Code:

        $templater = vB_Template::create('memberinfo_block_friends_mini');
        $friends_mini = $templater->render();

        $miblock['block_template'] = $friends_mini;
       
        $templater = vB_Template::create('profile_sidebar_friends');
        $friends_hook = $templater->render();

        $miblock['template_hook'] = $friends_hook;

        vB_Template::preRegister('MEMBERINFO', array('newBlockFriends' => $miblock);

And then I replace above sidebar section with new code here:

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 newBlockFriends.block_template}
        {vb:raw newBlockFriends.template_hook}


        {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>

But when I display my profile page, it only display Friend block with content is "has not made any friends yet" although I had made some friend before. It cannot display list of my friend in Friend block in sidebar of profile page.

Help me with this situation. It's urgent please.

Thanks!

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

It's fixed!
All above things are correct.


All times are GMT. The time now is 06:49 AM.

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.00975 seconds
  • Memory Usage 1,715KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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