Advanced search  


cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.

Pages: [1]   Go Down

Author Topic: Adding javascript to Coppermine php pages  (Read 2829 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Adding javascript to Coppermine php pages
« on: May 11, 2005, 03:20:42 pm »

Hi i am a total newbie to php.
I have a photo gallery called coppermine, I wanted to add some security to the displayimage.php page. Wherever i add the code in the page it doesn't accept the javascript.
i am trying to add no right click script etc. Would it be best to do this as a separate .js file and call it in the php, but i am not sure how to write it.
Basically i want to stop people taking the images.
Code i want to add:

Code: [Select]
<meta http-equiv="pragma" content="no-cache">
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<script language="JavaScript1.2">
if (window.Event)

function nocontextmenu() {
  event.cancelBubble = true, event.returnValue = false;

  return false;

function norightclick(e) {
  if (window.Event) {
    if (e.which == 2 || e.which == 3) return false;
  else if (event.button == 2 || event.button == 3) {
    event.cancelBubble = true, event.returnValue = false;
    return false;

if (document.layers)

document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;
document.onmouseup = norightclick;

<script language="javascript">
function noLeftClick() {
if (event.button==1) {

<script language="javascript">


function clearboard()

<script language="JavaScript1.2">

//No Text Select
//For script visit

function disableselect(e){
return false

function reEnable(){
return true

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

//if NS6
if (window.sidebar){

I am trying to add this to the php page which displays the main image when thumbnails are clicked which is called displayimage.php:

Pages: [1]   Go Up

Page created in 0.023 seconds with 19 queries.