/*
Plugin Name: WP-CopyProtect [Protect your blog posts]
Plugin URI:
http://chetangole.com/blog/wp-copyprotect/Description: This plug-in will protect your blog content [posts] from being copied. A simple plug-in developed to stop the Copy cats.
Version: 3.1.0
Author: Chetan Gole
Author URI:
http://chetangole.com/*/
/*
Copyright (C) 2015 Chetan Gole - chetangole.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
// No right click (with message) - Problem for copy cats NO RIGHT CLICK
function CopyProtect_no_right_click($CopyProtect_click_message)
{
?>
<script>
</script>
}
// No right click (without message) - Problem for copy cats NO RIGHT CLICK
function CopyProtect_no_right_click_without_message()
{
?>
<script>
</script>
}
// No selection header - Now your content is protected from copy and paste guys
function CopyProtect_no_select()
{
?>
<script>
/******************************************************************************
*** COPY PROTECTED BY
http://chetangole.com/blog/wp-copyprotect/ version 3.1.0 ****
******************************************************************************/
function disableSelection(target){
if (typeof target.onselectstart!="undefined") //For IE
target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //For Firefox
target.style.MozUserSelect="none"
else //All other route (For Opera)
target.function(){return false}
target.style.cursor = "default"
}
</script>
}
// No selection footer
function CopyProtect_no_select_footer()
{
?>
<script>
disableSelection(document.body)
</script>
}
function CopyProtectCredit()
{
?>
Copy Protected by Chetan's WP-Copyprotect.}
// Tuning your WP-CopyProtect - The settings page
function CopyProtect_options_page()
{
?>
WP Copy Protect v3.0.0
|
Visit Plugin page |
Donate |
Power Donors |
if($_POST['CopyProtect_save']){
update_option('CopyProtect_nrc',$_POST['CopyProtect_nrc']);
update_option('CopyProtect_nts',$_POST['CopyProtect_nts']);
update_option('CopyProtect_nrc_text', sanitize_text_field($_POST['CopyProtect_nrc_text']));
update_option('CopyProtect_credit',$_POST['CopyProtect_credit']);
update_option('CopyProtect_user_setting',$_POST['CopyProtect_user_setting']);
echo '
Settings saved, Please clear/update cache if you are using any cache plugin
';
}
$wp_CopyProtect_nrc = get_option('CopyProtect_nrc');
$wp_CopyProtect_nts = get_option('CopyProtect_nts');
$wp_CopyProtect_credit = get_option('CopyProtect_credit');
$wp_CopyProtect_user_setting = get_option('CopyProtect_user_setting');
?>
}
//call to function
function CopyProtect()
{
$wp_CopyProtect_nrc = get_option('CopyProtect_nrc');
$wp_CopyProtect_nts = get_option('CopyProtect_nts');
$wp_CopyProtect_nrc_text = get_option('CopyProtect_nrc_text');
$wp_CopyProtect_credit = get_option('CopyProtect_credit');
$pos = strpos(strtolower(getenv("REQUEST_URI")), '?preview=true');
if ($pos === false && ToApplySettings()) {
if($wp_CopyProtect_nrc == 1) { CopyProtect_no_right_click_without_message(); }
if($wp_CopyProtect_nrc == 2) { CopyProtect_no_right_click($wp_CopyProtect_nrc_text); }
if($wp_CopyProtect_nts == true) { CopyProtect_no_select(); }
}
}
function ToApplySettings(){
$wp_CopyProtect_user_setting = get_option('CopyProtect_user_setting');
if($wp_CopyProtect_user_setting == 0 && current_user_can('level_10'))
{
return false;
}else if ($wp_CopyProtect_user_setting == 1 && is_user_logged_in()) {
return false;
}else if ($wp_CopyProtect_user_setting == 2) {
return true;
}else{
return true;
}
}
function CopyProtect_footer()
{
$wp_CopyProtect_nts = get_option('CopyProtect_nts');
$wp_CopyProtect_credit = get_option('CopyProtect_credit');
if(ToApplySettings()){
if($wp_CopyProtect_nts == true) { CopyProtect_no_select_footer(); }
if($wp_CopyProtect_credit == true) { CopyProtectCredit(); }
}
}
function CopyProtect_adminmenu()
{
if (function_exists('add_options_page')) {
add_options_page('WP-CopyProtect', 'WP-CopyProtect', 9, basename(__FILE__),'CopyProtect_options_page');
}
}
//Commanding the Wordpress
add_action('wp_head','CopyProtect');
add_action('wp_footer','CopyProtect_footer');
add_action( 'admin_menu', 'register_wp_copyprotect_menu' );
function register_wp_copyprotect_menu(){
add_menu_page( 'WP Copy Protect', 'WP Copy Protect', 'manage_options', 'wpcopyprotect', 'CopyProtect_options_page', '', '2.5467' );
}
?>
Ek Olarak: hicbiryerde left click le alakali bir kod bulamadim
Ek Olarak:
TurkCoder adlı üyeden alıntı
Bu ozaman kullandığınız bir javascript kodundan olabilir, css kod eklediyseniz veya javascript onları kaldırıp deneyin, bu kesinlikle admin panelde çalışan bir javascript veya css koduna benziyor..
kesinlikle haklisin ama left click le ilgili bir kod aradim her eklentide ama bulamadim
Ek Olarak: yokmu yardim edebilecek :/