PDA

View Full Version : How to call this variable in VB4


Breakpoint
04-23-2010, 10:56 PM
I have a plugin that is calling the variable

$vbulletin->templatecache['threadadmin_editthread']

this is in postings.php

How do I call this in VB4 since it is not working and believe it is sitting somewhere else

Lynne
04-23-2010, 11:43 PM
It's the same call in vb4 (I use that call in a couple of my vB4 mods). What hook location are you using?

Breakpoint
04-24-2010, 03:44 PM
The hook is threadmanage_start

Here is the code, what I am trying to do is find all <h1> tags and replace them with nothing. But it is not working. You seem pretty smart, would you know what the main problem with my code is?


if ($_REQUEST['do'] == 'editthread' AND $threadinfo['open'] != 10) {
$page_templater['threadadmin_editthread'] = str_replace('<h1>','',$page_templater['threadadmin_editthread']);
}

Lynne
04-24-2010, 05:45 PM
Try using the parse_template hook location. I do not see $vbulletin->templatecache['threadadmin_editthread'] in there at all.

Breakpoint
04-24-2010, 09:32 PM
That other hook doesn't work with my code.

Is the reason why you dont see it in postings.php is because it is being called differently. I see it in this code


$actiontemplates = array(
'editthread' => array(
'threadadmin_editthread',
'threadadmin_logbit',
'optgroup',
'posticonbit',
'posticons'
),


and

$page_templater = vB_Template::create('threadadmin_editthread');


but I have no clue how to call this.


In VB3, the variable in posting.php was


$templatename = 'threadadmin_editthread';



-----

Would you have a better clue on instead, how to add a new input box into the Edit Thread portion of the forum?

The main thing I am looking to do is change the HTML of the template via a plugin