PDA

View Full Version : Trying to customize block_html output according to the current forumid


zlos
01-27-2011, 08:47 AM
First I set up a small plugin like that:

$niuchacz['foruminfo_forumid'] = $foruminfo['forumid'];
$niuchacz['foruminfo_vbulletin_GPC'] = $vbulletin->GPC['forumid'];
$niuchacz['thread'] = $thread['forumid'];


vB_Template::preRegister('block_html',array('niuch acz' => $niuchacz)); hooked at global bootstrap init complete (I'm not sure about that) and then call them from block_html template to see the forumid:

<div id="block_html_{vb:raw blockinfo.blockid}" class="blockbody restore">
{vb:raw content}
<br />foruminfo: {vb:raw niuchacz.foruminfo_forumid}
<br />GPC: {vb:raw niuchacz.foruminfo_vbulletin_GPC}
<br />thread: {vb:raw niuchacz.thread}

</div>
Results are, that $global->GPC['forumid'] works for forumdisplay, but not for showthread.php.
On the showthread level I see no forumid at all.

Any clue what I'm doing wrong?

--------------- Added 1296125847 at 1296125847 ---------------

Solved. Plugin hook should be process_templates_complete.
Although I am not sure if AFTER that process I can give some parameters to my own php file. I'll check this...