Author Topic: Disable right click only for guests  (Read 6525 times)

0 Members and 1 Guest are viewing this topic.

Offline marceloraf

  • Pre-Newbie
  • Posts: 3
    • View Profile
Disable right click only for guests
« on: September 01, 2006, 12:15:31 PM »
I searched all the forum and don't find this. It's possible to use the javascript code to disable right click only for guests??? The registered users could save the images usually.

I hope somebody can help myself.

Offline marceloraf

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: Disable right click only for guests
« Reply #1 on: September 02, 2006, 10:26:49 AM »
 :(

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Disable right click only for guests
« Reply #2 on: September 02, 2006, 03:22:31 PM »
have you tryed use {if user_loggedout} {endif user_loggedout} tags in header.html? (refer FAQ for more info about right click popup)
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)

Offline marceloraf

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: Disable right click only for guests
« Reply #3 on: September 03, 2006, 12:54:32 PM »
Thank you. I'll try do this.  :)

Offline KimmyMarie

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Disable right click only for guests
« Reply #4 on: July 09, 2007, 12:36:25 AM »
have you tryed use {if user_loggedout} {endif user_loggedout} tags in header.html? (refer FAQ for more info about right click popup)

Where do those need to be placed to work?


Thanks,
Kimmy

manurom

  • Guest
Re: Disable right click only for guests
« Reply #5 on: July 09, 2007, 01:05:36 AM »
Hello, KimmyMarie;
if you use 4images V. 1.7.4, change the whole code in templates/your_template/header.html to this one (assuming you have not made any change before or do not have downloaded a moded header.html template file):
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');
  }
 
// -->
</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}
{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 />

Offline KimmyMarie

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Disable right click only for guests
« Reply #6 on: July 09, 2007, 03:39:50 AM »
It worked perfectly! :D :D :D Thanks manurom!



Best wishes,
Kimmy