danielford99 Posted April 6, 2004 Posted April 6, 2004 Anyone any ideas if I am able to stop users downloading pictures from my site? I have some JavaScript that used to work with my old HTML site but I don't want to mess up my current site... Where can I out the JavaScript? is it in the index.php file? if so where!? Dan
sam6 Posted April 6, 2004 Posted April 6, 2004 in the <body> tag of index.php and pronucts info.php put oncontextmenu="return false" this will disable right click on your main pages if you want to diable for all pages you will have to put that in the body tag of all of the main php pages i dont think it will stop them from stealing images but it might help!
danielford99 Posted April 6, 2004 Author Posted April 6, 2004 Hi, Thanks for that. I have some JavaScript that I was hoping I could use, it has a copyright notice in it: <script language="Javascript1.2"> <!-- // © 2003 CodeLifter.com // Source: CodeLifter.com // Do not remove this header // Set the message for the alert box am = "WARNING: Copyright ? 2004 Movie-Shop"; // do not edit below this line // =========================== bV = parseInt(navigator.appVersion) bNS = navigator.appName=="Netscape" bIE = navigator.appName=="Microsoft Internet Explorer" function nrc(e) { if (bNS && e.which > 1){ alert(am) return false } else if (bIE && (event.button >1)) { alert(am) return false; } } document.onmousedown = nrc; if (document.layers) window.captureEvents(Event.MOUSEDOWN); if (bNS && bV<5) window.onmousedown = nrc; function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> But when I put it in the body tag I get a 'n' showing up at the top of my category pics and my items. Something is making it put an 'n' in for every category/item in that page??? Really don't understand why, do you think it is something to do with not using dequalifiers in the javascript (\)
sam6 Posted April 6, 2004 Posted April 6, 2004 I am not sure i copied the script exactly as you have it above in the head of my test site it worked fine on index.php
rekhis Posted April 6, 2004 Posted April 6, 2004 Look at the following contribution, it will do the trick for you - http://www.oscommerce.com/community/contributions,1395/ ...Manjeet
radders Posted April 6, 2004 Posted April 6, 2004 The only way to stop people downloading them is not to put them there in the first place. Disbling right click just pisses people of without stopping them downloading. If it can be displayed it can be dwonloadd. Try only displaying a thumbnail, watermarking or, even better, printing your website address across all image.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.