Changeset 240 for dev/mods

Show
Ignore:
Timestamp:
09/25/07 15:26:51 (13 years ago)
Author:
ralle030583
Message:

Implemented exi's involvedloader class

Location:
dev/mods
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • dev/mods/example_mod/home.php

    r233 r240  
    11<?php 
    2 require_once("common/includes/class.killsummarytable.php"); 
    3 require_once("common/includes/class.box.php"); 
    4 require_once("common/includes/class.corp.php"); 
    5 require_once("common/includes/class.alliance.php"); 
    6 require_once("common/includes/class.killlist.php"); 
    7 require_once("common/includes/class.killlisttable.php"); 
    8 require_once("common/includes/class.contract.php"); 
    9 require_once("common/includes/class.graph.php"); 
    10 require_once("common/includes/class.toplist.php"); 
     2require_once('common/includes/class.killsummarytable.php'); 
     3require_once('common/includes/class.corp.php'); 
     4require_once('common/includes/class.alliance.php'); 
     5require_once('common/includes/class.killlist.php'); 
     6require_once('common/includes/class.killlisttable.php'); 
     7require_once('common/includes/class.contract.php'); 
     8require_once('common/includes/class.toplist.php'); 
    119 
    12 $week = date("W"); 
    13 $year = date("Y"); 
     10$week = kbdate('W'); 
     11$year = kbdate('Y'); 
    1412 
    1513$page = new Page("omgwtfpwnd!!!1"); 
    1614 
    1715$kslist = new KillList(); 
    18 if (CORP_ID) 
    19     $kslist->addInvolvedCorp(new Corporation(CORP_ID)); 
    20 if (ALLIANCE_ID) 
    21     $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
    22  
     16involved::load($kslist,'kill'); 
    2317$kslist->setWeek($week); 
    2418$kslist->setYear($year); 
    2519 
    2620$llist = new KillList(); 
    27 if (CORP_ID) 
    28     $llist->addVictimCorp(new Corporation(CORP_ID)); 
    29 if (ALLIANCE_ID) 
    30     $llist->addVictimAlliance(new Alliance(ALLIANCE_ID)); 
    31  
     21involved::load($llist,'loss'); 
    3222$llist->setWeek($week); 
    3323$llist->setYear($year); 
     
    3525$summarytable = new KillSummaryTable($kslist, $llist); 
    3626$summarytable->setBreak(5); 
    37 //$html .= $summarytable->generate(); 
     27$html .= $summarytable->generate(); 
    3828 
    3929if ($week == 1) 
    4030{ 
    41     $pyear = date("Y") - 1; 
     31    $pyear = kbdate("Y") - 1; 
    4232    $pweek = 52; 
    4333} 
    4434else 
    4535{ 
    46     $pyear = date("Y"); 
     36    $pyear = kbdate("Y"); 
    4737    $pweek = $week - 1; 
    4838} 
     
    6858} 
    6959 
    70 $html .= "<div class=kb-kills-header>20 most recent pwns</div>"; 
     60// bad hax0ring, we really need mod callback stuff 
     61if (strpos(config::get('mods_active'), 'rss_feed') !== false) 
     62{ 
     63    $html .= "<div class=kb-kills-header><a href=\"?a=rss\"><img src=\"mods/rss_feed/rss_icon.png\" alt=\"RSS-Feed\" border=\"0\"></a>&nbsp;20 most recent kills</div>"; 
     64} 
     65else 
     66{ 
     67    $html .= "<div class=kb-kills-header>20 most recent kills</div>"; 
     68} 
    7169 
    7270$klist = new KillList(); 
    7371$klist->setOrdered(true); 
    74 if (CORP_ID) 
    75     $klist->addInvolvedCorp(new Corporation(CORP_ID)); 
    76 if (ALLIANCE_ID) 
    77     $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
     72involved::load($klist,'kill'); 
     73 
    7874 
    7975// boards with low killcount could not display 20 kills with those limits 
    8076//$klist->setStartWeek($week - 1); 
    8177//$klist->setYear($year); 
     78$klist->setLimit(20); 
    8279 
    8380if ($_GET['scl_id']) 
     
    9188 
    9289$page->setContent($html); 
    93 $menubox = new MenuBox(); 
    94 $menubox->addCaption("Navigation"); 
    95 $menubox->addOption("Previous week", "?a=kills&w=" . $pweek . "&y=" . $pyear); 
     90$menubox = new box("Menu"); 
     91$menubox->setIcon("menu-item.gif"); 
     92$menubox->addOption("caption","Navigation"); 
     93$menubox->addOption("link","Previous week", "?a=kills&w=" . $pweek . "&y=" . $pyear); 
    9694$page->addContext($menubox->generate()); 
    9795 
     
    9997$tklist->setWeek($week); 
    10098$tklist->setYear($year); 
    101 if (CORP_ID) 
    102     $tklist->addInvolvedCorp(new Corporation(CORP_ID)); 
    103 if (ALLIANCE_ID) 
    104     $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
     99involved::load($tklist,'kill'); 
    105100 
    106101$tklist->generate(); 
     
    113108    $tklist->setWeek($week); 
    114109    $tklist->setYear($year); 
    115     if (CORP_ID) 
    116         $tklist->addInvolvedCorp(new Corporation(CORP_ID)); 
    117     if (ALLIANCE_ID) 
    118         $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
     110    involved::load($tklist,'kill'); 
    119111 
    120112    $tklist->generate(); 
  • dev/mods/forum_post/cc_detail.php

    r233 r240  
    223223$tklist = new TopContractKillsList(); 
    224224$tklist->setContract(new Contract($ctr_id)); 
    225 if (CORP_ID) 
    226     $tklist->addInvolvedCorp(new Corporation(CORP_ID)); 
    227 if (ALLIANCE_ID) 
    228     $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
     225involved::load($tklist,'kill'); 
    229226 
    230227$tklist->generate(); 
     
    241238    $tklist = new TopContractScoreList(); 
    242239    $tklist->setContract(new Contract($ctr_id)); 
    243     if (CORP_ID) 
    244         $tklist->addInvolvedCorp(new Corporation(CORP_ID)); 
    245     if (ALLIANCE_ID) 
    246         $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
     240    involved::load($tklist,'kill'); 
    247241 
    248242    $tklist->generate(); 
  • dev/mods/forum_post/forum_post.php

    r233 r240  
    8989$kslist->setStartDate($firstts); 
    9090$kslist->setEndDate($lastts); 
    91 if (CORP_ID) 
    92     $kslist->addInvolvedCorp(new Corporation(CORP_ID)); 
    93 if (ALLIANCE_ID) 
    94     $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
     91involved::load($kslist,'kill'); 
    9592 
    9693$lslist = new KillList(); 
     
    9996$lslist->setStartDate($firstts); 
    10097$lslist->setEndDate($lastts); 
    101 if (CORP_ID) 
    102     $lslist->addVictimCorp(new Corporation(CORP_ID)); 
    103 if (ALLIANCE_ID) 
    104     $lslist->addVictimAlliance(new Alliance(ALLIANCE_ID)); 
     98involved::load($lslist,'loss'); 
    10599 
    106100$killsummary = new KillSummaryTable($kslist, $lslist); 
  • dev/mods/forum_post/kill_related.php

    r233 r240  
    7979$kslist->setStartDate($firstts); 
    8080$kslist->setEndDate($lastts); 
    81 if (CORP_ID) 
    82     $kslist->addInvolvedCorp(new Corporation(CORP_ID)); 
    83 if (ALLIANCE_ID) 
    84     $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
     81involved::load($kslist,'kill'); 
    8582 
    8683$lslist = new KillList(); 
     
    8986$lslist->setStartDate($firstts); 
    9087$lslist->setEndDate($lastts); 
    91 if (CORP_ID) 
    92     $lslist->addVictimCorp(new Corporation(CORP_ID)); 
    93 if (ALLIANCE_ID) 
    94     $lslist->addVictimAlliance(new Alliance(ALLIANCE_ID)); 
     88involved::load($lslist,'loss'); 
    9589 
    9690$summarytable = new KillSummaryTable($kslist, $lslist); 
     
    10397$klist->setStartDate($firstts); 
    10498$klist->setEndDate($lastts); 
    105 if (CORP_ID) 
    106     $klist->addInvolvedCorp(new Corporation(CORP_ID)); 
    107 if (ALLIANCE_ID) 
    108     $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
     99involved::load($klist,'kill'); 
    109100 
    110101$llist = new KillList(); 
     
    113104$llist->setStartDate($firstts); 
    114105$llist->setEndDate($lastts); 
    115 if (CORP_ID) 
    116     $llist->addVictimCorp(new Corporation(CORP_ID)); 
    117 if (ALLIANCE_ID) 
    118     $llist->addVictimAlliance(new Alliance(ALLIANCE_ID)); 
     106involved::load($llist,'loss'); 
    119107 
    120108if ($_GET['scl_id']) 
  • dev/mods/ingame_mod/igb.php

    r212 r240  
    4949                $klist = new KillList(); 
    5050                $klist->setOrdered(true); 
    51                 if ( CORP_ID ) 
    52                         $klist->addVictimCorp( new Corporation( CORP_ID ) ); 
    53                 if ( ALLIANCE_ID ) 
    54                         $klist->addVictimAlliance( new Alliance( ALLIANCE_ID ) ); 
    55                          
     51                involved::load($klist,'loss');           
    5652                $html .= mktable($klist,30); 
    5753                break; 
     
    5955                $klist = new KillList(); 
    6056                $klist->setOrdered(true); 
    61                 if ( CORP_ID ) 
    62                         $klist->addInvolvedCorp( new Corporation( CORP_ID ) ); 
    63                 if ( ALLIANCE_ID ) 
    64                         $klist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); 
     57                involved::load($klist,'kill'); 
    6558                $html .= mktable($klist,30); 
    6659                break; 
    6760        default:  
    6861                $klist = new KillList(); 
    69                 if ( CORP_ID ) 
    70                         $klist->addInvolvedCorp( new Corporation( CORP_ID ) ); 
    71                 if ( ALLIANCE_ID ) 
    72                         $klist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ) ); 
     62                involved::load($klist,'kill'); 
    7363                $klist->setOrdered(true); 
    7464                $html .= mktable($klist,10); 
  • dev/mods/rss_feed/rss.php

    r190 r240  
    2424$klist = new KillList(); 
    2525$klist->setOrdered(true); 
    26 if (CORP_ID) 
    27 { 
    28     $klist->addInvolvedCorp(new Corporation(CORP_ID)); 
    29 } 
    30 if (ALLIANCE_ID) 
    31 { 
    32     $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 
    33 } 
     26involved::load($klist,'kill'); 
    3427 
    3528if ($_GET['scl_id'])