Community Support Forums — WordPress® ( Users Helping Users ) — 2011-06-02T20:27:57-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=6663 2011-06-02T20:27:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6663&p=16589#p16589 <![CDATA[Re: Calling s2Member from external PHP]]> you for sharing that! I'm sure others will find it very helpful when they try to do something similar. :)

Statistics: Posted by Cristián Lávaque — June 2nd, 2011, 8:27 pm


]]>
2011-06-02T16:36:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6663&p=16577#p16577 <![CDATA[Re: Calling s2Member from external PHP]]>
Code:
   require_once("/wordpress_root_dir/wp-load.php");
   $download_key = $_GET["s2member_file_download_key"];

   if($download_key){
      echo "<p>Download key: $download_key</p>";
      
      $verified_key = c_ws_plugin__s2member_files::file_download_key ('Module1.html');
      $file_download_key_is_valid = $download_key === $verified_key;
      
      echo "<p>Verified key: $verified_key</p>";
   }else{
      // No download key provided
      $file_download_key_is_valid = false;
   }   

   if($file_download_key_is_valid)
      echo "Valid";
   else
      echo "Invalid";


In my case I hardcoded the filename as 'Module1.html', and only pass in the key which is also generated based on the same filename. Seems to work well.

Thanks Christian

Statistics: Posted by replaysMike — June 2nd, 2011, 4:36 pm


]]>
2011-06-02T16:02:53-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6663&p=16575#p16575 <![CDATA[Re: Calling s2Member from external PHP]]>
Code:
   require_once("../../wp-load.php");
   get_header();
   echo "Custom PHP page outside of wordpress.<br/><br/>";
   echo "<p>".s2member_file_download_key('mydownloadfile.zip')."</p>";
   get_footer();

Statistics: Posted by replaysMike — June 2nd, 2011, 4:02 pm


]]>
2011-06-02T13:23:05-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6663&p=16559#p16559 <![CDATA[Re: Calling s2Member from external PHP]]> http://www.google.com/search?q=use+word ... on+outside

Statistics: Posted by Cristián Lávaque — June 2nd, 2011, 1:23 pm


]]>
2011-06-01T23:47:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6663&p=16545#p16545 <![CDATA[Calling s2Member from external PHP]]>
Is it possible to call into s2Member's API functions or internal functions from an external PHP file?

I've got some files that I am unable to protect using the file_download_key/s2member_file_download method as they are SWF files that load other SWF files, and I can't control the absolute path from which they load. So they can't reside inside the s2member-files directory.

My plan was to simply create a wrapper PHP file which is already being passed a generated file_download_key, but I have no way to validate that key as I'm not sure which PHP files to include to access the library.

Help? :? Thanks!

Mike

Statistics: Posted by replaysMike — June 1st, 2011, 11:47 pm


]]>