Changeset 215
- Timestamp:
- 05/09/07 16:17:28 (16 years ago)
- Location:
- dev
- Files:
-
- 1 added
- 7 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin/option_generic.php
r191 r215 35 35 options::fadd('ReAdd known killmails', 'readd_dupes', 'checkbox'); 36 36 37 options::cat('Appearance', 'Generic', 'Public-Mode-Beta (Provided by eve-kill.net, the TRUE public KB... *jokeing*)'); 38 options::fadd('Only Kills in SummaryTables', 'public_summarytable', 'checkbox','','','CORP_ID and ALLIANCE_ID in config.php has to be 0 to work "public"'); 39 options::fadd('Remove Losses Page', 'public_losses', 'checkbox'); 40 options::fadd('Stats Page', 'public_stats', 'select',array('admin_generic', 'createSelectStats')); 41 37 42 class admin_generic 38 43 { … … 101 106 } 102 107 108 function createSelectStats() 109 { 110 $options = array(); 111 if (config::get('public_stats') == 'none') 112 { 113 $state = 1; 114 } 115 else 116 { 117 $state = 0; 118 } 119 $options[] = array('value' => 'do nothing', 'descr' => 'do nothing', 'state' => $state); 120 121 if (config::get('public_stats') == 'remove') 122 { 123 $state = 1; 124 } 125 else 126 { 127 $state = 0; 128 } 129 $options[] = array('value' => 'remove', 'descr' => 'remove', 'state' => $state); 130 131 if (config::get('public_stats') == 'replace') 132 { 133 $state = 1; 134 } 135 else 136 { 137 $state = 0; 138 } 139 $options[] = array('value' => 'replace', 'descr' => 'replace (not rdy yet)', 'state' => $state); 140 141 return $options; 142 } 143 103 144 function dateSelector() 104 145 { -
dev/common/includes/class.killsummarytable.php
r213 r215 7 7 { 8 8 $this->klist_ = $klist; 9 $this->llist_ = $llist; 10 9 if (!config::get('public_summarytable')){ 10 $this->llist_ = $llist; 11 } 11 12 $this->verbose_ = false; 12 13 $this->filter_ = true; … … 141 142 } 142 143 143 $sql = 'SELECT count(*) AS lnb, scl_id, scl_class,'; 144 if (config::get('ship_values')) 145 { 146 $sql .= ' sum(ifnull(ksv.shp_value,scl.scl_value)) AS lisk FROM kb3_kills kll 147 INNER JOIN kb3_ships shp ON ( shp.shp_id = kll.kll_ship_id ) 148 left join kb3_ships_values ksv on (shp.shp_id = ksv.shp_id)'; 149 } 150 else 151 { 152 $sql .= ' sum(scl.scl_value) AS lisk FROM kb3_kills kll 153 INNER JOIN kb3_ships shp ON ( shp.shp_id = kll.kll_ship_id )'; 154 } 155 $sql .= ' INNER JOIN kb3_ship_classes scl ON ( scl.scl_id = shp.shp_class )'; 156 157 if ($this->inv_crp_) 158 { 159 $sql .= ' where kll.kll_crp_id in ( '.join(',', $this->inv_crp_).' ) '; 160 } 161 elseif ($this->inv_all_) 162 { 163 $sql .= ' where kll.kll_all_id in ( '.join(',', $this->inv_all_).' ) '; 164 } 165 $sql .= 'GROUP BY scl_class order by scl_class'; 166 167 $qry = new DBQuery(); 168 $qry->execute($sql); 169 while ($row = $qry->getRow()) 170 { 171 $this->entry_[$row['scl_class']]['losses'] = $row['lnb']; 172 $this->entry_[$row['scl_class']]['losses_isk'] = $row['lisk']; 173 174 $this->tlcount_ += $row['lnb']; 175 $this->tlisk_ += $row['lisk']; 144 if (!config::get('public_summarytable')) 145 { 146 $sql = 'SELECT count(*) AS lnb, scl_id, scl_class,'; 147 if (config::get('ship_values')) 148 { 149 $sql .= ' sum(ifnull(ksv.shp_value,scl.scl_value)) AS lisk FROM kb3_kills kll 150 INNER JOIN kb3_ships shp ON ( shp.shp_id = kll.kll_ship_id ) 151 left join kb3_ships_values ksv on (shp.shp_id = ksv.shp_id)'; 152 } 153 else 154 { 155 $sql .= ' sum(scl.scl_value) AS lisk FROM kb3_kills kll 156 INNER JOIN kb3_ships shp ON ( shp.shp_id = kll.kll_ship_id )'; 157 } 158 $sql .= ' INNER JOIN kb3_ship_classes scl ON ( scl.scl_id = shp.shp_class )'; 159 160 if ($this->inv_crp_) 161 { 162 $sql .= ' where kll.kll_crp_id in ( '.join(',', $this->inv_crp_).' ) '; 163 } 164 elseif ($this->inv_all_) 165 { 166 $sql .= ' where kll.kll_all_id in ( '.join(',', $this->inv_all_).' ) '; 167 } 168 $sql .= 'GROUP BY scl_class order by scl_class'; 169 170 $qry = new DBQuery(); 171 $qry->execute($sql); 172 while ($row = $qry->getRow()) 173 { 174 $this->entry_[$row['scl_class']]['losses'] = $row['lnb']; 175 $this->entry_[$row['scl_class']]['losses_isk'] = $row['lisk']; 176 177 $this->tlcount_ += $row['lnb']; 178 $this->tlisk_ += $row['lisk']; 179 } 176 180 } 177 181 } … … 214 218 } 215 219 // losses 216 while ($kill = $this->llist_->getKill()) 217 { 218 $classname = $kill->getVictimShipClassName(); 219 $entry[$classname]['losses']++; 220 $entry[$classname]['losses_isk'] += $kill->getVictimShipValue(); 221 $this->tlcount_++; 222 $this->tlisk_ += $kill->getVictimShipValue(); 223 } 220 if (!config::get('public_summarytable')) 221 while ($kill = $this->llist_->getKill()) 222 { 223 $classname = $kill->getVictimShipClassName(); 224 $entry[$classname]['losses']++; 225 $entry[$classname]['losses_isk'] += $kill->getVictimShipValue(); 226 $this->tlcount_++; 227 $this->tlisk_ += $kill->getVictimShipValue(); 228 } 224 229 } 225 230 else … … 236 241 $counter = 1; 237 242 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>"; 243 if (!config::get('public_summarytable')) 244 { 245 if ($this->verbose_) 246 { 247 $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>"; 248 } 249 else 250 { 251 $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>"; 252 } 241 253 } 242 254 else 243 255 { 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>";256 $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></tr>"; 245 257 } 246 258 $html .= $header; … … 284 296 $lclass = "kl-loss"; 285 297 286 if ($this->verbose_)287 {288 $kclass .= "-bg";289 $lclass .= "-bg";290 }291 292 298 $html .= "<tr class=".$class.">"; 293 299 … … 309 315 310 316 $html .= "<td class=".$kclass." align=center>".$v['kills']."</td>"; 311 if ( $this->verbose_)317 if (($this->verbose_)||config::get('public_summarytable')) 312 318 $html .= "<td class=".$kclass." align=center>".round($v['kills_isk']/1000000, 2)."</td>"; 313 $html .= "<td class=".$lclass." align=center>".$v['losses']."</td>"; 314 if ($this->verbose_) 315 $html .= "<td class=".$lclass." align=center>".round($v['losses_isk']/1000000, 2)."</td>"; 316 319 320 if (!config::get('public_summarytable')) 321 { 322 $html .= "<td class=".$lclass." align=center>".$v['losses']."</td>"; 323 if ($this->verbose_) 324 $html .= "<td class=".$lclass." align=center>".round($v['losses_isk']/1000000, 2)."</td>"; 325 } 317 326 $html .= "</tr>"; 318 327 319 328 $counter++; 329 320 330 $this->tkcount_ += $kcount; 321 $this->tlcount_ += $lcount;322 331 $this->tkisk_ += $kisk; 323 $this->tlisk_ += $lisk;324 332 $this->tkpoints_ += $kpoints; 325 $this->tlpoints_ += $lpoints; 333 334 if (!config::get('public_summarytable')) 335 { 336 $this->tlcount_ += $lcount; 337 $this->tlisk_ += $lisk; 338 $this->tlpoints_ += $lpoints; 339 } 326 340 } 327 341 if ($this->break_) … … 330 344 $html .= "</tr></table>"; 331 345 332 if (config::get('summarytable_summary') )346 if (config::get('summarytable_summary') && !config::get('public_summarytable')) 333 347 { 334 348 $html .= '<table width=100% border=0 cellspacing=2>' 335 349 .'<tr align=center><td width=51%><span align=right class="killcount">' 336 .$this->tkcount_.' Ships killed ('.round($this->tkisk_/1000000, 2).'M ISK)</span></td><td width=49%><span class="losscount">' 337 .$this->tlcount_.' Ships lost ('.round($this->tlisk_/1000000, 2).'M ISK)</span></td></tr></table>'; 338 } 350 .$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>'; 351 } 352 if (config::get('summarytable_summary') && config::get('public_summarytable')) 353 { 354 $html .= '<table width=100% border=0 cellspacing=2>' 355 .'<tr align=center><th>'.$this->tkcount_.' Ships killed ('.round($this->tkisk_/1000000, 2).'M ISK)</th></tr></table>'; 356 } 357 339 358 if ($_GET['scl_id'] != "") 340 359 { -
dev/common/includes/class.page.php
r212 r215 4 4 function Page($title = '', $cachable = true) 5 5 { 6 $this->title_ = $title; 6 if (config::get('page_pos_home') == '') 7 { 8 config::set('page_count',0); 9 config::set('page_pos_home', 1); 10 config::set('page_pos_campaigns',2); 11 config::set('page_pos_contracts',3); 12 config::set('page_pos_kills',4); 13 config::set('page_pos_losses',5); 14 config::set('page_pos_post',6); 15 config::set('page_pos_stats',7); 16 config::set('page_pos_awards',8); 17 config::set('page_pos_standings',9); 18 config::set('page_pos_search',10); 19 config::set('page_pos_admin',11); 20 config::set('page_pos_about',12); 21 } 22 23 $this->title_ = $title; 7 24 $this->admin_ = false; 8 25 … … 69 86 $smarty->assign('banner', $banner); 70 87 71 $menu = new Menu(); 72 $menu->add('home', 'Home'); 73 74 $contracts = $this->killboard_->hasContracts(); 75 $campaigns = $this->killboard_->hasCampaigns(); 76 if ($contracts) 77 { 78 $menu->add('contracts', 'Contracts'); 79 } 80 if ($campaigns) 81 { 82 $menu->add('campaigns', 'Campaigns'); 83 } 84 $w = 10; 85 if ($campaigns) 86 { 87 $w--; 88 } 89 if ($contracts) 90 { 91 $w--; 92 } 93 if (config::get('show_standings')) 94 { 95 $w--; 96 $menu->add('standings', 'Standings'); 97 } 98 $menu->add('kills', 'Kills'); 99 $menu->add('losses', 'Losses'); 100 $menu->add('post', 'Post Mail'); 101 102 if (CORP_ID) 103 { 104 $link = 'corp_detail&crp_id='.CORP_ID; 105 } 106 elseif (ALLIANCE_ID) 107 { 108 $link = 'alliance_detail&all_id='.ALLIANCE_ID; 109 } 110 $menu->add($link, 'Stats'); 111 $menu->add('awards', 'Awards'); 112 $menu->add('search', 'Search'); 113 $menu->add('admin', 'Admin'); 114 $menu->add('about', 'About'); 115 116 $smarty->assign('menu_w', $w.'%'); 88 $menu = $this->generateMenu(); 89 $w = floor(100 / count($menu->get())); 90 91 $smarty->assign('menu_w',$w.'%'); 117 92 $smarty->assign('menu', $menu->get()); 118 93 } … … 189 164 $this->cachetime_ = $cachetime; 190 165 } 166 167 function generateMenu(){ 168 $menu = new Menu(); 169 $contracts = $this->killboard_->hasContracts(); 170 $campaigns = $this->killboard_->hasCampaigns(); 171 $layout = array(); 172 173 // Check which stat page should be schown 174 if (config::get('public_stats')=='do nothing') 175 { 176 if (CORP_ID) 177 { 178 $statlink = 'corp_detail&crp_id='.CORP_ID; 179 } 180 elseif (ALLIANCE_ID) 181 { 182 $link = 'alliance_detail&all_id='.ALLIANCE_ID; 183 } 184 } 185 if (config::get('public_stats')=='replace') 186 { 187 // Public Stats Page not rdy yet. 188 $statlink = ''; 189 } 190 191 192 //preparing default pages 193 $layout[config::get('page_pos_home')] = array('Home','?a=home'); 194 if ($campaigns) 195 $layout[config::get('page_pos_campaigns')] = array('Campaigns','?a=campaigns'); 196 if ($contracts) 197 $layout[config::get('page_pos_contracts')] = array('Contracts','?a=contracts'); 198 $layout[config::get('page_pos_kills')] = array('Kills','?a=kills'); 199 if (!config::get('public_losses')) 200 $layout[config::get('page_pos_losses')] = array('Losses','?a=losses'); 201 $layout[config::get('page_pos_awards')] = array('Awards','?a=awards'); 202 if (config::get('show_standings')) 203 $layout[config::get('page_pos_standings')] = array('Standings','?a=standings'); 204 $layout[config::get('page_pos_search')] = array('Search','?a=search'); 205 $layout[config::get('page_pos_admin')] = array('Admin','?a=admin'); 206 $layout[config::get('page_pos_stats')] = array('Stats',$statlink); 207 $layout[config::get('page_pos_admin')] = array('Admin','?a=admin'); 208 $layout[config::get('page_pos_post')] = array('Post mail','?a=post'); 209 $layout[config::get('page_pos_about')] = array('About','?a=about'); 210 211 //preparing custom pages 212 for ($i = 1; $i <= config::get('page_count');$i++) 213 { 214 $layout[config::get('page_pos_'.$i)] = array(config::get('page_descr_'.$i),config::get('page_url_'.$i).'" target="_blank"'); 215 } 216 217 //sorting menu 218 ksort($layout,SORT_NUMERIC); 219 220 //building menu 221 foreach ($layout as $item){ 222 $menu->add($item[1] , $item[0]); 223 } 224 225 return $menu; 226 } 191 227 } 192 228 -
dev/common/includes/globals.php
r213 r215 1 1 <?php 2 2 // current subversion revision 3 preg_match('/\$Re'.'vision: (.*?) \$/', '$Revision: 21 3$', $match);3 preg_match('/\$Re'.'vision: (.*?) \$/', '$Revision: 215 $', $match); 4 4 define('SVN_REV', $match[1]); 5 5 -
dev/common/losses.php
r206 r215 6 6 require_once('common/includes/class.killsummarytable.php'); 7 7 require_once('common/includes/class.toplist.php'); 8 9 if (config::get('public_losses')){ 10 die('Forbidden'); 11 } 8 12 9 13 $week = $_GET['w']; -
dev/install/install_step2.php
r88 r215 83 83 else 84 84 { 85 include('../common/ class.http.php');85 include('../common/includes/class.http.php'); 86 86 echo 'allow_url_fopen is disabled, nethertheless i will try a socket connect now.<br/>'; 87 87 -
dev/templates/menu.tpl
r86 r215 3 3 <tr class="kb-table-row-odd"> 4 4 {section name=item loop=$menu} 5 <td width="{$menu_w}" align="center"><a class="link" style="display: block;" href=" ?a={$menu[item].link}">{$menu[item].text}</a></td>5 <td width="{$menu_w}" align="center"><a class="link" style="display: block;" href="{$menu[item].link}">{$menu[item].text}</a></td> 6 6 {/section} 7 7 </tr>