Changeset 243
- Timestamp:
- 10/10/07 14:31:28 (15 years ago)
- Location:
- branch/rev3
- Files:
-
- 30 added
- 24 modified
Legend:
- Unmodified
- Added
- Removed
-
branch/rev3/common/admin/admin_kill_export.php
r190 r243 11 11 if (!$_POST['dir']) 12 12 { 13 $dir = getcwd().'/cache/kill_export';13 $dir = str_replace('\\','/',getcwd()).'/cache/kill_export'; 14 14 } 15 15 if (!$_POST['ext']) … … 43 43 $ext = $_SESSION['admin_kill_export']['ext']; 44 44 } 45 if (!strstr(stripslashes($dir), stripslashes( getcwd())))46 { 47 $dir = getcwd().$dir;45 if (!strstr(stripslashes($dir), stripslashes(str_replace('\\','/',getcwd())))) 46 { 47 $dir = str_replace('\\','/',getcwd()).$dir; 48 48 } 49 49 -
branch/rev3/common/admin/option_generic.php
r215 r243 15 15 options::fadd('Enable Comments', 'comments', 'checkbox'); 16 16 options::fadd('Require password for Comments', 'comments_pw', 'checkbox'); 17 options::fadd('Display Comment Count on Killlists', 'comments_count', 'checkbox');18 17 options::fadd('Display Standings', 'show_standings', 'checkbox'); 19 18 options::fadd('Enable Lost Item Values', 'item_values', 'checkbox'); … … 35 34 options::fadd('ReAdd known killmails', 'readd_dupes', 'checkbox'); 36 35 36 options::cat('Appearance', 'Generic', 'Killlists'); 37 options::fadd('Display Comment Count on Killlists', 'comments_count', 'checkbox'); 38 options::fadd('Display Alliance Logos on killlists', 'killlist_alogo', 'checkbox'); 39 37 40 options::cat('Appearance', 'Generic', 'Public-Mode-Beta (Provided by eve-kill.net, the TRUE public KB... *jokeing*)'); 38 41 options::fadd('Only Kills in SummaryTables', 'public_summarytable', 'checkbox','','','CORP_ID and ALLIANCE_ID in config.php has to be 0 to work "public"'); … … 118 121 } 119 122 $options[] = array('value' => 'do nothing', 'descr' => 'do nothing', 'state' => $state); 120 123 121 124 if (config::get('public_stats') == 'remove') 122 125 { … … 138 141 } 139 142 $options[] = array('value' => 'replace', 'descr' => 'replace (not rdy yet)', 'state' => $state); 140 143 141 144 return $options; 142 145 } 143 146 144 147 function dateSelector() 145 148 { -
branch/rev3/common/includes/class.config.php
r226 r243 93 93 } 94 94 } 95 $cache[$key] = $value; 95 96 96 if (is_array($value)) 97 97 { 98 $cache[$key] = $value; 98 99 $value = serialize($value); 99 100 } 101 else 102 { 103 $cache[$key] = stripslashes($value); 104 } 105 $value = addslashes($value); 100 106 101 107 $qry = new DBQuery(); … … 122 128 return null; 123 129 } 124 return $cache[$key];130 return stripslashes($cache[$key]); 125 131 } 126 132 } -
branch/rev3/common/includes/class.item.php
r213 r243 1 1 <?php 2 require_once("db.php"); 2 require_once('db.php'); 3 4 define('DGM_TECHLEVEL', 422); 3 5 4 6 class Item … … 7 9 { 8 10 $this->id_ = $id; 9 $this->qry_ = new DBQuery();10 11 } 11 12 … … 18 19 { 19 20 $this->execQuery(); 21 if (DB_USE_CCP) 22 { 23 return $this->row_['typeName']; 24 } 20 25 return $this->row_['itm_name']; 21 26 } … … 26 31 global $smarty; 27 32 28 // slot 6 is dronebay29 if ($this->row_['itt_ slot'] == 6)33 // cat 18 are combat drones 34 if ($this->row_['itt_cat'] == 18) 30 35 { 31 36 $img = IMG_URL.'/drones/'.$size.'_'.$size.'/'.$this->row_['itm_externalid'].'.png'; 37 } 38 // cat 6 are ships (destroyed in cargo) 39 elseif ($this->row_['itt_cat'] == 6) 40 { 41 $img = IMG_URL.'/ships/'.$size.'_'.$size.'/'.$this->row_['itm_externalid'].'.png'; 32 42 } 33 43 else … … 47 57 else 48 58 { 49 $icon = IMG_URL.'/items/32_32/blank.gif';59 $icon = IMG_URL.'/items/32_32/blank.gif'; 50 60 } 51 61 … … 63 73 function execQuery() 64 74 { 75 if (!isset($this->qry_)) 76 { 77 $this->qry_ = new DBQuery(); 78 } 79 65 80 if (!$this->qry_->executed_) 66 81 { … … 73 88 left join kb3_item_types on itm_type = itt_id 74 89 where itm_id = '".$this->id_."'"; 90 91 if (DB_USE_CCP) 92 { 93 // new 94 $this->sql_ = "select inv.*, kb3_item_types.*, dga.value as techlevel, itp.price 95 from kb3_invtypes inv 96 left join kb3_dgmtypeattributes dga on dga.typeID=inv.typeID and dga.attributeID=".DGM_TECHLEVEL." 97 left join kb3_item_price itp on itp.typeID=inv.typeID 98 left join kb3_item_types on groupID=itt_id 99 where inv.typeID = '".$this->id_."'"; 100 } 75 101 $this->qry_->execute($this->sql_); 76 102 $this->row_ = $this->qry_->getRow(); 103 if (DB_USE_CCP) 104 { 105 $this->row_['itm_icon'] = $this->row_['icon']; 106 $this->row_['itm_techlevel'] = $this->row_['techlevel']; 107 $this->row_['itm_externalid'] = $this->row_['typeID']; 108 $this->row_['itm_value'] = $this->row_['price']; 109 } 77 110 } 78 111 } … … 82 115 $name = trim($name); 83 116 $qry = new DBQuery(); 84 $qry->execute("select * from kb3_items itm 85 where itm_name = '".slashfix($name)."'"); 117 $query = "select * from kb3_items itm 118 where itm_name = '".slashfix($name)."'"; 119 if (DB_USE_CCP) 120 { 121 $query = "select *,typeID as itm_id from kb3_invtypes itm 122 where typeName = '".slashfix($name)."'"; 123 } 124 $qry->execute($query); 86 125 $row = $qry->getRow(); 87 126 if (!isset($row['itm_id'])) 88 127 { 89 if (config::get('adapt_items') )128 if (config::get('adapt_items') && DB_USE_CCP !== true) 90 129 { 91 130 // if the item is a tec2 we likely have the tec1 … … 110 149 $row['itm_id'] = $qry->getInsertID(); 111 150 } 151 else 152 { 153 // that item doesnt exist or is mispelled 154 return false; 155 } 112 156 } 113 157 $this->id_ = $row['itm_id']; … … 117 161 { 118 162 $qry = new DBQuery(); 119 $q ry->execute("select *163 $query = "select * 120 164 from kb3_items 121 where itm_name = '".slashfix($name)."'"); 165 where itm_name = '".slashfix($name)."'"; 166 if (DB_USE_CCP) 167 { 168 $query = "select *,typeID as itm_id 169 from kb3_items 170 where typeName = '".slashfix($name)."'"; 171 } 172 $qry->execute($query); 122 173 123 174 $row = $qry->getRow(); -
branch/rev3/common/includes/class.kill.php
r240 r243 386 386 } 387 387 // destroyed items 388 $sql = "select sum( itd.itd_quantity ) as itd_quantity, itd_itm_id, 389 itd_itl_id, itl_location 390 from kb3_items_destroyed itd, kb3_items itm, 391 kb3_item_locations itl 388 $sql = "select sum(itd.itd_quantity) as itd_quantity, itd_itm_id, 389 itd_itl_id, itl_location 390 from kb3_items_destroyed itd 391 left join kb3_items itm on itd.itd_itm_id = itm.itm_id 392 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)) 392 393 where itd.itd_kll_id = ".$this->getID()." 393 and itd.itd_itm_id = itm.itm_id394 and ( itd.itd_itl_id = itl.itl_id or (itd.itd_itl_id = 0 and itl.itl_id = 1))395 394 group by itd_itm_id, itd_itl_id 396 395 order by itd.itd_itl_id, itm.itm_type"; 397 396 397 if (DB_USE_CCP) 398 { 399 $sql = "select sum(itd.itd_quantity) as itd_quantity, itd_itm_id, 400 itd_itl_id, itl_location 401 from kb3_items_destroyed itd 402 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)) 403 where itd.itd_kll_id = ".$this->getID()." 404 group by itd_itm_id, itd_itl_id 405 order by itd.itd_itl_id"; 406 } 398 407 $qry->execute($sql); 399 408 while ($row = $qry->getRow()) … … 730 739 $item = $dest->getItem(); 731 740 $loc_id = $dest->getLocationID(); 732 if (!is_numeric($ item->getID()) || !is_numeric($item->getID()) || !is_numeric($dest->getQuantity()) || !is_numeric($loc_id))741 if (!is_numeric($this->getID()) || !is_numeric($item->getID()) || !is_numeric($dest->getQuantity()) || !is_numeric($loc_id)) 733 742 { 734 743 trigger_error('error with destroyed item.', E_USER_WARNING); … … 744 753 745 754 // call the event that we added this mail 746 event::call('killmail_added', &$this);755 event::call('killmail_added', $this); 747 756 return $this->id_; 748 757 } … … 753 762 return; 754 763 755 event::call('killmail_delete', &$this);764 event::call('killmail_delete', $this); 756 765 757 766 $qry = new DBQuery(); … … 843 852 844 853 function getValue() 845 //returns the value of an item846 854 { 855 if (DB_USE_CCP) 856 { 857 $qry = new DBQuery(); 858 $qry->execute("select basePrice, price from kb3_invtypes left join kb3_item_price using (typeID) where typeID='".$this->item_->getID()."'"); 859 if ($row = $qry->getRow()) 860 { 861 if ($row['price']) 862 { 863 return $row['price']; 864 } 865 return $row['basePrice']; 866 } 867 return 0; 868 } 869 870 //returns the value of an item 847 871 $value = 0; // Set 0 value incase nothing comes back 848 872 $id = $this->item_->getID(); // get Item ID -
branch/rev3/common/includes/class.killlisttable.php
r213 r243 40 40 } 41 41 42 43 42 while ($kill = $this->kill_list_->getKill()) 44 43 { … … 76 75 $kll['systemsecurity'] = $kill->getSolarSystemSecurity(); 77 76 $kll['timestamp'] = $kill->getTimeStamp(); 77 if (config::get('killlist_alogo')) 78 { 79 $kll['victimallianceicon'] = preg_replace('/[^a-zA-Z0-9]/', '', $kll['victimalliancename']); 80 $kll['allianceexists'] = file_exists('img/alliances/'.$kll['victimallianceicon'].'.png'); 81 } 82 78 83 if (isset($kill->_tag)) 79 84 { -
branch/rev3/common/includes/class.page.php
r219 r243 10 10 config::set('public_stats','do nothing'); 11 11 } 12 12 13 13 $this->title_ = $title; 14 14 $this->admin_ = false; … … 22 22 $this->cachable_ = $cachable; 23 23 $this->cachetime_ = 5; 24 25 // if you have probs with missing tables uncomment this and 24 25 // if you have probs with missing tables uncomment this and 26 26 // require_once('common/includes/autoupgrade.php'); 27 27 // check_navigationtable(); … … 79 79 } 80 80 $smarty->assign('banner', $banner); 81 81 82 82 $nav = new Navigation(); 83 83 $nav->setSite($_GET['a']); 84 84 $menu = $nav->generateMenu(); 85 85 $w = floor(100 / count($menu->get())); 86 86 87 87 $smarty->assign('menu_w',$w.'%'); 88 88 $smarty->assign('menu', $menu->get()); … … 107 107 } 108 108 $smarty->assign('context_html', $this->contexthtml_); 109 event::call('smarty_displayindex', $smarty); 109 110 $smarty->display(get_tpl('index')); 110 111 } … … 160 161 $this->cachetime_ = $cachetime; 161 162 } 162 163 163 164 } 164 165 -
branch/rev3/common/includes/class.session.php
r190 r243 1 1 <?php 2 2 3 class Session3 class session 4 4 { 5 5 function init() -
branch/rev3/common/includes/class.toplist.php
r234 r243 885 885 { 886 886 $sql = "select count(*) as cnt, ind.ind_wep_id as itm_id 887 from kb3_inv_detail ind 888 inner join kb3_items itm on ( itm_id = ind.ind_wep_id )"; 887 from kb3_inv_detail ind 888 inner join kb3_items itm on (itm_id = ind.ind_wep_id)"; 889 if (DB_USE_CCP) 890 { 891 $sql = "select count(*) as cnt, ind.ind_wep_id as itm_id 892 from kb3_inv_detail ind 893 inner join kb3_invtypes itm on (typeID = ind.ind_wep_id)"; 894 } 889 895 890 896 if ($this->invplt_) … … 907 913 908 914 $this->setSQLTop($sql); 915 if (DB_USE_CCP) 916 { 917 // since ccps database doesnt have icons for ships this will also fix the ship as weapon bug 918 $this->setSQLBottom(" and itm.icon != '' 919 and itm.typeName != 'Unknown' 920 group by ind.ind_wep_id order by 1 desc limit 20"); 921 } 922 else 909 923 $this->setSQLBottom(" and itm.itm_icon not in ( '1', 'icon_null' ) 910 924 and itm.itm_name != 'Unknown' 911 group by ind.ind_wep_id order by 1 desc 912 limit 20"); 925 group by ind.ind_wep_id order by 1 desc limit 20"); 913 926 } 914 927 } -
branch/rev3/common/includes/globals.php
r240 r243 6 6 // current version: major.minor.sub 7 7 // unpair numbers for minor = development version 8 define('KB_VERSION', '1. 3.0 (Tigerduck Memorial Edition)');8 define('KB_VERSION', '1.4.0 (Revelations 3)'); 9 9 10 10 // set the running-server for id-syncs here -
branch/rev3/common/index.php
r240 r243 31 31 require_once('common/includes/class.user.php'); 32 32 require_once('common/includes/class.session.php'); 33 require_once('common/includes/class.cache.php'); 33 34 require_once('common/includes/class.involvedloader.php'); 34 35 require_once('common/smarty/Smarty.class.php'); … … 59 60 } 60 61 61 // killboard is instantiated by class::Page62 //$killboard = new Killboard(KB_SITE);63 64 62 // load the config from the database 65 63 $config = new Config(KB_SITE); 64 define('KB_HOST', config::get('cfg_kbhost')); 65 define('MAIN_SITE', config::get('cfg_mainsite')); 66 define('STYLE_URL', config::get('cfg_style')); 67 define('COMMON_URL', config::get('cfg_common')); 68 define('IMG_URL', config::get('cfg_img')); 69 define('DB_HALTONERROR', (bool)config::get('cfg_sqlhalt')); 70 define('DB_USE_QCACHE', (bool)config::get('cfg_qcache')); 71 define('KB_TITLE', config::get('cfg_kbtitle')); 72 73 // corporation OR alliance id 74 if (config::get('cfg_corpid')) 75 { 76 define('CORP_ID', config::get('cfg_corpid')); 77 define('ALLIANCE_ID', 0); 78 } 79 else 80 { 81 define('CORP_ID', 0); 82 define('ALLIANCE_ID', config::get('cfg_allianceid')); 83 } 84 if (!$dir = config::get('cache_dir')) 85 { 86 $dir = 'cache/data'; 87 } 88 define('KB_CACHEDIR', $dir); 66 89 67 90 // setting up smarty and feed it with some config … … 79 102 80 103 // start session management 81 Session::init(); 104 session::init(); 105 106 // reinforced management 107 if (config::get('auto_reinforced')) 108 { 109 // first check if we are in reinforced 110 if (config::get('is_reinforced')) 111 { 112 // every 1/x request we check for disabling RF 113 if (rand(1, config::get('reinforced_rf_prob')) == 1) 114 { 115 cache::checkLoad(); 116 } 117 } 118 else 119 { 120 // reinforced not active 121 // check for load and activate reinforced if needed 122 if (rand(1, config::get('reinforced_prob')) == 1) 123 { 124 cache::checkLoad(); 125 } 126 } 127 } 82 128 83 129 // this is to make sure that smarty is able to create output … … 134 180 } 135 181 136 if (KB_CACHE == 1 && count($_POST) == 0 && !in_array($page, $cacheignore)) 137 { 138 $docache = true; 139 } 140 else 141 { 142 $docache = false; 143 } 144 145 if ($docache) 146 { 147 if (!file_exists(KB_CACHEDIR.'/'.KB_SITE)) 148 { 149 @mkdir(KB_CACHEDIR.'/'.KB_SITE); 150 } 151 152 if ($cachetimes[$page]) 153 { 154 $cachetime = $cachetimes[$page]; 155 } 156 else 157 { 158 $cachetime = 5; 159 } 160 161 $cachetime = $cachetime * 60; 162 163 $cachefile = KB_CACHEDIR.'/'.KB_SITE.'/'.md5($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']).'.cache'; 164 $timestamp = ((@file_exists($cachefile))) ? @filemtime($cachefile) : 0; 165 166 if (time() - $cachetime < $timestamp) 167 { 168 ob_start('ob_gzhandler'); 169 @readfile($cachefile); 170 ob_end_flush(); 171 exit(); 172 } 173 174 ob_start(); 175 } 176 182 cache::check($page); 177 183 if ($settingsPage) 178 184 { 179 if (! Session::isAdmin())185 if (!session::isAdmin()) 180 186 { 181 187 header('Location: ?a=login'); … … 195 201 } 196 202 197 if ($docache) 198 { 199 $fp = @fopen($cachefile, 'w'); 200 @fwrite($fp, ob_get_contents()); 201 @fwrite($fp, '<!-- Generated from cache -->'); 202 @fclose($fp); 203 ob_end_flush(); 204 } 203 cache::generate(); 205 204 ?> -
branch/rev3/common/kill_detail.php
r213 r243 69 69 $involved[$i]['AlliName'] = $alliance->getName(); 70 70 $involved[$i]['ShipName'] = $ship->getName(); 71 $involved[$i]['ShipID'] = $ship->externalid_; 71 72 72 73 if ($pilot->getID() == $kill->getFBPilotID()) … … 89 90 90 91 if ($weapon->getName() != "Unknown" && $weapon->getName() != $ship->getName()) 92 { 91 93 $involved[$i]['weaponName'] = $weapon->getName(); 94 $involved[$i]['weaponID'] = $weapon->row_['itm_externalid']; 95 } 92 96 else 93 97 $involved[$i]['weaponName'] = "Unknown"; … … 110 114 $smarty->assign('ShipImage', $ship->getImage(64)); 111 115 $smarty->assign('ShipName', $ship->getName()); 116 $smarty->assign('ShipID', $ship->externalid_); 112 117 $smarty->assign('ClassName', $shipclass->getName()); 113 118 … … 224 229 } 225 230 226 //Admin is able to see classsiefied systems 231 //Admin is able to see classsiefied systems 227 232 if ((!$kill->isClassified()) || ($page->isAdmin())) 228 233 { -
branch/rev3/common/login.php
r206 r243 6 6 if ($_POST['usrlogin'] == '' && $_POST['usrpass'] == ADMIN_PASSWORD) 7 7 { 8 Session::create(true);8 session::create(true); 9 9 10 10 header('Location: ?a=admin'); -
branch/rev3/templates/index.tpl
r209 r243 33 33 </div> 34 34 {include file="menu.tpl"} 35 {if $message} 36 <table class="navigation" width="100%" height="25" border="0" cellspacing="1"> 37 <tr class="kb-table-row-odd"> 38 <td align="center"><b>{$message}</b></td> 39 </tr> 40 </table> 41 {/if} 35 42 <div id="page-title">{$page_title}</div> 36 43 <table cellpadding="0" cellspacing="0" width="100%" border="0"> -
branch/rev3/templates/kill_detail.tpl
r213 r243 22 22 <tr class={cycle name=ccl}> 23 23 <td rowspan=5 width="64"><img {if $i.FB == "true"}class=finalblow{/if} src="{$i.portrait}" border="0"></td> 24 <td rowspan=5 width="64"><img 24 <td rowspan=5 width="64"><img {if $i.FB == "true"}class=finalblow{/if} src="{$i.shipImage}" border="0"></td> 25 25 <td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;"><a href="{$i.PilotURL}">{$i.PilotName}</a></td> 26 26 </tr> … … 32 32 </tr> 33 33 <tr class={cycle name=ccl}> 34 <td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;"><b> {$i.ShipName}</b></td>34 <td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;"><b><a href="?a=invtype&id={$i.ShipID}">{$i.ShipName}</a></b></td> 35 35 </tr> 36 36 <tr class={cycle name=ccl}> 37 <td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;">{ $i.weaponName}</td>37 <td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;">{if $i.weaponID}<a href="?a=invtype&id={$i.weaponID}">{$i.weaponName}</a>{else}{$i.weaponName}{/if}</td> 38 38 </tr> 39 39 {/foreach} … … 46 46 <td width="64" heigth="64" rowspan=3><img src="{$VictimShipImg}" width="64" heigth="64"></td> 47 47 <td class=kb-table-cell><b>Ship:</b></td> 48 <td class=kb-table-cell><b> {$ShipName}</b> ({$ClassName})</td>48 <td class=kb-table-cell><b><a href="?a=invtype&id={$ShipID}">{$ShipName}</a></b> ({$ClassName})</td> 49 49 </tr> 50 50 <tr class={cycle name=ccl}> … … 73 73 <tr class="kb-table-row-odd"> 74 74 <td class="item-icon" width="32" height="34" valign="top">{$i.Icon}</td> 75 <td class="kb-table-cell"> {$i.Name}</td>75 <td class="kb-table-cell"><a href="?a=invtype&id={$i.itemID}">{$i.Name}</a></td> 76 76 <td width="30" align="center">{$i.Quantity}</td> 77 77 {if $config->get('item_values')} -
branch/rev3/templates/killlisttable.tpl
r154 r243 6 6 <tr class="kb-table-header"> 7 7 <td class="kb-table-header" colspan="2" align="center">Ship type</td> 8 <td class="kb-table-header" >Victim</td>8 <td class="kb-table-header"{if $config->get('killlist_alogo')} colspan="2"{/if}>Victim</td> 9 9 <td class="kb-table-header">Final blow</td> 10 10 <td class="kb-table-header" align="center">System</td> … … 21 21 <td width="32" align="center"><img src="{$k.victimshipimage}" border="0" width="32" heigth="32"></td> 22 22 <td height="34" width=150 valign="middle"><div class="kb-shiptype"><b>{$k.victimshipname}</b><br>{$k.victimshipclass}</div><div class="kb-shipicon"><img src="{$k.victimshipindicator}" border="0"></div></td> 23 {if $config->get('killlist_alogo')} 24 {if $k.allianceexists} 25 <td width="32" align="center"><img src="{$img_url}/alliances/{$k.victimallianceicon}.png" border="0" width="32" height="32"></td> 26 {elseif $k.victimalliancename != "None"} 27 <td width="32" align="center"><img src="{$img_url}/alliances/default.gif" border="0" width="32" height="32"></td> 28 {else} 29 <td width="32" align="center"> </td> 30 {/if} 31 {/if} 23 32 <td width="200" class="kb-table-cell"><b>{$k.victim}</b><br/>{$k.victimcorp|truncate:30}</td> 24 33 <td width="200" class="kb-table-cell"><b>{$k.fb}</b><br>{$k.fbcorp|truncate:30}</td>