MyBB Community Forums
[How To?] Add personal menu above mybb - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [How To?] Add personal menu above mybb (/thread-184190.html)



Add personal menu above mybb - metulburr - 2015-10-12

I have a basic menu bar i have on my main site.
http://python-gaming.com/


I would like to add that same bar above the header of the forums of mybb in 
http://python-gaming.com/forums/

Kinda like just dropping the forums a few pixels to insert the menu bar. I have the code for the menu bar in a header shtml file that i add to all my html files. I dont know if there is a way to just add that included line somewhere in the code or not?

I tried adding
<!--#include virtual="/menu.shtml"-->
to the header section within ACP but it does not add my menu bar. The menu.shtml is in my root, but i am not sure how far back i need to go?
I went as far back one by one as
<!--#include virtual="../../../../../menu.shtml"-->
but i dont know what directory the header for the forums are in

I also tried path to relative root as well as php include
<!--#include virtual="/menu.shtml"-->
<?php include("/menu.shtml");?>
but that didnt work either


RE: Add personal menu above mybb - Shiblee - 2015-10-12

You can do it simply editing your header template from your ACP.
Check the menu links and add your own menu links with MyBB default menus.


RE: Add personal menu above mybb - SentoWeb - 2015-10-12

If you really want to keep the menu separate this will work:

config.php (added)
$config['header'] = file_get_contents('../../menu.shtml');

You can then include this anywhere in your templates:
{$mybb->config['header']}



RE: Add personal menu above mybb - metulburr - 2015-10-12

I get this error 
Warning [2] file_get_contents(../../menu.shtml): failed to open stream: No such file or directory - Line: 10 - File: inc/config.php PHP 5.5.9-1ubuntu4.13 (Linux)

File
Line
Function[PHP]
 
errorHandler->error
/inc/config.php
10
file_get_contents
/inc/init.php
65
require_once
/global.php
18
require_once
/index.php
18
require_once

on top of the forums showing when i add 
$config['header'] = file_get_contents('../../menu.shtml');
to inc/config.php

and the directory listing is 
metulburr /var/www/html $ ls
blog             favicon.ico  images      info.php  menu.shtml  testing_django
donations.shtml  forums       index.html  menu      pygame      trash

So it is 2 directories back. Why am i getting this error?


RE: Add personal menu above mybb - metulburr - 2015-10-22

I am an idiot. I could of just used the full path
$config['header'] = file_get_contents('http://python-gaming.com/menu/menu.shtml');

I got it to work


RE: Add personal menu above mybb - metulburr - 2015-10-23

but it changes my header to larger font. Why is this and how can i change it?