MyBB Community Forums

Full Version: How do I add a chunk of code to the <head> tag on all MyBB pages?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Basically I want to add this block of code my friend wrote (or a slight variation of it):

switch(screen.availWidth) {
  case 800:
    css="/css/body_800.css";
    break;
  case 1024:
    css="/css/body_1024.css";
    break;
  default:
    css="/css/other.css";
    break;
}
document.write("<link rel='stylesheet' type='text/css' href='" + css + "' />");

to get my forum to change the background depending on a user's res (I find CSS scaling of the background results in slow performance).

Erm.. where should I add this code?

Thank you very much cool MyBB dudes and dudettes! ^_^


Mike!
Ungrouped Templates >> headerinclude
Wow! I had no idea that was even there! How useful Smile

Thank you very much! ^_^