2010-01-28, 09:40 PM
I was not sure whether to post this under Code Modifications or Templates but it seemed to fall best under Code Modifications.
I have been working on integrating MyBB with my site, and have gotten quite far, however I still am having some issues. I am trying to find out if there is an easier way to do what I have already done.
I have 3 PHP files (header.php, leftsidebar.php, and footer.php) which need to be included into MyBB each time the page loads. Because MyBB does not allow PHP in templates I had to resort to modifying each page (index.php, usercp.php etc.) to include these files, which surround the forum.
I have done this like this:
Where the output_page is the part that displays the MyBB template and the includes are the files being included. I have also removed everything from the header and footer templates in MyBB.
Most pages display just fine using this method, however I did this to every output_page I could find, and it took quite some time. Now that I think about it, there probably is a place where I can place the include code that will include it to every output_page. Does anyone know in what file and where I could do this?
Another part of the problem I am running into is that some page elements are not displaying, such as the avatar on a member's profile. After moving the include code around a bit, I was able to get the avatar to display, but then the breadcrumb stopped working. I am guess this is because some things before the php include are getting left behind and are never loaded.
Is there any place I can put the include code so that it would be included on all pages (without affecting things on the page)?
Sorry if this question is confusing. I probably made it that way by making it so long!
Thanks for taking the time to read it!
I have been working on integrating MyBB with my site, and have gotten quite far, however I still am having some issues. I am trying to find out if there is an easier way to do what I have already done.
I have 3 PHP files (header.php, leftsidebar.php, and footer.php) which need to be included into MyBB each time the page loads. Because MyBB does not allow PHP in templates I had to resort to modifying each page (index.php, usercp.php etc.) to include these files, which surround the forum.
I have done this like this:
include 'header.php';
include 'leftsidebarwide.php';
eval("\$index = \"".$templates->get("index")."\";");
output_page($index);
include 'footer.php';
Where the output_page is the part that displays the MyBB template and the includes are the files being included. I have also removed everything from the header and footer templates in MyBB.
Most pages display just fine using this method, however I did this to every output_page I could find, and it took quite some time. Now that I think about it, there probably is a place where I can place the include code that will include it to every output_page. Does anyone know in what file and where I could do this?
Another part of the problem I am running into is that some page elements are not displaying, such as the avatar on a member's profile. After moving the include code around a bit, I was able to get the avatar to display, but then the breadcrumb stopped working. I am guess this is because some things before the php include are getting left behind and are never loaded.
Is there any place I can put the include code so that it would be included on all pages (without affecting things on the page)?
Sorry if this question is confusing. I probably made it that way by making it so long!
Thanks for taking the time to read it!