WP-CopyProtect [Protect your blog posts] - Version 1.0

Version Description

Download this release

Release Info

Developer cchetanonline
Plugin Icon wp plugin WP-CopyProtect [Protect your blog posts]
Version 1.0
Comparing to
See all releases

Version 1.0

Files changed (2) hide show
  1. readme.txt +33 -0
  2. wp-copyprotect.php +197 -0
readme.txt ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP-CopyProtect ===
2
+ Contributors: cchetanonline
3
+ Donate link: http://www.thechetan.com/
4
+ Tags: post, posts, copy, protect, right, click, disable, copyprotect
5
+ Requires at least: 2.X
6
+ Tested up to: 2.6
7
+ Stable tag: 1.0
8
+
9
+ Protect your blog content from being copied. A simple plug-in developed to stop the Copy cats
10
+
11
+ == Description ==
12
+
13
+ This plug-in will disable right click on your blog , it will also disable selection of text in your site
14
+ NOTE: Please do not use this plug-in if you provide any type of copy paste codes on your blogs
15
+
16
+ == Installation ==
17
+
18
+ 1. Upload `wp-copyprotect.php` to the `/wp-content/plugins/` directory
19
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
20
+ 3. Go to Settings and then WP-CopyProtect to configure.
21
+
22
+ == Frequently Asked Questions ==
23
+
24
+ = I've a problem. Where can I get help? =
25
+
26
+ Please post your messages to <a href="http://www.thechetan.com/wp-copyprotect">WP-Protect home page</a>
27
+
28
+ = Is it wp_2.6.x compatible? =
29
+
30
+ Of course it is!
31
+
32
+ == Screenshots ==
33
+ <img src="http://i34.tinypic.com/2sblqv6.jpg" /><br />Configuration Page
wp-copyprotect.php ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: WP-CopyProtect
4
+ Plugin URI: http://www.thechetan.com/wp-copyprotect
5
+ Description: This plug-in will protect your blog content from being copied. A simple plug-in developed to stop the Copy cats.
6
+ Author: Chetan Gole
7
+ Author URI: http://www.thechetan.com/
8
+ */
9
+
10
+ /*
11
+ Copyright 2008 Chetan Gole, IN (http://www.thechetan.com)
12
+
13
+ This program is free software; you can redistribute it and/or modify
14
+ it under the terms of the GNU General Public License as published by
15
+ the Free Software Foundation; either version 2 of the License, or
16
+ (at your option) any later version.
17
+
18
+ This program is distributed in the hope that it will be useful,
19
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ GNU General Public License for more details: http://www.gnu.org/licenses/gpl.txt
22
+ */
23
+
24
+
25
+
26
+ // No right click - Problem for copy cats NO RIGHT CLICK
27
+ function CopyProtect_no_right_click($CopyProtect_click_message)
28
+ {
29
+ ?>
30
+ <script language=JavaScript>
31
+ <!--
32
+
33
+ /***************************************************************************************************************
34
+ *Copyprotection for this site is provided by WP-CopyProtect visit TheChetan.com/wp-copyprotect for more details
35
+ *RightClick Disabled, Please DO NOT COPY.
36
+ ***************************************************************************************************************/
37
+
38
+ var message="<?php echo $CopyProtect_click_message; ?>";
39
+
40
+ ///////////////////////////////////
41
+ function clickIE4(){
42
+ if (event.button==2){
43
+ alert(message);
44
+ return false;
45
+ }
46
+ }
47
+
48
+ function clickNS4(e){
49
+ if (document.layers||document.getElementById&&!document.all){
50
+ if (e.which==2||e.which==3){
51
+ alert(message);
52
+ return false;
53
+ }
54
+ }
55
+ }
56
+
57
+ if (document.layers){
58
+ document.captureEvents(Event.MOUSEDOWN);
59
+ document.onmousedown=clickNS4;
60
+ }
61
+ else if (document.all&&!document.getElementById){
62
+ document.onmousedown=clickIE4;
63
+ }
64
+
65
+ document.oncontextmenu=new Function("alert(message);return false")
66
+
67
+ // -->
68
+ </script>
69
+
70
+ <?php
71
+ }
72
+
73
+
74
+
75
+ // No selection header - Now your content is protected from copy and paste guys
76
+ function CopyProtect_no_select()
77
+ {
78
+ ?>
79
+ <script type="text/javascript">
80
+
81
+ /***************************************************************************************************************
82
+ *Copyprotection for this site is provided by WP-CopyProtect visit TheChetan.com/wp-copyprotect for more details
83
+ *Selection Disabled, Please DO NOT COPY.
84
+ ***************************************************************************************************************/
85
+
86
+ function disableSelection(target){
87
+ if (typeof target.onselectstart!="undefined") //IE route
88
+ target.onselectstart=function(){return false}
89
+ else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
90
+ target.style.MozUserSelect="none"
91
+ else //All other route (ie: Opera)
92
+ target.onmousedown=function(){return false}
93
+ target.style.cursor = "default"
94
+ }
95
+
96
+ </script>
97
+
98
+
99
+ <?php
100
+ }
101
+
102
+
103
+ // No selection footer
104
+ function CopyProtect_no_select_footer()
105
+ {
106
+ ?>
107
+ <script type="text/javascript">
108
+ disableSelection(document.body) //disable text selection on entire body of page
109
+ </script>
110
+
111
+ <?php
112
+ }
113
+
114
+
115
+ // Tuning your WP-CopyProtect
116
+ function CopyProtect_options_page()
117
+ {
118
+ if($_POST['CopyProtect_save']){
119
+ update_option('CopyProtect_nrc',$_POST['CopyProtect_nrc']);
120
+ update_option('CopyProtect_nts',$_POST['CopyProtect_nts']);
121
+ update_option('CopyProtect_nrc_text',$_POST['CopyProtect_nrc_text']);
122
+
123
+ echo '<div class="updated"><p>Commands accepted. Options saved successfully.</p></div>';
124
+ }
125
+ $wp_CopyProtect_nrc = get_option('CopyProtect_nrc');
126
+ $wp_CopyProtect_nts = get_option('CopyProtect_nts');
127
+ ?>
128
+ <div class="wrap">
129
+ <h2>WP-CopyProtect Options</h2>
130
+ <form method="post" id="CopyProtect_options">
131
+ <fieldset class="options">
132
+ <legend>Now, its the time to bang the copy cats, select your options below</legend>
133
+ <h2>Options</h2>
134
+ <table width="100%" cellspacing="2" cellpadding="5" class="editform">
135
+
136
+ <tr valign="top">
137
+ <th width="33%" scope="row">Disable right mouse click:</th>
138
+ <td>
139
+ <input type="checkbox" id="CopyProtect_nrc" name="CopyProtect_nrc" value="CopyProtect_nrc" <?php if($wp_CopyProtect_nrc == true) { echo('checked="checked"'); } ?> />
140
+ check to activate
141
+ <br />
142
+ <input name="CopyProtect_nrc_text" type="text" id="CopyProtect_nrc_text" value="<?php echo get_option('CopyProtect_nrc_text') ;?>" size="30"/>
143
+ This warning will be given to right clickers.
144
+ </td>
145
+ </tr>
146
+ <tr valign="top">
147
+ <th width="33%" scope="row">Disable text selection:</th>
148
+ <td>
149
+ <input type="checkbox" id="CopyProtect_nts" name="CopyProtect_nts" value="CopyProtect_nts" <?php if($wp_CopyProtect_nts == true) { echo('checked="checked"'); } ?> />
150
+ check to activate
151
+ </td>
152
+ </tr>
153
+ </table>
154
+ <p class="submit"><input type="submit" name="CopyProtect_save" value="Save" /></p>
155
+ <h2>Any Problems ?? </h2>
156
+ <p> Visit <a href="http://www.thechetan.com/">www.TheChetan.com</a></p>
157
+ </fieldset>
158
+ </form>
159
+ </div>
160
+ <?php
161
+ }
162
+
163
+ //We are calling you function
164
+ function CopyProtect()
165
+ {
166
+
167
+ $wp_CopyProtect_nrc = get_option('CopyProtect_nrc');
168
+ $wp_CopyProtect_nts = get_option('CopyProtect_nts');
169
+ $wp_CopyProtect_nrc_text = get_option('CopyProtect_nrc_text');
170
+
171
+ $pos = strpos(strtolower(getenv("REQUEST_URI")), '?preview=true');
172
+
173
+ if ($pos === false) {
174
+ if($wp_CopyProtect_nrc == true) { CopyProtect_no_right_click($wp_CopyProtect_nrc_text); }
175
+ if($wp_CopyProtect_nts == true) { CopyProtect_no_select(); }
176
+ }
177
+ }
178
+
179
+ function CopyProtect_footer()
180
+ {
181
+ $wp_CopyProtect_nts = get_option('CopyProtect_nts');
182
+
183
+ if($wp_CopyProtect_nts == true) { CopyProtect_no_select_footer(); }
184
+ }
185
+
186
+ function CopyProtect_adminmenu()
187
+ {
188
+ if (function_exists('add_options_page')) {
189
+ add_options_page('WP-CopyProtect', 'WP-CopyProtect', 9, basename(__FILE__),'CopyProtect_options_page');
190
+ }
191
+ }
192
+
193
+ // Commanding the Wordpress
194
+ add_action('wp_head','CopyProtect');
195
+ add_action('wp_footer','CopyProtect_footer');
196
+ add_action('admin_menu','CopyProtect_adminmenu',1);
197
+ ?>