Jump to content

flash using PHP for wordpress


lmcm2008

Recommended Posts

Hi:

I have a wordpress, and I want to publish a flash animation.

 

I´ve modified the wordpress file sidebar.php with a include to this code in another .php file, but I don´t see nothing, but I don´t have any error... just "white space" instead the animation...

 

Can you help me with the code??

<?
$wmode	= "opaque";

$refererId	=	258;
$bannerId	=	210;
$width		=	250;
$height		=	250;

$link		= "http://www.bellross.com/index.php?bannerId=".$bannerId."&refererId=".$refererId;
$flashLink	= "http://www.bellross.com/index.php?bannerId=".$bannerId."%26refererId=".$refererId;

?>

<style type="text/css">

body, object {
	padding:0;
	margin:0;
}

#timekeeper, .link {
	width: <?= $width?>px;
	height:<?= $height?>px;
}

.hand {
	bottom: 0px;
	left: 107px;
}

</style>



<link href="wp-content/themes/sahifa/template/style.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript">
window.onload = function() {      
      if(document.getElementsByTagName('body')[0].style.MozTransform == ''
         || document.getElementsByTagName('body')[0].style.WebkitTransform == ''
         || document.getElementsByTagName('body')[0].style.OTransform == ''
		 || document.getElementsByTagName('body')[0].style.transform == '') {
	    function hand() {
		  handS.style.MozTransform    =
		  handS.style.WebkitTransform =
		  handS.style.OTransform      =
		  handS.style.transform       = 'rotate(' + (time * 6) + 'deg)';
		  handM.style.MozTransform    =
		  handM.style.WebkitTransform =
		  handM.style.OTransform      =
		  handM.style.transform       = 'rotate(' + (time / 10) + 'deg)';
		  handH.style.MozTransform    =
		  handH.style.WebkitTransform =
		  handH.style.OTransform      =
		  handH.style.transform       = 'rotate(' + (time / 120) + 'deg)';
	    }
	    var handH = document.getElementById('handH');
	    var handM = document.getElementById('handM');
	    var handS = document.getElementById('handS');
	    var timekeeper = document.getElementById('timekeeper');
	    var d = new Date();
	    var time = d.getSeconds() + 60 * d.getMinutes() + 3600 * d.getHours();
	    hand();
	    setInterval(function() {time = time+0.20; hand();}, 200);
		setInterval(function() {r = new Date(); time = r.getSeconds() + 60 * r.getMinutes() + 3600 * r.getHours(); hand()}, 10000);
      }
	  
};
</script>


<script src="wp-content/themes/sahifa/swf/Scripts/swfobject_modified.js" type="text/javascript"></script>

<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>



<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="<?= $width?>" height="<?= $height?>">
  <param name="movie" value="wp-content/themes/sahifa/swf/timekeeper.swf">
  <param name="quality" value="high">
  <param name="wmode" value="<?= $wmode?>">
  <param name="swfversion" value="8.0.35.0">
  <param name="FlashVars" value="clickTAG=<?=$flashLink?>" />
  <!-- Cette balise <param> invite les utilisateurs de Flash Player en version 6.0 r65 et ultérieure à télécharger la version la plus récente de Flash Player. Supprimez-la si vous ne voulez pas que cette invite soit visible. -->
  <param name="expressinstall" value="wp-content/themes/sahifa/swf/Scripts/expressInstall.swf">
  <!-- La balise <object> suivante est destinée aux navigateurs autres qu'IE. Supprimez-la d'IE à l'aide d'IECC. -->
  <!--[if !IE]>-->
  <object type="application/x-shockwave-flash" data="wp-content/themes/sahifa/swf/timekeeper.swf" width="<?= $width?>" height="<?= $height?>">
    <!--<![endif]-->
    <param name="quality" value="high">
    <param name="wmode" value="<?= $wmode?>">
    <param name="swfversion" value="8.0.35.0">
    <param name="expressinstall" value="wp-content/themes/sahifa/swf/Scripts/expressInstall.swf">
    <param name="FlashVars" value="clickTAG=<?=$flashLink?>" />
    <!-- Le navigateur affichera le contenu alternatif suivant pour les utilisateurs d'un lecteur Flash de version 6.0 ou de versions plus anciennes. -->
    <div id="timekeeper">
        <a href="<?= $link; ?>" target="_blank" class="link"></a>
        <img src="template/images/handH.png" class="hand" id="handH" alt="heure"/>
        <img src="template/images/handM.png" class="hand" id="handM" alt="minute"/>
        <img src="template/images/handS.png" class="hand" id="handS" alt="seconde"/>
    </div>
    <!--[if !IE]>-->
  </object>
  <!--<![endif]-->
</object>


Do you see anything wrong?

How can I make this work in my page?

 

I hope you can help me.

Thanks.

Regards

 

Link to comment
https://forums.phpfreaks.com/topic/292034-flash-using-php-for-wordpress/
Share on other sites

Try using full <?php tags versus short <? tags, some servers are not configured for it.

 

change these

width: <?= $width?>px;
height:<?= $height?>px;

to

width:<?php echo $width;?>px;
height:<?php echo $height;?>px;

css errors can cause the white page as well with no error messages

 

If you need to see the errors you can enable debug in wp-config.php

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

The log will be saved in wp-content as debug.log

I´ve change all the

<?= $variable ?>

to

<? echo $variable ?>

and also move this lines

<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>

right under the <object></object> with all the code inside...

 

And works in all navigators!!... Great!!!

 

But... now doesn´t do it in mobiles phones and ipads... jeje...

Can you help me now with this matter? just to adapt the code to mobile phones and Ipads? Or its not possible? How can I do it?

 

Thanks a lot to everybody!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.