Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Getting Paid for Template Work, Encrypt


php4ever

Recommended Posts

How to get paid by time locking your templates

I like to get paid when hired to do a job, maybe I'm strange because of it. But when I trust someone to pay me after a project is done, it irritates me when I get burned. I rarely request a deposit unless I'm after special files, photos or other things which will incur an expense up front.

 

I recently designed an XHTML / CSS osCMax template that was to have a custom random flash rotator all fully XML controlled for a guy, which is the good part. I mean how many osCommerce sites have you seen with an XML controlled featured product rotator? None that I found. It was so clean that employees could login in, add new banners to their featured products inventory, add the link and hit submit and the slide show would cycle featured products with links. I mean how easy can it get for this person. Well I never got paid because they said they couldn't afford my work but promised they wouldn't use my code. :angry: Yeah, BS! We came up with a small php solution to stop this repeat event from happening.

 

So before you get burned by being a competent trusting coder or designer, do this; encrypt and time lock your code.

 

Anytime you want to deliver a design for a client to load up and test on his machine (common request even by scammers) you simply encrypt the code below the doctype all the way down into the <body> somewhere say about half way just for good measure. But do so ONLY AFTER you include the little snippet below.

 

How do I encrypt?

Zend and IonCube are great investments. I own a license of IonCube and its great but if you don't want to spend the $$ then use a product I purchased a few years ago that works dandy. You can visit http://www.jaredritchey.com/codelock/ and select SEGMENT on the right to paste in your PHP or HTML code type to encrypt. (REMEMBER to keep a backup of your unencrypted code. I'm not even going to tell you how foolish I was by forgetting that a year ago) So using my codelock tool on my site is fine just don't attempt to use other methods because all of the directories have been CHMOD 644 and will likely not encrypt your code.

 

So where is this time lock code?

To begin with create a file called time.php or getservertime.php and add the following PHP code to get the server time.

 

<?php
echo time();
?>

 

Next after you upload that to a server and access it in your browser you will get a long server time date back which we will use now as the "START DATE" for the time lock.

 

The code below is fully commented so you can examine it and all you do is create a expiration date like this.

 

If you want to give them 7 days to try your product then its;

7 days x 24 hours x 60 minutes x 60 seconds = 604800 for a 7 day trial

That number "604800" is going to be placed in the end trial variable. Lets look at the code below;

 

<?php
//PHP Code for timelock:
// add the following code to your project.
// the time reflects the linux / unix time using the simple echo time();
// the $start_trial time is the current time or the time I create the trial period to begin.
$start_trial = 1157044256;
// to add the trial time you multiply days times hours times minutes times seconds so
// it would be 7x24x60x60=604800 for a 7 day trial.
// add echo time(); to a file called time.php to get server time.
//$end_trial = $start_trial + 604800;
$end_trial = $start_trial + 604800;
$current_time = time();
$remaining_trial = $end_trial - $current_time;
if ($current_time > $end_trial) {
	die('Your demo has expired. Jared would like to get off the government cheese program, <a href="http://www.jaredritchey.com" target="_blank">Pay The Man!</a>  You will then receive the unlock files');
}
?>

 

Once you get your server time (AKA: start time) and enter your trial time you simply paste that code above in the header of your PHP or HTML (parsed by php) file. It can be in as many php files in your package as you like you highlight the code, copy it, paste it into the encryptor (after you save an original) you encrypt it, paste it back into your document, save it, deliver it and GET PAID. Because if you don't they get a message that instructs them to where ever you want.

 

Now I did make a version that sends you an email of the install location the first time its installed but some people get psychotic about that one. I did that when I would sell a template only to have it passed around like Paris Hilton. So I changed my method to encrypt a portion of the code by using PHP Includes and a domain lock in my templates. This saves headaches from being ripped off and it doesn't put a dent in the XHTML or CSS validation of the layout. The above method however does.

 

Is this a surefire way to solve this issue. No! any clever person can just recreate the header area of your template and any portion they feel should be required duping your efforts. However its difficult to do so and if you use dependent external includes, each encrypted as well, the task is daunting and it would be better if they just used PayPal to enjoy their new design.

 

~ Jared

Edited by php4ever

www.jaredritchey.com

Link to comment
Share on other sites

Nice.

 

It's always a good idea to protect yourself as much as possible when offering services to 3rd parties, but it seems like your taking the scenic route as far as protecting yourself is concerned. I don't understand why you don't ask for a deposit?

 

• Demand a deposit

• Have a written agreement with payment terms clearly stated

• If necessary, register your IP

 

If the client rips you off, pursue them in writing and inform them that you will take appropriate action. If they don't honour the terms of the contract take them to the small claims court.

Link to comment
Share on other sites

Nice.

 

It's always a good idea to protect yourself as much as possible when offering services to 3rd parties, but it seems like your taking the scenic route as far as protecting yourself is concerned. I don't understand why you don't ask for a deposit?

 

• Demand a deposit

• Have a written agreement with payment terms clearly stated

• If necessary, register your IP

 

If the client rips you off, pursue them in writing and inform them that you will take appropriate action. If they don't honour the terms of the contract take them to the small claims court.

 

Wicky all those things you say are true however I rarely work on small individual jobs and my price is so low as to be competitive that things like legal pursuits and small claims court would cost me more time and money than just encrypting my work until final payment. 90% of all my work is for large template houses and template clubs that buy in bulk from me. They contract for 10, 15, 20+ designs and I never have to worry about payment even though that they re brand and sell our work they can afford it.

 

I mean the average custom job is under $500+ on design and full blown projects that include custom icons, LDAP and SSL integration rarely if ever tops out above $1,000 unless I'm asked to maintain the project in a support capacity as I do for a few counties and school districts that hire us.

 

So, encryption is an easy way to just save time and I figured I'd share it with everyone in case someone ever had a need to distribute demo templates and encrypt them. I'm adding code like that to 50+ OpenRealty templates when I release them so anyone can download them and try them before they buy. Once were done with the automated serial numbering and encryption with the IonCube tool I think it will demonstrate its value well.

 

Check out the code you will find it works well for time expiring a file.

 

~ Jared

P.S. Thanks for your reply

www.jaredritchey.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...