vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Memberinfo template extra data (https://vborg.vbsupport.ru/showthread.php?t=296437)

Christos Teriakis 03-23-2013 04:27 PM

Memberinfo template extra data
 
Hello,

I'm trying to add some extra data at the top of the "About Me" tab in memberinfo template. Unfortunatelly the only hook available is on Statistics section, which is not what I want.

So I'm trying to use str_replace but seems that something is not working well with my plugin code. eg I added in the template the text my_extra_info and I'm trying to replace that text with my_extra_info_updated. The code that I'm using is:

Code:

<plugin active="1" executionorder="60">
<title>More Aboutme</title>
<hookname>member_complete</hookname>
<phpcode><![CDATA[
global $vbulletin;
$vbulletin->templatecache['MEMBERINFO'] = str_replace('my_extra_info', 'my_extra_info_updated', $vbulletin->templatecache['MEMBERINFO']);
]]></phpcode>
</plugin>

I tried many other hooks like global_start, cache_templates etc etc but the text remain unchanged. Can you see any bug in my code?

Thank you
Chris

Lynne 03-23-2013 04:59 PM

I think you want to use the hook location parse_templates or process_templates_complete?

Christos Teriakis 03-23-2013 05:12 PM

Quote:

Originally Posted by Lynne (Post 2411789)
I think you want to use the hook location parse_templates or process_templates_complete?

Thank you for your effort to help me Lynne but unfortunatelly none of them is doing the trick. Actually I've already tried the 2nd option. I also cleared the cache before each test. Nothing changed.

Chris

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

Well, my code is ok but seems that is not (?) possible to replace text in tabs. I added the same text in many places on left sidebar and in all tabs (Activity, About me etc). The text in sidebar replaced fine which means that the php code, the template name, and the hook position (member_complete) are correct. Now is the magic question why does not works on tabs. I've activated the show template name in comments and I can't see any other major template name. I also tried to place the block template name instead of MEMBERINFO but again ...no luck.


All times are GMT. The time now is 09:12 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.01172 seconds
  • Memory Usage 1,719KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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