Page 1 of 1
include embeded swf file
Posted:
March 21st, 2011, 5:35 pm
by akosgis
Hi over there
I just managed to restrict my html file via "s2Member File Download Options" and inline file extensions. So far it is function but I have a html file with some js code and embeded a swf file. And this seams a big problem because it seams that the js code get not read in wordpress.
What can i do??? There is any posibillity to make it run??
Thanks for your help
Frank
Re: include embeded swf file
Posted:
March 21st, 2011, 11:17 pm
by Cristián Lávaque
Are the JS and SWF files protected by s2Member too? If so, are they allowed file extensions?
Are the addresses to those files relative to your HTML file? If so, are they correct?
Re: include embeded swf file
Posted:
March 22nd, 2011, 5:18 am
by akosgis
Yes they are protected too. Everything I have in the s2member-files directory with subdirectories for each level. The addresses I think are correct because with a test.html file it is function so far. Also I put swf,js, into the Default Inline File Extensions.
Re: include embeded swf file
Posted:
March 22nd, 2011, 11:52 am
by Cristián Lávaque
OK.
If they are protected, the URL to them has to be served by s2Member the same way the HTML file one is.
Re: include embeded swf file
Posted:
March 22nd, 2011, 4:55 pm
by akosgis
what means this concretly?
Re: include embeded swf file
Posted:
March 22nd, 2011, 5:05 pm
by Cristián Lávaque
That the same way you format the URL to the HTML file protected by s2Member, you'd use for the JS and SWF ones. Since they are protected by s2Member, they can't be accessed directly, it has to be via s2Member.
Could you show me the URLs you're using to link to the HTML, JS and SWF files? You can remove the domain name, I'm interested in the rest.
Re: include embeded swf file
Posted:
March 22nd, 2011, 5:07 pm
by akosgis
The files I need to serve the flash (swf) are all into one folder in my case named ges_level_0 (and so on)
if I take this folder out of wordpress on the same server they work fine. So i guess it has something to do with wordpress or s2members. it seams wordpress don't read the javascript or do not accept the embeded swf files.
Is there another possibility to protect those files via s2memeber?
Re: include embeded swf file
Posted:
March 22nd, 2011, 5:15 pm
by akosgis
Thx for answering again. Look I used the download options and at the Memebership welcome page I but this code [s2If current_user_is(s2member_level0)]
Welcome to the Test Membership of Geo Evaluation System GES. Enter here for using GES
[/s2If]
with this link
http://akosgis.com/?s2member_file_downl ... evel0.htmlint the html file is some js code and embedded the swf files witch are into the same folder "ges_level_0/"
Re: include embeded swf file
Posted:
March 22nd, 2011, 6:01 pm
by Cristián Lávaque
OK.
Could you please quote the code from the HTML page where those two files are referenced? You can quote it between code tags like this: [code]The HTML code here.[/code]
Re: include embeded swf file
Posted:
March 27th, 2011, 6:56 am
by akosgis
Sorry for my late but I was on the road all the last week.
I quote the code with the code tag but it is also not function. it get shown in the browser only the body text and the head code get not executed. I also but in the js file the code tag but doesn't help. I copy your the html below maybe you get an other idea:
- Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>GES - Geo Evaluation System</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="./swfobject.js"></script>
<script type="text/javascript">
function getURLParam(strParamName) {
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 ){
var strQueryString = strHref.substr(strHref.indexOf("?"));
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
if ( aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;
}
}
}
return unescape(strReturn);
}
<!-- Adobe recommends that developers use SWFObject2 for Flash Player detection. -->
<!-- For more information see the SWFObject page at Google code (http://code.google.com/p/swfobject/). -->
<!-- Information is also available on the Adobe Developer Connection Under "Detecting Flash Player versions and embedding SWF files with SWFObject 2" -->
<!-- Set to minimum required Flash Player version or 0 for no version detection -->
var swfVersionStr = "9.0.45";
<!-- xiSwfUrlStr can be used to define an express installer SWF. -->
var xiSwfUrlStr = "";
var flashvars = {};
flashvars.location = getURLParam("l");
flashvars.data = "data.csv";
flashvars.settings = "settings.csv";
var params = {};
params.quality = "high";
params.bgcolor = "#ffffff";
params.play = "true";
params.loop = "true";
params.wmode = "window";
params.allowfullScreen ="true";
params.scale = "showall";
params.menu = "true";
params.devicefont = "false";
params.salign = "";
params.allowscriptaccess = "sameDomain";
var attributes = {};
attributes.id = "StatPlanet";
attributes.name = "StatPlanet";
attributes.align = "middle";
swfobject.createCSS("html", "height:100%; background-color: #ffffff;");
swfobject.createCSS("body", "margin:0; padding:0; overflow:hidden; height:100%;");
swfobject.embedSWF(
"StatPlanet.swf", "flashContent",
"100%", "100%",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
</script>
</head>
<body>
<!-- SWFObject's dynamic embed method replaces this alternative HTML content for Flash content when enough JavaScript and Flash plug-in support is available. -->
<div id="flashContent">
<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>
<p>This page requires Flash Player version 9.0.45 or higher.</p>
</div>
</body>
</html>
the swfobject.js which get loaded too, is a google script: SWFObject v2.2 <http://code.google.com/p/swfobject/>
Thanks for your further help.
Re: include embeded swf file
Posted:
March 27th, 2011, 5:08 pm
by Cristián Lávaque
The SWF and JS file names didn't have
http://akosgis.com/?s2member_file_download=ges_level_0/ before them, so they were not being served by s2Member. I hope that adding that before the file names solves your problem.
- Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>GES - Geo Evaluation System</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://akosgis.com/?s2member_file_download=ges_level_0/swfobject.js"></script>
<script type="text/javascript">
function getURLParam(strParamName){
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 ){
var strQueryString = strHref.substr(strHref.indexOf("?"));
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
if ( aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;
}
}
}
return unescape(strReturn);
}
<!-- Adobe recommends that developers use SWFObject2 for Flash Player detection. -->
<!-- For more information see the SWFObject page at Google code (http://code.google.com/p/swfobject/). -->
<!-- Information is also available on the Adobe Developer Connection Under "Detecting Flash Player versions and embedding SWF files with SWFObject 2" -->
<!-- Set to minimum required Flash Player version or 0 for no version detection -->
var swfVersionStr = "9.0.45";
<!-- xiSwfUrlStr can be used to define an express installer SWF. -->
var xiSwfUrlStr = "";
var flashvars = {};
flashvars.location = getURLParam("l");
flashvars.data = "data.csv";
flashvars.settings = "settings.csv";
var params = {};
params.quality = "high";
params.bgcolor = "#ffffff";
params.play = "true";
params.loop = "true";
params.wmode = "window";
params.allowfullScreen ="true";
params.scale = "showall";
params.menu = "true";
params.devicefont = "false";
params.salign = "";
params.allowscriptaccess = "sameDomain";
var attributes = {};
attributes.id = "StatPlanet";
attributes.name = "StatPlanet";
attributes.align = "middle";
swfobject.createCSS("html", "height:100%; background-color: #ffffff;");
swfobject.createCSS("body", "margin:0; padding:0; overflow:hidden; height:100%;");
swfobject.embedSWF(
"http://akosgis.com/?s2member_file_download=ges_level_0/StatPlanet.swf", "flashContent",
"100%", "100%",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
</script>
</head>
<body>
<!-- SWFObject's dynamic embed method replaces this alternative HTML content for Flash content when enough JavaScript and Flash plug-in support is available. -->
<div id="flashContent">
<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>
<p>This page requires Flash Player version 9.0.45 or higher.</p>
</div>
</body>
</html>
Re: include embeded swf file
Posted:
March 28th, 2011, 6:38 am
by akosgis
Hi Cristián, this was helping half. thank you. now its loading the swf file but it stops because it seams that the data.csv and settings.csv can not be loaded even if I give those files the same absolute path (this files are into the same folder). I included this extensions also into the s2member. I have no possibility to chance the swf file.
Is there existing any work around, like to protect a folder with s2 member which is outside of wp or a subdomain or something like this???? Because outside wp my application works fine.
You can check out the problem if you enter here:
http://akosgis.com/wp-login.php with username and password: testxx0 and you can see how it is loading correct outside of wp here:
http://ges.akosgis.com/public/web/statges.html (as a subdomain). Any suggestion would help me very much. Thank you
Re: include embeded swf file
Posted:
March 28th, 2011, 11:57 am
by Cristián Lávaque
Got it. Did you add the CSV extension to the list of allowed ones? Maybe that's the problem.
Re: include embeded swf file
Posted:
March 28th, 2011, 1:06 pm
by akosgis
Hi there, yes I did also all other used extension I added to the inline file extensions.
I also experimented a bit with different directories, for exampel to go out from the restricted folder. But nothing happens. The main point seams to be that the data.csv and the setting.csv does't load. Otherwise once they was loading but when they was finished loading it stopped which is seams like the content.swf get not loaded. It looks very curious because in normaly the all remain in the same folder, so they should be accepted with the normal relativ link like "data.csv"
Greatings Frank
Re: include embeded swf file
Posted:
March 28th, 2011, 1:25 pm
by Cristián Lávaque
Yeah, the relative location works, it's just that s2Member doesn't let them go because it's protecting them, which is why you had to use the URL format required to serve the files via s2Member.
I had not noticed those files before, was just looking for the CSV and JS ones. So you tried changing those two lines to this and it still didn't work?
- Code: Select all
flashvars.data = "http://akosgis.com/?s2member_file_download=ges_level_0/data.csv";
flashvars.settings = "http://akosgis.com/?s2member_file_download=ges_level_0/settings.csv";
Well, if you don't mind not having everything in the same folder, you could just have the HTML file protected by s2Member and the rest in another directory.
Re: include embeded swf file
Posted:
March 28th, 2011, 2:16 pm
by akosgis
Yes I did, but I also find out now, that I can not really split the files in different folders, even if I give the path in the html file. Alos I can open the programm with the content.swf only this is function outside the restricted folder but inside it is not loading. thats why i gues there is a problem loading the swf file inside the s2memeber. have a look here
http://ges.akosgis.com/public/web/content.swf and here
http://akosgis.com/?s2member_file_downl ... ontent.swf (user&pass: testxx0)
Re: include embeded swf file
Posted:
March 28th, 2011, 6:21 pm
by Cristián Lávaque
I tried every file and was able to load them all: HTML, CSV, JS and SWF.
I couldn't see what happens with the SWF in the HTML file because I keep getting the message "this page requires Flash Player version 9.0.45 or higher" although I have 10.2 installed.
When I open the SWF file all I see is the words "STAT PLANET" in red. What is it supposed to do? or is that it?
I don't know what the problem you're having is. Have you tried using a download key? WP Admin -> s2Member -> Download Options -> Advanced Download Restrictions.