Changeset 149 for dev/common/kills.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/kills.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.ship.php" ); 
    8   require_once( "class.killlisttable.php" ); 
    9   require_once( "class.killsummarytable.php" ); 
    10   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.ship.php"); 
     8require_once("class.killlisttable.php"); 
     9require_once("class.killsummarytable.php"); 
     10require_once("class.toplist.php"); 
    1111 
    12   $week = $_GET['w']; 
    13   $year = $_GET['y']; 
    14    
    15   if ( $week == "" ) 
    16     $week = date( "W" ); 
    17    
    18   if ( $year == "" ) 
    19     $year = date( "Y" ); 
    20      
    21   if ( $week == 52 ) { 
     12$week = $_GET['w']; 
     13$year = $_GET['y']; 
     14 
     15if ($week == "") 
     16    $week = date("W"); 
     17 
     18if ($year == "") 
     19    $year = date("Y"); 
     20 
     21if ($week == 52) 
     22{ 
    2223    $nweek = 1; 
    2324    $nyear = $year + 1; 
    2425    $pyear = $year - 1; 
    25   } 
    26   else { 
     26} 
     27else 
     28{ 
    2729    $nweek = $week + 1; 
    2830    $nyear = $year; 
    29   } 
    30   if ( $week == 1 ) { 
     31} 
     32if ($week == 1) 
     33{ 
    3134    $pweek = 52; 
    3235    $pyear = $year - 1; 
    33   } 
    34   else { 
     36} 
     37else 
     38{ 
    3539    $pweek = $week - 1; 
    3640    $pyear = $year; 
    37   } 
     41} 
    3842 
    39   $page = new Page( "Kills - Week ".$week ); 
     43$page = new Page("Kills - Week ".$week); 
    4044 
    41   $kslist = new KillList(); 
    42   $kslist->setWeek( $week ); 
    43   $kslist->setYear( $year ); 
    44   if ( CORP_ID ) 
    45     $kslist->addInvolvedCorp( new Corporation( CORP_ID ) ); 
    46   if ( ALLIANCE_ID ) 
    47     $kslist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); 
    48                                                                                  
    49   $llist = new KillList(); 
    50   $llist->setWeek( $week ); 
    51   $llist->setYear( $year ); 
    52   if ( CORP_ID ) 
    53     $llist->addVictimCorp( new Corporation( CORP_ID ) ); 
    54   if ( ALLIANCE_ID ) 
    55     $llist->addVictimAlliance( new Alliance( ALLIANCE_ID ) ); 
     45$kslist = new KillList(); 
     46$kslist->setWeek($week); 
     47$kslist->setYear($year); 
     48if (CORP_ID) 
     49    $kslist->addInvolvedCorp(new Corporation(CORP_ID)); 
     50if (ALLIANCE_ID) 
     51    $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
    5652 
    57   $summarytable = new KillSummaryTable( $kslist, $llist ); 
    58   $summarytable->setBreak( 6 ); 
    59   $html .= $summarytable->generate(); 
     53$llist = new KillList(); 
     54$llist->setWeek($week); 
     55$llist->setYear($year); 
     56if (CORP_ID) 
     57    $llist->addVictimCorp(new Corporation(CORP_ID)); 
     58if (ALLIANCE_ID) 
     59    $llist->addVictimAlliance(new Alliance(ALLIANCE_ID)); 
    6060 
    61   $klist = new KillList(); 
    62   $klist->setOrdered( true ); 
    63   $klist->setWeek( $week ); 
    64   $klist->setYear( $year ); 
    65   if ( CORP_ID ) 
    66     $klist->addInvolvedCorp( new Corporation( CORP_ID ) ); 
    67   if ( ALLIANCE_ID ) 
    68     $klist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); 
    69   if ( $_GET['scl_id'] ) 
    70     $klist->addVictimShipClass( new ShipClass( $_GET['scl_id'] ) ); 
    71   else 
    72     $klist->setPodsNoobShips( false ); 
     61$summarytable = new KillSummaryTable($kslist, $llist); 
     62$summarytable->setBreak(6); 
     63$html .= $summarytable->generate(); 
    7364 
    74   $table = new KillListTable( $klist ); 
    75   $html .= $table->generate(); 
     65$klist = new KillList(); 
     66$klist->setOrdered(true); 
     67$klist->setWeek($week); 
     68$klist->setYear($year); 
     69if (CORP_ID) 
     70    $klist->addInvolvedCorp(new Corporation(CORP_ID)); 
     71if (ALLIANCE_ID) 
     72    $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
     73if ($_GET['scl_id']) 
     74    $klist->addVictimShipClass(new ShipClass($_GET['scl_id'])); 
     75else 
     76    $klist->setPodsNoobShips(false); 
    7677 
    77   $page->setContent( $html ); 
     78$table = new KillListTable($klist); 
     79$html .= $table->generate(); 
     80 
     81$page->setContent($html); 
    7882$menubox = new box("Menu"); 
    7983$menubox->setIcon("menu-item.gif"); 
    80   $menubox->addOption("caption", "Navigation" ); 
    81   $menubox->addOption("link", "Previous week ", "?a=kills&w=".$pweek."&y=".$pyear ); 
    82   if ( $week != date( "W" ) ) 
    83     $menubox->addOption( "Next week", "?a=kills&w=".$nweek."&y=".$nyear ); 
    84   $page->addContext( $menubox->generate() ); 
    85    
    86   $tklist = new TopKillsList(); 
    87   $tklist->setWeek( $week ); 
    88   $tklist->setYear( $year ); 
    89   if ( CORP_ID ) 
    90     $tklist->addInvolvedCorp( new Corporation( CORP_ID ) ); 
    91   if ( ALLIANCE_ID ) 
    92     $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); 
    93      
    94   $tklist->generate(); 
    95   $tkbox = new AwardBox( $tklist, "Top killers", "kills in week ".$week, "kills", "eagle" ); 
    96   $page->addContext( $tkbox->generate() );   
     84$menubox->addOption("caption", "Navigation"); 
     85$menubox->addOption("link", "Previous week ", "?a=kills&w=".$pweek."&y=".$pyear); 
     86if ($week != date("W")) 
     87{ 
     88    $menubox->addOption('link', "Next week", "?a=kills&w=".$nweek."&y=".$nyear); 
     89} 
     90$page->addContext($menubox->generate()); 
    9791 
    98   $killboard = $page->killboard_; 
    99   $config = $killboard->getConfig(); 
    100   if ( $config->getKillPoints() ) { 
     92$tklist = new TopKillsList(); 
     93$tklist->setWeek($week); 
     94$tklist->setYear($year); 
     95if (CORP_ID) 
     96    $tklist->addInvolvedCorp(new Corporation(CORP_ID)); 
     97if (ALLIANCE_ID) 
     98    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
     99 
     100$tklist->generate(); 
     101$tkbox = new AwardBox($tklist, "Top killers", "kills in week ".$week, "kills", "eagle"); 
     102$page->addContext($tkbox->generate()); 
     103 
     104$killboard = $page->killboard_; 
     105$config = $killboard->getConfig(); 
     106if ($config->getKillPoints()) 
     107{ 
    101108    $tklist = new TopScoreList(); 
    102     $tklist->setWeek( $week ); 
    103     $tklist->setYear( $year ); 
    104     if ( CORP_ID ) 
    105       $tklist->addInvolvedCorp( new Corporation( CORP_ID ) ); 
    106     if ( ALLIANCE_ID ) 
    107       $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); 
    108      
     109    $tklist->setWeek($week); 
     110    $tklist->setYear($year); 
     111    if (CORP_ID) 
     112        $tklist->addInvolvedCorp(new Corporation(CORP_ID)); 
     113    if (ALLIANCE_ID) 
     114        $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
     115 
    109116    $tklist->generate(); 
    110     $tkbox = new AwardBox( $tklist, "Top scorers", "points in week ".$week, "points", "redcross" ); 
    111     $page->addContext( $tkbox->generate() );   
    112   } 
     117    $tkbox = new AwardBox($tklist, "Top scorers", "points in week ".$week, "points", "redcross"); 
     118    $page->addContext($tkbox->generate()); 
     119} 
    113120 
    114   $page->generate(); 
     121$page->generate(); 
    115122?>