Changeset 1205
- Timestamp:
- 07/28/08 04:43:32 (4 months ago)
- Files:
-
- bb-attachments/trunk/bb-attachments.php (modified) (3 diffs)
- bb-attachments/trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bb-attachments/trunk/bb-attachments.php
r1191 r1205 6 6 Author: _ck_ 7 7 Author URI: http://bbShowcase.org 8 Version: 0.1. 78 Version: 0.1.8 9 9 10 10 License: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ … … 214 214 } 215 215 if ($output) {$output="<h3>".__("Attachments")."</h3><ol>".$output."</ol>";} 216 if ($location="edit.php") { 217 $output.='<scr'.'ipt type="text/javascript" defer="defer">function bbat_inline_insert(post_id,id) { 218 myValue="[attachment="+post_id+","+id+"]"; 219 if (document.selection) {myField.focus();sel = document.selection.createRange();sel.text = myValue;} 220 else if (myField.selectionStart || myField.selectionStart == "0") {var startPos = myField.selectionStart; var endPos = myField.selectionEnd; 221 myField.value = myField.value.substring(0, startPos)+ myValue+ myField.value.substring(endPos, myField.value.length); 222 } else {myField.value += myValue;} 216 if ($location=="edit.php") { 217 $output.='<scr'.'ipt type="text/javascript" defer="defer"> 218 function bbat_inline_insert(post_id,id) { 219 bbat_field = document.getElementsByTagName("textarea")[0]; 220 bbat_value="[attachment="+post_id+","+id+"]"; 221 if (document.selection) {bbat_field.focus(); sel = document.selection.createRange();sel.text = bbat_value;} 222 else if (bbat_field.selectionStart || bbat_field.selectionStart == "0") {var startPos = bbat_field.selectionStart; var endPos = bbat_field.selectionEnd; 223 bbat_field.value = bbat_field.value.substring(0, startPos)+ bbat_value+ bbat_field.value.substring(endPos, bbat_field.value.length); 224 } else {bbat_field.value += bbat_value;} 223 225 return false;} </script>'; 224 226 } … … 424 426 } 425 427 426 $headers = apache_request_headers(); 428 // $headers = apache_request_headers(); $ifModifiedSince=$headers['If-Modified-Since']; 429 $ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : false; 427 430 $filemtime=filemtime($fullpath); 428 431 $httpcode="200"; 429 if ( isset($headers['If-Modified-Since']) && (strtotime($headers['If-Modified-Since']) == $filemtime)) {$httpcode="304";}432 if ($ifModifiedSince && (strtotime($ifModifiedSince) >= $filemtime)) {$httpcode="304";} 430 433 if (ini_get('zlib.output_compression')) {ini_set('zlib.output_compression', 'Off');} // fix for IE 431 434 header('Last-Modified: '.gmdate('D, d M Y H:i:s', $filemtime).' GMT', true, $httpcode); bb-attachments/trunk/readme.txt
r1185 r1205 53 53 * 0.1.5 first attempt at inline image display ability 54 54 * 0.1.6 BBcode replacement for inserted inline attachment 55 * 0.1.7 bug squashed for IIS ? 56 * 0.1.8 workaround for lack of apache_request_headers, javascript insert bug 55 57 56 58 == To Do ==
