MyBB Community Forums

Full Version: [Tutorial] How to restore a deleted template, or 'blue name' template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
This happened to me in 1.4.10 or 1.4.9...don't remember which one. It happened when I hit save and then i hit stop while it was loading, edited the template some more then hit save again.
Yeah, that's what does it, finally got to the bottom of it. I think if it was stopped before it was inserted and you either refreshed or saved again, it would break. I believe the fix for this was in 1.4.10/11 though so this *shouldn't* happen anymore.
That's Good to Know. I've yet to re-add this template, mainly because I'm too lazy Toungue and Because its the ACPLink template which noone sees anyway.
I still could overwrite the default template easy.
Mind explaining how...??
this function would overwrite default template.

//Thanks to Demonic for this function
//http://community.mybboard.net/thread-39634.html
function classicauthorcolumn_temp($title,$find,$replace) {
global $db;
$title = $db->escape_string( $title );
$query = $db->simple_select("templates", "*", "title='$title' AND sid='-2'");
if( $db->num_rows( $query ) > 0 ) {
$rows = $db->fetch_array( $query );
$temp = str_replace($find,$replace, $rows['template']);
$updatetemp = array("template" => $db->escape_string($temp), "dateline" => TIME_NOW);
$db->update_query("templates", $updatetemp, "title='$title'");
}
}
there have to be a way to see if the master templates have been edited by accident.
Is that a function you've written?? Can't find it in any files. Clearly if you write your own functions you could do whatever you want, the point of this thread was when it was happening with core code...
actually Demonic wrote this function and I used it in my old plugins.
Right, well if a custom function breaks something, I don't see what point you're trying to prove, it's not possible to do edit the master with core MyBB.
Here is the php code I created to show that it is possible to edit the core template.

you just upload them in your root dir and run it.
There is a fix included here.

youtube video of the demo here:

http://www.youtube.com/watch?v=oe5sWSHCCx0
Pages: 1 2 3