Skip to content

Commit 664cde0

Browse files
committed
Display the bounce time on the Campaigns tab.
1 parent b7337ee commit 664cde0

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

public_html/lists/admin/actions/campaigns.php

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,23 @@
2323

2424
$ls = new WebblerListing(s('Campaigns'));
2525
if (Sql_Table_Exists($GLOBALS['tables']['usermessage'])) {
26-
$msgs = Sql_Query(sprintf('select messageid,entered,viewed,(viewed = 0 or viewed is null) as notviewed,
27-
abs(unix_timestamp(entered) - unix_timestamp(viewed)) as responsetime from %s where userid = %d and status = "sent" order by entered desc',
28-
$GLOBALS['tables']['usermessage'], $user['id']));
26+
$msgs = Sql_Query(sprintf(
27+
'select messageid,
28+
entered,
29+
viewed,
30+
(viewed = 0 or viewed is null) as notviewed,
31+
abs(unix_timestamp(entered) - unix_timestamp(viewed)) as responsetime,
32+
(select max(time)
33+
from %s umb
34+
where umb.message = messageid and umb.user = userid
35+
) as bouncetime
36+
from %s
37+
where userid = %d and status = "sent"
38+
order by entered desc',
39+
$GLOBALS['tables']['user_message_bounce'],
40+
$GLOBALS['tables']['usermessage'],
41+
$user['id']
42+
));
2943
$num = Sql_Affected_Rows();
3044
} else {
3145
$num = 0;
@@ -59,8 +73,9 @@
5973
$resptime += $msg['responsetime'];
6074
$totalresp += 1;
6175
}
62-
if (!empty($bounces[$msg['messageid']])) {
63-
$ls->addColumn($element, s('bounce'), $bounces[$msg['messageid']]);
76+
77+
if ($msg['bouncetime']) {
78+
$ls->addColumn($element, s('bounce'), formatDateTime($msg['bouncetime'], 1));
6479
}
6580
}
6681
if ($totalresp) {

0 commit comments

Comments
 (0)