Customizing SMF > SMF Coding Discussion

Calling Stylesheet

(1/3) > >>

The Wizard:
Hello:

I'm using SMF 2.0.2 and I have created a extra little script/page for my forum and need to know how to call the style sheet my forum is using at the moment. Just like a popup on the forum.

thanks

Wiz

Gary:
You can call extra stylesheets by placing this code in the <head> section of the HTML code.


--- Code: ---<link rel="stylesheet" type="text/css" href="path/to/file.css" />
--- End code ---

The Wizard:
Hello:

I know about that code, but thanks for trying. What I would like is the code to get SMF itself to figure out what theme I'm using and adjust by itself. I don't want to have to change this code everytime I decide I want to use a new theme.

Anybody?

Thanks

Wiz

Labradoodle-360:

--- Code: ---<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/file.css" />
--- End code ---
Two things though...make sure $settings is in the global scope, and also make sure the file does indeed exist.

The Wizard:
The code below gives me errors and I'm hoping someone will tell me why?

Wiz


--- Code: ---require_once("/xxx/xxx/xx/xxxx/xxxx/xxx/SSI.php");

global $smcFunc, $db_prefix, $user_info, $boardurl, $settings;

include ''.$settings['theme_url'].'/css/index.css';
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version