No Right Click Images Plugin - Version 1.1

Version Description

  • deleted some unused code in the javascript

=

Download this release

Release Info

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

Version 1.1

Files changed (2) hide show
  1. no-right-click-images-plugin.php +132 -0
  2. readme.txt +39 -0
no-right-click-images-plugin.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.1
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
+ // sets the image onclick event
34
+ function kpg_nrci_action(event) {
35
+ try {
36
+ var b=document.getElementsByTagName("IMG");
37
+ for (var i = 0; i < b.length; i++) {
38
+ b[i].oncontextmenu=function(event) { return kpg_nrci_context(event);}
39
+ }
40
+ } catch (ee) {}
41
+ }
42
+ // set the onload event
43
+ if (document.addEventListener) {
44
+ document.addEventListener("DOMContentLoaded", function(event) { kpg_nrci_action(event); }, false);
45
+ } else if (window.attachEvent) {
46
+ window.attachEvent("onload", function(event) { kpg_nrci_action(event); });
47
+ } else {
48
+ var oldFunc = window.onload;
49
+ window.onload = function() {
50
+ if (oldFunc) {
51
+ oldFunc();
52
+ }
53
+ kpg_nrci_action('load');
54
+ };
55
+ }
56
+ // end of No Right Click Images Plugin
57
+ // -->
58
+ </script>
59
+
60
+ <?php
61
+ }
62
+ function kpg_no_rc_img_control() {
63
+ // this is the display of information about the page.
64
+ $bname=urlencode(get_bloginfo('name'));
65
+ $burl=urlencode(get_bloginfo('url'));
66
+ $bdesc=urlencode(get_bloginfo('description'));
67
+
68
+ ?>
69
+
70
+ <div class="wrap">
71
+ <h2>No Right Click Images Plugin</h2>
72
+ <h4>The No Right Click Images Plugin is installed and working correctly.</h4>
73
+ <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>
74
+ <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>
75
+
76
+ <hr/>
77
+ <h3>If you like this plugin, why not try out these other interesting plugins.</h3>
78
+ <?php
79
+ // list of plugins
80
+ $p=array(
81
+ "facebook-open-graph-widget"=>"The easiest way to add a Facebook Like buttons to your blog' sidebar",
82
+ "threat-scan-plugin"=>"Check your blog for virus, trojans, malicious software and other threats",
83
+ "open-in-new-window-plugin"=>"Keep your surfers. Open all external links in a new window, automatically.",
84
+ "youtube-poster-plugin"=>"Automagically add YouTube videos as posts. All from inside the plugin. Painless, no heavy lifting.",
85
+ "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",
86
+ );
87
+ $f=$_SERVER["REQUEST_URI"];
88
+ // get the php out
89
+ $ff=explode('page=',$f);
90
+ $f=$ff[1];
91
+ $ff=explode('/',$f);
92
+ $f=$ff[0];
93
+ foreach ($p as $key=>$data) {
94
+ if ($f!=$key) {
95
+ $kk=urlencode($key);
96
+ ?><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
97
+ }
98
+ }
99
+ ?>
100
+
101
+
102
+ <hr/>
103
+
104
+ <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>
105
+
106
+
107
+ <p>Keith Graham</p>
108
+ <p><a target="_blank" href="http://www.cthreepo.com/blog">Wandering Blog </a>(My personal Blog) <br />
109
+ <a target="_blank" href="http://www.cthreepo.com">Resources for Science Fiction</a> (Writing Science Fiction) <br />
110
+ <a target="_blank" href="http://www.jt30.com">The JT30 Page</a> (Amplified Blues Harmonica) <br />
111
+ <a target="_blank" href="http://www.harpamps.com">Harp Amps</a> (Vacuum Tube Amplifiers for Blues) <br />
112
+ <a target="_blank" href="http://www.blogseye.com">Blog's Eye</a> (PHP coding) <br />
113
+ <a target="_blank" href="http://www.cthreepo.com/bees">Bee Progress Beekeeping Blog</a> (My adventures as a new beekeeper) </p>
114
+ </div
115
+
116
+ >
117
+ <form method="post" action="options.php">
118
+ <?php settings_fields( 'myoption-group' ); ?>
119
+
120
+ </form>
121
+ <?php
122
+ }
123
+ // no unistall because I have not created any meta data to delete.
124
+ function kpg_no_rc_img_init() {
125
+ add_options_page('No Right Click Images', 'No Right Click Images', 'manage_options',__FILE__,'kpg_no_rc_img_control');
126
+ }
127
+ // Plugin added to Wordpress plugin architecture
128
+ add_action('admin_menu', 'kpg_no_rc_img_init');
129
+ add_action( 'wp_footer', 'kpg_no_rc_img_fixup' );
130
+
131
+
132
+ ?>
readme.txt ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.1
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
+ = 1.1 =
28
+ * deleted some unused code in the javascript
29
+
30
+
31
+ == Support ==
32
+ 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>".
33
+ Other plugins:
34
+ <a href="http://wordpress.org/extend/plugins/permalink-finder/">Permalink Finder Plugin</a>
35
+ <a href="http://wordpress.org/extend/plugins/outbound-click-tracker/">Outbound Link Tracker</a>
36
+ <a href="http://wordpress.org/extend/plugins/open-in-new-window-plugin/">No Right Click Images Plugin</a>
37
+ <a href="http://wordpress.org/extend/plugins/recent-google-searches-widget/stats/">Recent Google Searches Widget</a>
38
+ <a href="http://wordpress.org/extend/plugins/looser-search-plugin/">Looser Search</a>
39
+ <a href="http://wordpress.org/extend/plugins/keywords-widget/">Keywords Widget</a>