MyBB Codes
[Help] Create a plugin - Printable Version

+- MyBB Codes (http://www.mybbcodes.com)
+-- Forum: Mods Database (/forumdisplay.php?fid=4)
+--- Forum: Requests (/forumdisplay.php?fid=16)
+--- Thread: [Help] Create a plugin (/showthread.php?tid=724)


[Help] Create a plugin - Kevin - 01-21-2010 04:44 AM

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


RE: [Help] Create a plugin - exdiogene - 01-21-2010 11:19 AM

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


RE: [Help] Create a plugin - Kevin - 01-21-2010 03:36 PM

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?


RE: [Help] Create a plugin - Nadjia - 01-21-2010 04:10 PM

(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?


RE: [Help] Create a plugin - Kevin - 01-22-2010 04:54 AM

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


RE: [Help] Create a plugin - exdiogene - 01-23-2010 03:21 PM

Then this mean you made a syntax error in your code so it won't parse...


RE: [Help] Create a plugin - LuminousX - 02-05-2010 12:35 AM

is there tut on how to make plugings