/** * 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>'; }
/** * 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>'; }
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>'; }