MyBB-Plugins Forums

Full Version: Rebuild template?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi PN,

After de-activating a plugin, is there any MyBB function to rebuild a template the plugin modified to its default state?

Thanks,
Combus
Nope
Thanks, I guess I'll just insert a default template manually.

Also, is there any method like find_replace_templatesets but instead of replacing for anything, it just replaces all the content of the template and insert the new content?

Thanks Smile (And sorry for bugging you)
Yes, the test plugin I sent you does that

Edit: Or do you mean the whole template?
Yep, I mean the whole content of the template. Is just that I need a new structure for the forumbit_depth1_cat, and I can't replace it in the templates that uses it (because it's called directly from the index.php). So I thought replacing the whole content is the only solution I have :S
Just do an DB::update_query() to that template and you're done
I guess update_query, works just like insert_query? I tried to make it using a tid = null, and with tid=125 (the tid of the template I want to change). But I get an error saying: 1062 - Duplicate entry '125' for key 'PRIMARY'. Am I doing it the wrong way?
update_query UPDATES, while insert_query INSERTS (creates a new row).
Just take a look at the arguments it needs or search for a plugin which makes use of it and see how it works
Thanks Big Grin It's working now. I just needed to add one more parameter, the tid. Instead of declaring it on the array, I had to do it on the update_query.
I'm glad you got it working Smile