summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-07-19 06:19:17 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-07-19 06:19:17 +0000
commite616f2b58095a22edf3c4de6aba4fc995a0cc7f7 (patch)
treef553def408673049fab5acce8820a8e72073534c /modules
parentdafb146b2700b204a02dea60f955d5e1db98ee37 (diff)
downloadbrdo-e616f2b58095a22edf3c4de6aba4fc995a0cc7f7.tar.gz
brdo-e616f2b58095a22edf3c4de6aba4fc995a0cc7f7.tar.bz2
#73748 by RobRoy, add a themeable wrapper for comments
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/comment.module17
1 files changed, 12 insertions, 5 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 9ec6fe377..842a5fc10 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -200,7 +200,7 @@ function comment_link($type, $node = 0, $main = 0) {
'title' => format_plural($all, '1 comment', '%count comments'),
'href' => "node/$node->nid",
'attributes' => array('title' => t('Jump to the first comment of this posting.')),
- 'fragment' => 'comment'
+ 'fragment' => 'comments'
);
if ($new) {
@@ -329,7 +329,7 @@ function comment_nodeapi(&$node, $op, $arg = 0) {
case 'rss item':
if ($node->comment != COMMENT_NODE_DISABLED) {
- return array(array('key' => 'comments', 'value' => url('node/'. $node->nid, NULL, 'comment', TRUE)));
+ return array(array('key' => 'comments', 'value' => url('node/'. $node->nid, NULL, 'comments', TRUE)));
}
else {
return array();
@@ -752,8 +752,6 @@ function comment_render($node, $cid = 0) {
$order = _comment_get_display_setting('sort');
$comments_per_page = _comment_get_display_setting('comments_per_page');
- $output .= "<a id=\"comment\"></a>\n";
-
if ($cid) {
// Single comment view.
$query = 'SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.picture, u.data, c.score, c.users, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d';
@@ -914,11 +912,13 @@ function comment_render($node, $cid = 0) {
if (user_access('post comments') && node_comment_mode($nid) == COMMENT_NODE_READ_WRITE && (variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW)) {
$output .= comment_form(array('nid' => $nid), t('Post new comment'));
}
+
+ $output = theme('comment_wrapper', $output);
}
+
return $output;
}
-
/**
* Menu callback; delete a comment.
*/
@@ -1662,6 +1662,13 @@ function theme_comment_post_forbidden($nid) {
}
}
+/**
+ * Allow themable wrapping of all comments.
+ */
+function theme_comment_wrapper($content) {
+ return '<div id="comments">' . $content . '</div>';
+}
+
function _comment_delete_thread($comment) {
if (!is_object($comment) || !is_numeric($comment->cid)) {
watchdog('content', t('Can not delete non-existent comment.'), WATCHDOG_WARNING);