No Right Click Images Plugin - Version 1.3

Version Description

  • 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.

=

Download this release

Release Info

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

Code changes from version 1.2 to 1.3

Files changed (2) hide show
  1. no-right-click-images-plugin.php +31 -46
  2. readme.txt +12 -12
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.2
7
  Author: Keith P. Graham
8
  Author URI: http://www.BlogsEye.com/
9
 
@@ -23,6 +23,7 @@ function kpg_no_rc_img_fixup() {
23
  ?>
24
  <script language="javascript" type="text/javascript">
25
  // <!--
 
26
  // No Right Click Images Plugin
27
  function kpg_nrci_context(event) {
28
  //alert("context");
@@ -73,7 +74,20 @@ function kpg_no_rc_img_fixup() {
73
  document.oncontextmenu=function(event) { return kpg_nrci_contextAll(event);}
74
  // other events
75
  document.ondragstart=function(event) { return kpg_nrci_contextAll(event);}
76
-
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  }
78
  // set the onload event
79
  if (document.addEventListener) {
@@ -90,6 +104,7 @@ function kpg_no_rc_img_fixup() {
90
  };
91
  }
92
  // end of No Right Click Images Plugin
 
93
  // -->
94
  </script>
95
 
@@ -105,55 +120,25 @@ function kpg_no_rc_img_control() {
105
 
106
  <div class="wrap">
107
  <h2>No Right Click Images Plugin</h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  <h4>The No Right Click Images Plugin is installed and working correctly.</h4>
109
  <p>This plugin installs some javascript in the footer of every page. When your page finishes loading, the javascript steps through the tags on the page looking for Images and sets them so the context menu won't appear.</p>
110
  <p>There are no configurations options. The plugin is on when it is installed and enabled. To turn it off just disable the plugin from the plugin menu.. </p>
111
 
112
  <hr/>
113
- <h3>If you like this plugin, why not try out these other interesting plugins.</h3>
114
- <?php
115
- // list of plugins
116
- $p=array(
117
- "facebook-open-graph-widget"=>"The easiest way to add a Facebook Like buttons to your blog' sidebar",
118
- "threat-scan-plugin"=>"Check your blog for virus, trojans, malicious software and other threats",
119
- "open-in-new-window-plugin"=>"Keep your surfers. Open all external links in a new window, automatically.",
120
- "youtube-poster-plugin"=>"Automagically add YouTube videos as posts. All from inside the plugin. Painless, no heavy lifting.",
121
- "permalink-finder"=>"Never get a 404 again. If you have restructured or moved your blog, this plugin will find the right post or page every time",
122
- );
123
- $f=$_SERVER["REQUEST_URI"];
124
- // get the php out
125
- $ff=explode('page=',$f);
126
- $f=$ff[1];
127
- $ff=explode('/',$f);
128
- $f=$ff[0];
129
- foreach ($p as $key=>$data) {
130
- if ($f!=$key) {
131
- $kk=urlencode($key);
132
- ?><p>&bull;<span style="font-weight:bold;"> <?PHP echo $key ?>: </span> <a href="plugin-install.php?tab=plugin-information&plugin=<?PHP echo $kk ?>&TB_iframe=true&width=640&height=669">Install Plugin</a> - <span style="font-style:italic;font-weight:bold;"><?PHP echo $data ?></span></p><?PHP
133
- }
134
- }
135
- ?>
136
-
137
-
138
- <hr/>
139
-
140
- <p>This plugin is free and I expect nothing in return. However, a link on your blog to one of my personal sites would be appreciated.</p>
141
-
142
-
143
- <p>Keith Graham</p>
144
- <p><a target="_blank" href="http://www.cthreepo.com/blog">Wandering Blog </a>(My personal Blog) <br />
145
- <a target="_blank" href="http://www.cthreepo.com">Resources for Science Fiction</a> (Writing Science Fiction) <br />
146
- <a target="_blank" href="http://www.jt30.com">The JT30 Page</a> (Amplified Blues Harmonica) <br />
147
- <a target="_blank" href="http://www.harpamps.com">Harp Amps</a> (Vacuum Tube Amplifiers for Blues) <br />
148
- <a target="_blank" href="http://www.blogseye.com">Blog's Eye</a> (PHP coding) <br />
149
- <a target="_blank" href="http://www.cthreepo.com/bees">Bee Progress Beekeeping Blog</a> (My adventures as a new beekeeper) </p>
150
- </div
151
-
152
- >
153
- <form method="post" action="options.php">
154
- <?php settings_fields( 'myoption-group' ); ?>
155
-
156
- </form>
157
  <?php
158
  }
159
  // no unistall because I have not created any meta data to delete.
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
 
23
  ?>
24
  <script language="javascript" type="text/javascript">
25
  // <!--
26
+ /* <![CDATA[ */
27
  // No Right Click Images Plugin
28
  function kpg_nrci_context(event) {
29
  //alert("context");
74
  document.oncontextmenu=function(event) { return kpg_nrci_contextAll(event);}
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) {
104
  };
105
  }
106
  // end of No Right Click Images Plugin
107
+ /* ]]> */
108
  // -->
109
  </script>
110
 
120
 
121
  <div class="wrap">
122
  <h2>No Right Click Images Plugin</h2>
123
+ <div style="position:relative;float:right;width:35%;background-color:ivory;border:#333333 medium groove;padding-left:6px;">
124
+
125
+ <p>This plugin is free and I expect nothing in return. If you would like to support my programming, you can buy my book of short stories.</p><p>Some plugin authors ask for a donation. I ask you to spend a very small amount for something that you will enjoy. eBook versions for the Kindle and other book readers start at 99&cent;. The book is much better than you might think, and it has some very good science fiction writers saying some very nice things. <br/>
126
+ <a target="_blank" href="http://www.amazon.com/gp/product/1456336584?ie=UTF8&tag=thenewjt30page&linkCode=as2&camp=1789&creative=390957&creativeASIN=1456336584">Error Message Eyes: A Programmer's Guide to the Digital Soul</a></p>
127
+ <p>A link on your blog to one of my personal sites would also be appreciated.</p>
128
+ <p><a target="_blank" href="http://www.WestNyackHoney.com">West Nyack Honey</a> (I keep bees and sell the honey)<br />
129
+ <a target="_blank" href="http://www.cthreepo.com/blog">Wandering Blog </a> (My personal Blog) <br />
130
+ <a target="_blank" href="http://www.cthreepo.com">Resources for Science Fiction</a> (Writing Science Fiction) <br />
131
+ <a target="_blank" href="http://www.jt30.com">The JT30 Page</a> (Amplified Blues Harmonica) <br />
132
+ <a target="_blank" href="http://www.harpamps.com">Harp Amps</a> (Vacuum Tube Amplifiers for Blues) <br />
133
+ <a target="_blank" href="http://www.blogseye.com">Blog&apos;s Eye</a> (PHP coding) <br />
134
+ <a target="_blank" href="http://www.cthreepo.com/bees">Bee Progress Beekeeping Blog</a> (My adventures as a new beekeeper) </p>
135
+ </div>
136
  <h4>The No Right Click Images Plugin is installed and working correctly.</h4>
137
  <p>This plugin installs some javascript in the footer of every page. When your page finishes loading, the javascript steps through the tags on the page looking for Images and sets them so the context menu won't appear.</p>
138
  <p>There are no configurations options. The plugin is on when it is installed and enabled. To turn it off just disable the plugin from the plugin menu.. </p>
139
 
140
  <hr/>
141
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  <?php
143
  }
144
  // no unistall because I have not created any meta data to delete.
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === No Right Click Images Plugin ===
2
  Tags: images, image, right click, stealing
3
- Donate link: https://online.nwf.org/site/Donation2?df_id=6620&6620.donation=form1
4
- Requires at least: 2.2
5
- Tested up to: 3.0
6
  Contributors: Keith Graham
7
- Stable tag: 1.2
8
 
9
  Disables right click context menu on images to help deter leeches from glomming images.
10
 
@@ -24,18 +24,18 @@ It is impossible to keep people from stealing images that appear in web pages, b
24
 
25
  = 1.0 =
26
  * initial release
 
27
  = 1.1 =
28
  * deleted some unused code in the javascript
 
29
  = 1.2 =
30
  * Added code that works when javascript creates or loads a new image. Disabled drag and drop on images so images can't be dragged to desktop.
31
 
 
 
32
 
33
  == Support ==
34
- This plugin is in active development. All feedback is welcome on "<a href="http://www.blogseye.com/" title="Wordpress plugin: No Right Click Images Plugin">program development pages</a>".
35
- Other plugins:
36
- <a href="http://wordpress.org/extend/plugins/permalink-finder/">Permalink Finder Plugin</a>
37
- <a href="http://wordpress.org/extend/plugins/outbound-click-tracker/">Outbound Link Tracker</a>
38
- <a href="http://wordpress.org/extend/plugins/open-in-new-window-plugin/">No Right Click Images Plugin</a>
39
- <a href="http://wordpress.org/extend/plugins/recent-google-searches-widget/stats/">Recent Google Searches Widget</a>
40
- <a href="http://wordpress.org/extend/plugins/looser-search-plugin/">Looser Search</a>
41
- <a href="http://wordpress.org/extend/plugins/keywords-widget/">Keywords Widget</a>
1
  === No Right Click Images Plugin ===
2
  Tags: images, image, right click, stealing
3
+ Donate link: http://www.amazon.com/gp/product/1456336584?ie=UTF8&tag=thenewjt30page&linkCode=as2&camp=1789&creative=390957&creativeASIN=1456336584
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
 
24
 
25
  = 1.0 =
26
  * initial release
27
+
28
  = 1.1 =
29
  * deleted some unused code in the javascript
30
+
31
  = 1.2 =
32
  * Added code that works when javascript creates or loads a new image. Disabled drag and drop on images so images can't be dragged to desktop.
33
 
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.
40
+ <a href="http://www.amazon.com/gp/product/1456336584?ie=UTF8&tag=thenewjt30page&linkCode=as2&camp=1789&creative=390957&creativeASIN=1456336584">Error Message Eyes: A Programmer's Guide to the Digital Soul</a>
41
+