where do i paste disable right click code?

GK User
Tue Dec 20, 2011 11:34 am
I need some sort of disable right click or disable copying photos function so I have pasted the following




<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="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>


into the body section of the template like I have done for all Joomla Sites in the past but this time it is not working. Any Suggestions?
User avatar
Gold Boarder

teitbite
Tue Dec 20, 2011 1:53 pm
Hi

Try add it to /layouts/blocks/head.php

Are You sure this code is full ? I do not see the trigger.
User avatar
Moderator

GK User
Thu Dec 29, 2011 8:30 am
Sorry I have tried to guess where that is but have had no luck. Can you say where to paste it for the really low IQ person to understand?
and no im not sure it is the full code Ill try finding another one if this one doesnt work once I know where to paste them.
Thanks
User avatar
Gold Boarder

GK User
Thu Dec 29, 2011 4:02 pm
Please open template directory and find file layouts/blocks/head.php and then paste this code at the end of this file.
User avatar
Platinum Boarder

teitbite
Thu Dec 29, 2011 6:16 pm
Hi

Exacly. The end of the file I've mentioned before is the best solution.
User avatar
Moderator

GK User
Fri Dec 30, 2011 12:07 am
I went to my host website cpanel as I couldnt find the file in the template menu on the joomla backend and I found /home/polomag1/public_html/templates/gk_myfolio/layouts/blocks/head.php

I hope this was the right one

it asked me if I wanted some encoder turned off if I was only using english so I clicked yes to that
and proceeded to past the code at the very end of the document and save however this made my whole site dissapear. So I tried another variation of the disable right click code and it it too ended with the same. So am I in the right place?
All these codes say to place them directly after the head tag
others say in the body section.
Still lost on this.
User avatar
Gold Boarder

teitbite
Fri Dec 30, 2011 6:13 pm
Hi

This is the right file. We do not see Your server so the root for us is a template folder (our product).

The problem may be with an editor. It's safier to edit it with notepad, vi or any other plain simple text editor You may have. If the code is wrong or not complete than the page may dissapear also.

If it should be in <body> section than You should edit /layouts/default.php file. You will fing <body> tag there.
User avatar
Moderator

GK User
Sat Dec 31, 2011 11:40 am
Well I went to cpanel again with another code so that makes four diffent codes. 2 of which I know worked before. All have made the site disappear. How do I find that file without going to cpanel? it is not in the template list on the joomla backend. ??
User avatar
Gold Boarder

GK User
Sat Dec 31, 2011 12:05 pm
Why don't you use AntiCopy Plugin , easy and effective.

AntiCopy
Code: Select all
http://extensions.joomla.org/extensions/access-a-security/content-restriction/17001
User avatar
Platinum Boarder

GK User
Sat Dec 31, 2011 12:06 pm
I'll have a look right now thanks for the tip.
User avatar
Gold Boarder

GK User
Sat Dec 31, 2011 1:49 pm
:cheer: :lol: normanUK Thank You. Your recommended Plug-In already Installed and working! Happy New Year! :silly: :side: :woohoo:
User avatar
Gold Boarder

teitbite
Mon Jan 02, 2012 2:51 pm
Hi

Hehe. I've thought You've already tried that :) Glad You made it working.
User avatar
Moderator


cron