ionCube Logo
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


 
Post new topic   Reply to topic    ionCube Forum Index -> ionCube PHP Encoder

Loader API document

Author Message
TheWebGuy



Joined: 19 Jun 2005
Posts: 20

PostPosted: Sun Jun 19, 2005 2:39 am    Post subject: Loader API document Reply with quote

Hi there,

Is it possible to get a copy of the loader API document mentioned previously ? I'm trying to get information about the expiry date to display from within an encoded script to allow users to see how long their trial still has to run.

Thanks,

Will.
Back to top
View user's profile Send private message Visit poster's website
ckh



Joined: 27 Mar 2005
Posts: 49

PostPosted: Sun Jun 19, 2005 9:38 am    Post subject: Reply with quote

Well, since I just went through this, I'll post what I'm doing to display the expiry date.

Background. All of my files are encoded. For the trial, I only encode 3 files with a 30 day expiration. They are header.php, header2.php, config.php. All three are included/required at some point in the rest of the files. If a person buys, then they only need to replace those three files and they are off and running again.

My config.php originally didn't have any variables in it and this is where I decided to add the variables for the encoding time/expiration time. The code I added is:

Code:

$expiry_date = ioncube_file_info();  //gets the array
$encoded_date=date("F j, Y",$expiry_date['ENCODING_TIME']);  //Encoding date Month day, year
$demo_expiry_date = date("F j, Y",$expiry_date['FILE_EXPIRY']);  Expiration date Month day, year
$encoded_stamp=$expiry_date['ENCODING_TIME']; //unix timestamp of the encoding time
$demo_expiry_stamp=$expiry_date['FILE_EXPIRY'];  //unix timestamp of the expiration date


If there is no expiry date, the timestamp will be 0. If there is then the timestamp will be greater than 0.

In my index.php, it requires the header.php which requires the config.php.

Since the index.php is the exact same file for both the trial and paid version, I only wanted the expiration to display for the trial. So I added this to my index.php:

Code:

if ($demo_expiry_stamp > 0){
echo "<p class=\"heading\">TrkIt Trial Version</p>";
echo "<p>This is the Trial Version.&nbsp; It will expire on <strong><font color=\"#FF0000\">".$demo_expiry_date."</font></strong> at which time, it will cease to function.&nbsp; To upgrade, please go to:</p>";
echo "<p><a href=\"http://mydomain.com\">http://mydomain.com</a></p>";
echo "<p>The upgrade consists of replacing 3 files.&nbsp; None of your data will be lost.</p>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "  <tr>";
echo "    <td>Trial Delivery Date:</td>";
echo "    <td>&nbsp;&nbsp;$encoded_date</td>";
echo "  </tr>";
echo "  <tr>";
echo "    <td><font color=\"#FF0000\">Trial Expiration Date:</font></td>";
echo "    <td><font color=\"#FF0000\">&nbsp;&nbsp;$demo_expiry_date</font></td>";
echo "  </tr>";
echo "</table>";
}



That will only display now if there is an expiration date in my config.php file. My trials last for 30 days and when I encode it, I'll email the download link to the client, so my 'Delivery Date' would be the same as the encoding date.

Of course this could all be done within one file. This method works the best for me and my clients in this situation as after installation of the trial, there is only a simple 3 file replacement and they are off and running again.

Chris
Back to top
View user's profile Send private message
TheWebGuy



Joined: 19 Jun 2005
Posts: 20

PostPosted: Sun Jun 19, 2005 9:44 am    Post subject: Thanks Reply with quote

That's very helpful, Chris. Much appreciated.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> ionCube PHP Encoder All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum