forum.coppermine-gallery.net

Support => Older/other versions => cpg1.1.X Support (standalone) => Topic started by: Iso-D on October 02, 2003, 06:53:40 pm

Title: How to require name for anonymous comments?
Post by: Iso-D 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?
Title: How to require name for anonymous comments?
Post by: boii 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
Title: How to require name for anonymous comments?
Post by: hardlocke on October 13, 2003, 02:35:41 pm
where is the code to replace? sorry, bi i'm not a big coder.. :oops:
Title: How to require name for anonymous comments?
Post by: Joachim Müller 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
Title: How to require name for anonymous comments?
Post by: docgonzo 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 ?
Title: How to require name for anonymous comments?
Post by: Joachim Müller 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