News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Disable Right Click (v4.0 Released!)

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

Previous topic - Next topic

adbrad

#220
Quotehttp://www.xxxxxxxxxxxx.com/index.php?action=dlattach;attach=1;type=avatar
8: Undefined index: html_headers
File: /home/sites/xxxxxxxxxxxxx.com/Sources/Subs.php
Line: 4266
using the mod gives me this error every time i click home button i don't get the error with the mod unistalled using the updated mod and RC3.
below is the code it refers to
   // This show a message if the "Show Message" option is selected
    $context['html_headers'] .= '  <----line 4266


seems to be when a guest clicks the home button


Liam.

Quote from: adbrad on May 20, 2010, 03:41:47 PM
Quotehttp://www.xxxxxxxxxxxx.com/index.php?action=dlattach;attach=1;type=avatar
8: Undefined index: html_headers
File: /home/sites/xxxxxxxxxxxxx.com/Sources/Subs.php
Line: 4266
using the mod gives me this error every time i click home button i don't get the error with the mod unistalled using the updated mod and RC3.
below is the code it refers to
   // This show a message if the "Show Message" option is selected
    $context['html_headers'] .= '  <----line 4266


seems to be when a guest clicks the home button

Could you please post 5 lines above and 5 lines below that line please (in total 11 lines...)? I'll look into it then - it seems to be working fine for me...

And thanks Nibogo for giving me this mod ;)

adbrad

    // 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


those are the lines thanks

Liam.

Hmm, seems like theres alot of comments there ;) Mind posting some more lines or attach your Subs.php file?

adbrad

// Disable Right Click v4 By: NIBOGO
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'] .= ' <-------this is the line in the error
       <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>';     
    }
}


that is everything the mod adds to subs.php

muskalyn

#226
hi guys!

Liam , this is for your mod. it's turkish translation.

$languagedir/Modifications.turkish.php

$txt['arrange_drc'] = 'Özel Üye gruplarına kapat';
$txt['drc_msg'] = 'Hata Mesajı göster';
$txt['drc_message2'] = 'Sağ Tık Yasaktır.';
$txt['drc_title'] = 'Hata mesajınızı yazın';
$txt['drc_exception'] = 'İstisnai durumlara kapat.<br /><span class="smalltext">(Giriş,Kayıt,..)</span>';
$txt['permissionname_right_click'] = 'Sağ Tık';


$languagedir/Help.turkish.php

$helptxt['drc_msg'] = 'Etkin?';
$helptxt['drc_title'] = 'Senin özel mesaj yazın gibi hata göstermek istiyorum';


it's not true %100 but it works. i am using it and i have not a problem. it help to Turkish people.

Liam.

Thanks muskalyn, I'll include that translation in the next version ;)

muskalyn

Quote from: Liam. on May 22, 2010, 03:03:27 PM
Thanks muskalyn, I'll include that translation in the next version ;)

not at all ;).

SoLoGHoST

#229
Nice mod, though unfortunately, I never saw a need for this, since if people wanna steal your images, than can simply do a View Source on it and search for <img> tags or even css classes for where the image is at within the DOM.  There's really nothing you can do to prevent users from stealing your images, so what's the point of trying to make it difficult?  I don't see any point in this mod if it is just to protect your images.  And not to mention the notorious Print Screen button.  But don't get me wrong, I'm sure people feel more secure about their images with this mod installed.

Just my .02¢

Liam.

Quote from: SoLoGHoST on May 22, 2010, 03:11:39 PM
Nice mod, though unfortunately, I never saw a need for this, since if people wanna steal your images, than can simply do a View Source on it and search for <img> tags or even css classes for where the image is at within the DOM.  There's really nothing you can do to prevent users from stealing your images, so what's the point of trying to make it difficult?  I don't see any point in this mod if it is just to protect your images.  And not to mention the notorious Print Screen button.  But don't get me wrong, I'm sure people feel more secure about their images with this mod installed.

Just my .02¢

Well the function is there and I personally see how some sites would use it - not all internet users even know how to view a page source, so it does stop alot. Again, alot of people don't know how to CTRL+C, so it stops copying aswell in some cases. Plus, why do we have any security features in SMF, since someone could still bypass them all... It stops a majority of people from doing it, so is still good...

SoLoGHoST


Sabre™

I've never seen you post rude reply before SoLo.
Interesting ..
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Liam.

Quote from: Sabre™ on May 23, 2010, 02:55:42 AM
I've never seen you post rude reply before SoLo.
Interesting ..

Wasn't really a rude reply, just stating his opinion, which I have to agree with. I would never consider using this on my own site but I do 100% understand why other webmasters would choose to. There's another thing, this simply gives them a choice ;)

Sabre™

Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


SoLoGHoST

Quote from: Sabre™ on May 23, 2010, 02:55:42 AM
I've never seen you post rude reply before SoLo.
Interesting ..

OMG, was that rude?  I'm sorry, I didn't think of it like that.  Nowadays I'm getting a bit of a bad habit of sarcasm in the way I come across sometimes.  Thanks for pointing that out Sabre.  And sorry bout that Liam, I know what you are saying though, don't get me wrong, and it seems that you didn't either, cool.

Cheers :)

adbrad

Quote from: adbrad on May 22, 2010, 04:30:47 AM
// Disable Right Click v4 By: NIBOGO
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'] .= ' <-------this is the line in the error
       <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>';     
    }
}


that is everything the mod adds to subs.php

still no feedback on this issue i have disabled the mod no errors i re-enable mod and get errors again so definitely this mod causing trouble if i don't get any answers i will simply have to uninstall mod

adbrad

11 days and still no solution this seems to be a conflict with simpleportal so i guess my issue will not get resolved

adbrad

#238
3 more days and still no solution to my problem.
Why do people bother taking over mods if they can't be bothered to support them.
14 days with no response is ridiculous. Infact its been over 3 weeks as i posted requested information on 22nd may

Liam.

Sorry for my unsupporting of this mod (and all others I have at the moment) over the past... while. I'll get to your support request as soon as possible; I'm trying to replicate it locally now.

Advertisement: