Changeset 149

Show
Ignore:
Timestamp:
12/12/06 18:10:07 (14 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.

Location:
dev
Files:
10 modified

Legend:

Unmodified
Added
Removed
  • dev/common/admin_shp_val.php

    r91 r149  
    3131        { 
    3232            $search = true; 
    33             $searchstr = ' where ksb.shp_value is null and shp.shp_class != 18 and shp.shp_id='.$id; 
     33            $searchstr = ' where ksb.shp_value is null and shp.shp_class != 17 and shp.shp_id='.$id; 
    3434        } 
    3535    } 
     
    3737    { 
    3838        $search = true; 
    39         $searchstr = " where ksb.shp_value is null and shp.shp_class != 18 and shp.shp_name like '%{$name}%'"; 
     39        $searchstr = " where ksb.shp_value is null and shp.shp_class != 17 and shp.shp_name like '%{$name}%'"; 
    4040    } 
    4141    else 
  • dev/common/class.comments.php

    r134 r149  
    77    { 
    88        $this->id_ = $kll_id; 
     9        $this->raw_ = false; 
    910 
    1011        $this->comments_ = array(); 
     
    2728    function addComment($name, $text) 
    2829    { 
    29         $comment = $text; 
    30         $comment = $this->bbencode($comment); 
     30        $comment = $this->bbencode($text); 
    3131 
    3232        $name = slashfix(strip_tags($name)); 
     
    4444    } 
    4545 
     46    function postRaw($bool) 
     47    { 
     48        $this->raw_ = $bool; 
     49    } 
     50 
    4651    function bbencode($string) 
    4752    { 
    48         $string = strip_tags(stripslashes($string)); 
     53        if (!$this->raw_) 
     54        { 
     55            $string = strip_tags(stripslashes($string)); 
     56        } 
    4957        $string = str_replace(array('[b]','[/b]','[i]','[/i]','[u]','[/u]'), 
    5058                              array('<b>','</b>','<i>','</i>','<u>','</u>'), $string); 
  • dev/common/class.killlist.php

    r137 r149  
    4040                                sys.sys_name, sys.sys_sec, 
    4141                                fbplt.plt_name as fbplt_name, 
     42                                fbplt.plt_externalid as fbplt_externalid, 
    4243                                fbcrp.crp_name as fbcrp_name'; 
    4344 
     
    283284            $kill->setFBCorpName($row['fbcrp_name']); 
    284285            $kill->setKillPoints($row['kll_points']); 
     286            $kill->plt_ext_ = $row['plt_externalid']; 
     287            $kill->fbplt_ext_ = $row['fbplt_externalid']; 
    285288            return $kill; 
    286289        } 
  • dev/common/class.killlisttable.php

    r134 r149  
    7878            $kll['systemsecurity'] = $kill->getSolarSystemSecurity(); 
    7979            $kll['timestamp'] = $kill->getTimeStamp(); 
     80 
     81            if ($kill->fbplt_ext_) 
     82            { 
     83                $kll['fbplext'] = $kill->fbplt_ext_; 
     84            } 
     85            else 
     86            { 
     87                $kll['fbplext'] = null; 
     88            } 
     89            if ($kill->plt_ext_) 
     90            { 
     91                $kll['plext'] = $kill->plt_ext_; 
     92            } 
     93            else 
     94            { 
     95                $kll['plext'] = null; 
     96            } 
    8097            if ($config->getConfig('comments_count')) 
    8198            { 
  • 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?> 
  • 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?> 
  • dev/install/install_step4.php

    r133 r149  
    107107                    if (trim($query)) 
    108108                    { 
     109                        $query = trim($query); 
     110                        if (substr($query, -1, 1) == ';') 
     111                        { 
     112                            $query = substr($query, 0, -1); 
     113                        } 
    109114                        $query_count++; 
    110115                        $id = mysql_query($query); 
     
    173178                foreach ($querys as $query) 
    174179                { 
    175                     $id = mysql_query($query); 
     180                    $query = trim($query); 
     181                    if ($query) 
     182                    { 
     183                        if (substr($query, -1, 1) == ';') 
     184                        { 
     185                            $query = substr($query, 0, -1); 
     186                        } 
     187                        $id = mysql_query($query); 
     188                    } 
    176189                } 
    177190                if ($id) 
  • dev/mods/rss_feed/rss.php

    r134 r149  
    1919<title>".KB_TITLE."</title> 
    2020<description>20 Most Recent Kills</description> 
    21 <link>http://".KB_HOST."</link> 
     21<link>".KB_HOST."</link> 
    2222<copyright>".KB_TITLE."</copyright>\n"; 
    2323 
  • dev/templates/kill_detail.tpl

    r137 r149  
    1414                <tr class={cycle name=ccl}> 
    1515                    <td class=kb-table-cell width=64><b>Alliance:</b></td> 
    16                     <td class=kb-table-cell><b><a href="VictimAllianceURL">{$VictimAllianceName}</a></b></td> 
     16                    <td class=kb-table-cell><b><a href="{$VictimAllianceURL}">{$VictimAllianceName}</a></b></td> 
    1717                </tr> 
    1818            </table> 
  • dev/templates/standings.tpl

    r134 r149  
    77{if $standings[opt].name=='Alliances'} 
    88    <td width="32" height="34" valign="top" align="right" style="background-image: url(?a=alliance_thumb&size=32&id={$standings[opt].list[idx].pid});"><img src="img/sta_{$standings[opt].list[idx].icon}.png"/></td> 
    9     <td><b><a href="?alliance_detail&all_id={$standings[opt].list[idx].id}">{$standings[opt].list[idx].text}</a></b>{$standings[opt].list[idx].descr}</td> 
     9    <td><b><a href="?a=alliance_detail&all_id={$standings[opt].list[idx].id}">{$standings[opt].list[idx].text}</a></b>{$standings[opt].list[idx].descr}</td> 
    1010{else} 
    1111    <td width="32" height="34" valign="top" align="right" style="background-image: url(?a=corpportrait&size=32&id={$standings[opt].list[idx].id});"><img src="img/sta_{$standings[opt].list[idx].icon}.png"/></td> 
    12     <td><b><a href="?corp_detail&all_id={$standings[opt].list[idx].id}">{$standings[opt].list[idx].text}</a></b>{$standings[opt].list[idx].descr}</td> 
     12    <td><b><a href="?a=corp_detail&all_id={$standings[opt].list[idx].id}">{$standings[opt].list[idx].text}</a></b>{$standings[opt].list[idx].descr}</td> 
    1313{/if} 
    1414    <td align="right">{$standings[opt].list[idx].value}</td>