The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

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

View previous topic View next topic Go down

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

Post by Michael_vx on 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
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 on 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
Hyperactive

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

http://redlustempire.forumtl.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 on 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
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 on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://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 on 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
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 on March 24th 2014, 11:38 am

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

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 on 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
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 on 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 edityour 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://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 on 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 edityour 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
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 on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://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 on March 24th 2014, 10:57 pm

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

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 on March 24th 2014, 10:59 pm

You're welcome I love you

Topic solved and archived

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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