MyBB Community Forums

Full Version: Load MyBB template outside of MyBB dir + how to get mybb.com custom topbar?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So it's a twofold question.

The first one was answered long ago on here but I just can't find the thread where people discussed and explained, it had a lot of template edits and I think custom files how to get similar top bar like in MyBB.com with above having home, download, community etc.

Now with that in mind, I remember an old 1.6 mybb trick to get the same layout as the forum by including a file from /inc/ to include the template system. This would be nice to keep pages in style and my lazy lime to make a custom page that's not done via plugin and loaded in the database.

Summary:
How to get mybb.com like top bar on my own forum
How to load the mybb template in a forum outside of mybb installed directory.

Thanks in advance.
(2020-12-07, 12:28 PM)MrAnderson Wrote: [ -> ]So it's a twofold question.

The first one was answered long ago on here but I just can't find the thread where people discussed and explained, it had a lot of template edits and I think custom files how to get similar top bar like in MyBB.com with above having home, download, community etc.

Now with that in mind, I remember an old 1.6 mybb trick to get the same layout as the forum by including a file from /inc/ to include the template system. This would be nice to keep pages in style and my lazy lime to make a custom page that's not done via plugin and loaded in the database.

Summary:
How to get mybb.com like top bar on my own forum
How to load the mybb template in a forum outside of mybb installed directory.

Thanks in advance.
1) I'm not really sure what exactly you're requesting help for. You can copy the css for the navigation bar right on this page. Looks like it's all in here:

https://community.mybb.com/cache/themes/...te.min.css

Just use an online beautifier so you can actually read it.


2) I'm really not sure what you're asking here. What do you mean load mybb in a forum outside of the installed directory? Are you talking about custom pages?

In case you are, you can basically do that without a plugin by creating a new template, then creating a new php file in your root folder that calls the contents of the template file like this:

<?php 
    define('IN_MYBB', 1);
    define('THIS_SCRIPT', 'mypage.php');
    require_once("global.php");
    add_breadcrumb("my page", $_SERVER['PHP_SELF']);
    eval("\$page = \"".$templates->get("mypage")."\";");
    output_page($page);
?>