I'm trying to integrate a link exchange directory with my MKPortal.
MKportal is using the forum's template.
But that link directory page is in an inframe inside the portal.
That page has no layout at all (Here's the link: http://harro.sin.khk.be/index.php?pid=2 )
Is it possible to let the page inside the iframe use the css file of the theme that a member is using?
if the page calls for the CSS file....
Yes, but how can I get that css file?
I want the css file of the theme the member is using and the default if it's a guest.
in that case, you will have to "include" SSI in order to get the member data and then use an if else statement...
Found nothing that gets the member data in SSI.php
There is however a function in Load.php called loadUserSettings();
But to be honest I don't know what to do with it.
Saw that there is a var $user_info that contains an array with all the information of the member.
But how can I use this on my other page?
[edit]
Managed to get the theme_id the user is using. (I think...)
<?php
require("/home/users/members/hwbk/harro/public_html/forums/SSI.php");
loadUserSettings();
$theme_id = $user_info['theme'];
echo $theme_id;
?>
Let's see if I can get the link to the css file now :)
Maybe even simpler than that...something like this in the <head> section?
<?php
require_once('pathtoSSI.php');
global $settings;
echo '<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc2" />';
?>
SSi takes care of the loading of user/guest settings, so you really don't need to do that yourelf - only check the variables.
Thanks a lot.
Just managed to do it, but your way is a lot easier ;)
Although I'm proud off myself ;)
Here's the code I had:
<?php
require("/home/users/members/hwbk/harro/public_html/forums/SSI.php");
loadUserSettings();
$theme_id = $user_info['theme'];
loadTheme($ID_THEME = $theme_id, $initialize = true);
$theme_dir = $settings['theme_url'];
$theme_css = $theme_dir . "/style.css";
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="<?php echo $theme_css ?>" />
</head>
Thanks a lot for the help!!
:) Glad to help. Thats how i started out too..by exploring and learning bit by bit.
Just curious....
style.css?rc2
Why is the ?rc2 after the style.css?
It will make sure any changes in style.css will be present right away. The browser updates its cache when something is attached to the filename.
Oh, K.
I get it :)
Thanks for explaining it!