Advanced search  

News:

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.
[more]

Pages: [1]   Go Down

Author Topic: [Solved]: Need help, copyright radio button  (Read 5678 times)

0 Members and 1 Guest are viewing this topic.

jolly

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
[Solved]: Need help, copyright radio button
« on: May 07, 2009, 04:02:45 pm »

hello
I want to enable uploding picture for non-register user. My gallery including a picture of people, so
I need to do some changes in upload.php file. This file must icluding "I certify that I have the copyright on these photos" phrase, and check or radio button.
Without mark that buton, user cannot click continue and upload files.
This is very Important.    
I do not want to be responsible for the photos posted on my site.

I know i can include that phrase in registration rules,  but like i said, uploding module must be enabled for everyone.

Can someone can help me with this ? I have no idea how to start...
« Last Edit: May 09, 2009, 02:32:36 pm by Joachim Müller »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Need help, copyright radio button
« Reply #1 on: May 07, 2009, 11:05:20 pm »

I do not want to be responsible for the photos posted on my site.
That's an "exotic" attitude. Making your visitors tick that checkbox doesn't mean much in legal terms.
Logged

jolly

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: Need help, copyright radio button
« Reply #2 on: May 08, 2009, 07:42:18 am »

Quote
That's an "exotic" attitude. Making your visitors tick that checkbox doesn't mean much in legal terms.

Thank you for your opinion, Joachim.
But for me and for polish lawyers it is very important, and change everything in legal terms.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Need help, copyright radio button
« Reply #3 on: May 08, 2009, 04:47:25 pm »

Edit upload.php then and add the checkbox there - shouldn't be too complicated, just plain HTML and JavaScript.
Logged

jolly

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: Need help, copyright radio button
« Reply #4 on: May 09, 2009, 09:14:41 am »

To be honest , I am a php noob :-[
I tried to put checkbox function in upload.php, but wherever i add this function , it is not showed.

I need assistance if somebody is willing..
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Need help, copyright radio button
« Reply #5 on: May 09, 2009, 01:53:10 pm »

No PHP skills needed - all it needs is HTML skills. You could have googled for a solution, as this is being covered on many sites. Here's the JavaScript-driven solution that will not work if your visitors have turned JavaScript off. If you need the foolproof method that works with JavaScript turned off as well, you will need PHP skills, as you will have to edit the code at db_input.php.
Anyway, here's the solution: edit upload.php , find
Code: [Select]
    </script>and add before it into a new line of it's own
Code: [Select]
var checkobj

function agreesubmit(el){
    checkobj=el
    if (document.all||document.getElementById){
        for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
            var tempobj=checkobj.form.elements[i]
            if(tempobj.type.toLowerCase()=="submit")
                tempobj.disabled=!checkobj.checked
        }
    }
}

function defaultagree(el){
    if (!document.all&&!document.getElementById){
        if (window.checkobj&&checkobj.checked)
            return true
        else{
            alert("I am sure")
            return false
        }
    }
}

Then find
Code: [Select]
    <form method="post" action="$path" enctype="multipart/form-data">and replace with
Code: [Select]
    <form name="uploadform" method="post" action="$path" enctype="multipart/form-data"  onSubmit="return defaultagree(this)">
Finally, find
Code: [Select]
                        <input type="submit" value="{$button_value}" class="button" />and replace with
Code: [Select]
                        <input name="agreecheck" id="agreecheck" type="checkbox" onClick="agreesubmit(this)" /><label for="agreecheck">I swear that I'm a nice guy and won't upload copyrighted material, yada yada.</label>
                </td>

        </tr>
        <tr>
                <td colspan="2" align="center" class="tablef">
                        <input type="submit" value="{$button_value}" class="button"  disabled="disabled" />
Not one single line of PHP affected - all plain HTML and JavaScript.

The code I have pasted in comes originally from modifyalb.php...
Logged

jolly

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: Need help, copyright radio button
« Reply #6 on: May 09, 2009, 02:13:25 pm »

Thank you !!!  You are TopMan.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.