MyBB Community Forums

Full Version: Modify my template type when user installs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey I'm making a plugin, during development I discovered my html template had exceded the chars a "text" type can hold and I put it to mediumtext which fixed it. I would like to know how I automaticly can specify the template data type as medium text when a user installs the plugin. I just ran a sql command to modify all the templates in mybb.templates to be mediumtext but I really don't want to have to ask an user to do this aswell.
You can change it with $db->modify_column() method, but I wouldn't recommend that. Why not simply separate it into 2 smaller templates?
(2016-03-27, 11:08 PM)Destroy666 Wrote: [ -> ]You can change it with $db->modify_column() method, but I wouldn't recommend that. Why not simply separate it into 2 smaller templates?

Why isn't that recommended?
It would be awkward to split it into several templates as it as right now Sad
Any documentation on how to use it?
Is it not possible to simply specify the Column template should have that datatype mediumtext upon creating the table?
Because it wouldn't be optimal to change the type of a whole column just for one record to fit... 65000+ characters is more than enough already. So we definitely won't change it upon creating the table in the core.

I don't know what's "akward" about splitiing it. If you separate it in a logical manner (e.g. take a look at header and headerinclude in the core), it'll even make it easier to edit for users.

Documentation of DB methods is here: http://docs.mybb.com/