PDA

View Full Version : [Solved] Add Code On Beginning Template newpost_attachment


omardealo
05-05-2013, 01:48 PM
Hello ,

I try to add code on Beginning Template newpost_attachment by this

Hook : global_start
$code = "SOME HTML CODE";
$vbulletin->templatecache['newpost_attachment'] = $code.$templatecache['newpost_attachment'];

But , not worked well ... it Replacing all template
i want add code only on Beginning this template

thnx ...

Lynne
05-05-2013, 02:17 PM
On the left side, you use:
$vbulletin->templatecache['newpost_attachment']

On the right side, you use:
$templatecache['newpost_attachment']

I would guess the left side is correct and you need to use it in both places.

omardealo
05-05-2013, 02:38 PM
On the left side, you use:
$vbulletin->templatecache['newpost_attachment']

On the right side, you use:
$templatecache['newpost_attachment']

I would guess the left side is correct and you need to use it in both places.

okay , u mean

$vbulletin->templatecache['newpost_attachment'] = $code.$templatecache['newpost_attachment'];

but not worked too , it's same problem
Variable $code Shows but the template does not exist

THNX !

Lynne
05-05-2013, 03:57 PM
Try the parse_templates hook.

omardealo
05-05-2013, 04:26 PM
Try the parse_templates hook.

Already i try it and global_start too ... it's same
thnx .

Lynne
05-05-2013, 05:41 PM
What page are you doing this on (the exact php page url)?

omardealo
05-05-2013, 05:51 PM
What page are you doing this on (the exact php page url)?

on newreply.php
i want add code above attachment , it already add but attachment template not exist

--------------- Added 1367858696 at 1367858696 ---------------

Any one have solutions ?

omardealo
05-06-2013, 07:45 PM
i solved it by another way

$code = "SOME HTML CODE";
$find = '<fieldset class="blockrow" id="attachfiles">';
$vbulletin->templatecache['newpost_attachment'] = str_replace($find, $code.$find , $vbulletin->templatecache['newpost_attachment']);