Disabling right click
Submitted by kpe on Fri, 2007-12-14 12:37.
Hi everyone, i started using PHPAlbum this morning and cannot find a way to prevent users from saving the photos to their computer. this is quite an important feature i need because i work in a school and many of the pictures may have students in them. Any advice on protecting these pictures would be much appreciated.
Thanks in advance,
Kieran

When people want the
When people want the pictures, there will always be some way to get them. A disabbled right click won't help. Most of the pictures are also stored in the cache of your browser. I've read that the only way of not getting your pictures 'stolen' is by not publishing them on the internet.
Joep Meijer
Using phpAlbum on
fotos.vanjoep.nl
spoorzoekerfotos.vanjoep.nl
i do realise that, its even
i do realise that, its even possible to just press the print screen button most of the time...but i need to take the neccessary steps to ensure photos of students are safe...everything on the site would be to school standards so there is no real danger if people download these photos...but i have to do whatever i can anyway.
I found an HTML code that disabled right click for my normal web pages, would it work the same way if i entered a PHP right click blocker in to the "main.php" document?
Don't even touch main.php
Don't even touch main.php :)!
You should edit the template files in themes/name_of_your_theme
album.tpl.php and imageview.tpl.php are the right places where you can put your own html code.
Patrik
Thanks Patrik, i will have a
Thanks Patrik, i will have a look at those files as soon as a get a chance.
Maybe is putting a
Maybe is putting a transparent overlay an option. When they want to download the picture, they download a transparent image.
I've found a website where this is discribed. Perhaps it is of some use for you and maybe even an idea as extra option in phpAlbum.
http://www.nickjarman.com/web-development/preventing-website-content-theft-images
Joep Meijer
Using phpAlbum on
fotos.vanjoep.nl
spoorzoekerfotos.vanjoep.nl
Thanks for the link :) i
Thanks for the link :) i tried your advice but didnt have much luck (mainly due to my lack of php knowledge) i will keep playing with it and post back here if i get it working. Thanks a lot for your help
Kieran, i've been playing
Kieran, i've been playing around with the script i posted before in this thread and when you place
<? echo ' < img src= "transparent.gif" alt=" '. $short_desc. ' " '.
'style=" width:'. $width.'px; '.
'height:'. $height.'px; '.
'background: url('.$image.')"';?> border="1" style="border-color: #888888;"/>
in imageview.tpl.php in the place of
< img alt="<? print $short_desc;?>" width="<? print $width;?>" height="<? print $height;?>" src="<? print $image;?>" border="1" style="border-color: #888888;"/>
This is around line 90 in the script.
I had to put some spaces behind the '<', but i don't think it makes much difference in the script if they are there.
and place a transparent gif image in the main-folder it should work. This image can be a 1x1 pixel size. You can even make an overlay image with a copyright-notice on it.
But most important thing, make a backup first, just in case.
b.t.w. On my page http://fotos.vanjoep.nl i've placed an example. when you chose an album and pick a picture, you'll see a roadrunner image over the original.
If you are using a non-modified script of PA, I can even mail you a changed version of it.
Let me know if this is of any good to you.
And another option, my sister pointed it to me, is to disable the saving of original picture
Joep Meijer
Using phpAlbum on
fotos.vanjoep.nl
spoorzoekerfotos.vanjoep.nl
I am using a non-modified
I am using a non-modified album at the moment but i will still try the chganging the code first so that i learn more from it. I'll post back here to let you know if i got it to work :)
and i will also look for that feature your sister found! Sounds useful.
Kieran, This can be found in
Kieran,
This can be found in the groups setup page. You must click on the items you want to disable for the specific usergroup i.e guest or family. THis however doesn't disable the possibility to right click on the image and download it to your computer.
---
Joep Meijer
Using phpAlbum on
fotos.vanjoep.nl
spoorzoekerfotos.vanjoep.nl
I tried your code and advice
I tried your code and advice on my own pages and it displayed the code rather than my pictures, if i send you a message with my email address could you mail me the file/code so i can compare them please? your help is much appreciated :)
That's oke. But parhaps it's
That's oke. But parhaps it's usefull to say what theme you use.
You can contact me at
fotos @ vanjoep.nl without the spaces around @
or via the contactpage by clicking on my name
---
Joep Meijer
Using phpAlbum on
fotos.vanjoep.nl
spoorzoekerfotos.vanjoep.nl
Not sure if this helps, but
Not sure if this helps, but the code worked for me. The one thing I had to tweak is to remove the spacing between "< img" at "<? echo ' < img src=" location. It worked perfect after that :)
p.s. can't type in "< img" with no space in between since the post thinks it's HTML tag.
Regards,
Jimmy
I now know that it makes a
I now know that it makes a difference, spaces or no spaces after <
---
Joep Meijer
Using phpAlbum on
fotos.vanjoep.nl
spoorzoekerfotos.vanjoep.nl
It worked! :D
Thanks for all your help. Joep sent me the php file with the correct code...i think mine didnt work because i missed a space.
Thanks for all your help guys,
Kieran
You're welcome. --- Joep
You're welcome.
---
Joep Meijer
Using phpAlbum on
fotos.vanjoep.nl
spoorzoekerfotos.vanjoep.nl
Removed Roadrunner image
Because I got a little bit crazy of the moving Roadrunner I've replaced it with a transparent image. So it's not possible to see what the script does. You now only notice it when you try to download an image with the right click.
---
Joep Meijer
Using phpAlbum on
fotos.vanjoep.nl
spoorzoekerfotos.vanjoep.nl
ok
exit your name and die
and now you are exiting :)
and now you are exiting :)