Page 1 of 1
Help! Trying to add flash movie to top of blog
Posted: Wed Jul 27, 2005 8:15 am
by lkelly
I'm trying to add a flash movie to the top of my blog index.php page, and doing so is causing problems with loading headers and producing error messages. This especially happens if I use the comments form and hit submit.
Does anyone have a simple example of how to add a flash item to the top of the blog index.php page without causing these errors?
Thanks in advance.
Re: Help! Trying to add flash movie to top of blog
Posted: Wed Jul 27, 2005 1:17 pm
by garvinhicking
Could you tell us the error messages? Without I'm really clueless.
How did you add the code, and which code did you add where?
Regards,
Garvin
Posted: Wed Jul 27, 2005 5:16 pm
by lkelly
Sure. I've tried a few different methods, some of which are probably equivalent.
1. Do an echo(' ') in the php code right before the line ob_start() in index.php. The contents of the echo statement are exactly what I pulled out of Dreamweaver, beginning with a <div> and then <object...> with the flash movie info and paramenters.
2. Another method was to put the flash movie info used above in a separate .html file and use an include(' ') php statement at the same point in the index.php. Right before ob_start().
What follows is the code I'm trying to use to add the flash (option 1 listed here):
Code: Select all
echo('<div align="left">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="700" height="80">
<param name="movie" value="http://myurl.com/flash/Menu.swf">
<param name="quality" value="high">
<embed src="http://myurl.com/flash/Menu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="700" height="80"></embed>
</object>
</div>');
The errors I get consist of:
Code: Select all
Warning: Cannot modify header information - headers already sent by (output started at <location edited>index.php:33) in <location edited>/blog/include/functions_config.inc.php on line 243
Warning: Cannot modify header information - headers already sent by (output started at <location edited>/blog/index.php:33) in <location edited>/blog/index.php on line 158
I get the first error from line 243 4 times, and the last error once. I have changed the error detail slightly by truncating out all the direct path info and just using <location edited>.
I assume this may have something to do with the header information from perhaps the macromedia page?
If someone has a more elegant way to add a flash movie to the top of a blog index.php page, I'll be more than happy to use it. For some reason adding it after the ob_start() function results in the flash showing up at the bottom of the page.
Thanks.
Posted: Wed Jul 27, 2005 6:36 pm
by kitten
Try to put your code after ob_start(), this should help

Posted: Wed Jul 27, 2005 8:27 pm
by lkelly
For some reason that causes the flash content to be displayed after all the blog stuff on the page layout. Any ideas?
That does seem to help with the header error messages.
Posted: Wed Jul 27, 2005 8:47 pm
by kitten
Perhaps you could try to put the code in the template index.tpl? This should work...