PHP: Unexpected T_LIST - getimagesize

I am using the following code to deliver and embed a flash file, i am using getimagesize to get the width and height of the swf but it doesn't seem to like the list part... anyone know where I'm going wrong?
<?php include($_SERVER['DOCUMENT_ROOT']."/header.php"); ?>
<h1><?php print($_GET['tag']); ?> (Related files)</h1>
<hr />
<div align="center">
<?php
$project = $_GET['project'];
$file = $_GET['file'];
$tag = $_GET['tag']
list($width, $height, $type, $attr) = getimagesize("files/".$project."/".$file.".swf");
print('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'.$width.'" height="'.$height.'" id="FlashID" title="'.$tag.'">');
print('<param name="movie" value="files/'.$project.'/'.$file.'.swf" />');
print('<param name="quality" value="high" />');
print('<param name="wmode" value="opaque" />');
print('<param name="swfversion" value="6.0.65.0" />');
print('<param name="expressinstall" value="/Scripts/expressInstall.swf" />');
?>
<!--[if !IE]>-->
<?php print('<object type="application/x-shockwave-flash" data="files/'.$project.'/'.$file.'.swf" width="'.$width.'" height="'.$height.'">') ?>
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<param name="expressinstall" value="/Scripts/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></p>
</div>
<?php include($_SERVER['DOCUMENT_ROOT']."/footer.php"); ?>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->

$tag = $_GET['tag'] needs an ;.
It's actually pretty easy to find, as you only have one list. Check the line above: boom you nailed It!

Related

Element "embed" undefined, XHTML 1.0 Transitional (W3C)

I am trying to validate my page as XHTML 1.0 Transitional (W3C).
And I have the following error:
element "embed" undefined
+
there is no attribute "src",
there is no attribute "quality",
there is no attribute "width"
there is no attribute "height",
there is no attribute "align",
there is no attribute "bgcolor",
there is no attribute "name"
please see the source code:
<embed src="<?php info(template_directory); ?>/images/top-flash.swf"
quality="high" bgcolor="#000099"
width="960" height="362"
name="flash" align="left"
allowScriptAccess="sameDomain"
allowFullScreen="false"
wmode="transparent"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
vspace="0" hspace="0"
style="padding:0; margin:0;" />
Please help me to pass this validation.
As #MichaelWagner has stated, element is really "not defined in XHTML 1.0 Transitional standard".
However, another solution could be to not changing the doctype, but changing the embed to object.
Thus Your code for including a .swf file could look like this:
<object type="application/x-shockwave-flash" data="TEMPLATE_DIRECTORY/images/top-flash.swf" width="960" height="362" name="flash" align="left" style="padding:0; margin:0;">
<param name="movie" value="TEMPLATE_DIRECTORY/images/top-flash.swf" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowfullscreen" value="false" />
<param name="bgcolor" value="#000099" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
Get Adobe Flash Player
</object>
Results in:
This document was successfully checked as XHTML 1.0 Transitional!
The following transformations apply (from embed to object):
allowScriptAccess="sameDomain" > <param name="allowScriptAccess"
value="sameDomain" />
allowFullScreen="false" > <param name="allowfullscreen"
value="false" />
bgcolor="#000099" > <param name="bgcolor" value="#000099" />
quality="high" > <param name="quality" value="high" />
wmode="transparent" > <param name="wmode" value="transparent" />
pluginspage="http://www.macromedia.com/go/getflashplayer" > Get Adobe Flash Player
Don't forget to change TEMPLATE_DIRECTORY/images/top-flash.swf to the original <?php info(template_directory); ?>/images/top-flash.swf
The embed element is not defined in XHTML1.0 Transitional standard. You have to remove the element or change your doctype to pass the test.

FLVPlayback Flash Skin not showing in wordpress

Im trying to insert a flash video with controls in my website. I can see the video but not the controls with FLVPlayback. I put all my files at the same level of my page, so i shouldnt have a path error...
Heres my files:
Confr.flv
Confr.swf
MinimaFlatCustomColorPlayBackSeekCounterVolMute.swf (playerSkin)
My code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="667" height="410" id="Confr" align="middle">
<param name="movie" value="http://unikmedia.ca/ad/wp-content/themes/adapte/Confr.swf" />
<param name="quality" value="best" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="false" />
<param name="loop" value="false" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="http://unikmedia.ca/ad/wp-content/themes/adapte/Confr.swf" width="667" height="410">
<param name="movie" value="http://unikmedia.ca/ad/wp-content/themes/adapte/Confr.swf" />
<param name="quality" value="best" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="false" />
<param name="loop" value="false" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
If you look at this link, you can see the player :http://unikmedia.ca/ad/wp-content/themes/adapte/Confr.swf
But in the wordpress, no controls at all... : http://unikmedia.ca/ad/a-propos/
Please I need help !!!
I had the same problem, and I found the solution... change the "swf BASE directory" in your embeded swf object. With this parameter pointing to your swf directory, the FLVPlayBack will be able to find the control skin swf.
Here's a sample:
<script type="text/javascript">
var flashvars = {};
var params = {"base": "../project/subfolder/"};
var attributes = {id: "Main", name: "Main"};
swfobject.embedSWF("MainLoader.swf", "myAlternativeContent", "920", "550", "10.0.0", "expressInstall.swf", flashvars, params, attributes);
</script>
Your file MinimaFlatCustomColorPlayBackSeekCounterVolMute.swf get an 404 error.
Try to find the script who call this file and change it.
But i suggest you to convert the .swf movie to an .mp4 and use jwplayer if its possible.
You can also try to create an 'a-propos' folder at the root of the site, like 'wp-content' folder, and put your 'MinimaFlatCustomColorPlayBackSeekCounterVolMute.swf' file in it
I was having the same issue, in my local workspace I could see it, but on the WP live site I couldn't. In my case I solved it by changing the permissions of the skin swf, try changing the chmod to 777 (of just skin swf file) to see if that's the issue.

How to allow embed inline tags in TinyMCE

I have TinyMCE control on my page ( asp.net page ). I'm trying to edit html and insert embed tags, but as soon as I switch to WYSIWYG mode, and then back to html edit mode, I can see that embed tags were cleared out, and added as a new PARAM inline tags for the OBJECT tag. Here's example html
<OBJECT id=ETFflash1016 codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 width=345 align=middle height=230>
<PARAM NAME="ProfileAddress" VALUE="">
<PARAM NAME="ProfilePort" VALUE="0">
<PARAM NAME="AllowNetworking" VALUE="all">
<PARAM NAME="AllowFullScreen" VALUE="false">
<PARAM NAME="AllowFullScreenInteractive" VALUE="false">
<PARAM NAME="IsDependent" VALUE="0">
<embed src="/video/ETFflash1016.swf.cms" quality="high" bgcolor="#ffffff" width="345" height="230" name="ETFflash1016" align="left" allowScriptAccess="sameDomain" allowFullScreen="false" wmode="Transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
</OBJECT>
So this has been transformed to this
<object id="ETFflash1016" width="345" height="230" data="../../../video/ETFflash1016.swf.cms" type="application/x-shockwave-flash">
<param name="Profile" value="0" />
<param name="ProfilePort" value="0" />
<param name="AllowNetworking" value="all" />
<param name="AllowFullScreen" value="false" />
<param name="AllowFullScreenInteractive" value="false" />
<param name="IsDependent" value="0" />
<param name="src" value="../../../video/ETFflash1016.swf.cms" />
<param name="name" value="ETFflash1016" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="Transparent" />
<param name="allowfullscreen" value="false" />
<param name="quality" value="high" />
</object>
As you may have noticed, embed tag's attributes became param inline tags for object tag.
I've searched the web, and the main solution was to add media plugin, set media_strict to false, but it didn't help, so I continue to search, and came across another suggestion - use extended_valid_elements but no lack so far. Here's the init function of my TinyMCE control
tinyMCE.init({
mode: "exact",
theme: "advanced",
plugins: "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,spellchecker,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist",
media_strict: "false",
convert_urls: "false",
theme_advanced_resizing: true,");
onchange_callback : "HandleTinyEditorChange",
valid_elements : "*[*]\",
extended_valid_elements : "object[width|height|classid|codebase],param[name|value],embed[src|type|width|height|flashvars|wmode]"
});
What I'm doing wrong ? How can I make this work ?
I'm using TinyMCE v.3.9.2
So the problem turned to be ridiculous. media_strict and convert_urls accept booleans not strings, so I just had to pass boolean values to those params instead of strings, and it works like a charm.
tinyMCE.init({
mode: "exact",
theme: "advanced",
plugins: "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,spellchecker,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist",
media_strict: false,
convert_urls: false,
theme_advanced_resizing: true,");
onchange_callback : "HandleTinyEditorChange",
valid_elements : "*[*]\",
extended_valid_elements : "object[width|height|classid|codebase],param[name|value],embed[src|type|width|height|flashvars|wmode]"
});

How can I embed the swf file into asp page?

I am using the following code but it does not work:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="540" height="400" hspace="10">
<param name=movie value="http://servername/foldername/file.swf">
<param name=quality value=high><param name="LOOP" value="false">
<embed src="C:\Users\SAINI\Desktop\online\spn_20Dec\vp\images\abc.swf"
width="540" height="400" hspace="10" loop="false"
quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash">
</embed>
</object>
How can I do that?
Internet Explorer, Google Chrome, Apple safari, Mozila Firefox and ...
you need a code which work in all of them and there it is:
<object width="900" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="myMovieName" >
<param name="src" value="YOUR MOVIE ADDRESS HERE.swf" />
<param name="quality" value="autohigh" />
<param name="bgcolor" value="black" />
<param name="autostart" value="true" />
<param name="FlashVars" value="init=yes&check=true" />
<param src="flash/movie.swf" autostart="true" flashvars="init=yes&check=true"
quality="autohigh" bgcolor="#000000" name="myMovieName"/>
</object>
All you need to do is:
copy and paste this code into your project,
change the address to your clip address,
change the dimensions of clip (in first line)
Enjoy it!
I've tried your code and it works with me without any alteration except the file and its location. I placed the file inside the root of my website. Sadly it doesn't work when I place another location. I don't know the reason yet
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="540" height="400" hspace="10">
<param name=movie value="http://servername/foldername/file.swf">
<param name=quality value=high><param name="LOOP" value="false">
<embed src="xx.swf" width="540" height="400" hspace="10" loop="false" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash">
</embed> </object>

Embeded swf file with its external resources to Content asp.net page

Under Visual Studio 2010, I’m developing an asp.net application.
I added a folder to my project called Flash. Under Flash folder I added a swf file with its external resources to run.
The folder content:
1- ScrollingImages.swf file to lunch the flash
2- ScrollingImages.xml file that the swf file uses to read images from thumbnails folder
3-thumbnails folder which content images used by swf file.
I can embed the swf file to html easily using this code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="ScrollingImages" width="800" height="400" align="middle" id=" ScrollingImages">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value=" ScrollingImages.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="ScrollingImages.swf" quality="high" bgcolor="#000000" width="800" height="400" name="ScrollingImages" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
But when I use the same code to embed it to asp.net page I will have a problem that the flash will run but I cannot see the images so the swf file unable to locate the xml file and the folder of the images location and they all in the same folder.
Here is the code I used in the aspx.net content page.
<%# Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Gallary.aspx.cs" Inherits="HabibWebSite.Gallary" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="ScrollingImages" width="800" height="400" align="middle" id=" ScrollingImages">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value=" ScrollingImages.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="ScrollingImages.swf" quality="high" bgcolor="#000000" width="800" height="400" name="ScrollingImages" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</asp:Content>
I also tested it in aspx.net page and I’m getting same result no images appear.
I know that the problem is related to who to embed the swf external resources (the xml file and the images folder) to the aspx.net page but I searched a lot and I could solve it.
Please advise me how solve this problem to make the swf file work OK.
Regards,
To resolve this problem all what I need to add is base attribute to the object tag to direct to the external resources folder.
and the code should be some thing like this:
<object type="application/x-shockwave-flash" data=" Flash/ShefBio/chefs_bio.swf" width="970" height="396">
<param name="movie" value=" Flash/ShefBio/chefs_bio.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="base" value=" Flash/ShefBio/" />
<embed src=" Flash/ShefBio/chefs_bio.swf" quality="high" bgcolor="#000000" width="970" height="396" name="ScrollingImages"
align="middle" allowScriptAccess="sameDomain" base=" Flash/ShefBio/"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Resources