So I have a client has a different logo for each section of the site and 3 of them are flash with animation and 2 of them are .jpg. So far, I've just commented out the following:
/*
$info = image_get_info($logo);
$headers = array('Content-Type: '.$info['mime_type']);
foreach ($headers as $header) {
header($header);
}
*/Thats line 200+ for those playing along at home....
And added the Flash insertion code to the page.tpl.php, thusly:
<div class="header">
<?php if ($logo): ?>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="777" height="202">
<param name="movie" value="<?php print $logo; ?>" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<embed src="<?php print $logo; ?>" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="777" height="202"></embed>
</object>
<?php endif; ?>
I should mention that I am not much of a coder (but getting better every day). Other than that I have treated the files just as I would jpgs. All the flash is working and I hope to be inserting the jpeg logos later today.
Any thoughts are welcome, particularly on:
A) Is the code on lines 200-204 only there for validation of the image file? i.e. should I write a new validation sequence that can distinguich between flash and jpeg?
B) Is there a way to have the module insert the proper object and embed tags for the flash, - I doubt as $logo just holds a path.
My current plan is to check the $logo mime type in page.tpl.php and have it decide whether to use object and embed, or image src.
Thanks!
Comments
Comment #1
egrotke commentedJust wondering, which theme are you using?
I'm trying to add flash in my header as well, using a modification of the chameleon theme. The code is a little different and it doesn't work:
if ($logo = theme_get_setting('logo')) {
$output .= "
";
}
Thanks,
-E
Comment #2
egrotke commentedOh I see, that's a phpTemplate file. Ok, I try that.
Comment #3
Andy Ramblings commentedI would very much like this feature as well. I have been looking at the banner module http://drupal.org/project/banner
This allows you to have swf files as an banner. I got it to work and do what I wanted, however, being a banner module, it has lots of extras that I don't want.
The code area that I think may be of interest is right at the bottom of the module:
As I said, I have modified this module to do what I want it to do, and it does it pretty much ok. The module allows for text banners, hence the
case 'text'Comment #4
Tresler commentedComment #5
pobster commentedI'm closing this as its infeasible... Currently as of the latest version, logotool *does* support swf files. Check it out, stick one in your logos folder and look at it like this; http://www.yoursite.com/logo.php?logo=whatever.swf
What *doesn't* support swf for logos is Drupal. Not 'out of the box' anyway, and until it does - my hands are tied, there's nothing I can do about it...
Sorry...
I guess though, if you add the embed code to your page.tpl.php file then you can use swf files, but that kind of defies the point of logotool automating things? You won't be able to display random swfs without sticking code into your page.tpl.php file as well because the width and height stuff will be wrong.
Pobster