4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 17, 2017, 03:20:01 PM

Login with username, password and session length
Search:     Advanced search
4images is now on facebook. Click here and become a fan!
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Help / Hilfe
| |-+  FAQ, Tips
| | |-+  Remove the right-click disabler / or remove only for Members
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 3 4 » »» Print
Author Topic: Remove the right-click disabler / or remove only for Members  (Read 129071 times)
Jan
Administrator
4images Guru
*****
Offline Offline

Posts: 5024

Thank You
-Given: 0
-Receive: 27


View Profile WWW
« 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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  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;
« Last Edit: February 21, 2009, 11:06:00 PM by V@no » Logged

Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
TheOracle
Guest
« Reply #1 on: September 04, 2005, 03:41:26 PM »

For users who uses Mozilla Firefox,

change :

Quote  [Expand]

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 :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

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;

Logged
jko
Pre-Newbie

Offline Offline

Posts: 1

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #2 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.

??
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #3 on: March 01, 2006, 12:55:47 AM »

cut-and-paste ???
There is nothing to paste, only cut! Wink

P.S. Disregard TheOracle's post, since it wasnt related to this topic...as usual...
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
cme550
Pre-Newbie

Offline Offline

Posts: 5

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #4 on: April 06, 2006, 04:46:42 AM »

Has anyone been able to get this to work? because it doesn't work for me Sad
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #5 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!
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
cme550
Pre-Newbie

Offline Offline

Posts: 5

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #6 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?
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #7 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.
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
cme550
Pre-Newbie

Offline Offline

Posts: 5

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #8 on: April 07, 2006, 12:16:24 AM »

Ok, whatever, Ill switch to Coppermine
Logged
Gwydion
Full Member
***
Offline Offline

Posts: 126

Thank You
-Given: 0
-Receive: 2


View Profile
« Reply #9 on: April 09, 2006, 11:16:21 PM »

LOL!
I found Coppermine more complicated than 4imges.

Anyway, removing the fuction part works perfect. Thanks.
Logged
tdkpaul
Full Member
***
Offline Offline

Posts: 205

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #10 on: July 15, 2006, 02:30:02 AM »

Ok, whatever, Ill switch to Coppermine
LLLLLLLLLLLLLLLLLLLLLOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLlll

 Laughing Laughing Laughing Laughing Laughing Laughing Laughing Laughing

 Rolling Eyes

[EDITED by V@no]
Check your keyboard, I think some of the keys are stuck Razz
« Last Edit: July 15, 2006, 07:32:31 AM by V@no » Logged
comicart
Full Member
***
Offline Offline

Posts: 147

Thank You
-Given: 3
-Receive: 2


View Profile
« Reply #11 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.

1
2
3
}

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

?
T
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #12 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.
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
MikeR
Pre-Newbie

Offline Offline

Posts: 3

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #13 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  Cool
Logged
jimraynor
Jr. Member
**
Offline Offline

Posts: 53

Thank You
-Given: 12
-Receive: 1


View Profile
« Reply #14 on: January 02, 2007, 04:58:26 AM »

i am using 1.7.4. How can i do this problem
Logged
Pages: [1] 2 3 4 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.263 seconds with 19 queries.
Post your comments here