No Right Click Images Plugin - Version 3.4

Version Description

  • Added right click enable for admins only option.
Download this release

Release Info

Developer willjenkins
Plugin Icon wp plugin No Right Click Images Plugin
Version 3.4
Comparing to
See all releases

Code changes from version 3.3 to 3.4

includes/nrci_options.php CHANGED
@@ -38,12 +38,18 @@ function kpg_no_rc_img_control_2() {
38
  } else {
39
  $ios='N';
40
  }
 
 
 
 
 
41
  // update options
42
  $options['drag']=$drag;
43
  $options['touch']=$touch;
44
  $options['gesture']=$gesture;
45
  $options['allowforlogged']=$allowforlogged;
46
  $options['ios']=$ios;
 
47
  update_option('kpg_no_right_click_image',$options);
48
 
49
  }
@@ -76,6 +82,9 @@ function kpg_no_rc_img_control_2() {
76
  Disable context menu on Apple devices:
77
  <input type="checkbox" <?php if ($ios=='Y') {echo 'checked="true"';} ?> value="Y" name="kpg_ios" />
78
  Adds a style to images on Apple IOS devices to prevent the context menu<br />
 
 
 
79
  </fieldset>
80
  <br>
81
  <input type="submit" name="Submit" class="button-primary" value="<?php echo("Save Changes"); ?>" />
38
  } else {
39
  $ios='N';
40
  }
41
+ if (array_key_exists('kpg_admin',$_POST)) {
42
+ $admin=stripslashes($_POST['kpg_admin']);
43
+ } else {
44
+ $admin='N';
45
+ }
46
  // update options
47
  $options['drag']=$drag;
48
  $options['touch']=$touch;
49
  $options['gesture']=$gesture;
50
  $options['allowforlogged']=$allowforlogged;
51
  $options['ios']=$ios;
52
+ $options['admin']=$admin;
53
  update_option('kpg_no_right_click_image',$options);
54
 
55
  }
82
  Disable context menu on Apple devices:
83
  <input type="checkbox" <?php if ($ios=='Y') {echo 'checked="true"';} ?> value="Y" name="kpg_ios" />
84
  Adds a style to images on Apple IOS devices to prevent the context menu<br />
85
+ Admin can always right click images:
86
+ <input type="checkbox" <?php if ($admin=='Y') {echo 'checked="true"';} ?> value="Y" name="kpg_admin" />
87
+ Admins can always right click images even if logged in users cannot.<br />
88
  </fieldset>
89
  <br>
90
  <input type="submit" name="Submit" class="button-primary" value="<?php echo("Save Changes"); ?>" />
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: 3.3
7
  Author: Keith P. Graham
8
  Author URI: http://www.BlogsEye.com/
9
 
@@ -22,8 +22,13 @@ function nrci_scripts() {
22
  $options=kpg_nrci_get_options();
23
  extract($options);
24
  if (function_exists('is_user_logged_in')) { // for non wp versions
 
25
  if(is_user_logged_in()) {
26
- // check to see if we should load js
 
 
 
 
27
  if ($allowforlogged=='Y') return;
28
  }
29
  }
@@ -31,7 +36,8 @@ function nrci_scripts() {
31
  $opts=array(
32
  'gesture'=>$gesture,
33
  'drag'=>$drag,
34
- 'touch'=>$touch
 
35
  );
36
  wp_localize_script( 'nrci_methods', 'nrci_opts', $opts );
37
  if ($ios=='Y') {
@@ -73,18 +79,21 @@ function kpg_nrci_get_options() {
73
  $opts['touch']='Y';
74
  $opts['allowforlogged']='N';
75
  $opts['ios']='N';
 
76
  }
77
  if (!array_key_exists('gesture',$opts)||empty($opts['gesture'])) $opts['gesture']='Y';
78
  if (!array_key_exists('drag',$opts)||empty($opts['drag'])) $opts['drag']='Y';
79
  if (!array_key_exists('touch',$opts)||empty($opts['touch'])) $opts['touch']='Y';
80
  if (!array_key_exists('ios',$opts)||empty($opts['ios'])) $opts['ios']='N';
81
  if (!array_key_exists('allowforlogged',$opts)||empty($opts['allowforlogged'])) $opts['allowforlogged']='N';
 
82
 
83
  if ($opts['gesture']!='Y') $opts['gesture']='N';
84
  if ($opts['drag']!='Y') $opts['drag']='N';
85
  if ($opts['allowforlogged']!='Y') $opts['allowforlogged']='N';
86
  if ($opts['touch']!='Y') $opts['touch']='N';
87
  if ($opts['ios']!='Y') $opts['ios']='N';
 
88
  if ($opts1!==$opts) {
89
  update_option('kpg_no_right_click_image',$opts);
90
  }
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: 3.4
7
  Author: Keith P. Graham
8
  Author URI: http://www.BlogsEye.com/
9
 
22
  $options=kpg_nrci_get_options();
23
  extract($options);
24
  if (function_exists('is_user_logged_in')) { // for non wp versions
25
+ // check to see if we should load js
26
  if(is_user_logged_in()) {
27
+ if( current_user_can('editor') || current_user_can('administrator') ) {
28
+ if ($admin=='Y') {
29
+ return; // admins can right click
30
+ }
31
+ }
32
  if ($allowforlogged=='Y') return;
33
  }
34
  }
36
  $opts=array(
37
  'gesture'=>$gesture,
38
  'drag'=>$drag,
39
+ 'touch'=>$touch,
40
+ 'admin'=>$admin
41
  );
42
  wp_localize_script( 'nrci_methods', 'nrci_opts', $opts );
43
  if ($ios=='Y') {
79
  $opts['touch']='Y';
80
  $opts['allowforlogged']='N';
81
  $opts['ios']='N';
82
+ $opts['admins']='Y';
83
  }
84
  if (!array_key_exists('gesture',$opts)||empty($opts['gesture'])) $opts['gesture']='Y';
85
  if (!array_key_exists('drag',$opts)||empty($opts['drag'])) $opts['drag']='Y';
86
  if (!array_key_exists('touch',$opts)||empty($opts['touch'])) $opts['touch']='Y';
87
  if (!array_key_exists('ios',$opts)||empty($opts['ios'])) $opts['ios']='N';
88
  if (!array_key_exists('allowforlogged',$opts)||empty($opts['allowforlogged'])) $opts['allowforlogged']='N';
89
+ if (!array_key_exists('admin',$opts)||empty($opts['admin'])) $opts['admin']='Y';
90
 
91
  if ($opts['gesture']!='Y') $opts['gesture']='N';
92
  if ($opts['drag']!='Y') $opts['drag']='N';
93
  if ($opts['allowforlogged']!='Y') $opts['allowforlogged']='N';
94
  if ($opts['touch']!='Y') $opts['touch']='N';
95
  if ($opts['ios']!='Y') $opts['ios']='N';
96
+ if ($opts['admin']!='Y') $opts['admin']='N';
97
  if ($opts1!==$opts) {
98
  update_option('kpg_no_right_click_image',$opts);
99
  }
no-right-click-images.css CHANGED
@@ -5,7 +5,7 @@ by Keith P. Graham
5
 
6
  Plugin URI: http://www.BlogsEye.com/
7
  Description: Uses Javascript to prevent right clicking of images to help keep leaches from copying images
8
- Version: 3.3
9
  Author: Keith P. Graham
10
  Author URI: http://www.BlogsEye.com/
11
 
5
 
6
  Plugin URI: http://www.BlogsEye.com/
7
  Description: Uses Javascript to prevent right clicking of images to help keep leaches from copying images
8
+ Version: 3.4
9
  Author: Keith P. Graham
10
  Author URI: http://www.BlogsEye.com/
11
 
no-right-click-images.js CHANGED
@@ -5,7 +5,7 @@ by Keith P. Graham
5
 
6
  Plugin URI: http://www.BlogsEye.com/
7
  Description: Uses Javascript to prevent right clicking of images to help keep leaches from copying images
8
- Version: 3.3
9
  Author: Keith P. Graham
10
  Author URI: http://www.BlogsEye.com/
11
 
5
 
6
  Plugin URI: http://www.BlogsEye.com/
7
  Description: Uses Javascript to prevent right clicking of images to help keep leaches from copying images
8
+ Version: 3.4
9
  Author: Keith P. Graham
10
  Author URI: http://www.BlogsEye.com/
11
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.blogseye.com/buy-the-book/
4
  Requires at least: 3.0
5
  Tested up to: 5.0
6
  Contributors: Keith Graham
7
- Stable tag: 3.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -34,7 +34,10 @@ The plugin no longer tries to replace images with a dummy image. This method har
34
 
35
  == Changelog ==
36
 
37
- = 3.2 =
 
 
 
38
  * Removed background image checking for IOS. Seems to break everything.
39
  * made IOS processing default to off for new installations.
40
 
4
  Requires at least: 3.0
5
  Tested up to: 5.0
6
  Contributors: Keith Graham
7
+ Stable tag: 3.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
34
 
35
  == Changelog ==
36
 
37
+ = 3.4 =
38
+ * Added right click enable for admins only option.
39
+
40
+ = 3.3 =
41
  * Removed background image checking for IOS. Seems to break everything.
42
  * made IOS processing default to off for new installations.
43