comment_unpublish_action

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 comment_unpublish_action($comment, $context = array())

Action to unpublish a comment.

Übergabeparameter

$comment An optional comment object.

$context Keyed array. Must contain the id of the comment if $comment is not passed.

Verwandte Themen

Code

modules/comment/comment.module, line 2096

<?php
function comment_unpublish_action($comment, $context = array()) {
  if (isset($comment->cid)) {
    $cid = $comment->cid;
    $subject = $comment->subject;
  }
  else {
    $cid = $context['cid'];
    $subject = db_result(db_query("SELECT subject FROM {comments} WHERE cid = %d", $cid));
  }
  db_query('UPDATE {comments} SET status = %d WHERE cid = %d', COMMENT_NOT_PUBLISHED, $cid);
  watchdog('action', 'Unpublished comment %subject.', array('%subject' => $subject));
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen