No Right Click Images Plugin - Version 3.1

Version Description

  • Fixed Option initialization
Download this release

Release Info

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

Code changes from version 3.0 to 3.1

Files changed (2) hide show
  1. no-right-click-images-plugin.php +18 -7
  2. readme.txt +4 -1
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.0
7
  Author: Keith P. Graham
8
  Author URI: http://www.BlogsEye.com/
9
 
@@ -18,15 +18,13 @@ if (!defined('ABSPATH')) exit; // just in case
18
  add_action( 'wp_enqueue_scripts', 'nrci_scripts' ); // enqueue the scripts
19
  add_action('admin_menu', 'kpg_no_rc_img_init');
20
 
21
-
22
-
23
  function nrci_scripts() {
 
 
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
- $options=kpg_nrci_get_options();
28
- extract($options);
29
- //if ($allowforlogged=='Y') return;
30
  }
31
  }
32
  wp_enqueue_script( 'nrci_methods', plugin_dir_url( __FILE__ ) . 'no-right-click-images.js', array(), null, false );
@@ -63,7 +61,14 @@ function kpg_no_rc_img_uninstall() {
63
  function kpg_nrci_get_options() {
64
  // before we begin we need to check if we need to redirect the options to blog 1
65
  $opts=get_option('kpg_no_right_click_image');
66
- if (empty($opts)||!is_array($opts)) $opts=array();
 
 
 
 
 
 
 
67
  $options=array(
68
  'gesture'=>'Y',
69
  'drag'=>'Y',
@@ -71,10 +76,16 @@ function kpg_nrci_get_options() {
71
  'touch'=>'Y'
72
  );
73
  $ansa=array_merge($options,$opts);
 
 
 
 
 
74
  if ($ansa['gesture']!='Y') $ansa['gesture']='N';
75
  if ($ansa['drag']!='Y') $ansa['drag']='N';
76
  if ($ansa['allowforlogged']!='Y') $ansa['allowforlogged']='N';
77
  if ($ansa['touch']!='Y') $ansa['touch']='N';
 
78
  return $ansa;
79
  }// done
80
 
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.1
7
  Author: Keith P. Graham
8
  Author URI: http://www.BlogsEye.com/
9
 
18
  add_action( 'wp_enqueue_scripts', 'nrci_scripts' ); // enqueue the scripts
19
  add_action('admin_menu', 'kpg_no_rc_img_init');
20
 
 
 
21
  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
  }
30
  wp_enqueue_script( 'nrci_methods', plugin_dir_url( __FILE__ ) . 'no-right-click-images.js', array(), null, false );
61
  function kpg_nrci_get_options() {
62
  // before we begin we need to check if we need to redirect the options to blog 1
63
  $opts=get_option('kpg_no_right_click_image');
64
+ if (empty($opts)||!is_array($opts)) {
65
+ $opts=array();
66
+ $opts['gesture']='Y';
67
+ $opts['drag']='Y';
68
+ $opts['touch']='Y';
69
+ $opts['allowforlogged']='N';
70
+ update_option('kpg_no_right_click_image',$opts);
71
+ }
72
  $options=array(
73
  'gesture'=>'Y',
74
  'drag'=>'Y',
76
  'touch'=>'Y'
77
  );
78
  $ansa=array_merge($options,$opts);
79
+ if (!array_key_exists('gesture',$ansa)||empty($ansa['gesture'])) $ansa['gesture']='Y';
80
+ if (!array_key_exists('drag',$ansa)||empty($ansa['drag'])) $ansa['drag']='Y';
81
+ if (!array_key_exists('touch',$ansa)||empty($ansa['touch'])) $ansa['touch']='Y';
82
+ if (!array_key_exists('allowforlogged',$ansa)||empty($ansa['allowforlogged'])) $ansa['allowforlogged']='N';
83
+
84
  if ($ansa['gesture']!='Y') $ansa['gesture']='N';
85
  if ($ansa['drag']!='Y') $ansa['drag']='N';
86
  if ($ansa['allowforlogged']!='Y') $ansa['allowforlogged']='N';
87
  if ($ansa['touch']!='Y') $ansa['touch']='N';
88
+ update_option('kpg_no_right_click_image',$ansa);
89
  return $ansa;
90
  }// done
91
 
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.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -34,6 +34,9 @@ The plugin no longer tries to replace images with a dummy image. This method har
34
 
35
  == Changelog ==
36
 
 
 
 
37
  = 3.0 =
38
  * Completely rewrote the plugin javascript. It uses a different set of functions to stop the right click.
39
  * Major rewrite of the plugin loading method.
4
  Requires at least: 3.0
5
  Tested up to: 5.0
6
  Contributors: Keith Graham
7
+ Stable tag: 3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
34
 
35
  == Changelog ==
36
 
37
+ = 3.1 =
38
+ * Fixed Option initialization
39
+
40
  = 3.0 =
41
  * Completely rewrote the plugin javascript. It uses a different set of functions to stop the right click.
42
  * Major rewrite of the plugin loading method.