Changeset 10 for dev/common/home.php
- Timestamp:
- 10/16/06 20:59:42 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/home.php
r2 r10 1 <? 2 require_once( "class.page.php");3 require_once( "class.killsummarytable.php");4 require_once( "class.box.php");5 require_once( "class.corp.php");6 require_once( "class.alliance.php");7 require_once( "class.killlist.php");8 require_once( "class.killlisttable.php");9 require_once( "class.contract.php");10 require_once( "class.graph.php");11 require_once( "class.toplist.php");1 <?php 2 require_once("class.page.php"); 3 require_once("class.killsummarytable.php"); 4 require_once("class.box.php"); 5 require_once("class.corp.php"); 6 require_once("class.alliance.php"); 7 require_once("class.killlist.php"); 8 require_once("class.killlisttable.php"); 9 require_once("class.contract.php"); 10 require_once("class.graph.php"); 11 require_once("class.toplist.php"); 12 12 13 $week = date( "W");14 $year = date( "Y");13 $week = date("W"); 14 $year = date("Y"); 15 15 16 $page = new Page( "Week ".$week);16 $page = new Page("Week " . $week); 17 17 18 19 if ( CORP_ID)20 $kslist->addInvolvedCorp( new Corporation( CORP_ID ));21 if ( ALLIANCE_ID)22 $kslist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ));18 $kslist = new KillList(); 19 if (CORP_ID) 20 $kslist->addInvolvedCorp(new Corporation(CORP_ID)); 21 if (ALLIANCE_ID) 22 $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 23 23 24 $kslist->setWeek( $week);25 $kslist->setYear( $year);24 $kslist->setWeek($week); 25 $kslist->setYear($year); 26 26 27 28 if ( CORP_ID)29 $llist->addVictimCorp( new Corporation( CORP_ID ));30 if ( ALLIANCE_ID)31 $llist->addVictimAlliance( new Alliance( ALLIANCE_ID ));27 $llist = new KillList(); 28 if (CORP_ID) 29 $llist->addVictimCorp(new Corporation(CORP_ID)); 30 if (ALLIANCE_ID) 31 $llist->addVictimAlliance(new Alliance(ALLIANCE_ID)); 32 32 33 $llist->setWeek( $week);34 $llist->setYear( $year);33 $llist->setWeek($week); 34 $llist->setYear($year); 35 35 36 $summarytable = new KillSummaryTable( $kslist, $llist);37 $summarytable->setBreak( 6);38 36 $summarytable = new KillSummaryTable($kslist, $llist); 37 $summarytable->setBreak(6); 38 $html .= $summarytable->generate(); 39 39 40 if ( $week == 1 ) { 41 $pyear = date( "Y" ) - 1; 40 if ($week == 1) 41 { 42 $pyear = date("Y") - 1; 42 43 $pweek = 52; 43 } 44 else { 45 $pyear = date( "Y" ); 44 } 45 else 46 { 47 $pyear = date("Y"); 46 48 $pweek = $week - 1; 47 } 48 49 if ( $page->killboard_->hasCampaigns( true ) ) { 49 } 50 51 if ($page->killboard_->hasCampaigns(true)) 52 { 50 53 $html .= "<div class=kb-campaigns-header>Active campaigns</div>"; 51 54 $list = new ContractList(); 52 $list->setActive( "yes");53 $list->setCampaigns( true);54 $table = new ContractListTable( $list);55 $list->setActive("yes"); 56 $list->setCampaigns(true); 57 $table = new ContractListTable($list); 55 58 $html .= $table->generate(); 56 59 } 57 60 58 if ( $page->killboard_->hasContracts( true ) ) { 61 if ($page->killboard_->hasContracts(true)) 62 { 59 63 $html .= "<div class=kb-campaigns-header>Active contracts</div>"; 60 64 $list = new ContractList(); 61 $list->setActive( "yes");62 $list->setCampaigns( false);63 $table = new ContractListTable( $list);65 $list->setActive("yes"); 66 $list->setCampaigns(false); 67 $table = new ContractListTable($list); 64 68 $html .= $table->generate(); 65 69 } 66 70 67 71 $html .= "<div class=kb-kills-header>20 most recent kills</div>"; 68 72 69 $klist = new KillList(); 70 $klist->setOrdered( true ); 71 if ( CORP_ID ) 72 $klist->addInvolvedCorp( new Corporation( CORP_ID ) ); 73 if ( ALLIANCE_ID ) 74 $klist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); 75 $klist->setStartWeek( $week - 1 ); 76 $klist->setYear( $year ); 73 $klist = new KillList(); 74 $klist->setOrdered(true); 75 if (CORP_ID) 76 $klist->addInvolvedCorp(new Corporation(CORP_ID)); 77 if (ALLIANCE_ID) 78 $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 77 79 78 if ( $_GET['scl_id'] ) 79 $klist->addVictimShipClass( new ShipClass( $_GET['scl_id'] ) ); 80 else 81 $klist->setPodsNoobShips( false ); 82 83 $table = new KillListTable( $klist ); 84 $table->setLimit( 20 ); 85 $html .= $table->generate(); 80 // boards with low killcount could not display 20 kills with those limits 81 //$klist->setStartWeek($week - 1); 82 //$klist->setYear($year); 86 83 87 $page->setContent( $html ); 88 $menubox = new MenuBox(); 89 $menubox->addCaption( "Navigation" ); 90 $menubox->addOption( "Previous week", "?a=kills&w=".$pweek."&y=".$pyear ); 91 $page->addContext( $menubox->generate() ); 84 if ($_GET['scl_id']) 85 $klist->addVictimShipClass(new ShipClass($_GET['scl_id'])); 86 else 87 $klist->setPodsNoobShips(false); 92 88 93 $tklist = new TopKillsList(); 94 $tklist->setWeek( $week ); 95 $tklist->setYear( $year ); 96 if ( CORP_ID ) 97 $tklist->addInvolvedCorp( new Corporation( CORP_ID ) ); 98 if ( ALLIANCE_ID ) 99 $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); 100 101 $tklist->generate(); 102 $tkbox = new AwardBox( $tklist, "Top killers", "kills in week ".$week, "kills", "eagle" ); 103 $page->addContext( $tkbox->generate() ); 89 $table = new KillListTable($klist); 90 $table->setLimit(20); 91 $html .= $table->generate(); 104 92 105 $config = $page->killboard_->getConfig(); 106 if ( $config->getKillPoints() ) { 93 $page->setContent($html); 94 $menubox = new MenuBox(); 95 $menubox->addCaption("Navigation"); 96 $menubox->addOption("Previous week", "?a=kills&w=" . $pweek . "&y=" . $pyear); 97 $page->addContext($menubox->generate()); 98 99 $tklist = new TopKillsList(); 100 $tklist->setWeek($week); 101 $tklist->setYear($year); 102 if (CORP_ID) 103 $tklist->addInvolvedCorp(new Corporation(CORP_ID)); 104 if (ALLIANCE_ID) 105 $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 106 107 $tklist->generate(); 108 $tkbox = new AwardBox($tklist, "Top killers", "kills in week " . $week, "kills", "eagle"); 109 $page->addContext($tkbox->generate()); 110 111 $config = $page->killboard_->getConfig(); 112 if ($config->getKillPoints()) 113 { 107 114 $tklist = new TopScoreList(); 108 $tklist->setWeek( $week);109 $tklist->setYear( $year);110 if ( CORP_ID)111 $tklist->addInvolvedCorp( new Corporation( CORP_ID ));112 if ( ALLIANCE_ID)113 $tklist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ));114 115 $tklist->setWeek($week); 116 $tklist->setYear($year); 117 if (CORP_ID) 118 $tklist->addInvolvedCorp(new Corporation(CORP_ID)); 119 if (ALLIANCE_ID) 120 $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 121 115 122 $tklist->generate(); 116 $tkbox = new AwardBox( $tklist, "Top scorers", "points in week ".$week, "points", "redcross");117 $page->addContext( $tkbox->generate() );118 119 120 123 $tkbox = new AwardBox($tklist, "Top scorers", "points in week " . $week, "points", "redcross"); 124 $page->addContext($tkbox->generate()); 125 } 126 127 $page->generate(); 121 128 ?>