Protect your Content and Copyright
Earlier we spoke about issues of people hotlinking images. Today we wanted to share some scripts and ideas to protect your copyright and your content. We must stress there are no guarantees or foolproof solutions once you put something online, but some of these actions will make it harder to steal your content.
There a couple of ways to stop theft of written content online. One way is to limit the RSS feed to a summary, and to include a copyright notice. Another way to protect your text is include a “no right click script” to your page. Use the below script. Place it in the head area of your page. This does not stop someone from using view source from the toolbar to steal your content or if they visit with JavaScript turned off, but it does present a hurdle to the non-technical thief.
<script language="JavaScript">
var message="";
function clickIE()
{if (document.all)
{(message);return false;}}
function clickNS(e) {
if
(document.layers||(document.getElementById&&!document.all))
{
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document. onmousedown=clickNS;}
else
{document.onmouseup=clickNS;document.oncontextmenu =clickIE;}
document.oncontextmenu=new Function("return false")
</script>
One other tip is to use obfuscation. For the uninitiated, an obfuscation script will take your HTML and Javascript and make it unreadable to the human eyes in the “view source” mode while the browser will still be able to read it. Each obfuscation script has it’s varying degrees of difficulty to crack. Some use a key, others are simple and straightforward. You can find over a dozen with a simple search. Just remember, using an obfuscator could make it difficult to make easy changes to your content later on, because you will need to decode it first.
Now that we have covered some of the solution for words, we can now move onto images. When it comes to images, there is a different solution than no right click or obfuscation, because peopel can still copy the image through a “screen print” or “screen capture”. The most common way to protect image theft, then it via a watermark. The easiest way to implement Watermarks is by using the below script:
<?php
// this script creates a watermarked image from an image file - can be a .jpg .gif or .png file
// where watermark.gif is a mostly transparent gif image with the watermark - goes in the same directory as this script
// where this script is named watermark.php
// call this script with an image tag
// <img src="watermark.php?path=imagepath"> where path is a relative path from the document root - such as subdirectory/image.jpg
$imagesource = $_SERVER['DOCUMENT_ROOT'] . "/" . $_GET['path'];
if (!file_exists($imagesource)) die();
$filetype = strtolower(substr($imagesource,strlen($imagesource)-4,4));
if($filetype == ".gif") $image = @imagecreatefromgif($imagesource);
if($filetype == ".jpg") $image = @imagecreatefromjpeg($imagesource);
if($filetype == ".png") $image = @imagecreatefrompng($imagesource);
if (empty($image)) die();
$watermark = @imagecreatefromgif('watermark.gif');
$imagewidth = imagesx($image);
$imageheight = imagesy($image);
$watermarkwidth = imagesx($watermark);
$watermarkheight = imagesy($watermark);
$startwidth = (($imagewidth - $watermarkwidth)/2);
$startheight = (($imageheight - $watermarkheight)/2);
imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight);
header("Content-type: image/jpeg");
imagejpeg($image);
imagedestroy($image);
imagedestroy($watermark);
?>
Make sure to name this script watermark.php and call this script on each page you need it:
<img src="watermark.php?path=image_name.filetype">
the only thing you need to chage is “image_name.filetype” and of course you can have the relative path such as:
<img src="folder/watermark.php?path=folder/imagename">
The caution here is the script watermark.php and watermark.gif should be in the same location. watermark.gif should have transparent background.
The location where the watermark.gif appears can be modified by adjusting this line of the code:
$startwidth = (($imagewidth - $watermarkwidth)/2);
$startheight = (($imageheight - $watermarkheight)/2);
To have it appear on the bottom right corner, try this:
$startwidth = (($imagewidth - $watermarkwidth) );
$startheight = (($imageheight - $watermarkheight) );
You can also make the original images inaccessible if you put the following lines in a .htaccess file in the directory with the images:
RewriteEngine On
RewriteCond %{REQUEST_URI} !error.gif$ RewriteRule \.(gif|jpg|png)$ /error.gif [L]
This will redirect any attempt to directly access an image in that directory to the error image specified. Note that the error image is specified on two lines in the .htaccess file. The first line allows the error image to bypass the rewrite.
To give credit where due, we found this watermark script here.
The main point of all of this is to protect copyright. To make sure it is clear for your visitors is to let them know with a message on each page. The easiest way is to include a firm and updated copyright notice. You can use the below script will always show the correct year:
<?php
echo "Copyright ©";
echo date("Y");
echo ", Your site. All rights reserved";
?>
For more clarity, you should also add a link to a more detailed Copyright page, or add text that cuts through the ambiguity with strong and direct wording. Something along the lines of : All full copyright rights are reserved by this site. Small excerpts and links are allowed only when full credit/attribution is given to oursite.com
All these steps, as we mentioned are not guarantees, but they can reduce theft which is the goal. You should also consider monitoring your site using a “Google Alert” to scan for your name or blog name/title in Google’s Index, to ensure your site’s written content is not being stolen.
What to do if your content is stolen?
Should you find your content stolen, below are the steps to use:
-Identify the Source : Who stole the content?
-Contact the Content Thief: Email them via contact page, via emial or use Whois.
The goal is to inform them of the theft, or that you are aware. Yu should be firm but polite and ask for either removal, correction, modification, and/or compensation for stolen material.
-If this does not work, you may send them a Cease and Desist Order,contact their advertisers, contact their host and so forth. Lorelle has a great article expanding on the subject.
Content theft is a never-ending battle, but by taking the above steps, you can make a small attempt at slowing it down.
Print This Post
