MyBB Community Forums

Full Version: [help]Plugin code for help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm find 2 plugin code

1)Revert to Original template code
Example:
Push to Deactivate Plugin button after template revert to original codes

2)Template all codes change
Example:
Change all code for index Template/index
Please help me

Sorry.I don't good speak English
You do know that you can already revert to the original template code theres a button where it says Edit, etc. And what is the "Template All Codes Change"?
i write a plugin
I'm find 2 plugin code

1)Revert to Original template code
Example:
Push to Deactivate Plugin button after template revert to original codes

2)Template all codes change
Example:
Change all code for index Template/index
They're writing new plug-in for mybb that changes the templates.So, they wanted to write any code to revert the template.What can they write?
help me to .....
Just use the same code like you do to edit the template but then backwards
I mean like:
require MYBB_ROOT."/inc/adminfunctions_templates.php"; //This must be added to define the functions used below. Use this in both the activation and deactivation functions!
find_replace_templatesets("index", "#hello#", "bye bye"); // code to edit a template. Use this in the activation function.

find_replace_templatesets("index", "#bye bye#", "hello", 0); // code to revert what you changed. Use this in the deactivation function. The 0 means no new template will be created.
Remember to also add the require line in your deactivation function!!

I don't really know what you mean with change all code. But when you edit a template with those functions, a new one will automatically be created and used while the old one is still saved (unless you add a 0 at the end of the function)
Smethead Wrote:Just use the same code like you do to edit the template but then backwards
I mean like:
require MYBB_ROOT."/inc/adminfunctions_templates.php"; //This must be added to define the functions used below. Use this in both the activation and deactivation functions!
find_replace_templatesets("index", "#hello#", "bye bye"); // code to edit a template. Use this in the activation function.

find_replace_templatesets("index", "#bye bye#", "hello", 0); // code to revert what you changed. Use this in the deactivation function. The 0 means no new template will be created.
Remember to also add the require line in your deactivation function!!

I don't really know what you mean with change all code. But when you edit a template with those functions, a new one will automatically be created and used while the old one is still saved (unless you add a 0 at the end of the function)

i love you =)=)

very thanks Smethead