MyBB-Plugins Forums
Rebuild template? - Printable Version

+- MyBB-Plugins Forums (
+-- Forum: Archived Forums (
+--- Forum: MyBB 1.4.x (
+---- Forum: General (
+---- Thread: Rebuild template? (/Thread-Rebuild-template)

Rebuild template? - combus - 06-07-2010

Hi PN,

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


RE: Rebuild template? - Diogo Parrinha - 06-08-2010


RE: Rebuild template? - combus - 06-08-2010

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)

RE: Rebuild template? - Diogo Parrinha - 06-09-2010

Yes, the test plugin I sent you does that

Edit: Or do you mean the whole template?

RE: Rebuild template? - combus - 06-10-2010

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

RE: Rebuild template? - Diogo Parrinha - 06-10-2010

Just do an DB::update_query() to that template and you're done

RE: Rebuild template? - combus - 06-10-2010

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?

RE: Rebuild template? - Diogo Parrinha - 06-10-2010

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

RE: Rebuild template? - combus - 06-11-2010

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.

RE: Rebuild template? - Diogo Parrinha - 06-11-2010

I'm glad you got it working Smile