PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

include embeded swf file

s2Member Plugin. A Membership plugin for WordPress®.

include embeded swf file

Postby akosgis » March 21st, 2011, 5:35 pm

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
User avatar
akosgis
Registered User
Registered User
 
Posts: 9
Joined: March 21, 2011

Re: include embeded swf file

Postby Cristián Lávaque » March 21st, 2011, 11:17 pm

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?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: include embeded swf file

Postby akosgis » March 22nd, 2011, 5:18 am

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.
User avatar
akosgis
Registered User
Registered User
 
Posts: 9
Joined: March 21, 2011

Re: include embeded swf file

Postby Cristián Lávaque » March 22nd, 2011, 11:52 am

OK.

If they are protected, the URL to them has to be served by s2Member the same way the HTML file one is.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: include embeded swf file

Postby akosgis » March 22nd, 2011, 4:55 pm

what means this concretly?
User avatar
akosgis
Registered User
Registered User
 
Posts: 9
Joined: March 21, 2011

Re: include embeded swf file

Postby Cristián Lávaque » March 22nd, 2011, 5:05 pm

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.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: include embeded swf file

Postby akosgis » March 22nd, 2011, 5:07 pm

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?
User avatar
akosgis
Registered User
Registered User
 
Posts: 9
Joined: March 21, 2011

Re: include embeded swf file

Postby akosgis » March 22nd, 2011, 5:15 pm

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.html
int the html file is some js code and embedded the swf files witch are into the same folder "ges_level_0/"
User avatar
akosgis
Registered User
Registered User
 
Posts: 9
Joined: March 21, 2011

Re: include embeded swf file

Postby Cristián Lávaque » March 22nd, 2011, 6:01 pm

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]
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: include embeded swf file

Postby akosgis » March 27th, 2011, 6:56 am

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.
User avatar
akosgis
Registered User
Registered User
 
Posts: 9
Joined: March 21, 2011

Re: include embeded swf file

Postby Cristián Lávaque » March 27th, 2011, 5:08 pm

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>
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: include embeded swf file

Postby akosgis » March 28th, 2011, 6:38 am

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
User avatar
akosgis
Registered User
Registered User
 
Posts: 9
Joined: March 21, 2011

Re: include embeded swf file

Postby Cristián Lávaque » March 28th, 2011, 11:57 am

Got it. Did you add the CSV extension to the list of allowed ones? Maybe that's the problem.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: include embeded swf file

Postby akosgis » March 28th, 2011, 1:06 pm

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
User avatar
akosgis
Registered User
Registered User
 
Posts: 9
Joined: March 21, 2011

Re: include embeded swf file

Postby Cristián Lávaque » March 28th, 2011, 1:25 pm

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.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: include embeded swf file

Postby akosgis » March 28th, 2011, 2:16 pm

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)
User avatar
akosgis
Registered User
Registered User
 
Posts: 9
Joined: March 21, 2011

Re: include embeded swf file

Postby Cristián Lávaque » March 28th, 2011, 6:21 pm

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.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron