MyBB Community Forums

Full Version: Remove <!DOCTYPE ... > heading in output
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Right now, I'm programming a JSON based AJAX theme to MyBB, but have a small bit of a problem. The <!DOCTYPE ... > thing won't go away, even when I try emptying the Ungrouped -> HTMLDocType template. How do I go about getting rid of this?

EDIT: The sites URL: http://dev.ubernerd.us I'm not completely done flushing through the json, but am done enough to demonstrate my issue.
Hmm, this is weird. I just tried it myself and it didn't work. I searched the whole MyBB package and only found hardcoded doctypes in the Admin CP, the archive and the installation page. So that's not the issue. The doctype is indeed defined in the htmldoctype template, i.e. that's what you should be editing.

What I found out is if you empty out the template it kind of falls back to the default doctype (even though there's no reference to this in the code). However, if you just type some random rubbish it will be edited. A temporary solution is to replace the doctype with Alt+255 or something. Note that a normal space won't work here.
(2012-03-15, 01:25 PM)Fábio Maia Wrote: [ -> ]Hmm, this is weird. I just tried it myself and it didn't work. I searched the whole MyBB package and only found hardcoded doctypes in the Admin CP, the archive and the installation page. So that's not the issue. The doctype is indeed defined in the htmldoctype template, i.e. that's what you should be editing.

What I found out is if you empty out the template it kind of falls back to the default doctype (even though there's no reference to this in the code). However, if you just type some random rubbish it will be edited. A temporary solution is to replace the doctype with Alt+255 or something. Note that a normal space won't work here.

Yeah, I've searched the code as well. The only reference to anything that would be against my goal is the <html xml:lang thing, which is completely eliminated once I remove the <html> tag from whatever page.

I'll try the Alt+255 possibility. I don't necessarily like it because I like to be able to see what I'm using just so it doesn't give random buggy errors.
(2012-03-15, 01:25 PM)Fábio Maia Wrote: [ -> ]even though there's no reference to this in the code

function parse_page($contents)
{
	global $lang, $theme, $mybb, $htmldoctype, $archive_url, $error_handler;

	$contents = str_replace('<navigation>', build_breadcrumb(1), $contents);
	$contents = str_replace('<archive_url>', $archive_url, $contents);

	if($htmldoctype)
	{
		$contents = $htmldoctype.$contents;
	}
	else
	{
		$contents = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n".$contents;
	}
Oh right. I only searched for the literal string of text. It didn't occur to me that the doctype could be within double quotes.