b2evolution PHP Cross Reference Blogging Systems

Source: /skins/basic/_item_comment_form.inc.php - 132 lines - 5126 bytes - Text - Print

Description: This is the template that displays the comment form for a post

   1  <?php
   2  /**
   3   * This is the template that displays the comment form for a post
   4   *
   5   * This file is not meant to be called directly.
   6   *
   7   * b2evolution - {@link http://b2evolution.net/}
   8   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
   9   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  10   *
  11   * @package evoskins
  12   * @subpackage basic
  13   */
  14  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  15  
  16  global $cookie_name, $cookie_email, $cookie_url;
  17  global $comment_allowed_tags;
  18  global $comment_cookies, $comment_allow_msgform, $dummy_fields;
  19  
  20  $comment_reply_ID = param( 'reply_ID', 'integer', 0 );
  21  
  22  ?>
  23  <h4><?php echo T_('Leave a comment') ?>:</h4>
  24  
  25  <?php
  26      if( ( $Comment = get_comment_from_session() ) == NULL )
  27      {
  28          $comment_author = param_cookie( $cookie_name, 'string', '' );
  29          $comment_author_email = evo_strtolower( param_cookie( $cookie_email, 'string', '' ) );
  30          $comment_author_url = param_cookie( $cookie_url, 'string', '' );
  31          $comment_text = '';
  32      }
  33      else
  34      {
  35          $comment_author = $Comment->author;
  36          $comment_author_email = $Comment->author_email;
  37          $comment_author_url = $Comment->author_url;
  38          $comment_text = $Comment->content;
  39      }
  40      $redirect = htmlspecialchars(url_rel_to_same_host(regenerate_url('','','','&'), $htsrv_url));
  41  ?>
  42  
  43  <!-- form to add a comment -->
  44  <form action="<?php echo $htsrv_url ?>comment_post.php" method="post" id="bComment_form_id_<?php echo $Item->ID ?>">
  45  
  46      <input type="hidden" name="comment_post_ID" value="<?php echo $Item->ID() ?>" />
  47      <input type="hidden" name="redirect_to" value="<?php echo $Item->get_feedback_url( $disp == 'feedback-popup', '&' ) ?>" />
  48      <input type="hidden" name="crumb_comment" value="<?php echo get_crumb( 'comment' ) ?>" />
  49      <?php
  50          if( !empty( $comment_reply_ID ) )
  51          {
  52      ?>
  53      <input type="hidden" name="reply_ID" value="<?php echo $comment_reply_ID ?>" />
  54      <a href="<?php echo url_add_param( $Item->get_permanent_url(), 'reply_ID='.$comment_reply_ID.'&amp;redir=no' ).'#c'.$comment_reply_ID ?>"><?php echo T_('You are currently replying to a specific comment') ?></a>
  55      <?php } ?>
  56  <table>
  57      <?php
  58      if( is_logged_in() )
  59      { // User is logged in:
  60          ?>
  61          <tr valign="top" bgcolor="#eeeeee">
  62              <td align="right"><strong><?php echo T_('User') ?>:</strong></td>
  63              <td align="left">
  64                  <strong><?php echo $current_User->get_identity_link( array( 'link_text' => 'preferredname' ) )?></strong>
  65                  <?php user_profile_link( ' [', ']', T_('Edit profile') ) ?>
  66                  </td>
  67          </tr>
  68          <?php
  69      }
  70      else
  71      { // User is not logged in:
  72          ?>
  73          <tr valign="top" bgcolor="#eeeeee">
  74              <td align="right"><label for="author"><strong><?php echo T_('Name') ?>:</strong></label></td>
  75              <td align="left"><input type="text" name="<?php echo $dummy_fields[ 'name' ] ?>" id="author" value="<?php echo htmlspecialchars( $comment_author ) ?>" size="40" tabindex="1" /></td>
  76          </tr>
  77  
  78          <tr valign="top" bgcolor="#eeeeee">
  79              <td align="right"><label for="email"><strong><?php echo T_('Email') ?>:</strong></label></td>
  80              <td align="left"><input type="text" name="<?php echo $dummy_fields[ 'email' ] ?>" id="email" value="<?php echo htmlspecialchars( $comment_author_email ) ?>" size="40" tabindex="2" /><br />
  81                  <small><?php echo T_('Your email address will <strong>not</strong> be displayed on this site.') ?></small>
  82              </td>
  83          </tr>
  84  
  85          <?php
  86          $Item->load_Blog();
  87          if( $Item->Blog->get_setting( 'allow_anon_url' ) )
  88          {
  89          ?>
  90              <tr valign="top" bgcolor="#eeeeee">
  91                  <td align="right"><label for="url"><strong><?php echo T_('Site/Url') ?>:</strong></label></td>
  92                  <td align="left"><input type="text" name="<?php echo $dummy_fields[ 'url' ] ?>" id="url" value="<?php echo htmlspecialchars( $comment_author_url ) ?>" size="40" tabindex="3" /><br />
  93                      <small><?php echo T_('Your URL will be displayed.') ?></small>
  94                  </td>
  95              </tr>
  96          <?php
  97          }
  98      }
  99      ?>
 100  
 101      <tr valign="top" bgcolor="#eeeeee">
 102          <td align="right"><label for="comment"><strong><?php echo T_('Comment text') ?>:</strong></label></td>
 103          <td align="left" width="450"><textarea cols="50" rows="12" name="<?php echo $dummy_fields[ 'content' ] ?>" id="comment" tabindex="4"><?php echo $comment_text ?></textarea><br />
 104              <small><?php echo T_('Allowed XHTML tags'), ': ', htmlspecialchars(str_replace( '><',', ', $comment_allowed_tags)) ?></small>
 105          </td>
 106      </tr>
 107  
 108      <?php if( ! is_logged_in() ) { ?>
 109      <tr valign="top" bgcolor="#eeeeee">
 110          <td align="right"><strong><?php echo T_('Options') ?>:</strong></td>
 111          <td align="left">
 112          <?php if( ! is_logged_in() )
 113          { // User is not logged in:
 114              ?>
 115              <input type="checkbox" name="comment_cookies" value="1" checked="checked" tabindex="7" id="comment_cookies" /> <label for="comment_cookies"><strong><?php echo T_('Remember me') ?></strong></label> <small><?php echo T_('(Set cookies for name, email &amp; url)') ?></small>
 116              <?php
 117          } ?>
 118          </td>
 119      </tr>
 120      <?php } ?>
 121  
 122      <tr valign="top" bgcolor="#eeeeee">
 123          <td colspan="2" align="center">
 124              <input type="submit" name="submit" value="<?php echo T_('Send comment') ?>" tabindex="8" />
 125          </td>
 126      </tr>
 127  </table>
 128  
 129  </form>
 130  <?php
 131      echo_comment_reply_js( $Item );
 132  ?>

title

Description

title

Description

title

Description

title

title

Body