coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: bean on July 21, 2004, 11:08:21 AM

Title: [Solved]: prevent right mouse clicking
Post by: bean on July 21, 2004, 11:08:21 AM
Hey

I cant use .htaccess so I need to find out how to prevent people from hotlinking to the pictures I have in the gallery.
An idea I have is to prevent right mouse clicking and it seems to work. But I can't find the place to add the java script code for the
full size image. Where do I but the java code to disable right click for the full size image ?
Title: Re: prevent right mouse clicking
Post by: Joachim Müller on July 21, 2004, 12:52:38 PM
edit displayimage.php, find// Display the full size image
function display_fullsize_pic()
{
    global $CONFIG, $HTTP_GET_VARS, $THEME_DIR, $ALBUM_SET;
    global $lang_errors, $lang_fullsize_popup, $lang_charset;

    if (function_exists('theme_display_fullsize_pic')) {
        theme_display_fullsize_pic();
        return;
    }

    ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php echo $CONFIG['gallery_name'?>: <?php echo $lang_fullsize_popup['click_to_close'];
    
?>
</title>
<meta http-equiv="content-type" content="text/html; charset=<?php echo $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'?>" />
<link rel="stylesheet" href="<?php echo $THEME_DIR ?>style.css" />
<script type="text/javascript" src="scripts.js"></script>
</head>
<body scroll="auto" marginwidth="0" marginheight="0">
<script language="JavaScript" type="text/JavaScript">
adjust_popup();
</script>
and add your "no right-click" script after it.

GauGau

P.S. I guess you're aware that no right-click sripts will only prevent complete and utter newbies from finding out the url of a pics. I wouldn't waste any energies on such a solution...
Title: Re: prevent right mouse clicking
Post by: bean on July 21, 2004, 02:57:18 PM
Quote from: GauGau on July 21, 2004, 12:52:38 PM
P.S. I guess you're aware that no right-click sripts will only prevent complete and utter newbies from finding out the url of a pics. I wouldn't waste any energies on such a solution...

That's the idea :-) Thanks!