Changeset 289

Show
Ignore:
Timestamp:
12/16/07 14:55:47 (12 years ago)
Author:
exi
Message:

Added the change from ticket:54 - customizable rowcount on KillSummaryTable?.
Added the change from ticket:55 - ship classes shouldnt wrap anymore.
Added the fix from ticket:56 - proper png output by the signature generator.

Location:
dev
Files:
15 modified

Legend:

Unmodified
Added
Removed
  • dev/common/admin/option_generic.php

    r282 r289  
    2222options::fadd('Use gmdate instead of date', 'date_gmtime', 'checkbox'); 
    2323options::fadd('Classify kills for hours:', 'kill_classified', 'edit:size:4', '', '', '0 to disable, 1-24hrs'); 
    24 options::fadd('Display a summary line below a killsummarytable', 'summarytable_summary', 'checkbox'); 
    2524 
    2625options::cat('Appearance', 'Generic', 'Posting'); 
     
    4140options::fadd('Include dropped value into total loss', 'kd_droptototal', 'checkbox'); 
    4241 
     42options::cat('Appearance', 'Generic', 'Killsummarytables'); 
     43options::fadd('Stats Row Count', 'summarytable_rowcount', 'edit:size:2'); 
     44options::fadd('Display a summary line below a killsummarytable', 'summarytable_summary', 'checkbox'); 
     45 
    4346options::cat('Appearance', 'Generic', 'Public-Mode v0.2'); 
    4447options::fadd('Only Kills in SummaryTables', 'public_summarytable', 'checkbox','','','CORP_ID and ALLIANCE_ID in config has to be 0 to work "public"'); 
  • dev/common/alliance_detail.php

    r281 r289  
    3434$kill_summary = new KillSummaryTable(); 
    3535$kill_summary->addInvolvedAlliance($alliance); 
    36 $kill_summary->setBreak(6); 
     36$kill_summary->setBreak(config::get('summarytable_rowcount')); 
    3737$summary_html = $kill_summary->generate(); 
    3838 
  • dev/common/cc_detail.php

    r281 r289  
    4040$llist = $contract->getLossList(); 
    4141$killsummary = new KillSummaryTable($klist, $llist); 
    42 $killsummary->setBreak(6); 
     42$killsummary->setBreak(config::get('summarytable_rowcount')); 
    4343if ($_GET['view'] == "") 
    4444    $killsummary->setFilter(false); 
  • dev/common/corp_detail.php

    r281 r289  
    2525$kill_summary = new KillSummaryTable(); 
    2626$kill_summary->addInvolvedCorp($corp); 
    27 $kill_summary->setBreak(6); 
     27$kill_summary->setBreak(config::get('summarytable_rowcount')); 
    2828$summary_html = $kill_summary->generate(); 
    2929 
  • dev/common/home.php

    r281 r289  
    2929        $summarytable = new KillSummaryTable($kslist, $llist); 
    3030} 
    31 $summarytable->setBreak(6); 
     31$summarytable->setBreak(config::get('summarytable_rowcount')); 
    3232$html .= $summarytable->generate(); 
    3333 
  • dev/common/igb_home.php

    r281 r289  
    2424 
    2525$summarytable = new KillSummaryTable($kslist, $llist); 
    26 $summarytable->setBreak(6); 
     26$summarytable->setBreak(config::get('summarytable_rowcount')); 
    2727 
    2828if ($week == 1) 
  • dev/common/includes/class.config.php

    r254 r289  
    126126        if (!isset($cache[$key])) 
    127127        { 
    128             return null; 
     128            return config::defaultval($key); 
    129129        } 
    130130        return stripslashes($cache[$key]); 
    131131    } 
     132 
     133    function defaultval($key) 
     134    { 
     135        // add important upgrade configs here, they will return the default if not set 
     136        $defaults = array('summarytable_rowcount' => 6); 
     137 
     138        if (!isset($defaults[$key])) 
     139        { 
     140            return null; 
     141        } 
     142        return $defaults[$key]; 
     143    } 
    132144} 
    133145?> 
  • dev/common/includes/class.kill.php

    r272 r289  
    438438                        itd_itl_id, itl_location 
    439439                    from kb3_items_destroyed itd 
    440                         left join kb3_items itm on itd.itd_itm_id = itm.itm_id 
    441                         left join kb3_item_locations itl on (itd.itd_itl_id = itl.itl_id or (itd.itd_itl_id = 0 and itl.itl_id = 1)) 
    442                     where itd.itd_kll_id = ".$this->getID()." 
    443                     group by itd_itm_id, itd_itl_id 
    444                     order by itd.itd_itl_id, itm.itm_type"; 
    445  
    446             if (DB_USE_CCP) 
    447             { 
    448                 $sql = "select sum(itd.itd_quantity) as itd_quantity, itd_itm_id, 
    449                         itd_itl_id, itl_location 
    450                     from kb3_items_destroyed itd 
    451440                        left join kb3_item_locations itl on (itd.itd_itl_id = itl.itl_id or (itd.itd_itl_id = 0 and itl.itl_id = 1)) 
    452441                    where itd.itd_kll_id = ".$this->getID()." 
    453442                    group by itd_itm_id, itd_itl_id 
    454443                    order by itd.itd_itl_id"; 
    455             } 
    456444            $qry->execute($sql); 
    457445            while ($row = $qry->getRow()) 
     
    463451            } 
    464452 
    465             if (DB_USE_CCP) 
    466             { 
    467                 $sql = "select sum(itd.itd_quantity) as itd_quantity, itd_itm_id, 
    468                         itd_itl_id, itl_location 
    469                     from kb3_items_dropped itd 
    470                         left join kb3_item_locations itl on (itd.itd_itl_id = itl.itl_id or (itd.itd_itl_id = 0 and itl.itl_id = 1)) 
    471                     where itd.itd_kll_id = ".$this->getID()." 
    472                     group by itd_itm_id, itd_itl_id 
    473                     order by itd.itd_itl_id"; 
    474                 $qry->execute($sql); 
    475                 while ($row = $qry->getRow()) 
    476                 { 
    477                     $destroyed = new DroppedItem(new Item($row['itd_itm_id']), 
    478                         $row['itd_quantity'], 
    479                         $row['itl_location']); 
    480                     array_push($this->droppeditems_, $destroyed); 
    481                 } 
     453            // dropped items 
     454            $sql = "select sum(itd.itd_quantity) as itd_quantity, itd_itm_id, 
     455                    itd_itl_id, itl_location 
     456                from kb3_items_dropped itd 
     457                    left join kb3_item_locations itl on (itd.itd_itl_id = itl.itl_id or (itd.itd_itl_id = 0 and itl.itl_id = 1)) 
     458                where itd.itd_kll_id = ".$this->getID()." 
     459                group by itd_itm_id, itd_itl_id 
     460                order by itd.itd_itl_id"; 
     461            $qry->execute($sql); 
     462            while ($row = $qry->getRow()) 
     463            { 
     464                $destroyed = new DroppedItem(new Item($row['itd_itm_id']), 
     465                    $row['itd_quantity'], 
     466                    $row['itl_location']); 
     467                array_push($this->droppeditems_, $destroyed); 
    482468            } 
    483469        } 
  • dev/common/includes/class.killsummarytable.php

    r281 r289  
    140140        } 
    141141 
    142        
     142 
    143143        $sql = 'SELECT count(*) AS lnb, scl_id, scl_class,'; 
    144144        if (config::get('ship_values')) 
     
    231231        $odd = false; 
    232232        $prevdate = ""; 
     233        $width = round($this->break_/count($entry)*100); 
     234        $width_abs = round($this->break_/count($entry)*600); 
     235 
    233236        $html .= "<table class=kb-subtable width=\"100%\" border=\"0\" cellspacing=0>"; 
    234237        if ($this->break_) 
    235             $html .= "<tr><td valign=top><table class=kb-table cellspacing=\"1\" width=\"100%\">"; 
     238            $html .= "<tr><td valign=top width=\"$width%\"><table class=kb-table cellspacing=\"1\" width=\"100%\">"; 
    236239        $counter = 1; 
    237240 
    238         if ($this->verbose_)  
    239         { 
    240             $header = "<tr class=kb-table-header><td class=kb-table-cell width=110>Ship class</td><td class=kb-table-cell width=60 align=center>Kills</td><td class=kb-table-cell width=60 align=center>ISK (M)</td><td class=kb-table-cell width=60 align=center>Losses</td><td class=kb-table-cell width=60 align=center>ISK (M)</td></tr>"; 
     241        if ($this->verbose_) 
     242        { 
     243            $header = "<tr class=kb-table-header><td class=kb-table-cell width=\"$width_abs\">Ship class</td><td class=kb-table-cell width=60 align=center>Kills</td><td class=kb-table-cell width=60 align=center>ISK (M)</td><td class=kb-table-cell width=60 align=center>Losses</td><td class=kb-table-cell width=60 align=center>ISK (M)</td></tr>"; 
    241244        } 
    242245        else 
    243246        { 
    244             $header = "<tr class=kb-table-header><td class=kb-table-cell width=110>Ship class</td><td class=kb-table-cell width=30 align=center>K</td><td class=kb-table-cell width=30 align=center>L</td></tr>"; 
    245         } 
    246          
     247            $header = "<tr class=kb-table-header><td class=kb-table-cell width=\"$width_abs\">Ship class</td><td class=kb-table-cell width=30 align=center>K</td><td class=kb-table-cell width=30 align=center>L</td></tr>"; 
     248        } 
     249 
    247250        $html .= $header; 
    248251 
     
    254257            { 
    255258                $html .= "</table></td>"; 
    256                 $html .= "<td valign=top><table class=kb-table cellspacing=\"1\">"; 
     259                $html .= "<td valign=top width=\"$width%\"><table class=kb-table cellspacing=\"1\">"; 
    257260                $html .= $header; 
    258261                $counter = 1; 
     
    293296                $qrystring .= '&view='.$this->view_; 
    294297            } 
    295             $html .= "<td class=kb-table-cell><b>"; 
     298            $html .= "<td nowrap class=kb-table-cell><b>"; 
    296299 
    297300            if ($this->filter_) $html .= "<a class=kb-shipclass".$highlight." href=\"?".$qrystring."&scl_id=".$v['id']."\">"; 
     
    306309            if ($this->verbose_) 
    307310                $html .= "<td class=".$kclass." align=center>".round($v['kills_isk']/1000000, 2)."</td>"; 
    308              
     311 
    309312            $html .= "<td class=".$lclass." align=center>".$v['losses']."</td>"; 
    310313                if ($this->verbose_) 
     
    314317 
    315318            $counter++; 
    316              
     319 
    317320            $this->tkcount_ += $kcount; 
    318321            $this->tkisk_ += $kisk; 
    319             $this->tkpoints_ += $kpoints;      
     322            $this->tkpoints_ += $kpoints; 
    320323            $this->tlcount_ += $lcount; 
    321324            $this->tlisk_ += $lisk; 
     
    333336                     .$this->tkcount_.' Ships killed ('.round($this->tkisk_/1000000, 2).'M ISK)</span></td><td width=49%><span class="losscount">'.$this->tlcount_.' Ships lost ('.round($this->tlisk_/1000000, 2).'M ISK)</span></td></tr></table>'; 
    334337        } 
    335          
     338 
    336339        if ($_GET['scl_id'] != "") 
    337340        { 
  • dev/common/kill_related.php

    r281 r289  
    8989 
    9090$summarytable = new KillSummaryTable($kslist, $lslist); 
    91 $summarytable->setBreak(6); 
     91$summarytable->setBreak(config::get('summarytable_rowcount')); 
    9292$html .= $summarytable->generate(); 
    9393 
  • dev/common/kills.php

    r281 r289  
    5757        $summarytable = new KillSummaryTable($kslist, $llist); 
    5858} 
    59 $summarytable->setBreak(6); 
     59$summarytable->setBreak(config::get('summarytable_rowcount')); 
    6060$html .= $summarytable->generate(); 
    6161 
  • dev/common/losses.php

    r281 r289  
    5454 
    5555$summarytable = new KillSummaryTable($klist, $lslist); 
    56 $summarytable->setBreak(6); 
     56$summarytable->setBreak(config::get('summarytable_rowcount')); 
    5757$html .= $summarytable->generate(); 
    5858// $html .= "<table width=\"99%\" align=center><tr><td class=weeknav align=left>"; 
  • dev/common/pilot_detail.php

    r281 r289  
    5656$lpoints = $llist->getPoints(); 
    5757$summary = new KillSummaryTable($klist, $llist); 
    58 $summary->setBreak(6); 
     58$summary->setBreak(config::get('summarytable_rowcount')); 
    5959if ($_GET['view'] == "ships_weapons") 
    6060{ 
  • dev/common/system_detail.php

    r281 r289  
    3131 
    3232$summarytable = new KillSummaryTable($kslist, $lslist); 
    33 $summarytable->setBreak(6); 
     33$summarytable->setBreak(config::get('summarytable_rowcount')); 
    3434$html .= $summarytable->generate(); 
    3535 
  • dev/mods/signature_generator/sig.php

    r192 r289  
    8080{ 
    8181    header('Content-Type: image/png'); 
     82    imagepng($im, 'cache/data/sig_'.$id.'_'.$plt_id); 
    8283} 
    8384else 
    8485{ 
    8586    header('Content-Type: image/jpeg'); 
     87    imagejpeg($im, 'cache/data/sig_'.$id.'_'.$plt_id, 90); 
    8688} 
    87 imagejpeg($im, 'cache/data/sig_'.$id.'_'.$plt_id, 95); 
    8889readfile('cache/data/sig_'.$id.'_'.$plt_id); 
    8990?>