Changeset 86
- Timestamp:
- 11/25/06 15:59:24 (16 years ago)
- Location:
- dev
- Files:
-
- 79 added
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/class.killlist.php
r47 r86 1 1 <?php 2 require_once( "class.kill.php");3 require_once( "class.profiler.php");4 require_once( "class.pagesplitter.php");2 require_once('class.kill.php'); 3 require_once('class.profiler.php'); 4 require_once('class.pagesplitter.php'); 5 5 6 6 class KillList … … 17 17 $this->vic_scl_id_ = array(); 18 18 $this->regions_ = array(); 19 $this->systems_ = array(); 19 20 $this->groupby_ = array(); 20 21 $this->offset_ = 0; … … 29 30 { 30 31 if (!count($this->groupby_)) 31 $this->sql_ = "select distinct kll.kll_id, kll.kll_timestamp, plt.plt_name,32 $this->sql_ = 'select distinct kll.kll_id, kll.kll_timestamp, plt.plt_name, 32 33 crp.crp_name, ali.all_name, kll.kll_ship_id, 33 34 kll.kll_system_id, kll.kll_ship_id, … … 39 40 sys.sys_name, sys.sys_sec, 40 41 fbplt.plt_name as fbplt_name, 41 fbcrp.crp_name as fbcrp_name ";42 fbcrp.crp_name as fbcrp_name'; 42 43 43 44 global $config; … … 100 101 on ( reg.reg_id = con.con_reg_id 101 102 and reg.reg_id in ( " . implode($this->regions_, ",") . " ) )"; 103 } 104 105 if (count($this->systems_)) 106 { 107 $this->sql_ .= " and kll.kll_system_id in ( " . implode($this->systems_, ",").")"; 102 108 } 103 109 // victim filter … … 345 351 } 346 352 353 function addSystem($system) 354 { 355 array_push($this->systems_, $system->getID()); 356 } 357 347 358 function addGroupBy($groupby) 348 359 { -
dev/common/class.page.php
r64 r86 12 12 13 13 if (substr($_SERVER['HTTP_USER_AGENT'], 0, 15) == "EVE-minibrowser") 14 { 14 15 $this->igb_ = true; 16 } 15 17 else 18 { 16 19 $this->igb_ = false; 20 } 17 21 18 22 $this->timestart_ = strtok(microtime(), ' ') + strtok(''); … … 38 42 function generate() 39 43 { 40 global $config; 41 $html = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; 42 $html .= '<html>'; 43 $html .= '<head>'; 44 $html .= '<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">'; 45 $html .= '<title>'.KB_TITLE.' Killboard - '.$this->title_."</title>\n"; 46 $html .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"".STYLE_URL."/common.css\">"; 44 global $config, $smarty; 45 46 $smarty->assign('kb_title', KB_TITLE.' Killboard - '.$this->title_); 47 47 48 48 $style = $config->getStyleName(); 49 $html .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"".STYLE_URL."/".$style."/style.css\">"; 49 $smarty->assign('style', $style); 50 51 $smarty->assign('common_url', COMMON_URL); 52 if ($this->onload_) 53 { 54 $smarty->assign('on_load', ' onload="'.$this->onload_.'"'); 55 } 56 // header 50 57 51 58 if (!$this->igb_) 52 $html .= "<script language=javascript src=\"".COMMON_URL."/generic.js\"></script>"; 53 $html .= "</head>\n"; 54 $html .= "<body bgcolor=\"#222222\""; 55 if ($this->onload_) 56 $html .= " onload=\"".$this->onload_."\""; 57 58 $html .= " style=\"height: 100%\">\n"; 59 // header 60 $html .= "<table class=\"main-table\" height=\"100%\" align=\"center\" bgcolor=\"#111111\" border=\"0\" cellspacing=\"1\" style=\"height: 100%\"><tr style=\"height: 100%\"><td valign=\"top\" height=\"100%\" style=\"height: 100%\">\n"; 61 if (!$this->igb_) 62 { 63 $html .= "<div id=header>\n"; 59 { 64 60 if (MAIN_SITE) 65 61 { 66 $html .= "<a href=\"".MAIN_SITE."\">"; 67 } 68 $html .= "<img src=\""; 62 $smarty->assign('banner_link', MAIN_SITE); 63 } 69 64 $banner = $config->getStyleBanner(); 70 if ($banner != "custom") 71 $html .= IMG_URL . "/banners/" . $banner . ".jpg"; 72 else 73 $html .= "kb-banner.jpg"; 74 75 $html .= "\" border=\"0\">"; 76 if (MAIN_SITE) 77 { 78 $html .= "</a>"; 79 } 80 $html .= "</div>\n"; 65 if ($banner == 'custom') 66 { 67 $banner = 'kb-banner.jpg'; 68 } 69 $smarty->assign('banner', $banner); 70 71 $menu = new Menu(); 72 $menu->add('home', 'Home'); 73 81 74 $contracts = $this->killboard_->hasContracts(); 82 75 $campaigns = $this->killboard_->hasCampaigns(); 83 $w = "\"10%\"";84 if ($contracts || $campaigns) $w = "\"9%\"";85 if ($contracts && $campaigns) $w = "\"8%\"";86 $html .= "<table class=navigation width=\"100%\" height=\"25\" border=\"0\" cellspacing=\"1\"><tr class=kb-table-row-odd>\n";87 $html .= "<td width=" . $w . " align=\"center\"><a class=link href=\"?a=home\">Home</a></td>";88 89 76 if ($contracts) 90 $html .= "<td width=" . $w . " align=\"center\"><a class=link href=\"?a=contracts\">Contracts</a></td>"; 91 77 { 78 $menu->add('contracts', 'Contracts'); 79 } 92 80 if ($campaigns) 93 $html .= "<td width=" . $w . " align=\"center\"><a class=link href=\"?a=campaigns\">Campaigns</a></td>"; 94 95 $html .= "<td width=" . $w . " align=\"center\"><a class=link href=\"?a=kills\">Kills</a></td>"; 96 $html .= "<td width=" . $w . " align=\"center\"><a class=link href=\"?a=losses\">Losses</a></td>"; 97 $html .= "<td width=" . $w . " align=\"center\"><a class=link href=\"?a=post\">Post mail</a></td>"; 98 $html .= "<td width=" . $w . " align=\"center\"><a class=link href=\""; 99 100 if (CORP_ID) $html .= "?a=corp_detail&crp_id=" . CORP_ID; 101 if (ALLIANCE_ID) $html .= "?a=alliance_detail&all_id=" . ALLIANCE_ID; 102 103 $html .= "\">Stats</a></td>"; 104 105 $html .= "<td width=" . $w . " align=\"center\"><a class=link href=\"?a=awards\">Awards</a></td>"; 106 $html .= "<td width=" . $w . " align=\"center\"><a class=link href=\"?a=search\">Search</a></td>"; 107 $html .= "<td width=" . $w . " align=\"center\"><a class=link href=\"?a=admin\">Admin</a></td>"; 108 $html .= "<td width=" . $w . " align=\"center\"><a class=link href=\"?a=about\">About</a></td>"; 109 110 $html .= "\n</tr></table>\n"; 111 } 112 $html .= "<div id=page-title>" . $this->title_ . "</div>"; 113 $html .= "<table cellpadding=0 cellspacing=0 width=\"100%\" border=\"0\"><tr>"; 114 $html .= "<td valign=top><div id=content>\n"; 115 $html .= $this->contenthtml_; 81 { 82 $menu->add('campaigns', 'Campaigns'); 83 } 84 $menu->add('kills', 'Kills'); 85 $menu->add('losses', 'Losses'); 86 $menu->add('post', 'Post Mail'); 87 88 if (CORP_ID) 89 { 90 $link = 'corp_detail&crp_id='.CORP_ID; 91 } 92 elseif (ALLIANCE_ID) 93 { 94 $link = 'alliance_detail&all_id='.ALLIANCE_ID; 95 } 96 $menu->add($link, 'Stats'); 97 $menu->add('awards', 'Awards'); 98 $menu->add('search', 'Search'); 99 $menu->add('admin', 'Admin'); 100 $menu->add('about', 'About'); 101 102 $w = '10%'; 103 if ($contracts || $campaigns) 104 { 105 $w = '9%'; 106 } 107 if ($contracts && $campaigns) 108 { 109 $w = '8%'; 110 } 111 112 $smarty->assign('menu_w', $w); 113 $smarty->assign('menu', $menu->get()); 114 } 115 $smarty->assign('page_title', $this->title_); 116 116 117 $this->timeend_ = strtok(microtime(), ' ') + strtok(''); 117 118 $this->processingtime_ = $this->timeend_ - $this->timestart_; 118 $html .= "</div></td>"; 119 if ($this->contexthtml_ != "") 120 { 121 $html .= "<td valign=top align=right><div id=context>\n"; 122 $html .= $this->contexthtml_; 123 $html .= "</div></td>\n"; 124 } 125 $html .= "</tr></table>"; 126 127 if (KB_PROFILE > 0) 128 $html .= "<table class=kb-subtable width=\"99%\" border=0><tr><td height=100% align=right valign=bottom>" . $this->processingtime_ . "s</td></tr></table>\n"; 119 120 $smarty->assign('profile_time', $this->processingtime_); 121 $smarty->assign('profile', KB_PROFILE); 122 $smarty->assign('content_html', $this->contenthtml_); 123 $smarty->assign('context_html', $this->contexthtml_); 124 if ($this->igb_) 125 { 126 $smarty->display('igb_index.tpl'); 127 } 129 128 else 130 $html .= "<!-- " . $this->processingtime_ . "s -->"; 131 $html .= '<div class="counter"></div>'; 132 $html .= "</td></tr></table>\n"; 133 $html .= "</body></html>\n"; 134 // ob_start( "ob_gzhandler" ); 135 echo $html; 136 // ob_end_flush(); 129 { 130 $smarty->display('index.tpl'); 131 } 137 132 } 138 133 … … 155 150 { 156 151 if (!$this->session_->isAdmin()) 157 Header("Location: ?a=login"); 152 { 153 header("Location: ?a=login"); 154 echo '<a href="?a=login">Login</a>'; 155 exit; 156 } 158 157 } 159 158 … … 190 189 } 191 190 } 191 192 class Menu 193 { 194 function Menu() 195 { 196 $this->menu_ = array(); 197 } 198 199 function get() 200 { 201 return $this->menu_; 202 } 203 204 function add($link, $text) 205 { 206 $this->menu_[] = array('link' => $link, 'text' => $text); 207 } 208 } 192 209 ?> -
dev/common/index.php
r30 r86 2 2 require_once('db.php'); 3 3 require_once('class.killboard.php'); 4 require_once('smarty/Smarty.class.php'); 5 require_once('config.php'); 4 6 5 7 $page = str_replace('.', '', $_GET['a']); … … 14 16 } 15 17 16 require_once('config.php');17 18 $killboard = new Killboard(KB_SITE); 18 19 $config = $killboard->getConfig(); 20 $smarty = new Smarty(); 21 $smarty->template_dir = './templates'; 22 $smarty->compile_dir = './cache/templates_c'; 23 $smarty->cache_dir = './cache/data'; 24 $smarty->assign('style_url', STYLE_URL); 25 $smarty->assign('img_url', IMG_URL); 26 $smarty->assign_by_ref('config', $config); 27 if (!is_dir('./cache/templates_c')) 28 { 29 if (mkdir('./cache/templates_c')) 30 { 31 chmod('./cache/templates_c', 0777); 32 } 33 else 34 { 35 exit('please create cache/templates_c and chmod it 777'); 36 } 37 } 19 38 // if ($killboard->isSuspended()) 20 39 // $page = 'suspended';