Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
e616f2b5
Commit
e616f2b5
authored
Jul 19, 2006
by
Neil Drumm
Browse files
#73748
by RobRoy, add a themeable wrapper for comments
parent
dafb146b
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/comment/comment.module
View file @
e616f2b5
...
...
@@ -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'
=>
'comment
s
'
);
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
,
'comment
s
'
,
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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment