MyBB Community Forums

Full Version: How to programatically include theme CSS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok, I've got most of my plugin working. Is there a static variable that returns the main CSS file of the current theme?

My Template is:
<html>
<head>
<title>{$mybb->settings[bbname]} - Example Page</title>
{$headerinclude}
</head>
<body>
{$header}
<br />
<!-- Content: Start -->
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder"><tr><td class="thead"><strong>BOX NAME</strong>
</td>
</tr><tr>
<td class="trow1">BOX CONTENT</td></tr>
</table>
<!-- Content: End -->
{$footer}
</body>
</html>

But I want to include the CSS of the theme somehow Toungue
Wouldn't it be included in "{$headerinclude}"?
In your hook that calls the template, globalize the $theme variable:
function myfunction_hook()
{
   global $theme;
   //...
}
I have included header include in my template, but it hasn't worked Sad I'm not using hook either Toungue