MyBB Codes

Full Version: [Help] Create a plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi I want to create a plugin

I want to add a code to postbit template by activing that plugin!
How can I add a code to a template by PHP in a plugin? Coffee
The standard way to accomplish this, for the "postbit" template, is to use this code :

PHP Code:[Highlight]
require MYBB_ROOT.'/inc/adminfunctions_templates.php';
    
find_replace_templatesets(
"postbit",
'#'.preg_quote('{$WhateverVariableYouWantToChange}').'#',
'{$WhateverVariableYouWantToChange} Whatever You Want To Add After The Variable Here'
    
); 

I hope this will help you, but normaly we are taking request for our own plugins! Wink
Really thanks and if I want to add a code to Header I have to change
find_replace_templatesets(
"postbit",

to
find_replace_templatesets(
"header",
?
And another question I want to add {$asdpm} Variable after {$ignore_bit} in postbit would you please show me the way of it whith the code yo have gotten to me?
(01-21-2010 11:19 AM)exdiogene Wrote: [ -> ]I hope this will help you, but normaly we are taking request for our own plugins! Wink

You should read the message above, because you are still asking help for your own plugins isn't it?
I have understood but when I add HtML codes instead of "Whatever You Want To Add After The Variable Here" It gets's This error
Parse error: parse error in d:\program files\easyphp1-8\www\inc\plugins\topicstats.php on line 31
Then this mean you made a syntax error in your code so it won't parse...
is there tut on how to make plugings
Reference URL's