Possible to Change SWF File Based on Current Theme?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Possible to Change SWF File Based on Current Theme?
DivotMaker
CZ Newbie
DivotMaker has been a member for over 19 year's 19 Year Member
Status: Offline
Joined: Sep 02, 2004
0.00 posts per day
Posts: 21
Points: 976
   
I am currently using three different themes on my site. I have some custom pages that I want to add a Flash animation too. The problem is I want the Flash animation to have a different look, depending on what theme is loaded. So, I made three different .swf files to handle this. On my custom module, I have the following code:

value=\"themes/BlueThemel/images/calvary.swf\"


Is there a way to pull in the theme variable that's used in Preferences so I don't have to type the theme name (in this case, Blue Theme) so that it will automatically pull in the correct .swf file based on the theme?

I found the following code in mainfile.php:

function get_theme() {
    global $user, $userinfo, $Default_Theme, $name, $op;
    if (isset($ThemeSelSave)) return $ThemeSelSave;
    if (is_user($user) && ($name != "Your_Account" OR $op != "logout")) {
        getusrinfo($user);
        if(empty($userinfo['theme'])) $userinfo['theme']=$Default_Theme;
        if(file_exists("themes/".$userinfo['theme']."/theme.php")) {
            $ThemeSel = $userinfo['theme'];
        } else {
            $ThemeSel = $Default_Theme;
        }
    } else {
        $ThemeSel = $Default_Theme;
    }
    static $ThemeSelSave;
    $ThemeSelSave = $ThemeSel;
    return $ThemeSelSave;
}


Anyone know if I can use this function in my module and then just call the theme that way?


Back to top Reply with quote
#2   
Telli
Site Admin
Telli has been a member for over 20 year's 20 Year Member
Occupation: Self Employed
Age: 45
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.06 posts per day
Posts: 8089
Points: 494,430
   

$swf_theme = get_theme();
value=\"themes/".$swf_theme."/images/calvary.swf\"




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum