Add code in the beginning of a template
Hello all !
I know that to edit a template you use for example (i copie the one wrote in the mybb documentation) :

    "#" . preg_quote('<body>') . "#i",

But i don't know how to make my {$myVar} in the beginning of a template. For example in headerinclude template, i need to insert in the end/beginning, because this template is different for each theme and it's difficult to adapt my code.

Thank you Toungue
[Image: Prez.png]
Use a regex to match anything, with multiline option. Insert your code before/after the match.
Hi !
I used this :
But all the headerinclude is replaced by SOMESTUFF wrote multiple times
[Image: Prez.png]
(2015-07-02, 07:20 PM)Destroy666 Wrote: with multiline option.

You need the m flag so that the dot captures newlines too. and use $0 instead of $1 to get the whole captured string

Forum Jump:

Users browsing this thread: 1 Guest(s)