MyBB Community Forums

Full Version: Edit Board Message Page (Dev Help)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I haven't even begun the member login stuff just yet. I'm just working on making the forum look the way I want it with the header and footer from my website.

I will eventually try and integrate the users and such but that is for another topic. Right now I just want to get this header/footer thing all situated for the Board Message page, which is the last page left I need for my forum to completely display both my header and footer on all forum pages.
Also for examples sake, this is basically what I have been doing to all pages in the main/home directory.

include '../header.php';

eval("\$index = \"".$templates->get("index")."\";");
output_page($index);

include '../footer.php';

All displays perfectly the way I want it on every page, except the Board Message when a user tries to access a forum/thread they don't have permissions for.
Wait, if you edit your website into your templates, then it will be globally the same aslong as you all use the same theme.
Yes, however for each page (ex: index.php, member.php, memberlist.php, profile.php, etc.) I have to manually insert the header/footer include. By doing it this way I can use whatever theme I want whenever I want without having to go through the template files again.

Do you/anyone get what I'm saying? lol

I basically edited all the forum files correctly (ex: index.php, member.php, memberlist.php, profile.php, etc.) to include my header/footer. Just need to know where to edit the Board Message file which I can not find where it's located.
I see where you're coming from, but it's much better/simpler to just edit it into the theme template then force the theme on users. That way they have to use that theme therefore seeing it the correct way.

I recommend reverting those back and then doing it through the theme file. As, I don't think there's a Board Message file, but is somehow called once activated.

(Not a php whiz, sorry.)
I appreciate the input Derek but going the route of just inputting in my theme will not work as MyBB does not seem to allow outside PHP to be executed, which is one of the main reasons why I chose this method.

Can anyone that knows the code within MyBB give me a hand?
The board message is not located in a file - it's generated by a function.

There are two templates - error_nopermission and error_nopermission_loggedin - that get used when the error_no_permission function is called. Ultimately, it's the error template that controls these too.

What do you mean by 'MyBB does not seem to allow outside PHP to be executed'? If you want to use the same header or footer for whatever theme, you can make a plugin that hooks into global_start (or global_end depending what you're wanting it to do) and replace the default theme template with your own custom one...

Instead of using custom files for all this, you should be using MyBB's templates function and reading templates from external files. Or at least that is how I suggest doing it. I can post examples if you need.
I said I would show an example, well here's an example of how I did it to have everything managed from within MyBB using MyBB's built in template system. The attached file is meant to be renamed as index.php and placed in a higher directory than your forum. Using this method the OP could use MyBB's template system for ALL of their custom pages, including theme, header, and footer. Far better than hacking MyBB core code since that would have to be repeated every time that a hacked file was updated.
Dylan,

Thanks for the example but could you explain a bit better in depth about what you mean in the script you gave?

Again, I have just two files. mywebheader.php and mywebfooter.php

I want both to be included in MyBB top and bottom respectively.

Thanks again and I really appreciate it.
Pages: 1 2