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.
The forum of the forums
3 posters

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

    Michael_vx
    Michael_vx
    Forumember


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

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

    Post by Michael_vx Mon 24 Mar 2014 - 10:00

    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
    Pizza Boi
    Pizza Boi
    Hyperactive


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

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

    Post by Pizza Boi Mon 24 Mar 2014 - 10:27

    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
    Michael_vx
    Michael_vx
    Forumember


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

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

    Post by Michael_vx Mon 24 Mar 2014 - 10:37

    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
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

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

    Post by Ange Tuteur Mon 24 Mar 2014 - 11:16

    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.
    Michael_vx
    Michael_vx
    Forumember


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

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

    Post by Michael_vx Mon 24 Mar 2014 - 11:33

    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

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

    Post by Michael_vx Mon 24 Mar 2014 - 11:38

    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

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

    Post by Michael_vx Mon 24 Mar 2014 - 17:22

    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
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

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

    Post by Ange Tuteur Mon 24 Mar 2014 - 22:22

    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;
              }
          });
        }
    });
    Michael_vx
    Michael_vx
    Forumember


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

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

    Post by Michael_vx Mon 24 Mar 2014 - 22:48

    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
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

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

    Post by Ange Tuteur Mon 24 Mar 2014 - 22:51

    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;
              }
          });
        }
    });
    Michael_vx
    Michael_vx
    Forumember


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

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

    Post by Michael_vx Mon 24 Mar 2014 - 22:57

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


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

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

    Post by Ange Tuteur Mon 24 Mar 2014 - 22:59

    You're welcome I love you

    Topic solved and archived

      Current date/time is Sun 22 Sep 2024 - 18:42