MyBB Community Forums

Full Version: How to get the orignal template?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do we copy a original template into a variable?
e.g private messaging template. Every theme has its own style, so we can't use find. and replace function, so Is there a way to store the template in a variable, so that, if something goes wrong, we can retrieve our original template again.
Over the template just click "Options" then "Revert to default".
(2011-09-29, 01:16 PM)Jason L. Wrote: [ -> ]Over the template just click "Options" then "Revert to default".

how to do it with a plugin? or simply what is revert to default function. and its arguments?
You mean to "evaluate" any existing template in a variable ?? If so then you can use something like this;
function SOMETHING()
{
   global $templates, $variable_name;
   eval("\$variable_name = \"".$templates->get("TEMPLATE_NAME")."\";");
}
(2011-09-29, 01:34 PM)Yaldaram Wrote: [ -> ]You mean to "evaluate" any existing template in a variable ?? If so then you can use something like this;
function SOMETHING()
{
   global $templates, $variable_name;
   eval("\$variable_name = \"".$templates->get("TEMPLATE_NAME")."\";");
}

Yeah Thanks solved