SaveConfig(); default: $this->ShowConfig(); break; } } /** * Save posted configuration options * */ public function SaveConfig(){ global $langmessage; $format = htmlspecialchars($_POST['date_format']); if( @date($format) ){ $this->config['date_format'] = $format; } $this->config['commenter_website'] = (string)$_POST['commenter_website']; if( isset($_POST['comment_captcha']) ){ $this->config['comment_captcha'] = true; }else{ $this->config['comment_captcha'] = false; } if( !\gp\tool\Files::SaveData($this->config_file, 'config', $this->config) ){ message($langmessage['OOPS']); return false; } message($langmessage['SAVED']); return true; } /** * Show EasyComments configuration options * */ public function ShowConfig(){ global $langmessage; $defaults = $this->Defaults(); $array = $_POST + $this->config; echo '

Easy Comments Configuration

'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo 'Option'; echo ''; echo 'Value'; echo ''; echo 'Default'; echo '
'; echo 'Date Format'; echo ' (About)'; echo ''; echo ''; echo ''; echo $defaults['date_format']; echo '
'; echo 'Commenter Website'; echo ''; echo ''; echo ''; echo 'Hide'; echo '
'; echo 'reCaptcha'; echo ''; if( !\gp\tool\Recaptcha::isActive() ){ $disabled = ' disabled="disabled" '; }else{ $disabled = ''; } if( $array['comment_captcha'] ){ echo ''; }else{ echo ''; } echo ''; echo ''; echo '
'; echo ''; echo ''; echo ' '; echo ' '; echo ''; echo '
'; } }