Example #1
0
<?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');
Example #2
0
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;
}
Example #3
0
if (!$obj) {
    return $ft->igberrorpage("Sorry, unable to access your account.  I cannot let you pass!");
}
# see what their standings are
if (!$obj->trustable()) {
    return $ft->igberrorpage("Sorry, we don't allow your type here.");
}
# store output here
$out = "<h2>Fortissimo Killboard</h2>";
# get the mail
$mail = $_POST['killmail'];
if (!$mail) {
    return $ft->igberrorpage('You must provide a mail to parse.');
}
# try to parse
$kobj = new KillMail($mail);
if (!$kobj->parsed) {
    return $ft->igberrorpage('The killmail didn\'t parse.  Please ensure you copied the entire mail.');
}
# now make sure it's not a duplicate
if ($kobj->is_duplicate()) {
    return $ft->igberrorpage('This seems to be a duplicate.  Sorry!');
}
# now put into database, since we know it's not a dupe
$kobj->store($pilotid);
$kobj->adjust_totals(1);
# now show the success/error/etc
$out = '<p>This kill of ' . $kobj->victim->pilot . '\'s ' . $kobj->victim->ship . ' has been recorded!  Thank you!</p>';
# now give them a kill submission form
$out .= "<h2>Killmail Submission</h2>";
$out .= "<form method='post' action='{$_WEB_URL}/igb-submit.php'>";