[SOLVED] Where script should be place

nogates

Joined: 2011-04-13
Posts: 26
Posted: Wed, 2011-04-13 17:17

I whant to put "no save as or right click" in gallery,where the script should be place.
<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

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

From that page of gallery 1. http://codex.gallery2.org/Gallery1:Securing#Other_Methods

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2011-04-13 17:29

First that doesn't provide any security at all.

Try this module:
http://codex.gallery2.org/Gallery3:Modules:norightclick

I can still download your photos with that installed though....
____________________________________________
Like Gallery? Like the support? Donate now!

 
nogates

Joined: 2011-04-13
Posts: 26
Posted: Wed, 2011-04-13 17:44

I know all about cache screanshot and all.But it prevent a basic windows user from getting it.
Thanks will try.

 
nogates

Joined: 2011-04-13
Posts: 26
Posted: Wed, 2011-04-13 19:33

Well don't seem to be working,i did install it an activate it in gallery.
gallery 3.0.1,Grey Dragon Theme
Missing something here.
thanks for the quick answer:)

 
Serge D
Serge D's picture

Joined: 2009-06-11
Posts: 2466
Posted: Wed, 2011-04-13 23:01

yes, you are missing something
have installed, activated and tested - works just fine
check that you have unpacked module correctly
please note that Zip file is somewhat confusing - there are module.info in the root and inside norightclick folder
you need to copy norightclick folder from the zip into modules folder and not a whole ZIP content

 
nogates

Joined: 2011-04-13
Posts: 26
Posted: Thu, 2011-04-14 00:02

I try what you said because before i copy the hole file but not zip one.
now i get the green bar saying it's activate but there no mark beside norightclick (in the small square)
Did remove and refresh page and upload back,it stop showing if i remoove and back.

 
nogates

Joined: 2011-04-13
Posts: 26
Posted: Thu, 2011-04-14 00:16

Maybe now i screw something because before whit the full file it was able to install and was on top of the list.
now it's where it should be in list but the square don't stay green.

 
Serge D
Serge D's picture

Joined: 2009-06-11
Posts: 2466
Posted: Thu, 2011-04-14 03:34
nogates wrote:
Maybe now i screw something because before whit the full file it was able to install and was on top of the list.
now it's where it should be in list but the square don't stay green.

ok, let's start from scratch

  • download zip
  • unzip it in folder "111" on your local machine
  • inside this folder now you would find file module.info and norightclick folder
  • on your server in modules folder make sure there is no trace of your last attempts
  • copy just norightclick folder from your local machine to your server's modules folder
  • now, activate module and test it
 
nogates

Joined: 2011-04-13
Posts: 26
Posted: Thu, 2011-04-14 05:22

Thanks.
Work fine now,had to uncheck all module then reselect all to activate it.
nice support thanks again.