By musko on
With clean urls off, this is not an issue... however, with clean urls on ....
I have a player embedded in a block [with php input enabled] which works fine in any dir 1 level deep -- ie,
But when a node is called -- ie
The src files will not call properly and do not display.
For whatever reason drupal is looking for the files relative to the specific node/page.
I've tried quite a few angles around this with no avail thus far. It's driving me nuts.
Can someone help me figure this out?
Here's the code embedded into the block:
<!-- Div that contains player. -->
<div id="player">
<h1>No flash player!</h1>
<p>It looks like you don't have flash player installed. <a href="http://www.macromedia.com/go/getflashplayer" >Click here</a> to go to Macromedia download page.</p>
</div>
<!-- Script that embeds player. -->
<script language="javascript" type="text/javascript">
var so = new SWFObject("/sites/default/files/mp3s/flashmp3player.swf", "player", "170", "247", "9");
so.addParam("quality","high");
so.addVariable("content_path","/sites/default/files/mp3s/mp3/");
so.addVariable("color_path","/sites/default/files/mp3s/default.xml");
so.addVariable("script_path","/sites/default/files/mp3s/flashmp3player.php");
so.write("player");
</script>
Comments
If the input type is PHP, try
If the input type is PHP, try using <?=base_path()?>sites/default.
Didn't work...
<?=base_path()?> Didn't work.
Thanks for the reply
Do you suppose this issue has something to do with the fact that I have "Rewritebase" un-commented in my .htaccess ??
That's the only way I could get cleanurls + fastgallery to both work in unison.
as far as I can tell
Hi, I had the same problem. What fixed the problem for me was to use the whole URL and not relative path.
When using a relative path, it tries to map it to a node (because of reroute rules I believe).
I think that is also why omnitrick came with the base_path() invocation, that way you did not had to type the domain part of the swf location yourself.
Also be aware that if you encounter the same problem with other files (file could not be found or you are rerouted to that page), the same solution may fix that problem as well.
I.e. I also used an Flash flv player and the flv movie, the flash swf file and js files all had to be absolutely referred to.
Best advice I can also give you is to only edit the .htaccess file as a last resort. However, I doubt that the Rewritebase caused the problem, I am more convinced that the solution provided above will work.
Hope this is any help to you.