The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

is there Script to disable right Klick works with topics and vistiors only

3 posters

Go down

Solved is there Script to disable right Klick works with topics and vistiors only

Post by Michael_vx March 24th 2014, 10:00 am

is there Script to disable right Klick works with topics and vistiors only
i know it might be hard to do that but if it possible to make the script some thing like my goal is to keep the script a way from contact us Page
the code i`m useing it right now

Code:
 <script language="JavaScript1.2"> function ejs_nodroit() { alert('عزرا تم منع الزوار من استخدام زر الفأرة الايمن Sorry Vistors are not allowed to use right Click'); return(false); } document.oncontextmenu = ejs_nodroit; </script>

its used on Widget but if that not possible then i need a good script for contact us page that`s works like HTML page or any thing so it wont bother my Visitors 
thanks
Michael_vx
Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is there Script to disable right Klick works with topics and vistiors only

Post by Pizza Boi March 24th 2014, 10:27 am

Hi Very Happy

Try using this as reference: Here

Try to see if you can work around it to be incorporated in a widget.

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

Solved Re: is there Script to disable right Klick works with topics and vistiors only

Post by Michael_vx March 24th 2014, 10:37 am

still working on contact page
my only problem is i want this the only Page that the code must not work on it i think i will try to make out site page for contact us
thanks for the help
Michael_vx
Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is there Script to disable right Klick works with topics and vistiors only

Post by Ange Tuteur March 24th 2014, 11:16 am

Hello Michael_vx,

You can try this :
Administration panel > modules > javascript codes management > create a new script

Title : what you wish
Placement : in all the pages
paste the code below and save :
Code:
$(document).ready(function() {
    if (location.pathname == '/contact') return;
    if (!document.getElementById('logout')) {
       $(document).bind('contextmenu',function(){
          alert('message');
          return false;
       });
    }
});

Make sure to remove your old codes. This one should work only for users who are logged out; it should not work on the contact page.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: is there Script to disable right Klick works with topics and vistiors only

Post by Michael_vx March 24th 2014, 11:33 am

wow you ar reall genius
true Supernatural intelligence
but i want the code work with this message

عزرا تم منع الزوار من استخدام زر الفأرة الايمن Sorry Vistors are not allowed to use right Click
when i changed word message to the message in the quote the code was disabled
looks like code only works with english only but thanks
if you can make the code works with both English and Arabic
the topic is 200% solved
really i like the Help here
Michael_vx
Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is there Script to disable right Klick works with topics and vistiors only

Post by Michael_vx March 24th 2014, 11:38 am

one more thing
can i disable
ctrl + V for Vistiors or copy for Visitors too
Michael_vx
Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is there Script to disable right Klick works with topics and vistiors only

Post by Michael_vx March 24th 2014, 5:22 pm

Michael_vx wrote:wow you ar reall genius
true Supernatural intelligence
but i want the code work with this message

عزرا تم منع الزوار من استخدام زر الفأرة الايمن Sorry Vistors are not allowed to use right Click
when i changed word message to the message in the quote the code was disabled
looks like code only works with english only but thanks
if you can make the code works with both English and Arabic
the topic is 200% solved
really i like the Help here

Michael_vx wrote:one more thing
can i disable
ctrl + V for Vistiors or copy for Visitors too
i wander if some one did read that Very Happy
Michael_vx
Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is there Script to disable right Klick works with topics and vistiors only

Post by Ange Tuteur March 24th 2014, 10:22 pm

Hi,

Please try not to double / triple post. Your posts must be separated by at least 24h before bumping. Remember that you can editis there Script to disable right Klick works with topics and vistiors only Editer15your posts to add more information too.

Replace the old script by :
Code:
$(document).ready(function() {
   
    var msg = 'عزرا تم منع الزوار من استخدام زر الفأرة الايمن Sorry Vistors are not allowed to use right Click';
   
    if (location.pathname == '/contact') return;
    if (!document.getElementById('logout')) {
      $(document).bind('contextmenu',function(){
          alert(msg);
          return false;
      });
      $(document).on('keydown',function(e) {
          if (e.ctrlKey && e.keyCode == 67 ||
              e.ctrlKey && e.keyCode == 86) {
            alert(msg);
            return false;
          }
      });
    }
});
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: is there Script to disable right Klick works with topics and vistiors only

Post by Michael_vx March 24th 2014, 10:48 pm

Ange Tuteur wrote:Hi,

Please try not to double / triple post. Your posts must be separated by at least 24h before bumping. Remember that you can editis there Script to disable right Klick works with topics and vistiors only Editer15your posts to add more information too.

Replace the old script by :
Code:
$(document).ready(function() {
    
    var msg = 'عزرا تم منع الزوار من استخدام زر الفأرة الايمن Sorry Vistors are not allowed to use right Click';
    
    if (location.pathname == '/contact') return;
    if (!document.getElementById('logout')) {
       $(document).bind('contextmenu',function(){
          alert(msg);
          return false;
       });
       $(document).on('keydown',function(e) {
          if (e.ctrlKey && e.keyCode == 67 ||
              e.ctrlKey && e.keyCode == 86) {
             alert(msg);
             return false;
          }
       });
    }
});
sorry i wont event double just forget about edit
about the alert msg at the ctirl + V can it be changed or it can not be and it will be the same as the right Click
but thsnks for the code
Solved
thanks for true Supernatural intelligence
Michael_vx
Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is there Script to disable right Klick works with topics and vistiors only

Post by Ange Tuteur March 24th 2014, 10:51 pm

Of course, it can be changed. Try this :
Code:
$(document).ready(function() {   
    if (location.pathname == '/contact') return;
    if (!document.getElementById('logout')) {
      $(document).bind('contextmenu',function(){
          alert('عزرا تم منع الزوار من استخدام زر الفأرة الايمن Sorry Vistors are not allowed to use right Click');
          return false;
      });
      $(document).on('keydown',function(e) {
          if (e.ctrlKey && e.keyCode == 67 ||
              e.ctrlKey && e.keyCode == 86) {
            alert('Sorry visitors are not allowed to copy');
            return false;
          }
      });
    }
});
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: is there Script to disable right Klick works with topics and vistiors only

Post by Michael_vx March 24th 2014, 10:57 pm

how can i thank you really
true Supernatural intelligence
the Topic is
1000% solved
 :wouhou:
Michael_vx
Michael_vx
Forumember

Male Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is there Script to disable right Klick works with topics and vistiors only

Post by Ange Tuteur March 24th 2014, 10:59 pm

You're welcome I love you

Topic solved and archived
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum