Changeset 149 for dev/common/losses.php

Show
Ignore:
Timestamp:
12/12/06 18:10:07 (16 years ago)
Author:
exi
Message:

Changed custom ship values to also display unknown types.
Changed comment class to allow html code insertion.
Added pullout of externalids on killlists.
Fixed next week link.
Small change to the sql-inserter to remove the ';'.
Fixed the double http-link on rss feeds.
Fixed VictimAllianceURL on kill_details.
Fixed wrong links on standings page.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/losses.php

    r104 r149  
    1 <? 
    2   require_once( "class.page.php" ); 
    3   require_once( "class.box.php" ); 
    4   require_once( "class.corp.php" ); 
    5   require_once( "class.alliance.php" ); 
    6   require_once( "class.killlist.php" ); 
    7   require_once( "class.killlisttable.php" ); 
    8   require_once( "class.killsummarytable.php" ); 
    9   require_once( "class.toplist.php" ); 
     1<?php 
     2require_once("class.page.php"); 
     3require_once("class.box.php"); 
     4require_once("class.corp.php"); 
     5require_once("class.alliance.php"); 
     6require_once("class.killlist.php"); 
     7require_once("class.killlisttable.php"); 
     8require_once("class.killsummarytable.php"); 
     9require_once("class.toplist.php"); 
    1010 
    11   $week = $_GET['w']; 
    12   $year = $_GET['y']; 
    13    
    14   if ( $week == "" ) 
    15     $week = date( "W" ); 
    16    
    17   if ( $year == "" ) 
    18     $year = date( "Y" ); 
    19      
    20   if ( $week == 52 ) { 
     11$week = $_GET['w']; 
     12$year = $_GET['y']; 
     13 
     14if ($week == "") 
     15    $week = date("W"); 
     16 
     17if ($year == "") 
     18    $year = date("Y"); 
     19 
     20if ($week == 52) 
     21{ 
    2122    $nweek = 1; 
    2223    $nyear = $year + 1; 
    23   } 
    24   else { 
     24} 
     25else 
     26{ 
    2527    $nweek = $week + 1; 
    2628    $nyear = $year; 
    27   } 
    28   if ( $week == "1" ) { 
     29} 
     30if ($week == "1") 
     31{ 
    2932    $pweek = 52; 
    3033    $pyear = $year - 1; 
    31   } 
    32   else { 
     34} 
     35else 
     36{ 
    3337    $pweek = $week - 1; 
    3438    $pyear = $year; 
    35   } 
     39} 
    3640 
    37   $page = new Page( "Losses - Week ".$week ); 
     41$page = new Page("Losses - Week ".$week); 
    3842 
    39   $klist = new KillList(); 
    40   $klist->setWeek( $week ); 
    41   $klist->setYear( $year ); 
    42   if ( CORP_ID ) 
    43     $klist->addInvolvedCorp( new Corporation( CORP_ID ) ); 
    44   if ( ALLIANCE_ID ) 
    45     $klist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); 
    46                                                                                  
    47   $lslist = new KillList(); 
    48   $lslist->setWeek( $week ); 
    49   $lslist->setYear( $year ); 
    50   if ( CORP_ID ) 
    51     $lslist->addVictimCorp( new Corporation( CORP_ID ) ); 
    52   if ( ALLIANCE_ID ) 
    53     $lslist->addVictimAlliance( new Alliance( ALLIANCE_ID ) ); 
    54                                                                                  
    55   $summarytable = new KillSummaryTable( $klist, $lslist ); 
    56   $summarytable->setBreak( 6 ); 
    57   $html .= $summarytable->generate(); 
     43$klist = new KillList(); 
     44$klist->setWeek($week); 
     45$klist->setYear($year); 
     46if (CORP_ID) 
     47    $klist->addInvolvedCorp(new Corporation(CORP_ID)); 
     48if (ALLIANCE_ID) 
     49    $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
    5850 
    59   //$html .= "<table width=\"99%\" align=center><tr><td class=weeknav align=left>"; 
    60    
    61  // if ( $week != date( "W" ) ) 
    62  //   $html .= "[<a href=\"?a=losses&w=".$nweek."&y=".$nyear."\"><<</a>]"; 
    63      
    64 //  $html .= "</td><td class=weeknav align=right>[<a href=\"?a=losses&w=".$pweek."&y=".$pyear."\">>></a>]</td></tr></table>"; 
     51$lslist = new KillList(); 
     52$lslist->setWeek($week); 
     53$lslist->setYear($year); 
     54if (CORP_ID) 
     55    $lslist->addVictimCorp(new Corporation(CORP_ID)); 
     56if (ALLIANCE_ID) 
     57    $lslist->addVictimAlliance(new Alliance(ALLIANCE_ID)); 
    6558 
    66   $llist = new KillList(); 
    67   $llist->setOrdered( true ); 
    68   $llist->setWeek( $week ); 
    69   $llist->setYear( $year ); 
    70   if ( CORP_ID ) 
    71     $llist->addVictimCorp( new Corporation( CORP_ID ) ); 
    72   if ( ALLIANCE_ID ) 
    73     $llist->addVictimAlliance( new Alliance( ALLIANCE_ID ) ); 
    74   if ( $_GET['scl_id'] ) 
    75     $llist->addVictimShipClass( new ShipClass( $_GET['scl_id'] ) ); 
    76   else 
    77     $llist->setPodsNoobShips( false ); 
    78                                                                                  
    79   $table = new KillListTable( $llist ); 
    80   $html .= $table->generate(); 
     59$summarytable = new KillSummaryTable($klist, $lslist); 
     60$summarytable->setBreak(6); 
     61$html .= $summarytable->generate(); 
     62// $html .= "<table width=\"99%\" align=center><tr><td class=weeknav align=left>"; 
     63// if ( $week != date( "W" ) ) 
     64// $html .= "[<a href=\"?a=losses&w=".$nweek."&y=".$nyear."\"><<</a>]"; 
     65// $html .= "</td><td class=weeknav align=right>[<a href=\"?a=losses&w=".$pweek."&y=".$pyear."\">>></a>]</td></tr></table>"; 
     66$llist = new KillList(); 
     67$llist->setOrdered(true); 
     68$llist->setWeek($week); 
     69$llist->setYear($year); 
     70if (CORP_ID) 
     71    $llist->addVictimCorp(new Corporation(CORP_ID)); 
     72if (ALLIANCE_ID) 
     73    $llist->addVictimAlliance(new Alliance(ALLIANCE_ID)); 
     74if ($_GET['scl_id']) 
     75    $llist->addVictimShipClass(new ShipClass($_GET['scl_id'])); 
     76else 
     77    $llist->setPodsNoobShips(false); 
     78 
     79$table = new KillListTable($llist); 
     80$html .= $table->generate(); 
    8181 
    8282$menubox = new box("Menu"); 
    8383$menubox->setIcon("menu-item.gif"); 
    84   $menubox->addOption("caption", "Navigation" ); 
    85   $menubox->addOption("link", "Previous week", "?a=losses&w=".$pweek."&y=".$pyear ); 
    86   if ( $week != date( "W" ) ) 
    87     $menubox->addOption("link", "Next week", "?a=losses&w=".$nweek."&y=".$nyear ); 
    88   $page->addContext( $menubox->generate() ); 
     84$menubox->addOption("caption", "Navigation"); 
     85$menubox->addOption("link", "Previous week", "?a=losses&w=".$pweek."&y=".$pyear); 
     86if ($week != date("W")) 
     87{ 
     88    $menubox->addOption("link", "Next week", "?a=losses&w=".$nweek."&y=".$nyear); 
     89} 
     90$page->addContext($menubox->generate()); 
    8991 
    90   $tllist = new TopLossesList(); 
    91   $tllist->setWeek( $week ); 
    92   $tllist->setYear( $year ); 
    93   if ( CORP_ID ) 
    94     $tllist->addVictimCorp( new Corporation( CORP_ID ) ); 
    95   if ( ALLIANCE_ID ) 
    96     $tllist->addVictimAlliance( new Alliance( ALLIANCE_ID ) ); 
    97      
    98   $tllist->generate(); 
    99   $tlbox = new AwardBox( $tllist, "Top losers", "losses in week ".$week, "losses", "moon" ); 
    100   $page->addContext( $tlbox->generate() );   
     92$tllist = new TopLossesList(); 
     93$tllist->setWeek($week); 
     94$tllist->setYear($year); 
     95if (CORP_ID) 
     96    $tllist->addVictimCorp(new Corporation(CORP_ID)); 
     97if (ALLIANCE_ID) 
     98    $tllist->addVictimAlliance(new Alliance(ALLIANCE_ID)); 
    10199 
    102   $page->setContent( $html ); 
    103   $page->generate(); 
     100$tllist->generate(); 
     101$tlbox = new AwardBox($tllist, "Top losers", "losses in week ".$week, "losses", "moon"); 
     102$page->addContext($tlbox->generate()); 
     103 
     104$page->setContent($html); 
     105$page->generate(); 
    104106?>