[ Index ]
 

Code source de Serendipity 1.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/include/admin/ -> comments.inc.php (source)

   1  <?php # $Id: comments.inc.php 1816 2007-08-06 10:18:39Z garvinhicking $
   2  # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
   3  # All rights reserved.  See LICENSE file for licensing details
   4  
   5  if (IN_serendipity !== true) {
   6      die ("Don't hack!");
   7  }
   8  
   9  if (!serendipity_checkPermission('adminComments')) {
  10      return;
  11  }
  12  
  13  $commentsPerPage = (int)(!empty($serendipity['GET']['filter']['perpage']) ? $serendipity['GET']['filter']['perpage'] : 10);
  14  $summaryLength = 200;
  15  
  16  if ($serendipity['POST']['formAction'] == 'multiDelete' && sizeof($serendipity['POST']['delete']) != 0 && serendipity_checkFormToken()) {
  17      foreach ( $serendipity['POST']['delete'] as $k => $v ) {
  18          serendipity_deleteComment($k, $v);
  19          echo DONE . ': '. sprintf(COMMENT_DELETED, $k) . '<br />';
  20      }
  21  }
  22  
  23  
  24  /* We are asked to save the edited comment, and we are not in preview mode */
  25  if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminAction'] == 'doEdit' && !isset($serendipity['POST']['preview']) && serendipity_checkFormToken()) {
  26      $sql = "UPDATE {$serendipity['dbPrefix']}comments
  27                      SET
  28                          author    = '" . serendipity_db_escape_string($serendipity['POST']['name'])    . "',
  29                          email     = '" . serendipity_db_escape_string($serendipity['POST']['email'])   . "',
  30                          url       = '" . serendipity_db_escape_string($serendipity['POST']['url'])     . "',
  31                          " . ($serendipity['POST']['replyTo'] != $serendipity['GET']['id'] ? "parent_id = '" . serendipity_db_escape_string($serendipity['POST']['replyTo']) . "'," : '') . "
  32                          body      = '" . serendipity_db_escape_string($serendipity['POST']['comment']) . "'
  33              WHERE id = " . (int)$serendipity['GET']['id'] . " AND
  34                    entry_id = " . (int)$serendipity['POST']['entry_id'];
  35      serendipity_db_query($sql);
  36      serendipity_plugin_api::hook_event('backend_updatecomment', $serendipity['POST'], $serendipity['GET']['id']);
  37      echo COMMENT_EDITED;
  38  }
  39  
  40  /* Submit a new comment */
  41  if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminAction'] == 'doReply' && !isset($serendipity['POST']['preview']) && serendipity_checkFormToken()) {
  42      $comment = array();
  43      $comment['url']       = $serendipity['POST']['url'];
  44      $comment['comment']   = trim($serendipity['POST']['comment']);
  45      $comment['name']      = $serendipity['POST']['name'];
  46      $comment['email']     = $serendipity['POST']['email'];
  47      $comment['subscribe'] = $serendipity['POST']['subscribe'];
  48      $comment['parent_id'] = $serendipity['POST']['replyTo'];
  49      if (!empty($comment['comment'])) {
  50          if (serendipity_saveComment($serendipity['POST']['entry_id'], $comment, 'NORMAL')) {
  51              echo '<script type="text/javascript">alert("' . COMMENT_ADDED . '"); parent.focus(); this.close();</script>';
  52              echo '<noscript>' . COMMENT_ADDED . '</noscript>';
  53              return true;
  54          } else {
  55              echo COMMENT_NOT_ADDED;
  56              $serendipity['GET']['adminAction'] = 'reply';
  57          }
  58      } else {
  59          echo COMMENT_NOT_ADDED;
  60          $serendipity['GET']['adminAction'] = 'reply';
  61      }
  62  }
  63  
  64  /* We approve a comment */
  65  if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminAction'] == 'approve' && serendipity_checkFormToken()) {
  66      $sql = "SELECT c.*, e.title, a.email as authoremail, a.mail_comments
  67              FROM {$serendipity['dbPrefix']}comments c
  68              LEFT JOIN {$serendipity['dbPrefix']}entries e ON (e.id = c.entry_id)
  69              LEFT JOIN {$serendipity['dbPrefix']}authors a ON (e.authorid = a.authorid)
  70              WHERE c.id = " . (int)$serendipity['GET']['id']  ." AND status = 'pending'";
  71      $rs  = serendipity_db_query($sql, true);
  72  
  73      if ($rs === false) {
  74          echo ERROR .': '. sprintf(COMMENT_ALREADY_APPROVED, (int)$serendipity['GET']['id']);
  75      } else {
  76          serendipity_approveComment($serendipity['GET']['id'], $rs['entry_id']);
  77          echo DONE . ': '. sprintf(COMMENT_APPROVED, (int)$serendipity['GET']['id']);
  78      }
  79  }
  80  
  81  /* We are asked to delete a comment */
  82  if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminAction'] == 'delete' && serendipity_checkFormToken()) {
  83      serendipity_deleteComment($serendipity['GET']['id'], $serendipity['GET']['entry_id']);
  84      echo DONE . ': '. sprintf(COMMENT_DELETED, (int)$serendipity['GET']['id']);
  85  }
  86  
  87  /* We are either in edit mode, or preview mode */
  88  if (isset($serendipity['GET']['adminAction']) && ($serendipity['GET']['adminAction'] == 'edit' || $serendipity['GET']['adminAction'] == 'reply') || isset($serendipity['POST']['preview'])) {
  89  
  90      $serendipity['smarty_raw_mode'] = true; // Force output of Smarty stuff in the backend
  91      serendipity_smarty_init();
  92  
  93      if ($serendipity['GET']['adminAction'] == 'reply' || $serendipity['GET']['adminAction'] == 'doReply') {
  94          $c          = serendipity_fetchComments($serendipity['GET']['entry_id'], 1, 'co.id', false, 'NORMAL', ' AND co.id=' . (int)$serendipity['GET']['id']);
  95  
  96          if (isset($serendipity['POST']['preview'])) {
  97              $c[] = array(
  98                        'email'     => $serendipity['POST']['email'],
  99                        'author'    => $serendipity['POST']['name'],
 100                        'body'      => $serendipity['POST']['comment'],
 101                        'url'       => $serendipity['POST']['url'],
 102                        'timestamp' => time(),
 103                        'parent_id' => $serendipity['GET']['id']
 104              );
 105          }
 106          
 107          $target_url = '?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=doReply&amp;serendipity[id]=' . (int)$serendipity['GET']['id'] . '&amp;serendipity[entry_id]=' . (int)$serendipity['GET']['entry_id'] . '&amp;serendipity[noBanner]=true&amp;serendipity[noSidebar]=true&amp;' . serendipity_setFormToken('url');
 108          $data       = $serendipity['POST'];
 109          $data['replyTo'] = (int)$serendipity['GET']['id'];
 110          $out        = serendipity_printComments($c);
 111          $serendipity['smarty']->display(serendipity_getTemplateFile('comments.tpl', 'serendipityPath'));
 112          
 113          if (!isset($data['name'])) {
 114              $data['name']  = $serendipity['serendipityRealname'];
 115          }
 116  
 117          if (!isset($data['email'])) {
 118              $data['email']  = $serendipity['serendipityEmail'];
 119          }
 120      } else {
 121          $target_url = '?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=doEdit&amp;serendipity[id]=' . (int)$serendipity['GET']['id'] . '&amp;serendipity[entry_id]=' . (int)$serendipity['GET']['entry_id'] . '&amp;' . serendipity_setFormToken('url');
 122  
 123          /* If we are not in preview, we need data from our database */
 124          if (!isset($serendipity['POST']['preview'])) {
 125              $comment = serendipity_db_query("SELECT * FROM {$serendipity['dbPrefix']}comments WHERE id = ". (int)$serendipity['GET']['id']);
 126              $data['name']       = $comment[0]['author'];
 127              $data['email']      = $comment[0]['email'];
 128              $data['url']        = $comment[0]['url'];
 129              $data['replyTo']    = $comment[0]['parent_id'];
 130              $data['comment']    = $comment[0]['body'];
 131      
 132          /* If we are in preview, we get data from our form */
 133          } elseif (isset($serendipity['POST']['preview'])) {
 134              $data['name']       = $serendipity['POST']['name'];
 135              $data['email']      = $serendipity['POST']['email'];
 136              $data['url']        = $serendipity['POST']['url'];
 137              $data['replyTo']    = $serendipity['POST']['replyTo'];
 138              $data['comment']    = $serendipity['POST']['comment'];
 139              $pc_data = array(
 140                      array(
 141                        'email'     => $serendipity['POST']['email'],
 142                        'author'    => $serendipity['POST']['name'],
 143                        'body'      => $serendipity['POST']['comment'],
 144                        'url'       => $serendipity['POST']['url'],
 145                        'timestamp' => time()
 146                      )
 147                    );
 148      
 149              serendipity_printComments($pc_data);
 150              $serendipity['smarty']->display(serendipity_getTemplateFile('comments.tpl', 'serendipityPath'));
 151          }
 152      }
 153  
 154      serendipity_displayCommentForm(
 155        $serendipity['GET']['entry_id'],
 156        $target_url,
 157        NULL,
 158        $data,
 159        false,
 160        false
 161      );
 162  
 163      $serendipity['smarty']->display(serendipity_getTemplateFile('commentform.tpl', 'serendipityPath'));
 164  
 165      return true;
 166  }
 167  
 168  /* Searchable fields */
 169  $filters = array('author', 'email', 'ip', 'url', 'body', 'referer');
 170  
 171  /* Compress the filters into an "AND" SQL query, and a querystring */
 172  foreach ($filters as $filter) {
 173      $and          .= (!empty($serendipity['GET']['filter'][$filter]) ? "AND c.". $filter ." LIKE '%". serendipity_db_escape_string($serendipity['GET']['filter'][$filter]) ."%'" : "");
 174      $searchString .= (!empty($serendipity['GET']['filter'][$filter]) ? "&amp;serendipity[filter][". $filter ."]=". htmlspecialchars($serendipity['GET']['filter'][$filter]) : "");
 175  }
 176  
 177  if ($serendipity['GET']['filter']['show'] == 'approved') {
 178      $and          .= "AND status = 'approved'";
 179      $searchString .= "&amp;serendipity[filter][show]=approved";
 180  } elseif ($serendipity['GET']['filter']['show'] == 'pending') {
 181      $and           .= "AND status = 'pending'";
 182      $searchString .= "&amp;serendipity[filter][show]=pending";
 183  } else {
 184      $serendipity['GET']['filter']['show'] = 'all';
 185  }
 186  
 187  if ($serendipity['GET']['filter']['type'] == 'TRACKBACK') {
 188      $c_type = 'TRACKBACK';
 189      $searchString .= "&amp;serendipity[filter][type]=TRACKBACK";
 190  } elseif ($serendipity['GET']['filter']['type'] == 'NORMAL') {
 191      $c_type = 'NORMAL';
 192      $searchString .= "&amp;serendipity[filter][type]=NORMAL";
 193  } else {
 194      $c_type = null;
 195  }
 196  
 197  if ($serendipity['GET']['filter']['type'] == 'TRACKBACK') {
 198      $c_type = 'TRACKBACK';
 199      $searchString .= "&amp;serendipity[filter][type]=TRACKBACK";
 200  } elseif ($serendipity['GET']['filter']['type'] == 'NORMAL') {
 201      $c_type = 'NORMAL';
 202      $searchString .= "&amp;serendipity[filter][type]=NORMAL";
 203  } else {
 204      $c_type = null;
 205  }
 206  
 207  if ($commentsPerPage != 10) {
 208      $searchString .= '&amp;serendipity[filter][perpage]=' . $commentsPerPage;
 209  }
 210  
 211  $searchString .= '&amp;' . serendipity_setFormToken('url');
 212  
 213  /* Paging */
 214  $sql = serendipity_db_query("SELECT COUNT(*) AS total FROM {$serendipity['dbPrefix']}comments c WHERE 1 = 1 " . ($c_type !== null ? " AND c.type = '$c_type' " : '') . $and, true);
 215  
 216  $totalComments = $sql['total'];
 217  $pages = ($commentsPerPage == COMMENTS_FILTER_ALL ? 1 : ceil($totalComments/(int)$commentsPerPage));
 218  $page = (int)$serendipity['GET']['page'];
 219  if ( $page == 0 || $page > $pages ) {
 220      $page = 1;
 221  }
 222  
 223  $linkPrevious = 'serendipity_admin.php?serendipity[adminModule]=comments&amp;serendipity[page]='. ($page-1) . $searchString;
 224  $linkNext = 'serendipity_admin.php?serendipity[adminModule]=comments&amp;serendipity[page]='. ($page+1) . $searchString;
 225  
 226  if ($commentsPerPage == COMMENTS_FILTER_ALL) {
 227      $limit = '';
 228  }else {
 229      $limit = serendipity_db_limit_sql(serendipity_db_limit(($page-1)*(int)$commentsPerPage, (int)$commentsPerPage));
 230  }
 231  
 232  $sql = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPrefix']}comments c
 233                                  LEFT JOIN {$serendipity['dbPrefix']}entries e ON (e.id = c.entry_id)
 234                                  WHERE 1 = 1 " . ($c_type !== null ? " AND c.type = '$c_type' " : '') . $and
 235                                  . (!serendipity_checkPermission('adminEntriesMaintainOthers') ? 'AND e.authorid = ' . (int)$serendipity['authorid'] : '') . "
 236                                  ORDER BY c.id DESC $limit");
 237  ?>
 238  <script type="text/javascript">
 239  function FT_toggle(id) {
 240      if ( document.getElementById(id + '_full').style.display == '' ) {
 241          document.getElementById(id + '_full').style.display='none';
 242          document.getElementById(id + '_summary').style.display='';
 243          document.getElementById(id + '_text').innerHTML = '<?php echo TOGGLE_ALL ?>';
 244      } else {
 245          document.getElementById(id + '_full').style.display='';
 246          document.getElementById(id + '_summary').style.display='none';
 247          document.getElementById(id + '_text').innerHTML = '<?php echo HIDE ?>';
 248      }
 249      return false;
 250  }
 251  function invertSelection() {
 252      var f = document.formMultiDelete;
 253      for (var i = 0; i < f.elements.length; i++) {
 254          if( f.elements[i].type == 'checkbox' ) {
 255              f.elements[i].checked = !(f.elements[i].checked);
 256              f.elements[i].onclick();
 257          }
 258      }
 259  }
 260  function highlightComment(id, checkvalue) {
 261      var comment = document.getElementById(id);
 262      if (checkvalue) {
 263          comment.style.borderColor = '#FF0000';
 264          comment.style.borderWidth = 2;
 265      } else {
 266          comment.style.borderColor = '';
 267          comment.style.borderWidth = '';
 268      }
 269  }
 270  </script>
 271  <form action="" method="GET" style="margin: 0">
 272  <?php echo serendipity_setFormToken(); ?>
 273  <input type="hidden" name="serendipity[adminModule]" value="comments" />
 274  <input type="hidden" name="serendipity[page]" value="<?php echo $page ?>" />
 275  <table class="serendipity_admin_filters" width="100%">
 276      <tr>
 277          <td colspan="6" class="serendipity_admin_filters_headline"><strong><?php echo FILTERS ?></strong> - <?php echo FIND_COMMENTS ?></td>
 278      </tr>
 279      <tr>
 280          <td><?php echo AUTHOR ?>:</td>
 281          <td><input class="input_textbox" type="text" name="serendipity[filter][author]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['author']) ?>" /></td>
 282          <td><?php echo EMAIL ?>:</td>
 283          <td><input class="input_textbox" type="text" name="serendipity[filter][email]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['email']) ?>" /></td>
 284          <td><?php echo URL ?>:</td>
 285          <td><input class="input_textbox" type="text" name="serendipity[filter][url]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['url']) ?>" /></td>
 286      </tr>
 287      <tr>
 288          <td>IP:</td>
 289          <td><input class="input_textbox" type="text" name="serendipity[filter][ip]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['ip']) ?>" /></td>
 290          <td><?php echo CONTENT ?>:</td>
 291          <td><input class="input_textbox" type="text" name="serendipity[filter][body]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['body']) ?>" /></td>
 292          <td><?php echo REFERER ?>:</td>
 293          <td><input class="input_textbox" type="text" name="serendipity[filter][referer]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['referer']) ?>" /></td>
 294      </tr>
 295      <tr>
 296          <td><?php echo COMMENTS; ?>:</td>
 297          <td><select name="serendipity[filter][perpage]">
 298          <?php
 299              $filter_vals = array(10, 20, 50, COMMENTS_FILTER_ALL);
 300              foreach($filter_vals AS $filter_val) { ?>
 301              <option value="<?php echo $filter_val; ?>" <?php echo ($commentsPerPage == $filter_val ? ' selected="selected"' : ''); ?>><?php echo $filter_val; ?></option>
 302          <?php
 303              }
 304          ?>
 305              </select></td>
 306          <td><?php echo COMMENTS_FILTER_SHOW ?>:</td>
 307          <td><select name="serendipity[filter][show]">
 308                  <option value="all"<?php if ( $serendipity['GET']['filter']['show'] == 'all' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_ALL ?></option>
 309                  <option value="approved"<?php if ( $serendipity['GET']['filter']['show'] == 'approved' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_APPROVED_ONLY ?></option>
 310                  <option value="pending"<?php if ( $serendipity['GET']['filter']['show'] == 'pending' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_NEED_APPROVAL ?></option>
 311              </select></td>
 312          <td><?php echo TYPE; ?></td>
 313          <td><select name="serendipity[filter][type]">
 314                  <option value=""><?php echo COMMENTS_FILTER_ALL ?></option>
 315                  <option value="NORMAL"<?php if ($c_type == 'NORMAL') echo ' selected="selected"' ?>><?php echo COMMENTS; ?></option>
 316                  <option value="TRACKBACK"<?php if ($c_type == 'TRACKBACK') echo ' selected="selected"' ?>><?php echo TRACKBACKS; ?></option>
 317              </select></td>
 318      </tr>
 319      <tr>
 320          <td colspan="6" align="right"><input type="submit" name="submit" value=" - <?php echo GO ?> - " class="serendipityPrettyButton input_button" /> <?php serendipity_plugin_api::hook_event('backend_comments_top', $sql); ?></td>
 321      </tr>
 322  </table>
 323  </form>
 324  <hr noshade="noshade" /><br />
 325  <?php
 326      if (!is_array($sql)) {
 327          echo '<div align="center">- '. NO_COMMENTS .' -</div>';
 328      } else {
 329  ?>
 330  <form action="" method="POST" name="formMultiDelete" id="formMultiDelete">
 331  <?php echo serendipity_setFormToken(); ?>
 332  <input type="hidden" name="serendipity[formAction]" value="multiDelete" />
 333  <table width="100%" cellpadding="3" border="0" cellspacing="0">
 334  <tr>
 335      <td align="center">
 336          <table width="100%" cellspacing="5" cellpadding="0" border="0">
 337              <tr>
 338                  <td>
 339                  <?php if ( $page != 1 && $page <= $pages ) { ?>
 340                      <a href="<?php echo $linkPrevious; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/previous.png') ?>" /><?php echo PREVIOUS ?></a>
 341                  <?php } ?>
 342                  </td>
 343                  <td align="center"><?php printf(PAGE_BROWSE_COMMENTS, $page, $pages, $totalComments); ?></td>
 344                  <td align="right">
 345                  <?php if ( $page != $pages ) { ?>
 346                      <a href="<?php echo $linkNext; ?>" class="serendipityIconLinkRight"><?php echo NEXT ?><img src="<?php echo serendipity_getTemplateFile('admin/img/next.png') ?>" /></a>
 347                  <?php } ?>
 348                  </td>
 349              </tr>
 350          </table>
 351      </td>
 352  </tr>
 353  <?php
 354  
 355  $i = 0;
 356  foreach ($sql as $rs) {
 357      $i++;
 358      $comment = array(
 359          'fullBody'  => $rs['body'],
 360          'summary'   => serendipity_mb('substr', $rs['body'], 0, $summaryLength),
 361          'status'    => $rs['status'],
 362          'type'      => $rs['type'],
 363          'id'        => $rs['id'],
 364          'title'     => $rs['title'],
 365          'timestamp' => $rs['timestamp'],
 366          'referer'   => $rs['referer'],
 367          'url'       => $rs['url'],
 368          'ip'        => $rs['ip'],
 369          'entry_url' => serendipity_archiveURL($rs['entry_id'], $rs['title']),
 370          'email'     => $rs['email'],
 371          'author'    => (empty($rs['author']) ? ANONYMOUS : $rs['author']),
 372          'entry_id'  => $rs['entry_id']
 373      );
 374  
 375      $entrylink = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id'];
 376      if (strlen($comment['fullBody']) > strlen($comment['summary']) ) {
 377          $comment['summary'] .= ' ...';
 378          $comment['excerpt'] = true;
 379  
 380          // When summary is not the full body, strip HTML tags from summary, as it might break and leave unclosed HTML.
 381          $comment['fullBody'] = nl2br(htmlspecialchars($comment['fullBody']));
 382          $comment['summary']  = nl2br(strip_tags($comment['summary']));
 383      } else {
 384          $comment['excerpt'] = false;
 385  
 386          $comment['fullBody'] = $comment['summary'] = nl2br(htmlspecialchars($comment['fullBody']));
 387      }
 388  
 389      serendipity_plugin_api::hook_event('backend_view_comment', $comment, '&amp;serendipity[page]='. $page . $searchString);
 390      $class = 'serendipity_admin_list_item_' . (($i % 2 == 0 ) ? 'even' : 'uneven');
 391      $header_class = ($comment['status'] == 'pending' ? 'serendipityAdminMsgNote' : '');
 392  ?>
 393  <tr>
 394      <td class="<?php echo $header_class; ?>">
 395  <?php   if ($header_class=='serendipityAdminMsgNote') { ?>
 396              <img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="<?php echo serendipity_getTemplateFile('admin/img/admin_msg_note.png'); ?>" alt="" />
 397  <?php   }?>
 398          <a name="c<?php echo $comment['id'] ?>"></a>
 399          <?php echo ($comment['type'] == 'NORMAL' ? COMMENT : TRACKBACK) . ' #'. $comment['id'] .', '. IN_REPLY_TO .' <strong><a href="' . $comment['entry_url'] . '">'. $comment['title'] .'</a></strong>, '. ON . ' ' . serendipity_mb('ucfirst', serendipity_strftime('%b %e %Y, %H:%M', $comment['timestamp']))?>
 400      </td>
 401  </tr>
 402  <tr>
 403      <td class="serendipity_admin_list_item <?php echo $class ?>" id="comment_<?php echo $comment['id'] ?>">
 404          <table width="100%" cellspacing="0" cellpadding="3" border="0">
 405              <tr>
 406                  <td rowspan="3" width="20" align="center"><input class="input_checkbox" type="checkbox" name="serendipity[delete][<?php echo $comment['id'] ?>]" value="<?php echo $comment['entry_id'] ?>" onclick="highlightComment('comment_<?php echo $comment['id'] ?>', this.checked)" tabindex="<?php echo $i ?>" /></td>
 407                  <td width="40%"><strong><?php echo AUTHOR ?></strong>: <?php echo htmlspecialchars($comment['author']) . $comment['action_author']; ?></td>
 408                  <td><strong><?php echo EMAIL ?></strong>:
 409                      <?php
 410                          if ( empty($comment['email']) ) {
 411                              echo 'N/A';
 412                          } else {
 413                      ?>
 414                              <a href="mailto:<?php echo htmlspecialchars($comment['email']) ?>"><?php echo htmlspecialchars($comment['email']) ?></a>
 415                      <?php } ?>
 416                  <?php echo $comment['action_email']; ?>
 417                  </td>
 418              </tr>
 419              <tr>
 420                  <td width="40%"><strong>IP</strong>:
 421                      <?php
 422                          if ( empty($comment['ip']) ) {
 423                              echo '0.0.0.0';
 424                          } else {
 425                              echo htmlspecialchars($comment['ip']);
 426                          }
 427                      ?>
 428                      <?php echo $comment['action_ip']; ?>
 429                      </td>
 430                  <td><strong><?php echo URL; ?></strong>:
 431                      <?php
 432                          if ( empty($comment['url']) ) {
 433                              echo 'N/A';
 434                          } else {
 435                      ?>
 436                              <a href="<?php echo htmlspecialchars($comment['url']) ?>" target="_blank"><?php echo htmlspecialchars($comment['url']) ?></a>
 437                      <?php } ?>
 438                      <?php echo $comment['action_url']; ?>
 439                      </td>
 440              </tr>
 441              <tr>
 442                  <td width="40%">&nbsp;</td>
 443                  <td><strong><?php echo REFERER; ?></strong>:
 444                      <?php
 445                          if ( empty($comment['referer']) ) {
 446                              echo 'N/A';
 447                          } else {
 448                      ?>
 449                            <a href="<?php echo htmlspecialchars($comment['referer']) ?>" title="<?php echo htmlspecialchars($comment['referer']) ?>"><?php echo htmlspecialchars(serendipity_truncateString($comment['referer'],30)) ?></a>
 450                      <?php } ?>
 451                      <?php echo $comment['action_referer']; ?>
 452                      </td>
 453              <tr>
 454                  <td style="border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC" colspan="3">
 455                      <div id="<?php echo $comment['id'] ?>_summary"><?php echo $comment['summary'] ?></div>
 456                      <div id="<?php echo $comment['id'] ?>_full" style="display: none"><?php echo $comment['fullBody'] ?></div>
 457                  </td>
 458              </tr>
 459          </table>
 460  <?php if ($comment['status'] == 'pending') { ?>
 461            <a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=approve&amp;serendipity[id]=<?php echo $comment['id'] ?>&amp;<?php echo serendipity_setFormToken('url'); ?>" class="serendipityIconLink" title="<?php echo APPROVE; ?>"><img src="<?php echo serendipity_getTemplateFile('admin/img/accept.png'); ?>" alt="<?php echo APPROVE ?>" /><?php echo APPROVE ?></a>
 462  <?php } ?>
 463  <?php if ($comment['excerpt']) { ?>
 464            <a href="#c<?php echo $comment['id'] ?>" onclick="FT_toggle(<?php echo $comment['id'] ?>); return false;" title="<?php echo VIEW; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo TOGGLE_ALL; ?>" /><span id="<?php echo $comment['id'] ?>_text"><?php echo TOGGLE_ALL ?></span></a>
 465  <?php } ?>
 466            <a target="_blank" href="<?php echo $entrylink; ?>" title="<?php echo VIEW; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo VIEW; ?>" /><?php echo VIEW ?></a>
 467            <a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=edit&amp;serendipity[id]=<?php echo $comment['id'] ?>&amp;serendipity[entry_id]=<?php echo $comment['entry_id'] ?>&amp;<?php echo serendipity_setFormToken('url'); ?>" title="<?php echo EDIT; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/edit.png'); ?>" alt="<?php echo EDIT; ?>" /><?php echo EDIT ?></a>
 468            <a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=delete&amp;serendipity[id]=<?php echo $comment['id'] ?>&amp;serendipity[entry_id]=<?php echo $comment['entry_id'] ?>&amp;<?php echo serendipity_setFormToken('url'); ?>" onclick='return confirm("<?php echo sprintf(COMMENT_DELETE_CONFIRM, $comment['id'], htmlspecialchars($comment['author'])) ?>")' title="<?php echo DELETE ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/delete.png'); ?>" alt="<?php echo DELETE; ?>" /><?php echo DELETE ?></a>
 469            <a target="_blank" onclick="cf = window.open(this.href, 'CommentForm', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1'); cf.focus(); return false;" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=reply&amp;serendipity[id]=<?php echo $comment['id'] ?>&amp;serendipity[entry_id]=<?php echo $comment['entry_id'] ?>&amp;serendipity[noBanner]=true&amp;serendipity[noSidebar]=true&amp;<?php echo serendipity_setFormToken('url'); ?>" title="<?php echo REPLY ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/user_editor.png'); ?>" alt="<?php echo REPLY; ?>" /><?php echo REPLY ?></a>
 470            <?php echo $comment['action_more']; ?>
 471      </td>
 472  </tr>
 473  <tr>
 474      <td><hr noshade="noshade" /></td>
 475  </tr>
 476  <?php } ?>
 477  <tr>
 478      <td><input type="button" name="toggle" value="<?php echo INVERT_SELECTIONS ?>" onclick="invertSelection()" class="serendipityPrettyButton input_button" /> <input type="submit" name="toggle" value="<?php echo DELETE_SELECTED_COMMENTS ?>" onclick="return confirm('<?php echo COMMENTS_DELETE_CONFIRM ?>')" tabindex="<?php echo ($i+1) ?>" class="serendipityPrettyButton input_button" /></td>
 479  </tr>
 480  </table>
 481  </form>
 482  <?php } ?>


Généré le : Sat Nov 24 09:00:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics