Home arrow Forum

Remository Forum

 


sabastina

Karma: 0  
Css image protection code - where to put it? - 2008/05/07 14:33 Greetings,

This is the most perfect script for what I had in mind - it does more than I suspected it would and the layout that my clients see is superb - WONDERFUL JOB - THANK YOU!

I realize there is a huge debate about restricting people's 'right' to download images (the whole, 'don't put it on the internet if you don't want it downloaded' debate). But my site is for artists to purchase PSP tubes to use in their own artwork, and I need to use this script to protect my display images. By using this code, I can permit visitors to see what I offer before they pay for a subscription...

That being said, I found a method that doesn't prevent my users from using the right click abilities, yet still protects my images from downloading by placing a layered transparent .gif file over my pages.

The code is here:
http://www.tech-recipes.com/web_application_programming_tips1321.html

But, I do not know how (where is more accurate) to place this script so that it will work.

I'm thinking I need to place the div insert code mentioned on that linked page in the place where the thumbnails are handled in the remository code (and I'm pretty sure I can do this if I can be sure that I'm putting it in the right place.)

But
1. I don't know that I'm correct in that assumption.
and
2. I don't know exactly where that portion of remository code would be.

If someone could let me know if I am correct in that assumption and where I would find that portion of code, I would appreciate it.

Thanks for reading this!

Sabastina
  | | Sorry, you do not currently have permission to write here.
admin

Karma: 98  
Re:Css image protection code - where to put it? - 2008/05/07 18:45 That's a neat idea! You can find all the code to do with rendering thumbnails and the larger images linked to thumbnails in the file ../p-classes/remositoryThumbnails.php. If you need more guidance, please ask. Martin Brampton aka Counterpoint
http://aliro.org
http://black-sheep-research.com
  | | Sorry, you do not currently have permission to write here.
sabastina

Karma: 0  
Re:Css image protection code - where to put it? - 2008/05/08 02:42 Thank you for the help.

This is more intimidating then I remember it being! I've worked with php a little bit, but mostly when applying hacks to phpbb forums and zencart - which means I'm used to following instructions to enter code...so I'm not able to just jump in and understand all of what I am reading, and I tend to get nervous - I think I will need a little guidance to learn how to do this (but that's the key, I would like to try to do this myself and then maybe share it with the community - if that is possible and ok?)

What I will do, is to post the remository code for the areas I think I need to work with, then while I wait for you to let me know if this is the proper code I should be looking at for this hack, I will go and study .php at w3schools.

Because I'm new at this, and wish to share it with other remository users, I want to be sure I am doing it in the proper way to make sure I don't cause errors and such...and I do appreciate your time and help very much!

Ok, I think that I need to look at this code here -because of the function displayThumbnail command line. Is this correct?

Code:

 function displayThumbnail ($item$link=true) {         if ($this->count == 0) return \'&nbsp;\';         $html \"\\n\\t\\t\\t<div class=\'remositorythumbnail\'>\";         if ($link) {             if ($this->allow_large) {                 $alt_text \'View Full Sized Screenshot\';                 if ($this->maxcount) {                     $imginfo getimagesize($this->img_paths[$item]);                     $imgw $imginfo[0]+20;                     $imgh $imginfo[1]+20;                 }                 else {                     $repository =& remositoryRepository::getInstance();                     $imgw $repository->Large_Image_Width;                     $imgh $repository->Large_Image_Height;                 }                 $imglink $this->img_URLs[$item];                 //get the x and y size of the full sized image                 $html .= \"\\n\\t\\t\\t\\t<a href=\\\"javascript:void(0)\\\" onclick=\\\"window.open(\'$imglink\',\'FullSize\',\'width=$imgw,height=$imgh,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizab le=0,copyhistory=0\')\\\">\";             }             else $alt_text \'Full screenshots disabled\';         }         else $alt_text \'Thumbnail image\';         if ($this->maxcount) {             $thinfo getimagesize($this->thumb_paths[$item]);             $thw $thinfo[0];             $thh $thinfo[1];         }         else {             $repository =& remositoryRepository::getInstance();             $thw $repository->Small_Image_Width;             $thh $repository->Small_Image_Height;         }         $thlink $this->thumb_URLs[$item];         $html .= \"\\n\\t\\t\\t\\t<img width=\\\"$thw\\\" height=\\\"$thh\\\" alt=\\\"$alt_text\\\" src=\'$thlink\' />\";         //create a thumbnail image linked to full size image         if ($link AND $this->allow_large$html .= \'</a>\';         if (isset($this->img_texts[$item])) $html .= \"\\n\\t\\t\\t\\t<div>{$this->img_texts[$item]}</div>\";         $html .= \"\\n\\t\\t\\t<!-- End of remositorythumbnail -->\";         $html .= \"\\n\\t\\t\\t</div>\";         return $html;     }     function displayOneThumbnail () {         if ($this->count == 0) return \'\';         if ($this->count 1$item rand(0,$this->count-1);         else $item 0;         if (isset($this->thumb_URLs[$item])) return $this->displayThumbnail($item);         else {             $repository =& remositoryRepository::getInstance();             return $repository->RemositoryImageURL(\'blank.gif\'$repository->Small_Image_Width$repository->Small_Image_Height);         }     }     function displayAllThumbnails () {         if ($this->count == 0) return \'\';         $html \"\\n\\t\\t\\t<div class=\'remositorythumbset\'>\";         for ($item=0$item<$this->count$item++) {             $html .= \'<div>\'.$this->displayThumbnail($item).\'</div>\'; //            if (($item+1) % _THUMBNAILS_PER_COLUMN == 0) echo \'</tr><tr><td>&nbsp;</td></tr><tr>\ ';         }         $html .= \"\\n\\t\\t\\t<!-- End of remositorythumbset -->\";         $html .= \"\\n\\t\\t\\t</div>\";         return $html;     }



I will go study php, then check back here. Once I know this is the correct code to look at, I will isolate exactly where in this code I will need to place the code - then you could tell me if that is correct for this.

Oh, would I need to create a variable for this part of the prevention code I'm using?

Code:

 $div style=\"position:absolute; top:10; left:10; width:400; height:75; z-index:1; padding:0px; border: #000000  1px solid; background-image:url(yourImage.ext);\"#$/div# 



I'm not clear how to handle this type of code so that it is limited to the Remository componet and not the entire site. It makes sense to create the variable for it because I later need to enter the following code directly to the code that calls the thumbnails...

Code:

  $div id=\"cover\"#$/div# 



Also, I figured that I needed to code the 'header' portion of the code into the index.php for Remository. I did that like this (is this the proper way to do this so that it works only for the Remository?):

Code:

 <html> <head>     style type=\"text/css\"     $!--         div#cover{ position:absolute; top:0; left:0; width:100%; height:100%; z-index:2; background-image: url(overlay.gif); image-           repeat:repeat          --     $/style </head> <body bgcolor=\"#FFFFFF\"> </body> </html>



I'm off to look into php and css for a while.

Thanks for helping with this!
  | | Sorry, you do not currently have permission to write here.
sabastina

Karma: 0  
Re:Css image protection code - where to put it? - 2008/05/09 02:45 I plan to get back to this project once I understand php and css better - I've spent 24 hours learning that I really need to spend more time learning before I try to do something this complicated.

I have to get back to getting my shop open or I'm going to have serious problems here - so this has to be put on hold.

Additionally, I had completely forgotten the single workaround that serious thieves can use (I won't mention it here though) but I don't think they can be stopped from using this particular method - therefore since stealing my images would actually put me out of business, for this particular use, I think I'll have to resort to watermarks...

But, I will try to come back here soon to work on figuring this out so it's there for other people who may need it.
  | | Sorry, you do not currently have permission to write here.
wayayeo

Karma: 0  
Re:Css image protection code - where to put it? - 2009/11/09 00:19 Any more input on adding a watermark to images?
  | | Sorry, you do not currently have permission to write here.

Login

Subscribe to Premium Support

Get priority support for Remository and Glossary, sign up now for a Premium Support monthly subscription:

Your Remository user name

Or purchase a year's support:

Your Remository user name

Recommended SEF

SEF Advance

Who is Online

Remository welcomes guests and visitors

We have 9 guest online