Changeset 479
- Timestamp:
- 12/05/09 03:20:46 (13 years ago)
- Location:
- dev
- Files:
-
- 1 added
- 2 removed
- 46 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/README.txt
r476 r479 1 1 ------------------------------------------- 2 Eve Development Network Killboard v2.0. 72 Eve Development Network Killboard v2.0.8 3 3 ------------------------------------------- 4 4 5 Incorporates changes and additional mods from Alvar's EDK Full Package v150.13Apoc.33.2622.06 5 7 6 VERSION HISTORY 7 v2.0.8 (svn r479) 8 Board updated with Dominion installation DB and IGB pages changed. 9 PHP4 compatibility improved 10 Rank mod no longer gives EWAR award for missile use. 8 11 v2.0.7 (svn r476) 9 12 PHP4 compatibility improved … … 29 32 ------------------------------------------- 30 33 v2.0.0 RC1 (svn 370) 34 - Incorporates changes and additional mods from Alvar's EDK Full Package v150.13Apoc.33.2622.0 31 35 - Database structure changed 32 36 - SQL queries optimised for speed and error protection. -
dev/common/includes/class.cache.php
r459 r479 5 5 class cache 6 6 { 7 8 9 10 11 12 13 7 //! Check the server load using /proc/loadavg. 8 function checkLoad() 9 { 10 if (PHP_OS != 'Linux') 11 { 12 return false; 13 } 14 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 15 $load = @file_get_contents('/proc/loadavg'); 16 if (false === $load) 17 { 18 return false; 19 } 20 $array = explode(' ', $load); 21 if ((float)$array[0] > (float)config::get('reinforced_threshold')) 22 { 23 // put killboard into RF 24 config::set('is_reinforced', 1); 25 } 26 elseif ((float)$array[0] > (float)config::get('reinforced_disable_threshold') && config::get('is_reinforced')) 27 { 28 // do nothing, we are in RF, load is dropping but stil over disabling threshold 29 } 30 else 31 { 32 // load low, dont enter reinforced 33 config::set('is_reinforced', 0); 34 } 35 } 36 36 //! Check if the current page should be cached. 37 38 39 40 41 42 43 37 function shouldCache($page = '') 38 { 39 // never cache for admins 40 if (session::isAdmin()) 41 { 42 return false; 43 } 44 44 // Don't cache the image files. 45 45 if (strpos($_SERVER['REQUEST_URI'],'thumb') || 46 46 strpos($_SERVER['REQUEST_URI'],'mapview')) return false; 47 48 49 50 47 if (config::get('auto_reinforced') && config::get('is_reinforced') && count($_POST) == 0) 48 { 49 return true; 50 } 51 51 52 52 $cacheignore = explode(',', config::get('cache_ignore')); 53 53 if (KB_CACHE == 1 && count($_POST) == 0 && !($page != '' && in_array($page, $cacheignore))) 54 55 56 54 { 55 return true; 56 } 57 57 return false; 58 58 } 59 59 //! Check if the current page is cached and valid then send it if so. 60 61 60 function check($page) 61 { 62 62 $cachefile = cache::genCacheName(); 63 63 64 64 // If the cache doesn't exist then we don't need to check times. 65 if (cache::shouldCache($page) && file_exists(cache::genCacheName())) 66 { 67 68 $times = explode(',', config::get('cache_times')); 69 foreach ($times as $string) 70 { 71 $array = explode(':', $string); 72 $cachetimes[$array[0]] = $array[1]; 73 } 65 if (cache::shouldCache($page) && file_exists(cache::genCacheName())) 66 { 67 $times = explode(',', config::get('cache_times')); 68 foreach ($times as $string) 69 { 70 $array = explode(':', $string); 71 $cachetimes[$array[0]] = $array[1]; 72 } 74 73 75 76 77 78 79 80 81 82 83 74 if ($cachetimes[$page]) 75 { 76 $cachetime = $cachetimes[$page]; 77 } 78 else 79 { 80 $cachetime = config::get('cache_time'); 81 } 82 84 83 $cachetime = config::get('cache_time'); 85 84 $cachetime = $cachetime * 60; 86 85 87 86 if (config::get('is_reinforced')) 88 89 90 87 { 88 global $smarty; 89 $smarty->assign('message', 'Note: This killboard has entered reinforced operation mode.'); 91 90 // cache is extended in reinforced mode 92 91 $cachetime = $cachetime * 20; 93 92 } 94 93 if(file_exists($cachefile)) $timestamp = @filemtime($cachefile); 95 94 else $timestamp = 0; 96 95 97 96 if(config::get('cache_update') == '*') 98 97 if(file_exists(KB_CACHEDIR.'/killadded.mk')) 99 98 if($timestamp < @filemtime(KB_CACHEDIR.'/killadded.mk')) 100 99 $timestamp = 0; 101 else 100 else 101 { 102 $cacheupdate = explode(',', config::get('cache_update')); 103 if (($page != '' && in_array($page, $cacheupdate))) 104 if(file_exists(KB_CACHEDIR.'/killadded.mk')) 105 if($timestamp < @filemtime(KB_CACHEDIR.'/killadded.mk')) 106 $timestamp = 0; 107 } 108 if (time() - $cachetime < $timestamp) 102 109 { 103 $cacheupdate = explode(',', config::get('cache_update'));104 if (($page != '' && in_array($page, $cacheupdate)))105 if(file_exists(KB_CACHEDIR.'/killadded.mk'))106 if($timestamp < @filemtime(KB_CACHEDIR.'/killadded.mk'))107 $timestamp = 0;108 }109 if (time() - $cachetime < $timestamp)110 {111 110 $etag=md5($cachefile); 112 111 header("Last-Modified: ".gmdate("D, d M Y H:i:s", $timestamp)." GMT"); 113 // Breaks comment posting.114 // header('Expires: ' . gmdate('D, d M Y H:i:s', $timestamp + $cachetime) . ' GMT');112 // Breaks comment posting. 113 // header('Expires: ' . gmdate('D, d M Y H:i:s', $timestamp + $cachetime) . ' GMT'); 115 114 header("Etag: ".md5($etag)); 116 115 header("Cache-Control:"); … … 124 123 } 125 124 126 127 128 129 130 131 132 125 ob_start(); 126 @readfile($cachefile); 127 ob_end_flush(); 128 exit(); 129 } 130 ob_start(); 131 } 133 132 header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); 134 // header('Expires: ' . gmdate('D, d M Y H:i:s', time()+60) . ' GMT');133 // header('Expires: ' . gmdate('D, d M Y H:i:s', time()+60) . ' GMT'); 135 134 header("Etag: ".md5($cachefile)); 136 135 header("Cache-Control:"); 137 136 header('Pragma:'); 138 137 } 139 138 //! Generate the cache for the current page. 140 141 142 143 144 139 function generate() 140 { 141 if (cache::shouldCache()) 142 { 143 $cachefile = cache::genCacheName(); 145 144 146 145 // Create directories if needed. 147 146 if (!file_exists(KB_CACHEDIR.'/'.KB_SITE)) 148 149 150 147 { 148 mkdir(KB_CACHEDIR.'/'.KB_SITE); 149 } 151 150 if (!file_exists(KB_CACHEDIR.'/'.KB_SITE.'/'.cache::genCacheName(true))) 152 153 154 155 151 { 152 mkdir(KB_CACHEDIR.'/'.KB_SITE.'/'.cache::genCacheName(true)); 153 } 154 $fp = @fopen($cachefile, 'w'); 156 155 157 158 159 160 161 156 @fwrite($fp, preg_replace('/profile -->.*<!-- \/profile/','profile -->Cached '.gmdate("d M Y H:i:s").'<!-- /profile',ob_get_contents())); 157 @fclose($fp); 158 ob_end_flush(); 159 } 160 } 162 161 //! Generate the cache filename. 163 162 … … 170 169 function genCacheName($subdir = false) 171 170 { 172 $filename = md5($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']. @implode($_SESSION)).'.cache';171 $filename = md5($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].IS_IGB).'.cache'; 173 172 if($subdir) return substr($filename,0,1); 174 173 else return KB_CACHEDIR.'/'.KB_SITE.'/'.substr($filename,0,1).'/'.$filename; … … 197 196 } 198 197 } 199 ?> -
dev/common/includes/class.page.php
r370 r479 88 88 $smarty->assign('page_bodylines', join("\n", $this->bodylines)); 89 89 90 if (!$this->igb_) 91 { 92 if (MAIN_SITE) 93 { 94 $smarty->assign('banner_link', MAIN_SITE); 95 } 96 $banner = config::get('style_banner'); 97 if ($banner == 'custom') 98 { 99 $banner = 'kb-banner.jpg'; 100 } 101 $smarty->assign('banner', $banner); 102 103 $nav = new Navigation(); 104 $nav->setSite($_GET['a']); 105 $menu = $nav->generateMenu(); 106 $w = floor(100 / count($menu->get())); 107 108 $smarty->assign('menu_w',$w.'%'); 109 $smarty->assign('menu', $menu->get()); 110 } 90 if (MAIN_SITE) 91 { 92 $smarty->assign('banner_link', MAIN_SITE); 93 } 94 $banner = config::get('style_banner'); 95 if ($banner == 'custom') 96 { 97 $banner = 'kb-banner.jpg'; 98 } 99 $smarty->assign('banner', $banner); 100 101 $nav = new Navigation(); 102 $nav->setSite($_GET['a']); 103 $menu = $nav->generateMenu(); 104 $w = floor(100 / count($menu->get())); 105 106 $smarty->assign('menu_w',$w.'%'); 107 $smarty->assign('menu', $menu->get()); 111 108 112 109 //check if banner is a swf -
dev/common/includes/globals.php
r477 r479 10 10 // current version: major.minor.sub 11 11 // unpair numbers for minor = development version 12 define('KB_VERSION', '2.0. 7');13 define('KB_RELEASE', '( Apocrypha)');12 define('KB_VERSION', '2.0.8'); 13 define('KB_RELEASE', '(Dominion)'); 14 14 15 15 // add new corporations here once you've added the logo to img/corps/ -
dev/common/index.php
r454 r479 64 64 65 65 // check for the igb 66 if (substr($_SERVER['HTTP_USER_AGENT'], 0, 15) == 'EVE-minibrowser') 67 { 68 define('IS_IGB', true); 69 if (!isset($_GET['a'])) 70 { 71 $page = 'igb'; 72 } 73 } 74 else 75 { 76 define('IS_IGB', false); 66 if (strpos($_SERVER['HTTP_USER_AGENT'], 'EVE-IGB') !== FALSE) 67 { 68 define('IS_IGB', true); 69 } 70 else 71 { 72 define('IS_IGB', false); 77 73 } 78 74 … … 254 250 255 251 cache::generate(); 256 ?> -
dev/install/config.data
r417 r479 60 60 cache_update * 61 61 cache_time 10 62 CCPDB Dominion.1.0.1 -
dev/install/index.php
r473 r479 1 1 <?php 2 3 if(file_exists('install.lock')) die("Remove install/install.lock before attempting to reinstall.");4 2 $installrunning = true; 5 3 … … 34 32 <tr><td valign="top"><div id="content"> 35 33 <?php 36 include('install_step'.$_SESSION['state'].'.php'); 34 if(file_exists('install.lock')) 35 { 36 ?> 37 <p>Remove install/install.lock before attempting to reinstall.</p> 38 <?php 39 } 40 else include('install_step'.$_SESSION['state'].'.php'); 41 37 42 ?> 38 43 </div></td> -
dev/packages/database/kb3_dgmattributetypes/table.xml
r451 r479 2 2 <kb3> 3 3 <name>kb3_dgmattributetypes</name> 4 <rows>14 35</rows>4 <rows>1470</rows> 5 5 <structure>CREATE TABLE `kb3_dgmattributetypes` ( 6 6 `attributeID` int(11) NOT NULL default '0', -
dev/packages/database/kb3_dgmeffects/table.xml
r451 r479 2 2 <kb3> 3 3 <name>kb3_dgmeffects</name> 4 <rows>2 534</rows>4 <rows>2611</rows> 5 5 <structure>CREATE TABLE `kb3_dgmeffects` ( 6 6 `effectID` smallint(5) NOT NULL default '0', -
dev/packages/database/kb3_dgmtypeattributes/table.xml
r451 r479 2 2 <kb3> 3 3 <name>kb3_dgmtypeattributes</name> 4 <rows>14 5393</rows>4 <rows>146704</rows> 5 5 <structure>CREATE TABLE `kb3_dgmtypeattributes` ( 6 6 `typeID` smallint(5) NOT NULL default '0', -
dev/packages/database/kb3_dgmtypeeffects/table.xml
r451 r479 2 2 <kb3> 3 3 <name>kb3_dgmtypeeffects</name> 4 <rows>35 318</rows>4 <rows>35646</rows> 5 5 <structure>CREATE TABLE `kb3_dgmtypeeffects` ( 6 6 `typeID` int(11) NOT NULL default '0', -
dev/packages/database/kb3_eveunits/table.xml
r376 r479 2 2 <kb3> 3 3 <name>kb3_eveunits</name> 4 <rows>4 6</rows>4 <rows>48</rows> 5 5 <structure>CREATE TABLE `kb3_eveunits` ( 6 6 `unitID` int(5) NOT NULL default '0', -
dev/packages/database/kb3_invtypes/table.xml
r451 r479 2 2 <kb3> 3 3 <name>kb3_invtypes</name> 4 <rows>18 260</rows>4 <rows>18433</rows> 5 5 <structure>CREATE TABLE `kb3_invtypes` ( 6 6 `typeID` int(11) NOT NULL default '0', -
dev/packages/database/kb3_item_price/table.xml
r376 r479 2 2 <kb3> 3 3 <name>kb3_item_price</name> 4 <rows> 8992</rows>4 <rows>17308</rows> 5 5 <structure>CREATE TABLE `kb3_item_price` ( 6 6 `typeID` int(11) NOT NULL, -
dev/packages/database/kb3_item_types/table.xml
r376 r479 2 2 <kb3> 3 3 <name>kb3_item_types</name> 4 <rows> 796</rows>4 <rows>808</rows> 5 5 <structure>CREATE TABLE `kb3_item_types` ( 6 6 `itt_id` int(11) NOT NULL default '0', -
dev/packages/database/kb3_ship_classes/table.xml
r376 r479 2 2 <kb3> 3 3 <name>kb3_ship_classes</name> 4 <rows> 39</rows>4 <rows>41</rows> 5 5 <structure>CREATE TABLE `kb3_ship_classes` ( 6 6 `scl_id` int(11) NOT NULL auto_increment, -
dev/packages/database/kb3_ships/table.xml
r451 r479 2 2 <kb3> 3 3 <name>kb3_ships</name> 4 <rows> 593</rows>4 <rows>629</rows> 5 5 <structure>CREATE TABLE `kb3_ships` ( 6 6 `shp_id` int(11) NOT NULL auto_increment, -
dev/templates/igb_index.tpl
r134 r479 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 1 2 <html> 2 3 <head> 4 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> 3 5 <title>{$kb_title}</title> 6 <link rel="stylesheet" type="text/css" href="{$style_url}/common.css"> 7 <link rel="stylesheet" type="text/css" href="{$style_url}/{$style}/style.css"> 8 {$page_headerlines} 9 <script type="text/javascript" language=javascript src="{$style_url}/generic.js"></script> 4 10 </head> 5 <body bgcolor="#222222"> 6 <table heigth="100%" width="100%" bgcolor="#111111" border="0" cellspacing="1"> 7 <tr> 8 <td valign="top"> 9 <div>{$page_title}</div> 10 <hr> 11 {$content_html} 12 {if $context_html} 13 <td valign="top" align="right"> 11 <body {$on_load} style="height: 100%"> 12 {$page_bodylines} 13 <div align="center" id="popup" style="display:none; 14 position:absolute; 15 top:217px; width:99%; 16 z-index:3; 17 padding: 5px;"></div> 18 <table class="main-table" align="center" bgcolor="#111111" border="0" cellspacing="1" style="height: 100%"> 19 <tr style="height: 100%"> 20 <td valign="top" height="100%" style="height: 100%"> 21 {include file="menu.tpl"} 22 {if $message} 23 <table class="navigation" width="100%" height="25" border="0" cellspacing="1"> 24 <tr class="kb-table-row-odd"> 25 <td align="center"><b>{$message}</b></td> 26 </tr> 27 </table> 28 {/if} 29 <div id="page-title">{$page_title}</div> 30 <table cellpadding="0" cellspacing="0" width="100%" border="0"> 31 <tr><td valign="top"> 32 <div id="content">{$content_html}</div> 33 </td> 34 {if $context_html}<td valign="top" align="right"> 14 35 <div id="context">{$context_html}</div> 15 </td> 36 </td>{/if} 37 </tr></table> 38 {if $profile} 39 <table class="kb-subtable" width="99%" border="0"> 40 <tr><td height="100%" align="right" valign="bottom"><!-- profile -->{$profile_sql} queries{if $profile_sql_cached} (+{$profile_sql_cached} cached) {/if} SQL time {$sql_time}s, Total time {$profile_time}s<!-- /profile --></td></tr> 41 </table> 16 42 {/if} 17 < hr>43 <div class="counter"></div> 18 44 </td></tr></table> 19 45 </body>