Revision 1898
Added by Dietmar about 11 years ago
view.php | ||
---|---|---|
4 | 4 |
* @category module |
5 | 5 |
* @package Form |
6 | 6 |
* @author WebsiteBaker Project |
7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
|
8 |
* @link http://www.websitebaker2.org/
|
|
7 |
* @copyright 2009-2013, WebsiteBaker Org. e.V.
|
|
8 |
* @link http://www.websitebaker.org/
|
|
9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
10 | 10 |
* @platform WebsiteBaker 2.8.x |
11 | 11 |
* @requirements PHP 5.2.2 and higher |
12 | 12 |
* @version $Id$ |
13 |
* @filesource $HeadURL$
|
|
13 |
* @filesource $HeadURL$
|
|
14 | 14 |
* @lastmodified $Date$ |
15 | 15 |
* @description |
16 | 16 |
*/ |
... | ... | |
162 | 162 |
if($query_fields->numRows() > 0) { |
163 | 163 |
?> |
164 | 164 |
<form <?php echo ( ( (strlen($form_name) > 0) AND (false == $use_xhtml_strict) ) ? "id=\"".$form_name.$section_id."\"" : ""); ?> action="<?php echo htmlspecialchars(strip_tags($_SERVER['SCRIPT_NAME'])).'';?>" method="post"> |
165 |
<fieldset> |
|
165 |
<fieldset class="frm-fieldset">
|
|
166 | 166 |
<input type="hidden" name="submission_id" value="<?php echo $_SESSION['form_submission_id']; ?>" /> |
167 | 167 |
<?php |
168 | 168 |
$iFormRequestId = isset($_GET['fri']) ? intval($_GET['fri']) : 0; |
... | ... | |
456 | 456 |
|
457 | 457 |
// Check if the user forgot to enter values into all the required fields |
458 | 458 |
if(sizeof($required )) { |
459 |
|
|
459 |
echo "<div class=\"frm-warning\">\n"; |
|
460 | 460 |
if(!isset($MESSAGE['MOD_FORM_REQUIRED_FIELDS'])) { |
461 | 461 |
echo '<h3>You must enter details for the following fields</h3>'; |
462 | 462 |
} else { |
463 | 463 |
echo '<h3>'.$MESSAGE['MOD_FORM_REQUIRED_FIELDS'].'</h3>'; |
464 | 464 |
} |
465 |
echo "<ol class=\"warning\">\n";
|
|
465 |
echo "<ol>\n"; |
|
466 | 466 |
foreach($required AS $field_title) { |
467 | 467 |
if($field_title!=''){ |
468 | 468 |
echo '<li>'.$field_title."</li>\n"; |
469 | 469 |
} |
470 | 470 |
} |
471 |
|
|
472 | 471 |
if(isset($email_error)) { |
473 | 472 |
echo '<li>'.$email_error."</li>\n"; |
474 | 473 |
} |
475 |
|
|
476 | 474 |
if(isset($captcha_error)) { |
477 | 475 |
echo '<li>'.$captcha_error."</li>\n"; |
478 | 476 |
} |
479 | 477 |
// Create blank "required" array |
480 | 478 |
$required = array(); |
481 | 479 |
echo "</ol>\n"; |
482 |
|
|
483 |
echo '<p> </p>'."\n".'<p><a href="'.htmlspecialchars(strip_tags($_SERVER['SCRIPT_NAME'])).'">'.$TEXT['BACK'].'</a></p>'."\n";
|
|
480 |
echo "</div>\n"; |
|
481 |
echo '<p class="frm-warning"><a href="'.htmlspecialchars(strip_tags($_SERVER['SCRIPT_NAME'])).'">'.$TEXT['BACK'].'</a></p>'."\n";
|
|
484 | 482 |
} else { |
485 | 483 |
if(isset($email_error)) { |
486 |
echo '<br /><ol class=\"warning\">'."\n"; |
|
484 |
echo "<div class=\"frm-warning\">\n"; |
|
485 |
echo '<br /><ol>'."\n"; |
|
487 | 486 |
echo '<li>'.$email_error.'</li>'."\n"; |
488 | 487 |
echo '</ol>'."\n"; |
489 |
echo '<a href="'.htmlspecialchars(strip_tags($_SERVER['SCRIPT_NAME'])).'">'.$TEXT['BACK'].'</a>'; |
|
488 |
echo "</div>\n"; |
|
489 |
echo '<p class="frm-warning"><a href="'.htmlspecialchars(strip_tags($_SERVER['SCRIPT_NAME'])).'">'.$TEXT['BACK'].'</a></p>'."\n"; |
|
490 | 490 |
} elseif(isset($captcha_error)) { |
491 |
echo '<br /><ol class=\"warning\">'."\n"; |
|
491 |
echo "<div class=\"frm-warning\">\n"; |
|
492 |
echo '<br /><ol>'."\n"; |
|
492 | 493 |
echo '<li>'.$captcha_error.'</li>'."\n"; |
493 | 494 |
echo '</ol>'."\n"; |
494 |
echo '<p> </p>'."\n".'<p><a href="'.htmlspecialchars(strip_tags($_SERVER['SCRIPT_NAME'])).'">'.$TEXT['BACK'].'</a></p>'."\n"; |
|
495 |
echo "</div>\n"; |
|
496 |
echo '<p class="frm-warning"><a href="'.htmlspecialchars(strip_tags($_SERVER['SCRIPT_NAME'])).'">'.$TEXT['BACK'].'</a></p>'."\n"; |
|
495 | 497 |
} else { |
496 |
// Check how many times form has been submitted in last hour
|
|
498 |
// Check how many times form has been submitted in last hour |
|
497 | 499 |
$last_hour = time()-3600; |
498 | 500 |
$sql = 'SELECT `submission_id` FROM `'.TABLE_PREFIX.'mod_form_submissions` '; |
499 | 501 |
$sql .= 'WHERE `submitted_when` >= '.$last_hour.''; |
... | ... | |
502 | 504 |
{ |
503 | 505 |
if($query_submissions->numRows() > $max_submissions) |
504 | 506 |
{ |
505 |
// Too many submissions so far this hour
|
|
507 |
// Too many submissions so far this hour |
|
506 | 508 |
echo $MESSAGE['MOD_FORM_EXCESS_SUBMISSIONS']; |
507 | 509 |
$success = false; |
508 | 510 |
} else { |
Also available in: Unified diff
! update form module, add class frm-fieldset to fieldset, restyle error box
! update captcha iframe attribute settings