Changeset 59
- Timestamp:
- 11/07/06 04:44:47 (16 years ago)
- Location:
- dev/common
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/about.php
r48 r59 53 53 $qry->execute($sql); 54 54 $html .= "<table class=kb-table cellspacing=1>"; 55 $html .= "<tr class=kb-table-header><td width=1 10>Ship class</td><td>Value in ISK</td><td align=center>Indicator</td></tr>";55 $html .= "<tr class=kb-table-header><td width=160>Ship class</td><td>Value in ISK</td><td>Points</td><td align=center>Indicator</td></tr>"; 56 56 while ($row = $qry->getRow()) 57 57 { 58 58 $shipclass = new ShipClass($row['scl_id']); 59 $html .= "<tr class=kb-table-row-odd><td>" . $shipclass->getName() . "</td><td align=\"right\">".number_format($shipclass->getValue()*1000000,0,',','.')."</td><td align=center><img class=ship src=\"" . $shipclass->getValueIndicator() . "\" border=\"0\"></td></tr>";59 $html .= "<tr class=kb-table-row-odd><td>".$shipclass->getName()."</td><td align=\"right\">".number_format($shipclass->getValue()*1000000,0,',','.')."</td><td align=\"right\">".number_format($shipclass->getPoints(),0,',','.')."</td><td align=center><img class=ship src=\"" . $shipclass->getValueIndicator() . "\" border=\"0\"></td></tr>"; 60 60 } 61 61 $html .= "</table>"; 62 63 function getVictimShipValueIndicator($value) 64 { 65 if ($value >= 0 && $value <= 1) 66 $color = "gray"; 67 elseif ($value > 1 && $value <= 15) 68 $color = "blue"; 69 elseif ($value > 15 && $value <= 25) 70 $color = "green"; 71 elseif ($value > 25 && $value <= 40) 72 $color = "yellow"; 73 elseif ($value > 40 && $value <= 80) 74 $color = "red"; 75 elseif ($value > 80 && $value <= 250) 76 $color = "orange"; 77 elseif ($value > 250 && $value <= 7000) 78 $color = "purple"; 79 80 return IMG_URL . "/ships/ship-" . $color . ".gif"; 81 } 62 82 63 83 if ($config->getConfig('ship_values')) 64 84 { 65 85 $sql = 'select kbs.shp_id as id, shp.shp_name, kbs.shp_value, 66 shp.shp_techlevel 86 shp.shp_techlevel, scl.scl_class, scl.scl_points 67 87 from kb3_ships_values kbs 68 88 inner join kb3_ships shp on (kbs.shp_id = shp.shp_id) 89 inner join kb3_ship_classes scl on (shp.shp_class = scl.scl_id) 69 90 order by shp.shp_name asc'; 70 91 $html .= "<br/>Custom shipvalues which override the value from shipclasses:<br><br>"; … … 72 93 $qry->execute($sql); 73 94 $html .= "<table class=kb-table cellspacing=1>"; 74 $html .= "<tr class=kb-table-header><td width=1 10>Ship Name</td><td>Value in ISK</td></tr>";95 $html .= "<tr class=kb-table-header><td width=160>Ship Name</td><td>Ship Class</td><td>Points</td><td align=\"right\">Value in ISK</td></tr>"; 75 96 while ($row = $qry->getRow()) 76 97 { … … 79 100 $row['shp_name'] = '<img src="'.IMG_URL.'/ships/32_32/t2.gif">'.$row['shp_name']; 80 101 } 81 $html .= "<tr class=kb-table-row-odd><td>".$row['shp_name']." </td><td align=\"right\">".number_format($row['shp_value'],0,',','.')."</td></tr>";102 $html .= "<tr class=kb-table-row-odd><td>".$row['shp_name']." </td><td>".$row['scl_class']." </td><td align=\"right\">".number_format($row['scl_points'],0,',','.')."</td><td align=\"right\"> ".number_format($row['shp_value'],0,',','.')." <img src=\"".getVictimShipValueIndicator($row['shp_value']/1000000)."\"></td></tr>"; 82 103 } 83 104 $html .= "</table>"; -
dev/common/admin.php
r47 r59 30 30 $config->setPostPassword($_POST['post_password']); 31 31 $config->setPostMailto($_POST['post_mailto']); 32 $config->setConfig('mail_host', $_POST['post_mailhost']); 32 33 33 34 if ($_POST['filter_apply'] == "on") … … 150 151 $html .= "<tr><td width=120><b>Post password:</b></td><td><input type=text name=post_password id=post_password size=20 maxlength=20 value=\"" . $config->getPostPassword() . "\"></td></tr>"; 151 152 $html .= "<tr><td width=120><b>Killmail CC:</b></td><td><input type=text name=post_mailto id=post_mailto size=20 maxlength=80 value=\"" . $config->getPostMailto() . "\"> (e-mail address)</td></tr>"; 153 $html .= "<tr><td width=120><b>Mailhost:</b></td><td><input type=text name=post_mailhost id=post_mailhost size=20 maxlength=80 value=\"".$config->getConfig('mail_host')."\"></td></tr>"; 152 154 $html .= "<tr><td width=120><b>Disallow any killmails before:</b></td><td>" . dateSelector($config->getConfig('filter_apply'), $config->getConfig('filter_date')) . "</td></tr>"; 153 155 $html .= "</table>"; -
dev/common/post.php
r21 r59 9 9 $kb = new Killboard(KB_SITE); 10 10 11 $config = $kb->getConfig();12 11 if (isset($_POST['killmail'])) 13 12 { … … 15 14 { 16 15 $parser = new Parser($_POST['killmail']); 17 18 //Filtering 19 if($config->getConfig("filter_apply") == "1"){ 20 $filterdate = $config->getConfig("filter_date"); 21 $year = substr($_POST['killmail'],0,4); 22 $month = substr($_POST['killmail'],5,2); 23 $day = substr($_POST['killmail'],8,2); 24 $killstamp = mktime(0,0,0,$month,$day,$year); 25 if($killstamp < $filterdate){ 26 $killid = -3; 27 }else{ 28 $killid = $parser->parse(true); 29 } 30 }else{ 31 $killid = $parser->parse(true); 32 } 16 17 // Filtering 18 if ($config->getConfig("filter_apply")) 19 { 20 $filterdate = $config->getConfig("filter_date"); 21 $year = substr($_POST['killmail'], 0, 4); 22 $month = substr($_POST['killmail'], 5, 2); 23 $day = substr($_POST['killmail'], 8, 2); 24 $killstamp = mktime(0, 0, 0, $month, $day, $year); 25 if ($killstamp < $filterdate) 26 { 27 $killid = -3; 28 } 29 else 30 { 31 $killid = $parser->parse(true); 32 } 33 } 34 else 35 { 36 $killid = $parser->parse(true); 37 } 33 38 34 39 if ($killid == 0 || $killid == -1 || $killid == -2 || $killid == -3) 35 40 { 36 41 if ($killid == 0) 42 { 37 43 $html = "Killmail is malformed."; 38 if ($killid == -1) 44 } 45 elseif ($killid == -1) 39 46 { 40 $html = "That killmail has already been posted <a href=\"?a=kill_detail&kll_id=" . $parser->dupeid_ ."\">here</a>.";47 $html = "That killmail has already been posted <a href=\"?a=kill_detail&kll_id=".$parser->dupeid_."\">here</a>."; 41 48 } 42 if ($killid == -2) 49 elseif ($killid == -2) 50 { 43 51 $html = "You are not authorized to post this killmail."; 44 45 if ($killid == -3){ 46 $filterdate = date("j F Y",$config->getConfig("filter_date")); 52 } 53 elseif ($killid == -3) 54 { 55 $filterdate = date("j F Y", $config->getConfig("filter_date")); 47 56 $html = "You are not allowed to post killmails older than $filterdate."; 48 57 } 49 58 } 50 59 else … … 55 64 $kill = new Kill($killid); 56 65 57 $mailer->From = "mailer@ eve-killboard.net";58 $mailer->FromName = "eve-killboard.net";66 $mailer->From = "mailer@".$config->getConfig('mail_host'); 67 $mailer->FromName = $config->getConfig('mail_host'); 59 68 $mailer->Subject = "Killmail #" . $killid; 60 69 $mailer->Host = "localhost"; … … 62 71 $mailer->Helo = "localhost"; 63 72 $mailer->Mailer = "smtp"; 64 $mailer->AddReplyTo("no_reply@ eve-killboard.net", "No-Reply");65 $mailer->Sender = "mailer@ eve-killboard.net";73 $mailer->AddReplyTo("no_reply@".$config->getConfig('mail_host'), "No-Reply"); 74 $mailer->Sender = "mailer@".$config->getConfig('mail_host'); 66 75 $mailer->Body = $kill->getRawMail(); 67 76 $mailer->AddAddress($config->getPostMailto()); … … 71 80 $qry = new DBQuery(); 72 81 $qry->execute("insert into kb3_log 73 values( " . $killid . ", '" . KB_SITE . "', 74 '" . $_SERVER['REMOTE_ADDR'] . "', 75 now() )"); 82 values(".$killid.",'".KB_SITE."','".$_SERVER['REMOTE_ADDR']."', now())"); 76 83 77 header("Location: ?a=kill_detail&kll_id=" .$killid);84 header("Location: ?a=kill_detail&kll_id=".$killid); 78 85 exit; 79 86 } -
dev/common/post_igb.php
r36 r59 1 <? 2 require_once( "class.page.php");3 require_once( "class.killboard.php");4 require_once( "class.parser.php");5 require_once( "class.phpmailer.php");6 require_once( "class.kill.php");1 <?php 2 require_once("class.page.php"); 3 require_once("class.killboard.php"); 4 require_once("class.parser.php"); 5 require_once("class.phpmailer.php"); 6 require_once("class.kill.php"); 7 7 8 $kb = new Killboard( KB_SITE);8 $kb = new Killboard(KB_SITE); 9 9 10 $html = "<html><head><title>".KB_TITLE." Killboard - Post Mail"."</title></head></html><body>";10 $html = "<html><head><title>" . KB_TITLE . " Killboard - Post Mail" . "</title></head></html><body>"; 11 11 12 $config = $kb->getConfig(); 12 if (isset($_POST['killmail'])) 13 { 14 if ($_POST['password'] == $config->getPostPassword()) 15 { 16 $parser = new Parser($_POST['killmail']); 13 17 14 if ( isset( $_POST['killmail'] ) ) {18 $killid = $parser->parse(true); 15 19 16 if ( $_POST['password'] == $config->getPostPassword() ) { 17 $parser = new Parser( $_POST['killmail'] ); 20 if ($killid == 0 || $killid == -1 || $killid == -2 || $killid == -3) 21 { 22 if ($killid == 0) 23 { 24 $html = "Killmail is malformed."; 25 } 26 elseif ($killid == -1) 27 { 28 $html = "That killmail has already been posted."; 29 } 30 elseif ($killid == -2) 31 { 32 $html = "You are not authorized to post this killmail."; 33 } 34 elseif ($killid == -3) 35 { 36 $filterdate = date("j F Y", $config->getConfig("filter_date")); 37 $html = "You are not allowed to post killmails older than $filterdate."; 38 } 18 39 19 $killid = $parser->parse( true ); 40 $html .= "<br><br><a href=\"?a=post_igb\">Try again</a>"; 41 } 42 else 43 { 44 if ($config->getPostMailTo() != "") 45 { 46 $mailer = new PHPMailer(); 47 $kill = new Kill($killid); 20 48 21 if ( $killid == 0 || $killid == -1 || $killid == -2 || $killid == -3) { 22 if ( $killid == 0 ) 23 $html = "Killmail is malformed."; 24 if ( $killid == -1 ) 25 $html = "That killmail has already been posted."; 26 if ( $killid == -2 ) 27 $html = "You are not authorized to post this killmail."; 28 29 if ($killid == -3) { 30 $filterdate = date("j F Y",$config->getConfig("filter_date")); 31 $html = "You are not allowed to post killmails older than $filterdate."; 32 } 49 $mailer->From = "mailer@".$config->getConfig('mail_host'); 50 $mailer->FromName = $config->getConfig('mail_host'); 51 $mailer->Subject = "Killmail #" . $killid; 52 $mailer->Host = "localhost"; 53 $mailer->Port = 25; 54 $mailer->Helo = "localhost"; 55 $mailer->Mailer = "smtp"; 56 $mailer->AddReplyTo("no_reply@".$config->getConfig('mail_host'), "No-Reply"); 57 $mailer->Sender = "mailer@".$config->getConfig('mail_host'); 58 $mailer->Body = $kill->getRawMail(); 59 $mailer->AddAddress($config->getPostMailto()); 60 $mailer->Send(); 61 } 33 62 63 $qry = new DBQuery(); 64 $qry->execute("insert into kb3_log 65 values( " . $killid . ", '" . KB_SITE . "', 66 '" . $_SERVER['REMOTE_ADDR'] . "', 67 now() )"); 68 69 $html .= "Killmail posted successfully.<br><br>"; 70 $html .= "<a href=\"?a=post_igb\">Post another killmail</a>"; 71 } 72 } 73 else 74 { 75 $html .= "Invalid password."; 34 76 $html .= "<br><br><a href=\"?a=post_igb\">Try again</a>"; 35 }36 else {37 if ( $config->getPostMailTo() != "" ) {38 $mailer = new PHPMailer();39 $kill = new Kill( $killid );40 41 $mailer->From = "mailer@eve-killboard.net";42 $mailer->FromName = "eve-killboard.net";43 $mailer->Subject = "Killmail #".$killid;44 $mailer->Host = "localhost";45 $mailer->Port = 25;46 $mailer->Helo = "localhost";47 $mailer->Mailer = "smtp";48 $mailer->AddReplyTo( "no_reply@eve-killboard.net", "No-Reply" );49 $mailer->Sender = "mailer@eve-killboard.net";50 $mailer->Body = $kill->getRawMail();51 $mailer->AddAddress( $config->getPostMailto() );52 $mailer->Send();53 }54 55 $qry = new DBQuery();56 $qry->execute( "insert into kb3_log57 values( ".$killid.", '".KB_SITE."',58 '".$_SERVER['REMOTE_ADDR']."',59 now() )" );60 61 $html .= "Killmail posted successfully.<br><br>";62 $html .= "<a href=\"?a=post_igb\">Post another killmail</a>";63 }64 77 } 65 else { 66 $html .= "Invalid password."; 67 $html .= "<br><br><a href=\"?a=post_igb\">Try again</a>"; 68 } 69 } 70 else { 78 } 79 else 80 { 71 81 $html .= "Paste the killmail from your EVEMail inbox into the box below. Make sure you post the <b>ENTIRE</b> mail.<br>Posting fake or otherwise edited mails is not allowed. All posts are logged."; 72 82 $html .= "<br><br>Remember to post your losses as well.<br><br>"; … … 77 87 $html .= " <input id=submit name=\"submit\" type=\"submit\" value=\"Process !\">"; 78 88 $html .= "</form>"; 89 } 79 90 80 } 91 $html .= "</body></html>"; 81 92 82 $html .= "</body></html>"; 83 84 echo $html; 93 echo $html; 85 94 ?>