PDA

View Full Version : Memberinfo template extra data


Christos Teriakis
03-23-2013, 04:27 PM
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:


<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
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 1364062549 at 1364062549 ---------------

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.