News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

How to require name for anonymous comments?

Started by Iso-D, October 02, 2003, 06:53:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Iso-D

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?

boii

i assume this will work:

add this:

<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:
<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

hardlocke

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

Joachim Müller

edit /themes/yourtheme/theme.php and look for<form method="post" name="post" action="db_input.php">Replace it with<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

docgonzo

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 ?

Joachim Müller

edit lang/yourlanguage.php and remove the translation for anonymous: find'your_name' => 'Anon',and replace it with'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