2007-10-12, 06:31 PM
Hi all,
I've been working on a forum embed, and once we got the site template into the MyBB system, I thought, why would I risk imperfections and update both the site and the forum if I could make it so the site uses the forum skin? Well, after a while, I came up with a code that would embed site pages into the MyBB template.
Thanks,
BrandMan211
I've been working on a forum embed, and once we got the site template into the MyBB system, I thought, why would I risk imperfections and update both the site and the forum if I could make it so the site uses the forum skin? Well, after a while, I came up with a code that would embed site pages into the MyBB template.
<?php
// Get access to MyBB stuff
define("IN_MYBB", 1);
chdir(board); // path to MyBB
require './global.php';
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
</head>
<body>
{$header}
<center>";
?>
<!-- ************************************************************************************************************* CONTENT BEGIN **** -->
<?php
include($pagename);
?>
<!-- ************************************************************************************************************* CONTENT END ****** -->
<?
echo "</center>
{$footer}
</body>
</html>";
?>
The code worked PERFECTLY, except, there was one problem. You see, the navigation for the forum is outputted with the tag <navigation>, and when you are not in MyBB, it can not interpret it and it marks it as invalid. Also, the <br/> which comes before it interferes with the site content. What I was wondering is, would anyone happen to know what could omit that line from pages that are not located in MyBB? Other than that, everything works perfectly, in terms of the forum embed.Thanks,
BrandMan211