No Right Click Images Plugin - Version 1.0

Version Description

  • initial release

=

Download this release

Release Info

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

Version 1.0

Files changed (2) hide show
  1. no-right-click-images-plugin.php +152 -0
  2. readme.txt +37 -0
no-right-click-images-plugin.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ /*
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.0
7
+ Author: Keith P. Graham
8
+ Author URI: http://www.BlogsEye.com/
9
+
10
+ This software is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ */
14
+
15
+ /************************************************************
16
+ * kpg_no_rc_img_fixup()
17
+ * Shows the javascript in the footer so that the image events can be adjusted
18
+ *
19
+ *************************************************************/
20
+ function kpg_no_rc_img_fixup() {
21
+ // this is the No Right Click Images functionality.
22
+
23
+ ?>
24
+ <script language="javascript" type="text/javascript">
25
+ // <!--
26
+ // No Right Click Images Plugin
27
+ function kpg_nrci_context(event) {
28
+ //alert("context");
29
+ var ev=event||window.event;
30
+ ev.returnValue=false;
31
+ return false;
32
+ }
33
+ function kpg_nrci_click(event) {
34
+
35
+ var ev=event||window.event;
36
+ if (ev.button == 2 || ev.button == 3||ev.which == 3 || ev.which == 2) {
37
+ //alert ("left");
38
+ ev.returnValue=false;
39
+ return false;
40
+ }
41
+ return true;
42
+ }
43
+ // sets the image onclick event
44
+ function kpg_nrci_action(event) {
45
+ try {
46
+ var b=document.getElementsByTagName("IMG");
47
+ for (var i = 0; i < b.length; i++) {
48
+ b[i].oncontextmenu=function(event) { return kpg_nrci_context(event);}
49
+ }
50
+ } catch (ee) {}
51
+ }
52
+ // set the onload event
53
+ if (document.addEventListener) {
54
+ document.addEventListener("DOMContentLoaded", function(event) { kpg_nrci_action(event); }, false);
55
+ } else if (window.attachEvent) {
56
+ window.attachEvent("onload", function(event) { kpg_nrci_action(event); });
57
+ } else {
58
+ var oldFunc = window.onload;
59
+ window.onload = function() {
60
+ if (oldFunc) {
61
+ oldFunc();
62
+ }
63
+ kpg_nrci_action('load');
64
+ };
65
+ }
66
+ function kpgremoveHTMLTags(ihtml){
67
+ try {
68
+ ihtml = ihtml.replace(/&(lt|gt);/g, function (strMatch, p1){
69
+ return (p1 == "lt")? "<" : ">";
70
+ });
71
+ return ihtml.replace(/<\/?[^>]+(>|$)/g, "");
72
+ } catch (eee) {
73
+ return '';
74
+ }
75
+ }
76
+ // end of No Right Click Images Plugin
77
+ // -->
78
+ </script>
79
+
80
+ <?php
81
+ }
82
+ function kpg_no_rc_img_control() {
83
+ // this is the display of information about the page.
84
+ $bname=urlencode(get_bloginfo('name'));
85
+ $burl=urlencode(get_bloginfo('url'));
86
+ $bdesc=urlencode(get_bloginfo('description'));
87
+
88
+ ?>
89
+
90
+ <div class="wrap">
91
+ <h2>No Right Click Images Plugin</h2>
92
+ <h4>The No Right Click Images Plugin is installed and working correctly.</h4>
93
+ <p>This plugin installs some javascript in the footer of every page. When your page finishes loading, the javascript steps through the links on the page looking for Images and sets them so the context menu won't appear.</p>
94
+ <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>
95
+
96
+ <hr/>
97
+ <h3>If you like this plugin, why not try out these other interesting plugins.</h3>
98
+ <?php
99
+ // list of plugins
100
+ $p=array(
101
+ "facebook-open-graph-widget"=>"The easiest way to add a Facebook Like buttons to your blog' sidebar",
102
+ "threat-scan-plugin"=>"Check your blog for virus, trojans, malicious software and other threats",
103
+ "open-in-new-window-plugin"=>"Keep your surfers. Open all external links in a new window, automatically.",
104
+ "youtube-poster-plugin"=>"Automagically add YouTube videos as posts. All from inside the plugin. Painless, no heavy lifting.",
105
+ "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",
106
+ );
107
+ $f=$_SERVER["REQUEST_URI"];
108
+ // get the php out
109
+ $ff=explode('page=',$f);
110
+ $f=$ff[1];
111
+ $ff=explode('/',$f);
112
+ $f=$ff[0];
113
+ foreach ($p as $key=>$data) {
114
+ if ($f!=$key) {
115
+ $kk=urlencode($key);
116
+ ?><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
117
+ }
118
+ }
119
+ ?>
120
+
121
+
122
+ <hr/>
123
+
124
+ <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>
125
+
126
+
127
+ <p>Keith Graham</p>
128
+ <p><a target="_blank" href="http://www.cthreepo.com/blog">Wandering Blog </a>(My personal Blog) <br />
129
+ <a target="_blank" href="http://www.cthreepo.com">Resources for Science Fiction</a> (Writing Science Fiction) <br />
130
+ <a target="_blank" href="http://www.jt30.com">The JT30 Page</a> (Amplified Blues Harmonica) <br />
131
+ <a target="_blank" href="http://www.harpamps.com">Harp Amps</a> (Vacuum Tube Amplifiers for Blues) <br />
132
+ <a target="_blank" href="http://www.blogseye.com">Blog's Eye</a> (PHP coding) <br />
133
+ <a target="_blank" href="http://www.cthreepo.com/bees">Bee Progress Beekeeping Blog</a> (My adventures as a new beekeeper) </p>
134
+ </div
135
+
136
+ >
137
+ <form method="post" action="options.php">
138
+ <?php settings_fields( 'myoption-group' ); ?>
139
+
140
+ </form>
141
+ <?php
142
+ }
143
+ // no unistall because I have not created any meta data to delete.
144
+ function kpg_no_rc_img_init() {
145
+ add_options_page('No Right Click Images', 'No Right Click Images', 'manage_options',__FILE__,'kpg_no_rc_img_control');
146
+ }
147
+ // Plugin added to Wordpress plugin architecture
148
+ add_action('admin_menu', 'kpg_no_rc_img_init');
149
+ add_action( 'wp_footer', 'kpg_no_rc_img_fixup' );
150
+
151
+
152
+ ?>
readme.txt ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.0
8
+
9
+ Disables right click context menu on images to help deter leeches from glomming images.
10
+
11
+ == Description ==
12
+ The No Right Click Images Plugin Plugin uses JavaScript to change the right click action on IMG tags to disable context menu. It disables the context menu on images only so other right click actions, such as links, should work normally.
13
+
14
+ Since it uses JavaScript, it targets more images than using a plugin that filter pages and rewrite the tag. The plugin will find many images generated in scripts or pasted into posts and comments, that similar plugins will not find.
15
+
16
+ It is impossible to keep people from stealing images that appear in web pages, but this plugin will deter casual theft from surfers who do not want to interpret HTML or dig into the browser cache.
17
+
18
+ == Installation ==
19
+ 1. Download the plugin.
20
+ 2. Upload the plugin to your wp-content/plugins directory.
21
+ 3. Activate the plugin.
22
+
23
+ == Changelog ==
24
+
25
+ = 1.0 =
26
+ * initial release
27
+
28
+
29
+ == Support ==
30
+ 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>".
31
+ Other plugins:
32
+ <a href="http://wordpress.org/extend/plugins/permalink-finder/">Permalink Finder Plugin</a>
33
+ <a href="http://wordpress.org/extend/plugins/outbound-click-tracker/">Outbound Link Tracker</a>
34
+ <a href="http://wordpress.org/extend/plugins/open-in-new-window-plugin/">No Right Click Images Plugin</a>
35
+ <a href="http://wordpress.org/extend/plugins/recent-google-searches-widget/stats/">Recent Google Searches Widget</a>
36
+ <a href="http://wordpress.org/extend/plugins/looser-search-plugin/">Looser Search</a>
37
+ <a href="http://wordpress.org/extend/plugins/keywords-widget/">Keywords Widget</a>