Changeset 165 for dev/common
- Timestamp:
- 01/03/07 09:06:54 (15 years ago)
- Location:
- dev/common
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin.php
r162 r165 33 33 // new function checkCheckbox, checks $_POST[arg] and inserts 0 if != 'on' 34 34 $config->checkCheckbox('kill_points'); 35 $config->checkCheckbox('loss_points'); 36 $config->checkCheckbox('total_points'); 35 37 $config->checkCheckbox('ship_values'); 36 38 $config->checkCheckbox('least_active'); … … 130 132 } 131 133 $html .= "></td></tr>"; 134 $html .= "<tr><td width=120><b>Display losspoints:</b></td><td><input type=checkbox name=loss_points id=loss_points"; 135 if ($config->getConfig('loss_points')) 136 { 137 $html .= " checked=\"checked\""; 138 } 139 $html .= "></td></tr>"; 140 $html .= "<tr><td width=120><b>Display totalpoints:</b></td><td><input type=checkbox name=total_points id=total_points"; 141 if ($config->getConfig('total_points')) 142 { 143 $html .= " checked=\"checked\""; 144 } 145 $html .= "></td></tr>"; 132 146 133 147 $html .= "<tr><td width=120><b>Enable Comments:</b></td><td><input type=checkbox name=comments id=comments"; -
dev/common/class.box.php
r134 r165 5 5 class Box 6 6 { 7 function Box($title = "")7 function Box($title = '') 8 8 { 9 9 $this->title_ = $title; 10 10 $this->box_array = array(); 11 11 } 12 12 13 function setIcon($icon) //its called setIcon... and it sets the Icon. 13 //its called setIcon... and it sets the Icon.//its called setIcon... and it sets the Icon. 14 function setIcon($icon) 14 15 { 15 16 $this->icon_ = $icon; 16 17 } 17 18 18 function addOption($type,$name,$url="") //add something to the array that we send to smarty later... types can be caption, img, link, points. Only link needs all 3 attribues 19 { 20 $this->box_array[]=array('type' => $type, 'name' => $name, 'url' => $url); 21 } 19 //add something to the array that we send to smarty later... types can be caption, img, link, points. Only link needs all 3 attribues 20 function addOption($type, $name, $url = '') 21 { 22 $this->box_array[] = array('type' => $type, 'name' => $name, 'url' => $url); 23 } 22 24 23 25 function generate() 24 26 { 25 //print_r($this->box_array); 26 global $config, $smarty; 27 $smarty->assign('count',count($this->box_array)); 28 if($this->icon_){ $smarty->assign('icon',IMG_URL . "/" . $this->icon_); } 29 $smarty->assign('title',$this->title_ ); 30 $smarty->assign('items',$this->box_array); 31 return $smarty->fetch(get_tpl('box')); 27 global $config, $smarty; 28 29 $smarty->assign('count', count($this->box_array)); 30 if($this->icon_) 31 { 32 $smarty->assign('icon', IMG_URL."/".$this->icon_); 33 } 34 $smarty->assign('title', $this->title_ ); 35 $smarty->assign('items', $this->box_array); 36 37 return $smarty->fetch(get_tpl('box')); 32 38 } 33 39 } … … 37 43 function AwardBox($list, $title, $comment, $entity, $award) 38 44 { 39 40 45 $this->toplist_ = $list; 41 46 $this->title_ = $title; … … 47 52 function generate() 48 53 { 49 global $config, $smarty; 54 global $config, $smarty; 55 50 56 $rows = array(); 51 57 $max = 0; … … 54 60 { 55 61 $row = $this->toplist_->getRow(); 56 if ($row) array_push($rows, $row); 57 if ($row['cnt'] > $max) $max = $row['cnt']; 62 if ($row) 63 { 64 array_push($rows, $row); 65 } 66 if ($row['cnt'] > $max) 67 { 68 $max = $row['cnt']; 69 } 58 70 } 59 71 60 if (!$rows[0]['plt_id']) return; 72 if (!$rows[0]['plt_id']) 73 { 74 return; 75 } 76 61 77 $pilot = new Pilot($rows[0]['plt_id']); 62 $smarty->assign('title',$this->title_); 63 $smarty->assign('pilot_portrait',$pilot->getPortraitURL(64)); 64 $smarty->assign('award_img',IMG_URL . "/awards/" . $this->award_ . ".gif"); 65 $smarty->assign('url',"?a=pilot_detail&plt_id=" . $rows[0]['plt_id'] ); 66 $smarty->assign('name',$pilot->getName() ); 78 $smarty->assign('title', $this->title_); 79 $smarty->assign('pilot_portrait', $pilot->getPortraitURL(64)); 80 $smarty->assign('award_img', IMG_URL."/awards/".$this->award_.".gif"); 81 $smarty->assign('url', "?a=pilot_detail&plt_id=".$rows[0]['plt_id'] ); 82 $smarty->assign('name', $pilot->getName() ); 83 67 84 $bar = new BarGraph($rows[0]['cnt'], $max, 60); 68 $smarty->assign('bar',$bar->generate());69 85 $smarty->assign('bar', $bar->generate()); 86 $smarty->assign('cnt', $rows[0]['cnt']); 70 87 71 88 for ($i = 2; $i < 11; $i++) 72 89 { 73 if (!$rows[$i - 1]['plt_id']) break; 90 if (!$rows[$i - 1]['plt_id']) 91 { 92 break; 93 } 74 94 $pilot = new Pilot($rows[$i - 1]['plt_id']); 75 76 $top[$i] = array('url'=> "?a=pilot_detail&plt_id=" . $rows[$i - 1]['plt_id'], 'name'=>$pilot->getName(),'bar'=>$bar->generate(),'cnt'=>$rows[$i - 1]['cnt']);95 $bar = new BarGraph($rows[$i - 1]['cnt'], $max, 60); 96 $top[$i] = array('url'=> "?a=pilot_detail&plt_id=".$rows[$i - 1]['plt_id'], 'name'=>$pilot->getName(), 'bar'=>$bar->generate(), 'cnt'=>$rows[$i - 1]['cnt']); 77 97 } 78 $smarty->assign('top',$top); 79 $smarty->assign('comment',$this->comment_); 80 return $smarty->fetch(get_tpl('award_box')); 98 99 $smarty->assign('top', $top); 100 $smarty->assign('comment', $this->comment_); 101 return $smarty->fetch(get_tpl('award_box')); 81 102 } 82 83 103 } 84 104 ?> -
dev/common/class.kill.php
r155 r165 372 372 where itd.itd_kll_id = ".$this->getID()." 373 373 and itd.itd_itm_id = itm.itm_id 374 and ( itd.itd_itl_id = itl.itl_id or itd.itd_itl_id = 0)374 and ( itd.itd_itl_id = itl.itl_id or (itd.itd_itl_id = 0 and itl.itl_id = 1)) 375 375 group by itd_itm_id, itd_itl_id 376 376 order by itd.itd_itl_id, itm.itm_type"; … … 685 685 { 686 686 $item = $dest->getItem(); 687 if (!$item->getID() || !$dest->getQuantity() || $dest->getLocationID() === false) 687 $loc_id = $dest->getLocationID(); 688 if (!$item->getID() || !$dest->getQuantity() || !is_numeric($loc_id)) 688 689 { 689 690 continue; … … 692 693 $sql = "insert into kb3_items_destroyed 693 694 values ( ".$this->getID().", ".$item->getID().", ".$dest->getQuantity().", " 694 .$ dest->getLocationID()." )";695 .$loc_id." )"; 695 696 $qry->execute($sql); 696 697 } -
dev/common/class.killlisttable.php
r149 r165 73 73 $kll['victim'] = $kill->getVictimName(); 74 74 $kll['victimcorp'] = $kill->getVictimCorpName(); 75 $kll['victimalliancename'] = $kill->getVictimAllianceName(); 75 76 $kll['fb'] = $kill->getFBPilotName(); 76 77 $kll['fbcorp'] = $kill->getFBCorpName(); -
dev/common/pilot_detail.php
r109 r165 56 56 57 57 $points = $klist->getPoints(); 58 $lpoints = $llist->getPoints(); 58 59 $summary = new KillSummaryTable($klist, $llist); 59 60 $summary->setBreak(6); … … 161 162 $page->addContext($menubox->generate()); 162 163 163 $killboard = $page->killboard_;164 $config = $killboard->getConfig();165 164 if ($config->getKillPoints()) 166 165 { 167 166 $scorebox = new Box("Kill points"); 168 $scorebox->addOption("points",$points); 167 $scorebox->addOption("points", $points); 168 $page->addContext($scorebox->generate()); 169 } 170 if ($config->getConfig('loss_points')) 171 { 172 $scorebox = new Box("Loss points"); 173 $scorebox->addOption("points", $lpoints); 174 $page->addContext($scorebox->generate()); 175 } 176 if ($config->getConfig('total_points')) 177 { 178 $scorebox = new Box("Total points"); 179 $scorebox->addOption("points", $points-$lpoints); 169 180 $page->addContext($scorebox->generate()); 170 181 } 171 182 172 183 $page->setContent($html); 173 174 184 $page->generate(); 175 185 ?>