No Right Click Images Plugin - Version 1.4

Version Description

  • Backed out click check on images because it broke galleries. I left it in as an option if you want to change the code.

=

Download this release

Release Info

Developer kpgraham
Plugin Icon wp plugin No Right Click Images Plugin
Version 1.4
Comparing to
See all releases

Code changes from version 1.3 to 1.4

Files changed (2) hide show
  1. no-right-click-images-plugin.php +14 -11
  2. readme.txt +4 -1
no-right-click-images-plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: No Right Click Images Plugin
4
  Plugin URI: http://www.BlogsEye.com/
5
  Description: Uses Javascript to prevent right clicking of images to help keep leaches from copying images
6
- Version: 1.3
7
  Author: Keith P. Graham
8
  Author URI: http://www.BlogsEye.com/
9
 
@@ -75,19 +75,22 @@ function kpg_no_rc_img_fixup() {
75
  // other events
76
  document.ondragstart=function(event) { return kpg_nrci_contextAll(event);}
77
  // find all the anchor tags and see if the href is an image in the content directory
78
- try {
79
- var b=document.getElementsByTagName("A");
80
- for (var i = 0; i < b.length; i++) {
81
- var hr=b[i].href;
82
- if (b[i].hostname && location.hostname) {
83
- if (b[i].hostname.toLowerCase() == location.hostname.toLowerCase()) {
84
- if (hr.indexOf('wp-content')!=-1 && (hr.indexOf('.jpg')!=-1||hr.indexOf('.png')!=-1||hr.indexOf('.gif')!=-1)) {
85
- b[i].href=null; // comment out this line if you want images to be clickable
 
 
 
86
  }
87
  }
88
  }
89
- }
90
- } catch (ee) {}
91
  }
92
  // set the onload event
93
  if (document.addEventListener) {
3
  Plugin Name: No Right Click Images Plugin
4
  Plugin URI: http://www.BlogsEye.com/
5
  Description: Uses Javascript to prevent right clicking of images to help keep leaches from copying images
6
+ Version: 1.4
7
  Author: Keith P. Graham
8
  Author URI: http://www.BlogsEye.com/
9
 
75
  // other events
76
  document.ondragstart=function(event) { return kpg_nrci_contextAll(event);}
77
  // find all the anchor tags and see if the href is an image in the content directory
78
+ var imageclick=false; // change the word false to true if you want to use this option
79
+ if (imageclick) {
80
+ try {
81
+ var b=document.getElementsByTagName("A");
82
+ for (var i = 0; i < b.length; i++) {
83
+ var hr=b[i].href;
84
+ if (b[i].hostname && location.hostname) {
85
+ if (b[i].hostname.toLowerCase() == location.hostname.toLowerCase()) {
86
+ if (hr.indexOf('wp-content')!=-1 && (hr.indexOf('.jpg')!=-1||hr.indexOf('.png')!=-1||hr.indexOf('.gif')!=-1)) {
87
+ b[i].href=null;
88
+ }
89
  }
90
  }
91
  }
92
+ } catch (ee) {}
93
+ }
94
  }
95
  // set the onload event
96
  if (document.addEventListener) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.amazon.com/gp/product/1456336584?ie=UTF8&tag=thenewjt30p
4
  Requires at least: 2.8
5
  Tested up to: 3.2
6
  Contributors: Keith Graham
7
- Stable tag: 1.3
8
 
9
  Disables right click context menu on images to help deter leeches from glomming images.
10
 
@@ -34,6 +34,9 @@ It is impossible to keep people from stealing images that appear in web pages, b
34
  = 1.3 =
35
  * Disabled links to local images (png, gif, jpg) in wp-content, preventing them from opening in a new window. This would allow these images to be saved or copied.
36
 
 
 
 
37
  == Support ==
38
  This plugin is free and I expect nothing in return. Please rate the plugin at http://wordpress.org/extend/plugins/stop-spammer-registrations-plugin/.
39
  If you wish to support my programming, please buy my Science Fiction book. The Kindle version is less thana buck.
4
  Requires at least: 2.8
5
  Tested up to: 3.2
6
  Contributors: Keith Graham
7
+ Stable tag: 1.4
8
 
9
  Disables right click context menu on images to help deter leeches from glomming images.
10
 
34
  = 1.3 =
35
  * Disabled links to local images (png, gif, jpg) in wp-content, preventing them from opening in a new window. This would allow these images to be saved or copied.
36
 
37
+ = 1.4 =
38
+ * Backed out click check on images because it broke galleries. I left it in as an option if you want to change the code.
39
+
40
  == Support ==
41
  This plugin is free and I expect nothing in return. Please rate the plugin at http://wordpress.org/extend/plugins/stop-spammer-registrations-plugin/.
42
  If you wish to support my programming, please buy my Science Fiction book. The Kindle version is less thana buck.