Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/06/2010, 21:42
juanpons14
 
Fecha de Ingreso: diciembre-2007
Ubicación: Valencia
Mensajes: 113
Antigüedad: 16 años, 4 meses
Puntos: 1
Incluir variable PHP en un Script

Hola que tal? el problema es el siguiente y me estoy volviendo loco!! xd!

Código:
<?php  if ( ae_detect_ie() ) { ?>

<div id="video2" class="flashvideo"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this content.</div>

<script type="text/javascript"> 
var params = { 'allowfullscreen': 'true', 'allowscriptaccess': 'always', 'wmode': 'transparent' };
var attributes = { 'id': 'video2', 'name': 'video2'};
var flashvars = {
	'file' : '<?php $key="video"; echo get_post_meta($post->ID, $key, true); ?>',
	'width' : '460',
	'height' : '280',
	'controlbar' : 'bottom',
	'dock' : 'false',
	'icons' : 'true',
	'logo.hide' : 'false',
	'logo.position' : 'bottom-left',
	'playlist' : 'none',
	'skin' : 'http://www.planetdescargas.com/wp-content/plugins/flash-video-player/skins/swift/swift.swf',
	'autostart' : 'true',
	'bufferlength' : '4',
	'item' : '0',
	'mute' : 'false',
	'repeat' : 'none',
	'shuffle' : 'false',
	'smoothing' : 'true',
	'stretching' : 'uniform',
	'volume' : '90'
 };
swfobject.embedSWF("http://www.planetdescargas.com/wp-content/plugins/flash-video-player/mediaplayer/player.swf", "video2", "460", "280", "9.0.0","http://www.planetdescargas.com/wp-content/plugins/flash-video-player/mediaplayer/expressinstall.swf", flashvars, params, attributes);
</script>
	
<?php	 } else { 
 echo '
<div class="scroll-img" style="margin-bottom:17px;">
<object height="180" width="230" type="application/x-shockwave-flash" id="video2" name="video2" data="http://www.planetdescargas.com/wp-content/plugins/flash-video-player/mediaplayer/player.swf" style="visibility: visible;"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="wmode" value="transparent"><param name="flashvars" value="file=';$key="video"; echo get_post_meta($post->ID, $key, true); echo '&amp;image='; $key="thumb"; echo get_post_meta($post->ID, $key, true); echo '&amp;width=230&amp;height=180&amp;controlbar=bottom&amp;dock=false&amp;icons=true&amp;logo.hide=false&amp;logo.position=bottom-left&amp;playlist=none&amp;skin=http://www.planetdescargas.com/wp-content/plugins/flash-video-player/skins/stylish/stylish.swf&amp;autostart=false&amp;bufferlength=4&amp;item=0&amp;mute=false&amp;repeat=none&amp;shuffle=false&amp;smoothing=true&amp;stretching=uniform&amp;volume=90"></object></div>';
			};
?>
Todo funciona perfecto, solo un fallo...la variable primera del código metido dentro del Script: <?php $key="video"; echo get_post_meta($post->ID, $key, true); ?> no se ejecuta....como puedo hacer par que funciona la variable?


Gracias, lo he probado todo no se hacerlo...

El código trata de hacer que en IE se muetre un codigo para un reproductor y en los demas otros ya que el que me va en todos los navegadores, como no, en IE no me va jaja!

Gracias un saludo.