News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Disable Right Click (v4.0 Released!)

Started by Chas Large, May 07, 2008, 07:10:11 PM

Previous topic - Next topic

Arantor

Heh. Wait until you do it with streaming images and a Flash client (where right click actually doesn't work), then they suddenly realise that it can be done quite easily...

Tatek

Quote from: Chas Large on March 27, 2013, 03:45:59 PMThe options are in Admin > Configuration > Miscellaneous.

Thanx, Finnaly found!...

Crow26

Hi the thing is that I install this mod (no errors and emulating 2.0.2) but once installed it does not come out in the administration to set in Miscellaneous. I tried installing it manually with the parse and still have the same problem.


Not the first time it happens this to install a mod.

I would appreciate if someone would lend a hand.

Kimmie


Arantor

Considering how easy it is to bypass such a measure, does it matter whether it works or not?

Kimmie

Well yes it does matter, that is why I asked. What a pissy response. I don't go around viewing source pages so I don't know how easy this would be to bypass..lol. All I want is something that keeps the source code from being viewed.

Arantor

Preventing the source from being viewed? IMPOSSIBLE.

Kimmie

And you expect EVERYONE to know that?  My understanding is, if they can't right click on the page, they can't get to that menu. All you had to do was explain that there are other ways around that.

From now on, please do not respond to me unless you can be nice. Remember, we can't all be as smart as you.

mashby

According to the mod's description, it will work on 2.0.x. But it certainly won't do what you might think. In fact, it actually disrupts more than right-click>Copy. There's a lot of fun in the right-click in most browsers. And View Source isn't only available in the right-click option. And tools like Firebug make it pretty to inspect elements on the page. Are you trying to not have people copy your content?
Always be a little kinder than necessary.
- James M. Barrie

Antechinus

Kimmie, TBH tricks like this mod only stop non-technical people. Anyone with a bit of (fairly common) knowledge can get around them in no time. What's more, they'll probably be so annoyed at losing some of their most commonly used functionality that they'll make a point of getting around it, just to show they can (I speak from experience here :D ).

Arantor

The thing is, there are so many ways around the right click that you cannot prevent it. I was trying to point out, with emphasis, just how impossible it is to actually do what you're asking. If the source gets to the browser, it must be able to be accessed and there's nothing you can do to stop that.

Most browsers expose View Source via their Tools menu. Or Ctrl-U. Or F12 for the developer panel.

Do I expect everyone to know that? No. But here's the thing. People who don't care, don't worry about it and therefore neither need to use the workarounds nor try to right click. And the people who do care long ago figured out how to get around it anyway.

Being as smart as me? Haha. Sorry, I'm not smart. I'm just very, very knowledgeable which is something quite different. However... I would hope that someone smart enough to ask questions would also be smart enough to listen to someone who understands this stuff and doesn't need to belittle their time investment. But I've wasted enough time trying to help people here, I'm largely immune to it.

SoLoGHoST

Disabling Right click is a thing of the past.  It's about as dusty as a Vinyl Record.  Just my 2 cents...

okoy

need help with this guys
"Fatal error: Cannot redeclare disable_right_click() (previously declared in /home/detikmed/public_html/Sources/Subs.php:5094) in /home/detikmed/public_html/Sources/Subs.php on line 5254"

it shows after i install "disable right click" packages.

and now i can't open my forum

Shades.

Was getting html_header errors and couldn't figure it out: https://www.simplemachines.org/community/index.php?topic=577533.msg4087421#msg4087421

But it seems to be in this mods code in Subs.php (highlighted in red below)

Quote// Disable Right Click BY: Chas Large
function disable_right_click()
{
    global $context, $modSettings, $txt;

    $do_drc = true;   
                  
    // Maybe I want to add an exception, well verify if you don't want the mod in a determinated action
    if (!empty($modSettings['drc_exception'])){
    $actions = explode(',', $modSettings['drc_exception']);   

    if (isset($_REQUEST['action']) && (in_array($_REQUEST['action'], $actions)))
       $do_drc = false;
    }

    // First check if we want a message 
    if (!empty($modSettings['drc_msg']) && $do_drc){

    // Define the message
    $drc_message = ((empty($modSettings['drc_title'])) ? $txt['drc_message2'] : $modSettings['drc_title']);    
   
    // This show a message if the "Show Message" option is selected
    $context['html_headers'] .= '
       <script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus ([email protected]) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
var message="'.$drc_message.'";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
// -->
</script>';
    }

    if (empty($modSettings['drc_msg']) && $do_drc)
    {
   
    // This hide the right click without a message, only if the "Dont Show Nothing" option is selected
   
    $context['html_headers'] .= '
       <script language=JavaScript>
<!--
//Disable right click script III- By Renigade ([email protected])
//For full source code, visit http://www.dynamicdrive.com
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// -->
</script>';     
    }
}
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Advertisement: