- Timestamp:
- 01/03/07 09:06:54 (16 years ago)
- Location:
- dev
- Files:
-
- 8 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 ?> -
dev/install/install_step5.php
r99 r165 98 98 $result = mysql_query($query); 99 99 100 $unsharp = true; 100 101 $results = array(); 101 102 while ($row = mysql_fetch_assoc($result)) … … 106 107 $link = "?step=5&do=select&a=0&c=".$row['crp_id'].'">Select'; 107 108 $descr = 'Corp '.$row['crp_name'].', member of '.$row['all_name']; 109 if ($row['crp_name'] == addslashes(stripslashes($_REQUEST['searchphrase']))) 110 { 111 $unsharp = false; 112 } 108 113 break; 109 114 case 'alliance': 110 115 $link = '?step=5&do=select&c=0&a='.$row['all_id'].'">Select'; 111 116 $descr = 'Alliance '.$row['all_name']; 117 if ($row['all_name'] == addslashes(stripslashes($_REQUEST['searchphrase']))) 118 { 119 $unsharp = false; 120 } 112 121 break; 113 122 } 114 123 $results[] = array('descr' => $descr, 'link' => $link); 115 124 } 116 if (!count($results) )125 if (!count($results) || $unsharp) 117 126 { 118 127 if ($_REQUEST['searchtype'] == 'corp') -
dev/mods/signature_generator/sig.php
r98 r165 6 6 $sig_name = str_replace('.', '', $sig_name); 7 7 $sig_name = str_replace('/', '', $sig_name); 8 $sig_name = str_replace('/', '', $sig_name); 8 9 function errorPic($string) 10 { 11 $im = imagecreate(200, 60); 12 $black = imagecolorallocate($im, 0, 0, 0); 13 $red = imagecolorallocate($im, 250, 200, 20); 14 imagefill($im, 1, 1, $black); 15 imagestring($im, 3, 10, 10, 'Error: '.$string, $red); 16 header('Content-Type: image/jpeg'); 17 imagejpeg($im); 18 exit; 19 } 9 20 10 21 if (!$plt_id = $_GET['i']) 11 22 { 12 header('Location: mods/signature_generator/error.jpg'); 13 exit; 23 errorPic('No pilot id specified.'); 14 24 } 15 25 require_once("common/class.pilot.php"); … … 21 31 if (!$pilot->exists()) 22 32 { 23 header('Location: mods/signature_generator/error.jpg'); 24 exit; 33 errorPic('That pilot doesnt exist.'); 25 34 } 26 35 $corp = $pilot->getCorp(); … … 30 39 if (ALLIANCE_ID && $alliance->getID() != ALLIANCE_ID) 31 40 { 32 header('Location: mods/signature_generator/error.jpg'); 33 exit; 41 errorPic('Wrong alliance.'); 34 42 } 35 43 elseif (CORP_ID && $corp->getID() != CORP_ID) 36 44 { 37 header('Location: mods/signature_generator/error.jpg'); 38 exit; 45 errorPic('Wrong corporation.'); 39 46 } 40 47 … … 64 71 if (!is_dir('mods/signature_generator/signatures/'.$sig_name)) 65 72 { 66 header('Location: mods/signature_generator/error.jpg'); 67 exit; 73 errorPic('Template not found.'); 68 74 } 69 75 -
dev/templates/box.tpl
r111 r165 1 1 <!-- box.tpl --> 2 <table class= kb-table width=150cellspacing="1">2 <table class="kb-table" width="150" cellspacing="1"> 3 3 <tr> 4 <td class= kb-table-header align=center>{$title}</td>4 <td class="kb-table-header" align="center">{$title}</td> 5 5 </tr> 6 <tr class=kb-table-row-even> 7 <td align="left"><div class=menu-wrapper> {foreach from=$items key=key item=i} 8 {strip} 9 {if $i.type == "caption" } 10 <div class=menu-caption>{$i.name}</div> 11 {elseif $i.type == "link" } 12 <div class=menu-item>{if isset($icon)}<img src="{$icon}" border="0">{/if} <a href="{$i.url}">{$i.name}</a><br> 6 <tr class="kb-table-row-even"> 7 <td align="left"> 8 <div class="menu-wrapper"> 9 {foreach from=$items key=key item=i} 10 {strip} 11 {if $i.type == "caption"} 12 <div class="menu-caption">{$i.name}</div> 13 {elseif $i.type == "link"} 14 <div class="menu-item"> 15 {if isset($icon)} 16 <img src="{$icon}" border="0"> 17 {/if} 18 <a href="{$i.url}">{$i.name}</a><br/> 13 19 </div> 14 {elseif $i.type == "img" } <img src="{$i.name}" border="0"> {elseif $i.type == "points" } 15 <div class=kill-points>{$i.name}</div> 16 {/if} 17 {/strip} 18 {/foreach} </div></td> 20 {elseif $i.type == "img"} 21 <img src="{$i.name}" border="0"> 22 {elseif $i.type == "points"} 23 <div class="kill-points">{$i.name}</div> 24 {/if} 25 {/strip} 26 {/foreach} 27 </div> 28 </td> 19 29 </tr> 20 30 </table>