Changeset 388
- Timestamp:
- 06/22/09 13:38:25 (13 years ago)
- Location:
- dev
- Files:
-
- 9 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin/option_acache.php
r382 r388 8 8 options::fadd('Caching enabled', 'cache_enabled', 'checkbox'); 9 9 options::fadd('Cache directory', 'cache_dir', 'edit:size:40'); 10 options::fadd('Ignore pages ', 'cache_ignore', 'edit:size:60');11 options::fadd('Cache times ', 'cache_times', 'edit:size:60');10 options::fadd('Ignore pages (xx,yy)', 'cache_ignore', 'edit:size:60'); 11 options::fadd('Cache times (xx:1,yy:2)', 'cache_times', 'edit:size:60'); 12 12 13 13 options::cat('Advanced', 'Cache', 'Query Cache'); -
dev/common/comments.php
r343 r388 25 25 } 26 26 $comments->addComment($name, $comment); 27 //Remove cached file. 28 if(KB_CACHE) cache::deleteCache(); 29 //Redirect to avoid refresh reposting comments. 30 header('Location: '.$_SERVER['REQUEST_URI'],TRUE,303); 31 die(); 27 32 } 28 33 } -
dev/common/includes/class.cache.php
r383 r388 64 64 } 65 65 // Include session info in the hash to support session-based security. 66 $cachefile = KB_CACHEDIR.'/'.KB_SITE.'/'.md5($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].implode($_SESSION)).'.cache'; 67 /* 68 // cache is unlimited in reinforced mode 69 if (config::get('is_reinforced') && file_exists($cachefile)) 70 { 71 ob_start('ob_gzhandler'); 72 @readfile($cachefile); 73 ob_end_flush(); 74 exit(); 75 } 76 elseif (config::get('is_reinforced')) 77 { 78 global $smarty; 79 $smarty->assign('message', 'Note: This killboard has entered reinforced operation mode.'); 80 } 81 */ 66 $cachefile = cache::genCacheName(); 82 67 $times = explode(',', config::get('cache_times')); 83 68 foreach ($times as $string) … … 93 78 else 94 79 { 95 $cachetime = 1 ;80 $cachetime = 10; 96 81 } 97 82 $cachetime = $cachetime * 60; … … 104 89 $cachetime = $cachetime * 20; 105 90 } 106 if(file_exists($cachefile)) 107 { 108 $timestamp = @filemtime($cachefile); 109 if(time() - $cachetime > $timestamp) unlink($cachefile); 110 } 91 if(file_exists($cachefile)) $timestamp = @filemtime($cachefile); 111 92 else $timestamp = 0; 112 93 //$timestamp = ((@file_exists($cachefile))) ? @filemtime($cachefile) : 0; 113 94 if (time() - $cachetime < $timestamp) 114 95 { 115 ob_start('ob_gzhandler'); 96 $etag=md5($cachefile); 97 header("Last-Modified: ".gmdate("D, d M Y H:i:s", $timestamp)." GMT"); 98 // Breaks comment posting. 99 // header('Expires: ' . gmdate('D, d M Y H:i:s', $timestamp + $cachetime) . ' GMT'); 100 header("Etag: ".md5($etag)); 101 header("Cache-Control:"); 102 header('Pragma:'); 103 104 if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $timestamp || 105 trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) 106 { 107 header("HTTP/1.1 304 Not Modified"); 108 exit; 109 } 110 111 if(!ini_get('zlib.output_compression')) ob_start('ob_gzhandler'); 112 else ob_start(); 116 113 @readfile($cachefile); 117 114 ob_end_flush(); … … 120 117 ob_start(); 121 118 } 119 header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); 120 // header('Expires: ' . gmdate('D, d M Y H:i:s', time()+60) . ' GMT'); 121 header("Etag: ".md5($cachefile)); 122 header("Cache-Control:"); 123 header('Pragma:'); 122 124 } 123 125 … … 126 128 if (cache::shouldCache()) 127 129 { 128 $cachefile = KB_CACHEDIR.'/'.KB_SITE.'/'.md5($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']).'.cache';130 $cachefile = cache::genCacheName(); 129 131 $fp = @fopen($cachefile, 'w'); 130 132 //@fwrite($fp, ob_get_contents()); … … 136 138 } 137 139 } 140 141 function deleteCache() 142 { 143 $cachefile = cache::genCacheName(); 144 @unlink($cachefile); 145 } 146 147 function genCacheName() 148 { 149 return KB_CACHEDIR.'/'.KB_SITE.'/'.md5($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].implode($_SESSION)).'.cache'; 150 } 138 151 } 139 152 ?> -
dev/common/includes/class.comments.php
r370 r388 11 11 */ 12 12 function Comments($kll_id) 13 { 13 { 14 14 $this->id_ = $kll_id; 15 15 $this->raw_ = false; … … 26 26 $qry = new DBQuery(true); 27 27 $qry->execute("SELECT *,id FROM kb3_comments WHERE `kll_id` = '". 28 $ kll_id."' order by posttime asc");28 $this->id_."' order by posttime asc"); 29 29 while ($row = $qry->getRow()) 30 30 { … … 32 32 'comment' => stripslashes($row['comment']), 'id' => $row['id']); 33 33 } 34 $smarty->assign_by_ref('comments', $this->comments_); 34 $smarty->assign_by_ref('comments', $this->comments_); 35 $smarty->assign('norep', time()%3700); 35 36 return $smarty->fetch(get_tpl('block_comments')); 36 37 } -
dev/common/kill_detail.php
r381 r388 1 1 <?php 2 2 require_once('common/includes/class.kill.php'); 3 4 $kll_id = intval($_GET['kll_id']); 5 $kll_external_id = intval($_GET['kll_external_id']); 6 if (!$kll_id && !$kll_external_id) 7 { 8 $html = "No kill id specified."; 9 $page->setContent($html); 10 $page->generate($html); 11 exit; 12 } 13 14 if($kll_id) 15 { 16 $kill = new Kill($kll_id); 17 } 18 else 19 { 20 $kill = new Kill($kll_external_id, true); 21 $kll_id = $kill->getID(); 22 } 23 $kill->setDetailedInvolved(); 24 25 if (!$kill->exists()) 26 { 27 $html="That kill doesn't exist."; 28 $page->setContent($html); 29 $page->generate($html); 30 exit; 31 } 32 33 // If a comment is being posted then we don't exit this block. 34 if(isset($_POST['comment']) && config::get('comments')) 35 { 36 include('common/comments.php'); 37 } 38 3 39 require_once('common/includes/class.pilot.php'); 4 40 require_once('common/includes/class.corp.php'); … … 66 102 $qry->execute("UPDATE kb3_items_".$table." SET itd_itl_id ='".$Val."' WHERE itd_itm_id=".$IID." AND itd_kll_id = ".$KID." AND itd_itl_id = ".$old); 67 103 } 68 }69 70 $kll_id = intval($_GET['kll_id']);71 $kll_external_id = intval($_GET['kll_external_id']);72 if (!$kll_id && !$kll_external_id)73 {74 $html = "No kill id specified.";75 $page->setContent($html);76 $page->generate($html);77 exit;78 }79 80 if($kll_id)81 {82 $kill = new Kill($kll_id);83 $kill->setDetailedInvolved();84 }85 else86 {87 $kill = new Kill($kll_external_id, true);88 $kill->setDetailedInvolved();89 $kll_id = $kill->getID();90 }91 92 if (!$kill->exists())93 {94 $html = "That kill doesn't exist.";95 $page->setContent($html);96 $page->generate($html);97 exit;98 104 } 99 105 … … 549 555 else 550 556 { 551 $menubox->addOption("link", "Fix Slots", "?a=kill_detail&kll_id=".$kill->getID()."& view=FixSlot");557 $menubox->addOption("link", "Fix Slots", "?a=kill_detail&kll_id=".$kill->getID()."&view=FixSlot"); 552 558 } 553 559 } -
dev/mods/apoc_fitting/kill_detail.php
r381 r388 1 1 <?php 2 2 require_once('common/includes/class.kill.php'); 3 4 $kll_id = intval($_GET['kll_id']); 5 $kll_external_id = intval($_GET['kll_external_id']); 6 if (!$kll_id && !$kll_external_id) 7 { 8 $html = "No kill id specified."; 9 $page->setContent($html); 10 $page->generate($html); 11 exit; 12 } 13 14 if($kll_id) 15 { 16 $kill = new Kill($kll_id); 17 } 18 else 19 { 20 $kill = new Kill($kll_external_id, true); 21 $kll_id = $kill->getID(); 22 } 23 $kill->setDetailedInvolved(); 24 25 if (!$kill->exists()) 26 { 27 $html="That kill doesn't exist."; 28 $page->setContent($html); 29 $page->generate($html); 30 exit; 31 } 32 33 // If a comment is being posted then we don't exit this block. 34 if(isset($_POST['comment']) && config::get('comments')) 35 { 36 include('common/comments.php'); 37 } 38 3 39 require_once('common/includes/class.killsummarytable.php'); 4 40 require_once('common/includes/class.pilot.php'); … … 66 102 . " AND itd_kll_id = " . $KID . " AND itd_itl_id = " . $old); 67 103 } 68 }69 70 $kll_id = intval($_GET['kll_id']);71 $kll_external_id = intval($_GET['kll_external_id']);72 if (!$kll_id && !$kll_external_id)73 {74 $html = "No kill id specified.";75 $page->setContent($html);76 $page->generate($html);77 exit;78 }79 80 if($kll_id)81 {82 $kill = new Kill($kll_id);83 $kill->setDetailedInvolved();84 }85 else86 {87 $kill = new Kill($kll_external_id, true);88 $kill->setDetailedInvolved();89 $kll_id = $kill->getID();90 }91 92 if (!$kill->exists())93 {94 $html="That kill doesn't exist.";95 $page->setContent($html);96 $page->generate($html);97 exit;98 104 } 99 105 … … 274 280 275 281 if (config::get('comments')) 276 282 { 277 283 include('common/comments.php'); 278 284 $smarty->assign('comments', $comment); 279 285 } 280 286 281 287 // ship, ship details … … 852 858 if (isset($_GET['view']) && $_GET['view'] == 'FixSlot') 853 859 { 854 $menubox->addOption("link", "Adjust Values", "?a=kill_detail& kll_id=" . $kill->getID() . "");860 $menubox->addOption("link", "Adjust Values", "?a=kill_detail&kll_id=" . $kill->getID() . ""); 855 861 } 856 862 else -
dev/mods/apoc_fitting/kill_detail.tpl
r381 r388 171 171 172 172 <br /> 173 <div id="fitting" style="position:relative; height:398px; width:398px;" name="fitting">173 <div id="fitting" style="position:relative; height:398px; width:398px;" title="fitting"> 174 174 <div id="mask" style="position:absolute; left:0px; top:0px; width:398px; height:398px; z-index:0;"> 175 175 <img border="0" style="position:absolute; height='398' width='398' filter:progid:DXImageTransform.Microsoft.AlphaImageLoader( … … 258 258 {if $admin and $config->get('item_values') and !$fixSlot} 259 259 <tr class="kb-table-row-even"> 260 < form method="post" action="">261 <td height="34" colspan="3" valign="top">260 <td height="34" colspan="4" valign="top" align="right"><form method="post" action=""><table><tr> 261 <td> 262 262 <div align="right"> 263 263 Current single Item Value: … … 266 266 </div></td> 267 267 <td height="34" valign="top"><input type="submit" name="submit" value="UpdateValue" class="comment-button"></td> 268 </ form>268 </tr></table></form></td> 269 269 </tr> 270 270 {/if} … … 297 297 {if $admin and $config->get('item_values') and !$fixSlot} 298 298 <tr class="kb-table-row-even"> 299 < form method="post" action="">300 <td height="34" colspan="3" valign="top">299 <td height="34" colspan="4" valign="top" align="right"><form method="post" action=""><table><tr> 300 <td> 301 301 <div align="right"> 302 302 Current single Item Value: … … 305 305 </div></td> 306 306 <td height="34" valign="top"><input type="submit" name="submit" value="UpdateValue" class="comment-button"></td> 307 </ form>307 </tr></table></form></td> 308 308 </tr> 309 309 {/if} -
dev/templates/block_comments.tpl
r343 r388 1 1 <div class="block-header">Comments</div> 2 <table class="kb-table" width="360" border="0" cellspacing="1" border="0">2 <table class="kb-table" width="360" border="0" cellspacing="1"> 3 3 <tr> 4 4 <td width="100%" align="left" valign="top"> 5 <table width="100%" border="0" cellspacing="0" border="0">5 <table width="100%" border="0" cellspacing="0"> 6 6 {cycle reset=true print=false name=ccl values="kb-table-row-even,kb-table-row-odd"}{section name=i loop=$comments} 7 7 <tr class="{cycle name=ccl}"> 8 8 <td> 9 <div style="position: relative;"><a href="?a=search& searchtype=pilot&searchphrase={$comments[i].name}">{$comments[i].name}</a>:9 <div style="position: relative;"><a href="?a=search&searchtype=pilot&searchphrase={$comments[i].name}">{$comments[i].name}</a>: 10 10 {if $comments[i].time} 11 11 <span style="position:absolute; right: 0px;">{$comments[i].time}</span> … … 13 13 <p>{$comments[i].comment}</p> 14 14 {if $page->isAdmin()} 15 <a href="javascript:openWindow('?a=admin_comments_delete& c_id={$comments[i].id}', null, 480, 350, '' );">Delete Comment</a>15 <a href="javascript:openWindow('?a=admin_comments_delete&c_id={$comments[i].id}', null, 480, 350, '' );">Delete Comment</a> 16 16 <span style="position:absolute; right: 0px;"><u>Posters IP:{$comments[i].ip}</u></span> 17 17 {/if} 18 </ td>18 </div></td> 19 19 </tr> 20 20 {/section} 21 <tr> 22 <td align="center"> <form id="postform" name="postform" method="post" action="">23 <textarea class="comment" name="comment" cols="55" rows="5" wrap=" PHYSICAL" style="width: 340px;" onkeyup="limitText(this.form.comment,document.getElementById('countdown'),200);" onkeypress="limitText(this.form.comment,document.getElementById('countdown'),200);"></textarea>21 <tr><td><form id="postform" name="postform" method="post" action=""><table><tr> 22 <td align="center"> 23 <textarea class="comment" name="comment" cols="55" rows="5" wrap="virtual" style="width: 340px;" onkeyup="limitText(this.form.comment,document.getElementById('countdown'),200);" onkeypress="limitText(this.form.comment,document.getElementById('countdown'),200);"></textarea> 24 24 </td> 25 25 </tr> … … 27 27 <td> 28 28 <br/> 29 <span name="countdown" id="countdown">200</span> Letters left<br/>29 <span title="countdown" id="countdown">200</span> Letters left<br/> 30 30 <b>Name:</b> 31 31 <input style="position:relative; right:-3px;" class="comment-button" name="name" type="text" size="24" maxlength="24"> … … 36 36 {/if} 37 37 <input class="comment-button" name="submit" type="submit" value="Add Comment"> 38 </form>39 </td> 38 39 </td></tr></table></form></td> 40 40 </tr> 41 41 </table> -
dev/templates/kill_detail.tpl
r370 r388 94 94 95 95 {if $config->get('fp_show')} 96 <div id="fitting" style="position:relative; height:398px; width:398px; background-image:url({$img_url}/{$themedir}/{$panel_style}.png)" name="fitting">96 <div id="fitting" style="position:relative; height:398px; width:398px; background-image:url({$img_url}/{$themedir}/{$panel_style}.png)" title="fitting"> 97 97 <div id="high0" style="position:absolute; left:0px; top:0px; width:398px; height:398px; z-index:0;"> 98 98 <img src="{$img_url}/{$themedir}/{$ssc->attrib.hiSlots.value}h.gif" border="0" alt=""></div> … … 211 211 {if $admin and $config->get('item_values') and !$fixSlot} 212 212 <tr class="kb-table-row-even"> 213 < form method="post" action="">214 <td height="34" colspan="3" valign="top">213 <td height="34" colspan="4" valign="top" align="right"><form method="post" action=""><table><tr> 214 <td> 215 215 <div align="right"> 216 216 Current single Item Value: … … 219 219 </div></td> 220 220 <td height="34" valign="top"><input type="submit" name="submit" value="UpdateValue" class="comment-button"></td> 221 </ form>221 </tr></table></form></td> 222 222 </tr> 223 223 {/if} … … 250 250 {if $admin and $config->get('item_values') and !$fixSlot} 251 251 <tr class="kb-table-row-even"> 252 < form method="post" action="">253 <td height="34" colspan="3" valign="top">252 <td height="34" colspan="4" valign="top" align="right"><form method="post" action=""><table><tr> 253 <td> 254 254 <div align="right"> 255 255 Current single Item Value: 256 256 <input name="IID" value="{$i.itemID}" type="hidden"> 257 257 <input name="{$i.itemID}" type="text" class="comment-button" value="{$i.single_unit}" size="6"> 258 </div> 258 </div></td> 259 259 <td height="34" valign="top"><input type="submit" name="submit" value="UpdateValue" class="comment-button"></td> 260 </ form>260 </tr></table></form></td> 261 261 </tr> 262 262 {/if}