<?php $id = sprintf('%d',$_GET['id']); if (!$id) { return ''; } $message = Sql_Fetch_Assoc_Query(sprintf('select *,unix_timestamp(embargo) - unix_timestamp(now()) as secstowait from %s where id = %d',$GLOBALS['tables']['message'],$id)); $messagedata = loadMessageData($id); $pqchoice = getConfig('pqchoice'); $totalsent = $messagedata['astext'] + $messagedata['ashtml'] + $messagedata['astextandhtml'] + $messagedata['aspdf'] + $messagedata['astextandpdf'] + $messagedata['sentastest']; $num_users = 0; if (isset($messagedata['to process'])) { $num_users = $messagedata['to process']; } $sent = $totaltime = $sampletime = $samplesent = 0; if (!isset($messagedata['sampletime'])) { ## take a "sample" of the send speed, to calculate msg/hr $sampletime = time(); $samplesent = $totalsent; setMessageData($id,'sampletime',$sampletime); setMessageData($id,'samplesent',$samplesent); } else { $totaltime = time() - $messagedata['sampletime']; $sent = $totalsent - $messagedata['samplesent']; if ($totaltime > MESSAGE_SENDSTATUS_SAMPLETIME) { ## refresh speed sampling setMessageData($id,'sampletime',time()); setMessageData($id,'samplesent',$totalsent); } } if ($sent > 0 && $totaltime > 0) { $msgperhour = (int)(3600/$totaltime) * $sent; $secpermsg = $totaltime / $sent; $timeleft = ($num_users - $sent) * $secpermsg; $eta = date('D j M H:i',time()+$timeleft); } else { $msgperhour = 0; $secpermsg = 0; $timeleft = 0; $eta = $GLOBALS['I18N']->get('unknown'); } ## 16850 - convert to string, to avoid an SQL error $msgperhour = "$msgperhour "; setMessageData($id,'ETA',$eta); setMessageData($id,'msg/hr',$msgperhour); if ($message['status'] != 'inprocess') { $html = $GLOBALS['I18N']->get($message['status']); if ($message['secstowait'] > 0) { $secstowait = secs2time($message['secstowait']); $html .= '<br/>'.sprintf($GLOBALS['I18N']->get('%s left until embargo'),$secstowait); } foreach ($GLOBALS['plugins'] as $plname => $plugin) { $html .= $plugin->messageStatus($id,$message['status']); } if ($message['status'] != 'submitted' && $message['status'] != 'draft') { $html .= '<br/>'.PageLinkButton("messages",$GLOBALS['I18N']->get("requeue"),"resend=".$message["id"], '', s('Requeue')); } if (!empty($messagedata['to process'])) { $html .= '<br/>'.$messagedata['to process'].' '.$GLOBALS['I18N']->get('still to process').'<br/>'. $GLOBALS['I18N']->get('sent').': '.$totalsent; } } else { if (empty($messagedata['last msg sent'])) $messagedata['last msg sent'] = 0; if (empty($messagedata['to process'])) $messagedata['to process'] = $GLOBALS['I18N']->get('Unknown'); $active = time() - $messagedata['last msg sent']; $html = $GLOBALS['I18N']->get($message['status']).'<br/>'; if ($messagedata['to process'] > 0) { $html .= $messagedata['to process'].' '.$GLOBALS['I18N']->get('still to process').'<br/>'; } $pluginhtml = ''; foreach ($GLOBALS['plugins'] as $plname => $plugin) { $pluginhtml .= $plugin->messageStatus($id,$message['status']); } ## if the plugins don't return anything do the speed calculation ## otherwise just what the plugins retunr if (empty($pluginhtml)) { ## not sure this calculation is accurate # $html .= $GLOBALS['I18N']->get('sent').': '.$totalsent.'<br/>'; $recently_sent = Sql_Fetch_Row_Query(sprintf('select count(*) from %s where entered > date_sub(current_timestamp,interval %d second) and status = "sent"', $tables["usermessage"],MAILQUEUE_BATCH_PERIOD)); if (MAILQUEUE_BATCH_PERIOD && MAILQUEUE_BATCH_SIZE && $recently_sent[0] >= MAILQUEUE_BATCH_SIZE) { $html .= '<h4>'.$GLOBALS['I18N']->get('limit reached').'</h4>'; foreach ($GLOBALS['plugins'] as $plname => $plugin) { $html .= $plugin->messageStatusLimitReached($recently_sent[0]); } $nextbatch = Sql_Fetch_Row_Query(sprintf('select current_timestamp,date_add(entered,interval %d second) from %s where entered > date_sub(current_timestamp,interval %d second) and status = "sent" order by entered desc limit 1', MAILQUEUE_BATCH_PERIOD + 60,$tables["usermessage"],MAILQUEUE_BATCH_PERIOD)); $html .= '<p>'.sprintf($GLOBALS['I18N']->get('next batch of %s in %s'),MAILQUEUE_BATCH_SIZE,timeDiff($nextbatch[0],$nextbatch[1])).'</p>'; } elseif ($msgperhour <= 0 || $active > MESSAGE_SENDSTATUS_INACTIVETHRESHOLD) { if (MANUALLY_PROCESS_QUEUE) { $html .= $GLOBALS['I18N']->get('Waiting'); if ($pqchoice == 'local') { $html .= PageLinkButton('processqueue',s('Send the queue')); } elseif ($pqchoice == 'phplistdotcom') { $html .= '<a href="https://www.phplist.com/myaccount" target="_blank" class="button">'.s('Check status'). '</a>'; } } else { $html .= $GLOBALS['I18N']->get('Processing'); } } else { $html .= $GLOBALS['I18N']->get('ETA').': '.$eta.'<br/>'. $GLOBALS['I18N']->get('Processing').' '.sprintf('%d',$msgperhour).' '.$GLOBALS['I18N']->get('msgs/hr'); } } else { $html .= $pluginhtml; } } if (!empty($GLOBALS['developer_email1'])) { if (isset($messagedata['sampletime'])) $html .= '<br/>ST: '.$messagedata['sampletime']; if (isset($messagedata['samplesent'])) $html .= '<br/>SS: '.$messagedata['samplesent']; if (isset($totaltime)) $html .= '<br/>TT: '.$totaltime; if (isset($sent)) $html .= '<br/>TS: '.$sent; } $status = $html; #exit;
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
.htaccess | File | 31 B | 0644 |
|
addemail.php | File | 874 B | 0644 |
|
addlist.php | File | 69 B | 0644 |
|
bounce.php | File | 166 B | 0644 |
|
bounces.php | File | 1.35 KB | 0644 |
|
campaigns.php | File | 2.57 KB | 0644 |
|
checkurl.php | File | 838 B | 0644 |
|
configure.php | File | 2.37 KB | 0644 |
|
domainbounces.php | File | 1.66 KB | 0644 |
|
domainstats.php | File | 7.2 KB | 0644 |
|
export.php | File | 6.92 KB | 0644 |
|
generatetext.php | File | 1.01 KB | 0644 |
|
generatetextpreview.php | File | 1.42 KB | 0644 |
|
getservertime.php | File | 127 B | 0644 |
|
hidenote.php | File | 245 B | 0644 |
|
import.php | File | 182 B | 0644 |
|
import1.php | File | 9.21 KB | 0644 |
|
import2.php | File | 23.54 KB | 0644 |
|
importsimple.php | File | 182 B | 0644 |
|
initlanguage.php | File | 243 B | 0644 |
|
keepalive.php | File | 180 B | 0644 |
|
listbounces.php | File | 2.4 KB | 0644 |
|
markread.php | File | 341 B | 0644 |
|
mclicks.php | File | 4.81 KB | 0644 |
|
mergeduplicatelists.php | File | 1.41 KB | 0644 |
|
msgbounces.php | File | 2.35 KB | 0644 |
|
msgsent.php | File | 881 B | 0644 |
|
msgstatus.php | File | 5.35 KB | 0644 |
|
mviews.php | File | 4.97 KB | 0644 |
|
plugins.php | File | 943 B | 0644 |
|
processqueue.php | File | 53.08 KB | 0644 |
|
reconcileusers.php | File | 471 B | 0644 |
|
removeemptylists.php | File | 379 B | 0644 |
|
searchemail.php | File | 825 B | 0644 |
|
shownotes.php | File | 74 B | 0644 |
|
statsoverview.php | File | 5.83 KB | 0644 |
|
storemessage.php | File | 2.05 KB | 0644 |
|
subscription.php | File | 3.91 KB | 0644 |
|
test.php | File | 13 B | 0644 |
|
updatetranslation.php | File | 824 B | 0644 |
|
upgrade.php | File | 183 B | 0644 |
|
user.php | File | 710 B | 0644 |
|
viewtemplate.php | File | 1.09 KB | 0644 |
|