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
# 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'>";
$out .= "Killmail here:<br /><textarea name='killmail' rows='10'></textarea>";
$out .= "<input type='submit' value='Submit Mail' /></form>";
# all done
echo "<html><title>Fortissimo Killboard</title><body>{$out}</body></html>";
?>