Hey folks, running into a problem I cant get my head around.
here is a link to my testing page on: stillstatic.tv.
I'm creating a plugin which:
queries indexhibit for the section number of the loading page,
then checks to see if there is a corresponding file and subdirectory for it.
If so it loads a bit of js, and html to insert a swf movie into the background.
else posts an error in its place.
However, while the URL string seems to be phrased properly (my error code generates a valid link to the file ie: http://www.stillstatic.tv/files/swfBg/11/18o.swf)
When I look at the source for the rendered page, the URL is correct yet the the response headers Im seeing in firebug show that the browser is going to http://www.stillstatic.tv/18o.swf instead!?
Im new to PHP and writing plugins so I don't know how to tackle this. Any Ideas?
I've got further notes on the test page I've been working on - check it out at
http://www.stillstatic.tv/index.php?/about/test/
Here is the plugin code:
<?php if defined'SITE' exit'No direct script access allowed'
/*
* Plugin swfBg
*
* @version .02b
* @author Ben Rush
*
*/
/* //use <plug:test_plugin sec_id='<%section_id%>', pg_num='<%id%>', base_url='<%baseurl%>'/> */
function test_plugin$sec_id $pg_num $base_url
$swfBg_name '18o.swf'
$swfBg_url $base_url'/files/swfBg/'$sec_id'/'$swfBg_name
//$swfBg_url = 'http://www.stillstatic.tv/files/swfBg/11/18o.swf';// neither work
if file_exists$swfBg_url
$swfBg_insert <<< EOH
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '100%',
'height', '100%',
'src', '$swfBg_url',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'transparent',
'devicefont', 'false',
'id', '18o',
'name', '18o',
'menu', 'false',
'allowFullScreen', 'false',
'allowScriptAccess','always',
'movie', '18o',
'salign', ''
); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="18o" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="false" />
<param name="movie" value='$swfBg_url' />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="transparent">
<param name="bgcolor" value="#ffffff" />
<embed src='$swfBg_url' quality="high" wmode="transparent" bgcolor="#ffffff" width="100%" height="100%" name="18o" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
</object>
</noscript>
EOH
return $swfBg_insert
else$swfBg_insert <<< EOH
<span class="plugin_error" style='background-color:red; margins:3px; display: inline-block; border-style: dashed;'>Oops! there's been an error!<br/> page details: section id = $sec_id, page number = $pg_num <br/>
the swf file couldn't be reached, is it there? <a href='$swfBg_url' title='$swfBg_url'>$swfBg_url</a></span>
EOH
return $swfBg_insert
?>