Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
comment_notify
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
comment_notify
Commits
dba0bbfb
Commit
dba0bbfb
authored
Aug 7, 2008
by
Greg Knaddison
Browse files
Options
Downloads
Patches
Plain Diff
task
#203223
by greggles: followup on making this work for 6.x - may need a little more...
parent
f8e5f8d1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
comment_notify.module
+20
-12
20 additions, 12 deletions
comment_notify.module
with
20 additions
and
12 deletions
comment_notify.module
+
20
−
12
View file @
dba0bbfb
...
...
@@ -271,7 +271,7 @@ function _comment_notify_mailalert($comment) {
global
$language
;
global
$base_url
;
$initial_l
ocal
e
=
$language
;
$initial_l
anguag
e
=
$language
;
if
(
function_exists
(
'locale'
))
{
$languages
=
locale_supported_languages
();
...
...
@@ -289,7 +289,6 @@ function _comment_notify_mailalert($comment) {
$comment_mail
=
$comment
->
mail
;
}
$from
=
variable_get
(
'site_mail'
,
ini_get
(
'sendmail_from'
));
$result
=
db_query
(
'SELECT DISTINCT c.cid, u.init, c.uid, c.name, c.nid, c.mail cmail, u.mail umail, u.init uinit, c.uid, c.name, cn.notify_hash mymd5
FROM {comments} c INNER JOIN {comment_notify} cn on c.cid = cn.cid LEFT OUTER JOIN {users} u ON c.uid = u.uid
WHERE nid = %d AND cn.notify = 1 AND c.status = 0'
,
$nid
...
...
@@ -304,19 +303,23 @@ function _comment_notify_mailalert($comment) {
$mail
=
empty
(
$alert
->
cmail
)
?
$umail
:
$alert
->
cmail
;
if
(
$mail
!=
$comment_mail
&&
!
in_array
(
$mail
,
$sent_to
)
&&
$alert
->
uid
!=
$comment
->
uid
)
{
if
(
function_exists
(
'locale'
)
&&
$languages
[
$user
->
language
])
{
$language
=
$user
->
language
;
$message
=
array
();
if
(
!
empty
(
$alert
->
uid
))
{
$recipient_user
=
user_load
(
array
(
'uid'
=>
$alert
.
uid
));
$language
=
user_preferred_language
(
$recipient_user
);
}
else
{
$language
=
language_default
();
}
$subject
=
t
(
'!site :: new comment for your post.'
,
array
(
'!site'
=>
variable_get
(
'site_name'
,
'drupal'
)));
$message
=
t
(
$
message
[
'
subject
'
]
=
t
(
'!site :: new comment for your post.'
,
array
(
'!site'
=>
variable_get
(
'site_name'
,
'drupal'
)));
$message
[
'body'
][]
=
drupal_html_to_text
(
t
(
variable_get
(
'comment_notify_default_mailtext'
,
DEFAULT_MAILTEXT
),
array
(
'!commname'
=>
$comment
->
name
,
'!commtext'
=>
$comment
->
comment
,
'!commsubj'
=>
$comment
->
subject
,
'!comment_url'
=>
url
(
'node/'
.
$nid
,
NULL
,
NULL
,
1
)
.
'#comment-'
.
$cid
,
'!comment_url'
=>
url
(
'node/'
.
$nid
,
array
(
'absolute'
=>
TRUE
)
)
.
'#comment-'
.
$cid
,
'!node_title'
=>
$node
->
title
,
'!node_teaser'
=>
$node
->
teaser
,
'!mission'
=>
variable_get
(
'site_mission'
,
''
),
...
...
@@ -330,9 +333,8 @@ function _comment_notify_mailalert($comment) {
'!edit_uri'
=>
url
(
'user/'
.
$alert
->
uid
.
'/edit'
,
array
(
'absolute'
=>
TRUE
)),
'!link1'
=>
url
(
'comment_notify/disable/'
.
$alert
->
mymd5
,
array
(
'absolute'
=>
TRUE
))
)
);
drupal_mail
(
'comment_notify_mail'
,
$mail
,
$subject
,
$message
,
$from
,
array
());
));
drupal_mail
(
'comment_notify'
,
'comment_notify_mail'
,
$mail
,
$language
,
$message
);
$count
++
;
$sent_to
[]
=
$mail
;
...
...
@@ -346,7 +348,7 @@ function _comment_notify_mailalert($comment) {
// Add an entry to the watchdog log.
watchdog
(
'comment_notify'
,
$watchdog_message
,
WATCHDOG_NOTICE
,
l
(
t
(
'source comment'
),
'node/'
.
$nid
,
NULL
,
NULL
,
'comment-'
.
$alert
->
cid
));
WATCHDOG_NOTICE
,
l
(
t
(
'source comment'
),
'node/'
.
$nid
,
array
(
'fragment'
=>
'comment-'
.
$alert
->
cid
))
)
;
// revert to previous (site default) locale
$language
=
$initial_language
;
...
...
@@ -354,6 +356,12 @@ function _comment_notify_mailalert($comment) {
}
}
function
comment_notify_mail
(
$key
,
&
$message
,
$params
)
{
$message
[
'subject'
]
=
$params
[
'subject'
];
$message
[
'body'
][]
=
$params
[
'body'
][
0
];
}
/**
* Callback for an administrative form to unsubscribe users by e-mail address.
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment