Rotating Banner -> Flash Header

plixel - November 14, 2008 - 01:47
Project:Marinelli
Version:6.x-2.4
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I've been trying to replace the rotating header images with a single embedded flash file, but haven't had much luck. I'm not sure if i'm not using the correct code to embed the swf or am putting it the wrong folder.

Thanks!

#1

plixel - November 14, 2008 - 02:21
Title:Flash Header » Rotating Banner -> Flash Header

#2

talktozee - November 18, 2008 - 16:44

In page.tpl.php, find:

<div id="header">
<?php if ($site_name) : ?>

Insert the following after the header DIV if you want the front page to have Flash and all other pages to have static images:

<?php $homepage = "/"; ?>
<?php $currentpage = $_SERVER['REQUEST_URI']; ?>
<?php
   
if($homepage==$currentpage){
          print
'<object width="970" height="195" wmode=transparent><param name="movie" value="yourflash.swf"></param><param name="allowFullScreen" value="false"></param><embed wmode=transparent src="yourflash.swf" type="application/x-shockwave-flash" allowfullscreen="false" width="970" height="195"></embed></object>';
    }
          else { print
'<img width=970 height=200 src=yourstatic.jpg />';
    }    
   
?>

If you want Flash on every page, remove the conditional statements and just do a print of the Object/Embed line. The height and width dimensions might have to be adjusted a bit, so be aware of this.

You'll also need to REM out the rotate.php line in the graphics.css file:

#header {background: #E34A10;}
/* url(img/banners/rotate.php) no-repeat 0px 0px; /*rotates images in the banners folder */} */

#3

signal000 - January 6, 2009 - 03:10

I followed this and put the yourflash.swf in the img/banners/ folder and its still not working ?

#4

bhardy101 - February 14, 2009 - 08:42

Ok, I've tried this for a bit now. I just want my flash to replace the image that makes up the header for the marinelli theme. this is what i've got.

<div id="header">
<?php if ($site_name) : ?>
<?php $homepage = "/"; ?>
<?php $currentpage = $_SERVER['REQUEST_URI']; ?>
<?php
   
if($homepage==$currentpage){
          print
'<object width="970" height="200" wmode=transparent><param name="movie" value="global.swf"></param><param name="allowFullScreen" value="false"></param><embed wmode=transparent src="global.swf" type="application/x-shockwave-flash" allowfullscreen="false" width="970" height="200"></embed></object>';
    }
          else { print
'<img width=970 height=200 src=yourstatic.jpg />';
    }   
   
?>

All i get is my one image, which i dont want anyway. If i delete the image, the header is just blank. Since i didn't know where to put the flash, it's in the root directory as well as the /themes/marinelli/img/banners/ folder. I'm a newb, thanks in advance for the help.

#5

bhardy101 - February 14, 2009 - 20:02

Ok, i got it. I needed to put the code inside the header. Now its on the top, and on the top on all the pages. This is what i wanted. i edited the page.tpl.php that was in the themes/marinelli/giordani folder. Giordani was the theme i had selected. Hope this helps out.

Global Decompression
http://www.globaldecompression.com

<div id="header" <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="970" height="180" id="http://www.yourpath.com/flash.swf" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="http://www.yourpath.com/flash.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#000000">
<embed src="http://www.yourpath.com/flash.swf" quality="high" bgcolor="#ffffff" width="970" height="180" name="http://www.yourpath.com/flash.swf" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</object>

#6

TravieMo9 - February 23, 2009 - 22:01

I added Flash header with the instructions in bhardy101 comment #5 above. It worked but then my Administration Menu "administration_menu module", and Primary Links went under it. Adding z-index to the div didn't help.

#7

Gullimont - May 18, 2009 - 16:32

bhardy's method worked perfectly for me, thanks very much!

#8

riote - May 20, 2009 - 18:07

instead of using a url, use the base_path just to make it easier when you move your site..

#9

willisjt - August 14, 2009 - 03:54

Re:#6
TravieMo9

Adding

<param name="wmode" value="transparent" />

as a param solves this issue in all browsers accept for safari.

#10

willisjt - October 9, 2009 - 20:23

I still haven't been able to get the drop downs to go over top of the flash in IE8 using any of these scripts, my site is live and i just noticed the issue. It's in a sort of soft launch mode right now so I can keep it up with the flash for a little while but I really don't want to go back to the static images. The site is http://www.wrighthealthcentre.com

#11

archetypemkt - October 16, 2009 - 18:55

I'm having problems getting the flash to work on "non-primary" links. The flash works on primary and secondary links but if you link in (i.e., click on a blog entry, form, etc.) you get a blank header. I look at the source code and all the flash is there. I've even tried to upload the flash file to the specific template directory as well as .....actually I have tried everything under the sun to make the flash show up on secondary pages but it doesn't.

Since the header block doesn't work inserting it that way isn't an option without changing the template. I'm trying to get away from that and am just looking for an easy fix.

Any help would be great. http://www.cacem-intl.com (you can see flash image on primaries and then the static on deeper linked pages).

#12

BeMathis - October 30, 2009 - 18:59


<?php
   
if($homepage==$currentpage){
          print
'<object width="970" height="195" wmode=transparent><param name="movie" value="yourflash.swf"></param><param name="allowFullScreen" value="false"></param><embed wmode=transparent src="yourflash.swf" type="application/x-shockwave-flash" allowfullscreen="false" width="970" height="195"></embed></object>';
   
?>

worked fine for me but when I go to any page that is www.example.com/node/ The banner reverts back to the rotate the php and is no longer my flash.

If i do removed the css line that sets up the rotating banner then i just get no banner. Any ideas on what may be causing this?

#13

willisjt - November 3, 2009 - 22:22

It's because you have your code in the if statement checking to see if the current page is the home page. Take it out and it should work fine.

<?php
         
print '<object width="970" height="195" wmode=transparent><param name="movie" value="yourflash.swf"></param><param name="allowFullScreen" value="false"></param><embed wmode=transparent src="yourflash.swf" type="application/x-shockwave-flash" allowfullscreen="false" width="970" height="195"></embed></object>';
   
?>

make sure you find the other } it wasn't in the code snippet you posted. If you can't find it then just do this

<?php
         
print '<object width="970" height="195" wmode=transparent><param name="movie" value="yourflash.swf"></param><param name="allowFullScreen" value="false"></param><embed wmode=transparent src="yourflash.swf" type="application/x-shockwave-flash" allowfullscreen="false" width="970" height="195"></embed></object>';
    if(
$homepage==$currentpage){
   
?>

 
 

Drupal is a registered trademark of Dries Buytaert.