/** * Verify the user submitted form by checking anti-spam hooks and/or recaptcha if they exist * @static * */ static function Check() { global $page, $langmessage, $config, $dataDir; // if hooks return false, stop if (!gpPlugin::Filter('AntiSpam_Check', array(true))) { return false; } // if recaptcha inactive, stop if (!gp_recaptcha::hasRecaptcha()) { return true; } //prevent undefined index warnings if there is a bot $_POST += array('recaptcha_challenge_field' => '', 'recaptcha_response_field' => ''); //includeFile('thirdparty/recaptchalib.php'); require_once $dataDir . '/include/thirdparty/recaptchalib.php'; $resp = recaptcha_check_answer($config['recaptcha_private'], $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field']); if (!$resp->is_valid) { message($langmessage['INCORRECT_CAPTCHA']); //if( common::LoggedIn() ){ // message($langmessage['recaptcha_said'],$resp->error); //} return false; } return true; }
/** * Verify the user submitted form by checking anti-spam hooks and/or recaptcha if they exist * @static * */ static function Check() { global $page, $langmessage, $config, $dataDir; // if hooks return false, stop if (!gpPlugin::Filter('AntiSpam_Check', array(true))) { return false; } // if recaptcha inactive, stop if (!gp_recaptcha::hasRecaptcha()) { return true; } if (empty($_POST['g-recaptcha-response'])) { return false; } require_once $dataDir . '/include/thirdparty/recaptcha/autoload.php'; if (!ini_get('allow_url_fopen')) { // allow_url_fopen = Off $recaptcha = new \ReCaptcha\ReCaptcha($config['recaptcha_private'], new \ReCaptcha\RequestMethod\SocketPost()); } else { // allow_url_fopen = On $recaptcha = new \ReCaptcha\ReCaptcha($config['recaptcha_private']); } if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip = $_SERVER['REMOTE_ADDR']; } $resp = $recaptcha->verify($_POST['g-recaptcha-response'], $ip); if (!$resp->isSuccess()) { //$error_codes = $resp->getErrorCodes(); //error_log(); msg($langmessage['INCORRECT_CAPTCHA']); return false; } return true; }
/** * Display the visitor form for adding comments * */ public function CommentForm() { if ($this->comments_closed) { echo '<div class="comments_closed">'; echo gpOutput::GetAddonText('Comments have been closed.'); echo '</div>'; return; } if ($this->comment_saved) { return; } $_POST += array('name' => '', 'website' => 'http://', 'comment' => ''); echo '<h3>'; echo gpOutput::GetAddonText('Leave Comment'); echo '</h3>'; echo '<form method="post" action="' . SimpleBlogCommon::PostUrl($this->post_id) . '">'; echo '<ul>'; //name echo '<li>'; echo '<label>'; echo gpOutput::GetAddonText('Name'); echo '</label><br/>'; echo '<input type="text" name="name" class="text" value="' . htmlspecialchars($_POST['name']) . '" />'; echo '</li>'; //website if (!empty(SimpleBlogCommon::$data['commenter_website'])) { echo '<li>'; echo '<label>'; echo gpOutput::GetAddonText('Website'); echo '</label><br/>'; echo '<input type="text" name="website" class="text" value="' . htmlspecialchars($_POST['website']) . '" />'; echo '</li>'; } //comment echo '<li>'; echo '<label>'; echo gpOutput::ReturnText('Comment'); echo '</label><br/>'; echo '<textarea name="comment" cols="30" rows="7" >'; echo htmlspecialchars($_POST['comment']); echo '</textarea>'; echo '</li>'; //recaptcha if (SimpleBlogCommon::$data['comment_captcha'] && gp_recaptcha::isActive()) { echo '<input type="hidden" name="anti_spam_submitted" value="anti_spam_submitted" />'; echo '<li>'; echo '<label>'; echo gpOutput::ReturnText('captcha'); echo '</label><br/>'; gp_recaptcha::Form(); echo '</li>'; } //submit button echo '<li>'; echo '<input type="hidden" name="cmd" value="Add Comment" />'; $html = '<input type="submit" name="" class="submit" value="%s" />'; echo gpOutput::GetAddonText('Add Comment', $html); echo '</li>'; echo '</ul>'; echo '</form>'; }
/** * Show the comment form * */ function CommentForm($showCaptcha = false) { $_POST += array('name' => '', 'website' => 'http://', 'comment' => ''); echo '<div class="easy_comment_form">'; echo '<h3>'; echo gpOutput::GetAddonText('Leave Comment'); echo '</h3>'; echo '<form method="post" action="' . common::GetUrl($this->current_title) . '">'; echo '<table>'; echo '<tr>'; echo '<td>'; echo '<div>'; echo gpOutput::GetAddonText('Name'); echo '</div>'; echo '<input type="text" name="name" class="text" value="' . htmlspecialchars($_POST['name']) . '" />'; echo '</td>'; echo '</tr>'; if (!empty($this->config['commenter_website'])) { echo '<tr>'; echo '<td>'; echo '<div>'; echo gpOutput::GetAddonText('Website'); echo '</div>'; echo '<input type="text" name="website" class="text" value="' . htmlspecialchars($_POST['website']) . '" />'; echo '</td>'; echo '</tr>'; } echo '<tr>'; echo '<td>'; echo '<div>'; echo gpOutput::GetAddonText('Comment'); echo '</div>'; echo '<textarea name="comment" cols="30" rows="7" >'; echo htmlspecialchars($_POST['comment']); echo '</textarea>'; echo '</td>'; echo '</tr>'; if ($this->config['comment_captcha'] && gp_recaptcha::isActive()) { echo '<tr>'; echo '<td>'; echo '<div>'; echo gpOutput::GetAddonText('captcha'); echo '</div>'; gp_recaptcha::Form(); echo '</td></tr>'; } echo '<tr>'; echo '<td>'; echo '<input type="hidden" name="nonce" value="' . htmlspecialchars(common::new_nonce('easy_comments:' . count($this->comment_data), true)) . '" />'; echo '<input type="hidden" name="cmd" value="easy_comment_add" />'; $html = '<input type="submit" name="" class="submit" value="%s" />'; echo gpOutput::GetAddonText('Add Comment', $html); echo '</td>'; echo '</tr>'; echo '</table>'; echo '</form>'; echo '</div>'; }
/** * Add a comment to the comment data for a post * */ function AddComment($post_index) { global $langmessage; $comments_closed = SimpleBlogCommon::AStrValue('comments_closed', $post_index); if ($comments_closed) { return; } $data = $this->GetCommentData($post_index); //need a captcha? if (SimpleBlogCommon::$data['comment_captcha'] && gp_recaptcha::isActive()) { if (!isset($_POST['anti_spam_submitted'])) { return false; } elseif (!gp_recaptcha::Check()) { return false; } } if (empty($_POST['name'])) { $field = gpOutput::SelectText('Name'); message($langmessage['OOPS_REQUIRED'], $field); return false; } if (empty($_POST['comment'])) { $field = gpOutput::SelectText('Comment'); message($langmessage['OOPS_REQUIRED'], $field); return false; } $temp = array(); $temp['name'] = htmlspecialchars($_POST['name']); $temp['comment'] = nl2br(strip_tags($_POST['comment'])); $temp['time'] = time(); if (!empty($_POST['website']) && $_POST['website'] !== 'http://') { $website = $_POST['website']; if (SimpleBlogCommon::strpos($website, '://') === false) { $website = false; } if ($website) { $temp['website'] = $website; } } $data[] = $temp; if (!$this->SaveCommentData($post_index, $data)) { message($langmessage['OOPS']); return false; } message($langmessage['SAVED']); //email new comments if (!empty(SimpleBlogCommon::$data['email_comments'])) { $subject = 'New Comment'; $body = ''; if (!empty($temp['name'])) { $body .= '<p>From: ' . $temp['name'] . '</p>'; } if (!empty($temp['website'])) { $body .= '<p>Website: ' . $temp['name'] . '</p>'; } $body .= '<p>' . $temp['comment'] . '</p>'; global $gp_mailer; includeFile('tool/email_mailer.php'); $gp_mailer->SendEmail(SimpleBlogCommon::$data['email_comments'], $subject, $body); } return true; }
function ShowForm() { global $page, $langmessage, $config; $attr = ''; if ($this->sent) { $attr = ' readonly="readonly" '; } $_GET += array('name' => '', 'email' => '', 'subject' => '', 'message' => ''); $_POST += array('name' => $_GET['name'], 'email' => $_GET['email'], 'subject' => $_GET['subject'], 'message' => $_GET['message']); $require_email =& $config['require_email']; echo '<form class="contactform" action="' . common::GetUrl($page->title) . '" method="post">'; //nonce fields echo '<div style="display:none !important">'; echo '<input type="hidden" name="contact_nonce" value="' . htmlspecialchars(common::new_nonce('contact_post', true)) . '" />'; echo '<input type="text" name="contact_void" value="" />'; echo '</div>'; echo '<label for="contact_name"><span class="title">'; echo gpOutput::ReturnText('your_name'); echo '</span><input id="contact_name" class="input text" type="text" name="name" value="' . htmlspecialchars($_POST['name']) . '" ' . $attr . ' />'; echo '</label>'; echo '<label for="contact_email"><span class="title">'; echo gpOutput::ReturnText('your_email'); if (strpos($require_email, 'email') !== false) { echo '*'; } echo '</span><input id="contact_email" class="input text" type="text" name="email" value="' . htmlspecialchars($_POST['email']) . '" ' . $attr . '/>'; echo '</label>'; echo '<label for="contact_subject"><span class="title">'; echo gpOutput::ReturnText('subject'); if (strpos($require_email, 'none') === false) { echo '*'; } echo '</span><input id="contact_subject" class="input text" type="text" name="subject" value="' . htmlspecialchars($_POST['subject']) . '" ' . $attr . '/>'; echo '</label>'; echo '<label for="contact_message">'; echo gpOutput::ReturnText('message'); if (strpos($require_email, 'none') === false) { echo '*'; } echo '</label>'; echo '<textarea id="contact_message" name="message" ' . $attr . ' rows="10" cols="10">'; echo htmlspecialchars($_POST['message']); echo '</textarea>'; gpPlugin::Action('contact_form_pre_captcha'); if (!$this->sent && gp_recaptcha::isActive()) { echo '<div class="captchaForm">'; echo gpOutput::ReturnText('captcha'); gp_recaptcha::Form(); echo '</div>'; } if ($this->sent) { echo gpOutput::ReturnText('message_sent', '%s', 'message_sent'); } else { echo '<input type="hidden" name="cmd" value="gp_send_message" />'; $key = 'send_message'; $text = gpOutput::SelectText($key); if (gpOutput::ShowEditLink('Admin_Theme_Content')) { $query = 'cmd=edittext&key=' . urlencode($key); echo gpOutput::EditAreaLink($edit_index, 'Admin_Theme_Content', $langmessage['edit'], $query, ' title="' . $key . '" data-cmd="gpabox" '); echo '<input type="submit" class="submit editable_area" id="ExtraEditArea' . $edit_index . '" name="aaa" value="' . $text . '" />'; } else { echo '<input type="submit" class="submit" name="aaa" value="' . $text . '" />'; } } echo '</form>'; }
/** * Show the configuration form * */ function Config() { global $langmessage, $addonFolderName, $gpversion; $defaults = SimpleBlogCommon::Defaults(); $array =& SimpleBlogCommon::$data; $label = gpOutput::SelectText('Blog'); $this->Heading('Admin_BlogConfig'); echo '<form class="renameform" action="' . common::GetUrl('Admin_BlogConfig') . '" method="post">'; echo '<table class="bordered full_width">'; echo '<tr><th>'; echo 'Option'; echo '</th><th>'; echo 'Value'; echo '</th><th>'; echo 'Default'; echo '</th></tr>'; $options = self::Options(); //Pretty Urls echo '<tr><td>Urls</td><td>'; if (version_compare($gpversion, '4.0', '>=')) { self::Radio('urls', $options['urls'], $array['urls']); } else { echo 'Available in gpEasy 4.0+'; } echo '</td><td>'; echo $defaults['urls']; echo '</td></tr>'; //Date Format echo '<tr><td>'; echo 'Date Format'; //echo ' (<a href="http://php.net/manual/en/function.date.php" target="_blank">About</a>)'; echo ' (<a href="http://www.php.net/manual/en/function.strftime.php" target="_blank">About</a>)'; echo '</td><td>'; //echo '<input type="text" name="date_format" size="20" value="'.htmlspecialchars($array['date_format']).'" class="gpinput" />'; echo '<input type="text" name="strftime_format" value="' . htmlspecialchars($array['strftime_format']) . '" class="gpinput" />'; echo '</td><td>'; echo $defaults['strftime_format']; echo '</td></tr>'; //Subtitle Separator echo '<tr><td>'; echo 'Subtitle Separator'; echo '</td><td>'; echo '<input type="text" name="subtitle_separator" size="20" value="' . htmlspecialchars($array['subtitle_separator']) . '" class="gpinput" />'; echo '</td><td>'; echo htmlspecialchars($defaults['subtitle_separator']); echo '</td></tr>'; //Entries Per Page echo '<tr><td>Entries Per Page</td><td>'; echo '<input type="text" name="per_page" value="' . htmlspecialchars($array['per_page']) . '" class="gpinput" />'; echo '</td><td>'; echo $defaults['per_page']; echo '</td></tr>'; //Entries Abbreviation Length echo '<tr><td>'; echo 'Entries Abbreviation Length'; echo '</td><td>'; echo '<input type="text" name="post_abbrev" value="' . htmlspecialchars($array['post_abbrev']) . '" class="gpinput" />'; echo '</td><td>'; echo $defaults['post_abbrev']; echo '</td></tr>'; //Image in Abbrevation echo '<tr><td>'; echo 'Image in Abbrevation'; echo '</td><td>'; if ($array['abbrev_image']) { echo '<input type="checkbox" name="abbrev_image" value="allow" checked="checked" />'; } else { echo '<input type="checkbox" name="abbrev_image" value="allow" />'; } echo '</td><td></td></tr>'; //Categories in Abbreviation echo '<tr><td>'; echo 'Categories in Abbrevation'; echo '</td><td>'; if ($array['abbrev_cat']) { echo '<input type="checkbox" name="abbrev_cat" value="allow" checked="checked" />'; } else { echo '<input type="checkbox" name="abbrev_cat" value="allow" />'; } echo '</td><td></td></tr>'; //Comments echo '<tr><th colspan="3">'; echo 'Gadget'; echo '</th></tr>'; //Entries For Gadget echo '<tr><td>'; echo 'Entries For Gadget'; echo '</td><td>'; echo '<input type="text" name="gadget_entries" value="' . htmlspecialchars($array['gadget_entries']) . '" class="gpinput" />'; echo '</td><td>'; echo $defaults['gadget_entries']; echo '</td></tr>'; //Gadget Abbreviation Length echo '<tr><td>'; echo 'Gadget Abbreviation Length'; echo '</td><td>'; echo '<input type="text" name="gadget_abbrev" value="' . htmlspecialchars($array['gadget_abbrev']) . '" class="gpinput" />'; echo '</td><td>'; echo $defaults['gadget_abbrev']; echo '</td></tr>'; //Comments echo '<tr><th colspan="3">'; echo 'Feed'; echo '</th></tr>'; //Entries For Feed echo '<tr><td>'; echo 'Entries For Feed'; echo '</td><td>'; echo '<input type="text" name="feed_entries" value="' . htmlspecialchars($array['feed_entries']) . '" class="gpinput" />'; echo '</td><td>'; echo $defaults['feed_entries']; echo '</td></tr>'; //Feed Abbreviation Length echo '<tr><td>'; echo 'Feed Abbreviation Length'; echo '</td><td>'; echo '<input type="text" name="feed_abbrev" size="20" value="' . htmlspecialchars($array['feed_abbrev']) . '" class="gpinput" />'; echo '</td><td>'; echo $defaults['feed_abbrev']; echo '</td></tr>'; //Comments echo '<tr><th colspan="3">'; echo 'Comments'; echo '</th></tr>'; //Allow Comments echo '<tr><td>'; echo 'Allow Comments'; echo '</td><td>'; if ($array['allow_comments']) { echo '<input type="checkbox" name="allow_comments" value="allow" checked="checked" />'; } else { echo '<input type="checkbox" name="allow_comments" value="allow" />'; } echo '</td><td></td></tr>'; //Email New Comment echo '<tr><td>'; echo 'Email New Comments'; echo '</td><td>'; echo '<input type="text" name="email_comments" value="' . htmlspecialchars($array['email_comments']) . '" />'; echo '</td><td></td></tr>'; echo '<tr><td>'; echo 'Commenter Website'; echo '</td><td>'; echo '<select name="commenter_website" class="gpselect">'; if ($array['commenter_website'] == 'nofollow') { echo '<option value="">Hide</option>'; echo '<option value="nofollow" selected="selected">Nofollow Link</option>'; echo '<option value="link">Follow Link</option>'; } elseif ($array['commenter_website'] == 'link') { echo '<option value="">Hide</option>'; echo '<option value="nofollow" selected="selected">Nofollow Link</option>'; echo '<option value="link" selected="selected">Follow Link</option>'; } else { echo '<option value="">Hide</option>'; echo '<option value="nofollow">Nofollow Link</option>'; echo '<option value="link">Follow Link</option>'; } echo '</select>'; echo '</td><td>'; echo 'Hide'; echo '</td></tr>'; echo '<tr><td>'; echo 'reCaptcha'; echo '</td><td>'; if (!gp_recaptcha::isActive()) { $disabled = ' disabled="disabled" '; } else { $disabled = ''; } if ($array['comment_captcha']) { echo '<input type="checkbox" name="comment_captcha" value="allow" checked="checked" ' . $disabled . '/>'; } else { echo '<input type="checkbox" name="comment_captcha" value="allow" ' . $disabled . '/>'; } echo '</td><td>'; echo ''; echo '</td></tr>'; echo '<tr><td></td>'; echo '<td colspan="2">'; echo '<input type="hidden" name="cmd" value="save_config" />'; echo '<input type="submit" name="" value="' . $langmessage['save'] . '" class="gpsubmit" /> '; echo '</td></tr>'; echo '</table>'; echo '<p style="text-align:center">'; echo common::Link('Admin_Theme_Content', $langmessage['editable_text'], 'cmd=addontext&addon=' . urlencode($addonFolderName), ' title="' . urlencode($langmessage['editable_text']) . '" name="gpabox" '); echo ' '; echo common::Link('Admin_BlogConfig', 'Regenerate Gadget', 'cmd=regen', ' name="creq"'); echo '</p>'; echo '</form>'; }
function ShowConfig() { global $langmessage; $defaults = $this->Defaults(); $array = $_POST + $this->config; echo '<h2>Easy Comments Configuration</h2>'; echo '<form class="renameform" action="' . common::GetUrl('Admin_Comments_Config') . '" method="post">'; echo '<table style="width:100%" class="bordered">'; echo '<tr>'; echo '<th>'; echo 'Option'; echo '</th>'; echo '<th>'; echo 'Value'; echo '</th>'; echo '<th>'; echo 'Default'; echo '</th>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'Date Format'; echo ' (<a href="http://php.net/manual/en/function.date.php" target="_blank">About</a>)'; echo '</td>'; echo '<td>'; echo '<input type="text" name="date_format" size="30" value="' . htmlspecialchars($array['date_format']) . '" />'; echo '</td>'; echo '<td>'; echo $defaults['date_format']; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'Commenter Website'; echo '</td>'; echo '<td>'; echo '<select name="commenter_website">'; if ($array['commenter_website'] == 'nofollow') { echo '<option value="">Hide</option>'; echo '<option value="nofollow" selected="selected">Nofollow Link</option>'; echo '<option value="link">Follow Link</option>'; } elseif ($array['commenter_website'] == 'link') { echo '<option value="">Hide</option>'; echo '<option value="nofollow" selected="selected">Nofollow Link</option>'; echo '<option value="link" selected="selected">Follow Link</option>'; } else { echo '<option value="">Hide</option>'; echo '<option value="nofollow">Nofollow Link</option>'; echo '<option value="link">Follow Link</option>'; } echo '</select>'; echo '</td>'; echo '<td>'; echo 'Hide'; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'reCaptcha'; echo '</td>'; echo '<td>'; if (!gp_recaptcha::isActive()) { $disabled = ' disabled="disabled" '; } else { $disabled = ''; } if ($array['comment_captcha']) { echo '<input type="checkbox" name="comment_captcha" value="allow" checked="checked" ' . $disabled . '/>'; } else { echo '<input type="checkbox" name="comment_captcha" value="allow" ' . $disabled . '/>'; } echo '</td>'; echo '<td>'; echo ''; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo '</td>'; echo '<td>'; echo '<input type="hidden" name="cmd" value="save_config" />'; echo '<input type="submit" name="" value="' . $langmessage['save'] . '" /> '; echo '<input type="submit" name="cmd" value="' . $langmessage['cancel'] . '" /> '; echo '</td>'; echo '<td>'; echo '</td>'; echo '</tr>'; echo '</table>'; }
/** * Show the configuration form * */ function Config() { global $langmessage, $addonFolderName; $defaults = SimpleBlogCommon::Defaults(); $array =& $this->blogData; $label = gpOutput::SelectText('Blog'); echo '<h2>'; echo common::Link('Special_Blog', $label); echo ' » '; echo $langmessage['configuration']; echo '</h2>'; echo '<form class="renameform" action="' . common::GetUrl('Admin_Blog') . '" method="post">'; echo '<table style="width:100%" class="bordered">'; echo '<tr>'; echo '<th>'; echo 'Option'; echo '</th>'; echo '<th>'; echo 'Value'; echo '</th>'; echo '<th>'; echo 'Default'; echo '</th>'; echo '</tr>'; echo '<tr>'; echo '<td>Entries Per Page</td>'; echo '<td>'; echo '<input type="text" name="per_page" size="20" value="' . htmlspecialchars($array['per_page']) . '" class="gpinput" />'; echo '</td><td>'; echo $defaults['per_page']; echo '</td></tr>'; echo '<tr>'; echo '<td>'; echo 'Entries Abbreviation Length'; echo '</td>'; echo '<td>'; echo '<input type="text" name="post_abbrev" size="20" value="' . htmlspecialchars($array['post_abbrev']) . '" class="gpinput" />'; echo '</td>'; echo '<td>'; echo $defaults['post_abbrev']; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'Entries For Gadget'; echo '</td>'; echo '<td>'; echo '<input type="text" name="gadget_entries" size="20" value="' . htmlspecialchars($array['gadget_entries']) . '" class="gpinput" />'; echo '</td>'; echo '<td>'; echo $defaults['gadget_entries']; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'Gadget Abbreviation Length'; echo '</td>'; echo '<td>'; echo '<input type="text" name="gadget_abbrev" size="20" value="' . htmlspecialchars($array['gadget_abbrev']) . '" class="gpinput" />'; echo '</td>'; echo '<td>'; echo $defaults['gadget_abbrev']; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'Date Format'; //echo ' (<a href="http://php.net/manual/en/function.date.php" target="_blank">About</a>)'; echo ' (<a href="http://www.php.net/manual/en/function.strftime.php" target="_blank">About</a>)'; echo '</td>'; echo '<td>'; //echo '<input type="text" name="date_format" size="20" value="'.htmlspecialchars($array['date_format']).'" class="gpinput" />'; echo '<input type="text" name="strftime_format" size="20" value="' . htmlspecialchars($array['strftime_format']) . '" class="gpinput" />'; echo '</td>'; echo '<td>'; echo $defaults['strftime_format']; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'Entries For Feed'; echo '</td>'; echo '<td>'; echo '<input type="text" name="feed_entries" size="20" value="' . htmlspecialchars($array['feed_entries']) . '" class="gpinput" />'; echo '</td>'; echo '<td>'; echo $defaults['feed_entries']; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'Feed Abbreviation Length'; echo '</td>'; echo '<td>'; echo '<input type="text" name="feed_abbrev" size="20" value="' . htmlspecialchars($array['feed_abbrev']) . '" class="gpinput" />'; echo '</td>'; echo '<td>'; echo $defaults['feed_abbrev']; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'Subtitle Separator'; echo '</td>'; echo '<td>'; echo '<input type="text" name="subtitle_separator" size="20" value="' . htmlspecialchars($array['subtitle_separator']) . '" class="gpinput" />'; echo '</td>'; echo '<td>'; echo htmlspecialchars($defaults['subtitle_separator']); echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<th>'; echo 'Comments'; echo '</th>'; echo '<th>'; echo 'Value'; echo '</th>'; echo '<th>'; echo 'Default'; echo '</th>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'Allow Comments'; echo '</td>'; echo '<td>'; if ($array['allow_comments']) { echo '<input type="checkbox" name="allow_comments" value="allow" checked="checked" />'; } else { echo '<input type="checkbox" name="allow_comments" value="allow" />'; } echo '</td>'; echo '<td>'; echo ''; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'Commenter Website'; echo '</td>'; echo '<td>'; echo '<select name="commenter_website" class="gpselect">'; if ($array['commenter_website'] == 'nofollow') { echo '<option value="">Hide</option>'; echo '<option value="nofollow" selected="selected">Nofollow Link</option>'; echo '<option value="link">Follow Link</option>'; } elseif ($array['commenter_website'] == 'link') { echo '<option value="">Hide</option>'; echo '<option value="nofollow" selected="selected">Nofollow Link</option>'; echo '<option value="link" selected="selected">Follow Link</option>'; } else { echo '<option value="">Hide</option>'; echo '<option value="nofollow">Nofollow Link</option>'; echo '<option value="link">Follow Link</option>'; } echo '</select>'; echo '</td>'; echo '<td>'; echo 'Hide'; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; echo 'reCaptcha'; echo '</td>'; echo '<td>'; if (!gp_recaptcha::isActive()) { $disabled = ' disabled="disabled" '; } else { $disabled = ''; } if ($array['comment_captcha']) { echo '<input type="checkbox" name="comment_captcha" value="allow" checked="checked" ' . $disabled . '/>'; } else { echo '<input type="checkbox" name="comment_captcha" value="allow" ' . $disabled . '/>'; } echo '</td>'; echo '<td>'; echo ''; echo '</td>'; echo '</tr>'; echo '<tr><td></td>'; echo '<td colspan="2">'; echo '<input type="hidden" name="cmd" value="save_config" />'; echo '<input type="submit" name="" value="' . $langmessage['save'] . '" class="gpsubmit" /> '; echo '</td>'; echo '</tr>'; echo '</table>'; echo '<p style="text-align:center">'; echo ' '; echo common::Link('Special_Blog', 'Back to Your Blog'); echo ' '; echo common::Link('Admin_BlogCategories', 'Categories Admin'); echo ' '; echo common::Link('Admin_Theme_Content', $langmessage['editable_text'], 'cmd=addontext&addon=' . urlencode($addonFolderName), ' title="' . urlencode($langmessage['editable_text']) . '" name="ajax_box" '); echo ' '; echo common::Link('Admin_Blog', 'Regenerate Gadget', 'cmd=regen', ' name="creq"'); echo '</p>'; echo '</form>'; }