function reprocess_all_mail($start = 0) { if ($start == 0) { reset_data(); } $output = array(); global $ft; $ids = $ft->dbh->_select_column('SELECT mailid FROM tbl:rawmail WHERE mailid >= ? ORDER BY mailid LIMIT 10', array($start)); foreach ($ids as $id) { $mail = $ft->dbh->_select_one('SELECT mail FROM tbl:rawmail WHERE mailid = ?', array($id)); if ($mail) { $obj = new KillMail($mail, $id); if ($obj->parsed) { array_push($output, array('ok', "<a href='/killmail.php?killid={$id}&raw=1'>Mail #{$id}</a> " . "processed: " . $obj->victim->pilot . " lost a " . $obj->victim->ship . " in " . $obj->system . ".", $id)); $obj->adjust_totals(); } else { array_push($output, array('err', "<a href='/killmail.php?killid={$id}&raw=1'>Mail #{$id}</a> failed to process.", $id)); } } } return $output; }
<?php include 'lib/fortissimo.php'; if (!$remote) { return $ft->errorpage('You must be logged in to use this page.'); } $mail = $_POST['mail']; if (!$mail) { return $ft->errorpage('You must provide a mail to parse.', 'submit'); } $obj = new KillMail($mail); if (!$obj->parsed) { $ft->assign('mail', $mail); return $ft->errorpage('The killmail didn\'t parse. Please ensure you copied the entire mail.', 'submit'); } # now make sure it's not a duplicate if ($obj->is_duplicate()) { return $ft->errorpage('This seems to be a duplicate. Sorry!', 'submit'); } # now put into database, since we know it's not a dupe $obj->store(); $obj->adjust_totals(1); # now show the success/error/etc $ft->message('This kill of ' . $obj->victim->pilot . '\'s ' . $obj->victim->ship . ' has been recorded! Thank you!'); $ft->title('Submit Killmail'); $ft->makepage('submit');