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: How to require name for anonymous comments?  (Read 12776 times)

0 Members and 1 Guest are viewing this topic.

Iso-D

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
How to require name for anonymous comments?
« on: October 02, 2003, 06:53:40 pm »

I have granted anonymous comments in my gallery, but most of the people are not filling the name box. There are many comments with the default name "nimesi" (finnish, roughly translated "your name"). So is there a way to require the anonymous people to fill the name box, so that I wouldn't have anymore of these "yourname"-comments?
Logged

boii

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
How to require name for anonymous comments?
« Reply #1 on: October 04, 2003, 09:23:43 am »

i assume this will work:

add this:
Code: [Select]

<script language="JavaScript" type="text/javascript">
<!--
function checkform ( form )
{
  // ** START **
  if (form.msg_author.value == "nimesi") {
    alert( "Please enter your name" );
    form.msg_author.focus();
    return false ;
  }
  // ** END **

  return true ;
//-->
</script>


non-finnish people, change 'nimesi' to 'Your name' or whatever applies.
finnish people, change 'Please enter ..' to finnish version.

and add this onsubmit to the form tag:
Code: [Select]
<form method="post" name="post" action="db_input.php" onsubmit="return checkform(this);">


i didn't try it out.
but i don't see why it wouldn't work.

cheers.
ken
Logged

hardlocke

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
How to require name for anonymous comments?
« Reply #2 on: October 13, 2003, 02:35:41 pm »

where is the code to replace? sorry, bi i'm not a big coder.. :oops:
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
How to require name for anonymous comments?
« Reply #3 on: October 13, 2003, 09:54:40 pm »

edit /themes/yourtheme/theme.php and look for
Code: [Select]
<form method="post" name="post" action="db_input.php">Replace it with
Code: [Select]
<form method="post" name="post" action="db_input.php" onsubmit="return checkform(this);">
<script language="JavaScript" type="text/javascript">
<!--
function checkform ( form )
{
  // ** START **
  if (form.msg_author.value == "your name") {
    alert( "Please enter your name" );
    form.msg_author.focus();
    return false ;
  }
  // ** END **

  return true ;
//-->
</script>
(also not tested, but should work. Better still, add the JavaScript part somewhere to the <head>).

GauGau
Logged

docgonzo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
How to require name for anonymous comments?
« Reply #4 on: February 05, 2004, 07:07:21 pm »

Tried this on my 1.2.1 install...
Doesn't do anything afaik.
I just want to force my visitors to enter their name (or anything for that matter) and their comment, but in the 1.2.1 it's standard on Anon...
How can i fix that ?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
How to require name for anonymous comments?
« Reply #5 on: February 06, 2004, 08:19:49 am »

edit lang/yourlanguage.php and remove the translation for anonymous: find
Code: [Select]
'your_name' => 'Anon',and replace it with
Code: [Select]
'your_name' => '',
This way, the user should be prompted to fill in a name when submitting a comment.
Allowing anonymous comments is not recommended though, as it will cause problems in the long run...

GauGau
Logged
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 18 queries.