function cmtx_output_captcha() { global $cmtx_path; if (cmtx_session_set() && isset($_SESSION['cmtx_captcha']) && $_SESSION['cmtx_captcha'] == cmtx_setting('session_key')) { } else { if (cmtx_setting('enabled_captcha') && cmtx_setting('captcha_type') == 'securimage' && extension_loaded('gd') && function_exists('imagettftext')) { ?> <div class="cmtx_height_between_fields"></div> <label class="cmtx_label"><?php echo CMTX_LABEL_CAPTCHA; if (cmtx_setting('display_required_symbol')) { ?> <span class="cmtx_required_symbol"><?php echo ' ' . CMTX_REQUIRED_SYMBOL; ?> </span><?php } ?> </label> <img id="cmtx_securimage" class="cmtx_securimage" src="<?php echo cmtx_commentics_url(); ?> external/securimage/securimage_show.php" alt="Captcha" title="Captcha"/> <object type="application/x-shockwave-flash" wmode="transparent" data="<?php echo cmtx_commentics_url(); ?> external/securimage/securimage_play.swf?audio_file=<?php echo cmtx_commentics_url(); ?> external/securimage/securimage_play.php&icon_file=<?php echo cmtx_commentics_url(); ?> external/securimage/images/audio_icon.png" title="<?php echo CMTX_TITLE_SECURIMAGE_AUDIO; ?> " class="cmtx_securimage_audio_icon"> <param name="movie" value="<?php echo cmtx_commentics_url(); ?> external/securimage/securimage_play.swf?audio_file=<?php echo cmtx_commentics_url(); ?> external/securimage/securimage_play.php&icon_file=<?php echo cmtx_commentics_url(); ?> external/securimage/images/audio_icon.png"/> </object> <br/> <a href="<?php echo cmtx_url_encode(cmtx_current_page()); ?> " onclick="document.getElementById('cmtx_securimage').src = '<?php echo cmtx_commentics_url(); ?> external/securimage/securimage_show.php?' + Math.random(); return false"><img src="<?php echo cmtx_commentics_url(); ?> external/securimage/images/refresh_icon.png" alt="Refresh" title="<?php echo CMTX_TITLE_SECURIMAGE_REFRESH; ?> " class="cmtx_securimage_refresh_icon"/></a> <div style="clear: left;"></div> <div class="cmtx_label"> </div> <span class="securimage_text"><?php echo CMTX_TEXT_SECURIMAGE; ?> </span> <input type="text" name="cmtx_captcha_code" class="cmtx_field cmtx_text_field cmtx_securimage_field" title="<?php echo CMTX_TITLE_SECURIMAGE; ?> " placeholder="<?php echo CMTX_PLACEHOLDER_CAPTCHA; ?> " maxlength="<?php echo cmtx_setting('field_maximum_captcha'); ?> " onkeypress="return cmtx_disable_enter_key(event)"/> <?php } else { if (cmtx_setting('enabled_captcha') && cmtx_setting('captcha_type') == 'recaptcha' && function_exists('fsockopen') && is_callable('fsockopen')) { ?> <div class="cmtx_height_between_fields"></div> <label class="cmtx_label"><?php echo CMTX_LABEL_CAPTCHA; if (cmtx_setting('display_required_symbol')) { ?> <span class="cmtx_required_symbol"><?php echo ' ' . CMTX_REQUIRED_SYMBOL; ?> </span><?php } ?> </label> <div class="cmtx_recaptcha"><?php if (cmtx_setting('recaptcha_public_key') == '' || cmtx_setting('recaptcha_private_key') == '') { echo '<span class="cmtx_recaptcha_no_key">' . CMTX_RECAPTCHA_NO_KEY . '</span>.'; } else { require_once $cmtx_path . 'includes/external/recaptcha/recaptchalib.php'; $cmtx_recaptcha_public_key = cmtx_setting('recaptcha_public_key'); echo recaptcha_get_html($cmtx_recaptcha_public_key); } ?> </div> <div style="clear: left;"></div><?php } } } }
cmtx_set_form_cookie($cmtx_name, $cmtx_email, $cmtx_website, $cmtx_town, $cmtx_country); //save form inputs $cmtx_default_name = cmtx_strip_slashes(cmtx_decode($cmtx_name)); $cmtx_default_email = cmtx_strip_slashes(cmtx_decode($cmtx_email)); $cmtx_default_website = cmtx_strip_slashes(cmtx_decode($cmtx_website)); $cmtx_default_town = cmtx_strip_slashes(cmtx_decode($cmtx_town)); $cmtx_default_country = cmtx_strip_slashes(cmtx_decode($cmtx_country)); } if (cmtx_session_set()) { //if there's a session $_SESSION['cmtx_resubmit_key'] = $_POST['cmtx_resubmit_key']; //add resubmit key to session } $cmtx_reply_id = 0; //reset the reply id if (cmtx_session_set()) { //if there's a session $_SESSION['cmtx_question'] = ''; //reset session $_SESSION['cmtx_captcha'] = ''; //reset session } if ($cmtx_rating != 0) { cmtx_delete_rating(); //delete guest rating if rated } } } } } //end of if-data-submitted
function cmtx_comment_resubmit() { //checks whether comment is new if (cmtx_session_set() && isset($_SESSION['cmtx_resubmit_key'])) { if ($_SESSION['cmtx_resubmit_key'] == $_POST['cmtx_resubmit_key']) { cmtx_error(CMTX_ERROR_MESSAGE_COMMENT_RESUBMIT); } } }