User The Seen needed to be able to pull in the url link or flash name into the Java script code but need to remove the extension (ie: .swf) form the end.
Here’s the embedded code that The Seen was using:
<?php foreach ($your_tableRecord['your_field'] as $upload): ?> <script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','960','height','362','src','<?php echo $upload['urlPath']?>','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgcolor','#181818','movie','<?php echo $upload['urlPath']?>' ); </script> <?php endforeach ?>
Here’s the solution provided by Dave from Interactive Tools. He said:
Just put:
<?php $upload['urlPathNoExt'] = preg_replace('/\.\w+$/', '', $upload['urlPath']); ?>
inside the foreach loop but above where you want to use it.
Then display it like this:
<?php echo $upload['urlPathNoExt'] ?>
So the result would be:
<?php foreach ($your_tableRecord['your_field'] as $upload): ?> <?php $upload['urlPathNoExt'] = preg_replace('/\.\w+$/', '', $upload['urlPath']); ?> <script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','960','height','362','src','<?php echo $upload['urlPathNoExt']?>','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgcolor','#181818','movie','<?php echo $upload['urlPathNoExt']?>' ); </script> <?php endforeach ?>
|