Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

copy protection

Asked Modified Viewed 2,168 times
D
dabnis
D
dabnis 10
  • Junior Member, joined since
  • Contributed 44 posts on the community forums.
  • Started 19 threads in the forums
  • Started this discussions
asked
Junior Member

Hi

How can i disable the right click funtion on a php-fusion site to prevent anyone from copying my information? or any other ideas?

Thanks
Dabnis
0 replies

9 posts

F
fetloser
F
  • Senior Member, joined since
  • Contributed 275 posts on the community forums.
  • Started 2 threads in the forums
answered
Senior Member

This at the very least disables right clicks.
Look in your fusion root, open up subheader.php and replace all of it with this. All done.

<?php
/*---------------------------------------------------+
| PHPFusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: index.php"); exit; }

require_once THEME."theme.php";

if ($settings['maintenance'] == "1" && !iADMIN) fallback(BASEDIR."maintenance.php");
if (iMEMBER) $result = dbquery("UPDATE ".$db_prefix."users SET user_lastvisit='".time()."', user_ip='".USER_IP."' WHERE user_id='".$userdata['user_id']."'");

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<title>".$settings['sitename']."</title>
<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."'>
<meta name='description' content='".$settings['description']."'>
<meta name='keywords' content='".$settings['keywords']."'>
<link rel='stylesheet' href='".THEME."styles.css' type='text/css'>
<script type='text/javascript' src='".INCLUDES."jscript.js'></script>
</head>
<body bgcolor='$body_bg' text='$body_text'>\n";
?>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//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>
<?php
render_header("<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."' title='".$settings['sitename']."'>");
?>
0 replies
D
dabnis
D
dabnis 10
  • Junior Member, joined since
  • Contributed 44 posts on the community forums.
  • Started 19 threads in the forums
  • Started this discussions
answered
Junior Member

Thats super thanks!!! does any one have an idea if it is possible to disable the copy command at all
0 replies
M
Matonor
M
Impossible things are there to be made possible
  • Veteran Member, joined since
  • Contributed 1,022 posts on the community forums.
  • Started 3 threads in the forums
answered
Veteran Member

no
0 replies
F
fetloser
F
  • Senior Member, joined since
  • Contributed 275 posts on the community forums.
  • Started 2 threads in the forums
answered
Senior Member

Do this for subheader.php, it's not entirely fool proof, but will certainly discard some folk... (it doesn't disable the copy, but disables marking text...)

<?php
/*---------------------------------------------------+
| PHPFusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: index.php"); exit; }

require_once THEME."theme.php";

if ($settings['maintenance'] == "1" && !iADMIN) fallback(BASEDIR."maintenance.php");
if (iMEMBER) $result = dbquery("UPDATE ".$db_prefix."users SET user_lastvisit='".time()."', user_ip='".USER_IP."' WHERE user_id='".$userdata['user_id']."'");

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<title>".$settings['sitename']."</title>
<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."'>
<meta name='description' content='".$settings['description']."'>
<meta name='keywords' content='".$settings['keywords']."'>
<link rel='stylesheet' href='".THEME."styles.css' type='text/css'>
<script type='text/javascript' src='".INCLUDES."jscript.js'></script>
</head>
<body bgcolor='$body_bg' text='$body_text' onload='onKeyDown();'>\n";
?>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//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>
<script language="javascript">

function onKeyDown() {
  // current pressed key
  var pressedKey = String.fromCharCode(event.keyCode).toLowerCase();

  if (event.ctrlKey && (pressedKey == "c" ||
                        pressedKey == "v")) {
    // disable key press porcessing
    event.returnValue = false;
  }

} // onKeyDown

</script>
<script language="JavaScript1.2">

function disableselect(e){
return false
}

function reEnable(){
return true
}

//if IE4+
document.onselectstart=new Function ("return false")

//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
<?php
render_header("<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."' title='".$settings['sitename']."'>");
?>
0 replies
B
Basti
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
answered
Veteran Member

This "protection" is very bad. If somebody looks into the source, he can have the whole website. So he does not need the right click function or to mark the text...
0 replies
D
dabnis
D
dabnis 10
  • Junior Member, joined since
  • Contributed 44 posts on the community forums.
  • Started 19 threads in the forums
  • Started this discussions
answered
Junior Member

Thanks fetloser, only problem if you do the last mentioned, it disables all mouse clicks and that means that you can't click inside the login block to login
0 replies
F
fetloser
F
  • Senior Member, joined since
  • Contributed 275 posts on the community forums.
  • Started 2 threads in the forums
answered
Senior Member

oh, sorry didn't realize that. Guess that sucks...

I'll see if i can find something else... and as slaughter says, this just stops the general mass, the more experienced folks will find a way anyway.
0 replies
D
dabnis
D
dabnis 10
  • Junior Member, joined since
  • Contributed 44 posts on the community forums.
  • Started 19 threads in the forums
  • Started this discussions
answered
Junior Member

in the end thats the only thing I want to do, keep the illiterate from easily steeling my work and diong their own.
Edited by dabnis on 06-12-2007 14:00,
0 replies
A
alcazar
A
Alcazar
nach Diktat spazierengegangen
  • Senior Member, joined since
  • Contributed 247 posts on the community forums.
  • Started 5 threads in the forums
answered
Senior Member

Yeah, the DAU's you can stop with that.
It may sound stupid, but the only way to "protect" your work is to not show it in internet.
There're lots of ways to get the content or images.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 9 posts
  • Votes 0 votes
  • Topic users 5 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet