MyBB Community Forums

Full Version: Add forum's CSS to a custom PHP file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys!

I added a custom PHP file to my server's root.

I'm using <object> HTML tag to show it to my forum's index.
The problem is that I need to make my script to display with the same CSS as my forum's.

My forum URL is

Looking forwards for tips.
what is the link of your custom php file ?

As you can notice, it displays only simple text. I want to apply my forum's CSS attributes to it.
it would be better to use OUGC pages plugin or this method for the custom php file
It seems it's not working how I want to, especially when using <frame> or <object> HTML tags. I tried to directly add the PHP code into my index HTML template, but it's not working too.
you may PM me your requirement and temporary access to forum admin panel & files (FTP)

however its about midnight for me & I can check it tomorrow
Try with following edit(s):

In your server.php file at the top, before <?php that contains code that is pulling your server status

define("NO_ONLINE", 1);
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'server.php');

require_once "./global.php";

$tid = $theme['tid'];


<style type="text/css">
@import url(cache/themes/theme<?php echo $tid ?>/global.css);

<?php the rest of your php code ?>
Thanks, I'll give it a try!

Edit: Well, it its working, somehow, but it does not takes the font of my CSS. The text only takes my forum's background and text color.

See at

Fixed, thanks to everybody for help!