Mercurial > defr > drupal > core
comparison modules/comment/comment.admin.inc @ 7:fff6d4c8c043 6.3
Drupal 6.3
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Tue, 23 Dec 2008 14:30:28 +0100 |
parents | c1f4ac30525a |
children |
comparison
equal
deleted
inserted
replaced
6:2cfdc3c92142 | 7:fff6d4c8c043 |
---|---|
1 <?php | 1 <?php |
2 // $Id: comment.admin.inc,v 1.4 2008/01/08 10:35:41 goba Exp $ | 2 // $Id: comment.admin.inc,v 1.4.2.2 2008/05/19 07:27:35 goba Exp $ |
3 | 3 |
4 /** | 4 /** |
5 * @file | 5 * @file |
6 * Admin page callbacks for the comment module. | 6 * Admin page callbacks for the comment module. |
7 */ | 7 */ |
62 // build a table listing the appropriate comments | 62 // build a table listing the appropriate comments |
63 $destination = drupal_get_destination(); | 63 $destination = drupal_get_destination(); |
64 while ($comment = db_fetch_object($result)) { | 64 while ($comment = db_fetch_object($result)) { |
65 $comments[$comment->cid] = ''; | 65 $comments[$comment->cid] = ''; |
66 $comment->name = $comment->uid ? $comment->registered_name : $comment->name; | 66 $comment->name = $comment->uid ? $comment->registered_name : $comment->name; |
67 $form['subject'][$comment->cid] = array('#value' => l($comment->subject, 'node/'. $comment->nid, array('title' => truncate_utf8($comment->comment, 128), 'fragment' => 'comment-'. $comment->cid))); | 67 $form['subject'][$comment->cid] = array('#value' => l($comment->subject, 'node/'. $comment->nid, array('attributes' => array('title' => truncate_utf8($comment->comment, 128)), 'fragment' => 'comment-'. $comment->cid))); |
68 $form['username'][$comment->cid] = array('#value' => theme('username', $comment)); | 68 $form['username'][$comment->cid] = array('#value' => theme('username', $comment)); |
69 $form['node_title'][$comment->cid] = array('#value' => l($comment->node_title, 'node/'. $comment->nid)); | 69 $form['node_title'][$comment->cid] = array('#value' => l($comment->node_title, 'node/'. $comment->nid)); |
70 $form['timestamp'][$comment->cid] = array('#value' => format_date($comment->timestamp, 'small')); | 70 $form['timestamp'][$comment->cid] = array('#value' => format_date($comment->timestamp, 'small')); |
71 $form['operations'][$comment->cid] = array('#value' => l(t('edit'), 'comment/edit/'. $comment->cid, array('query' => $destination))); | 71 $form['operations'][$comment->cid] = array('#value' => l(t('edit'), 'comment/edit/'. $comment->cid, array('query' => $destination))); |
72 } | 72 } |
275 * @param $comment | 275 * @param $comment |
276 * An associative array describing the comment to be deleted. | 276 * An associative array describing the comment to be deleted. |
277 */ | 277 */ |
278 function _comment_delete_thread($comment) { | 278 function _comment_delete_thread($comment) { |
279 if (!is_object($comment) || !is_numeric($comment->cid)) { | 279 if (!is_object($comment) || !is_numeric($comment->cid)) { |
280 watchdog('content', 'Cannot delete non-existent comment.', WATCHDOG_WARNING); | 280 watchdog('content', 'Cannot delete non-existent comment.', array(), WATCHDOG_WARNING); |
281 return; | 281 return; |
282 } | 282 } |
283 | 283 |
284 // Delete the comment: | 284 // Delete the comment: |
285 db_query('DELETE FROM {comments} WHERE cid = %d', $comment->cid); | 285 db_query('DELETE FROM {comments} WHERE cid = %d', $comment->cid); |