Changeset 1327 for bb-attachments
- Timestamp:
- 09/04/08 07:13:15 (3 months ago)
- Files:
-
- bb-attachments/trunk/bb-attachments.php (modified) (4 diffs)
- bb-attachments/trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bb-attachments/trunk/bb-attachments.php
r1318 r1327 6 6 Author: _ck_ 7 7 Author URI: http://bbShowcase.org 8 Version: 0.1.1 08 Version: 0.1.11 9 9 10 10 License: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ … … 45 45 $bb_attachments['inline']['solution']="resize"; // resize|frame - images can be either resized or CSS framed to meet above requirement 46 46 // only resize is supported at this time 47 $bb_attachments['inline']['auto']=true; // auto insert uploaded images into post 48 47 49 $bb_attachments['style']=".bb_attachments_link, .bb_attachments_link img {border:0; text-decoration:none; background:none;} #thread .post li {clear:none;}"; 48 50 … … 247 249 248 250 $user_ip=$_SERVER["REMOTE_ADDR"]; // $GLOBALS["HTTP_SERVER_VARS"]["REMOTE_ADDR"]; 249 $time=time(); 251 $time=time(); $inject=""; 250 252 251 253 $bb_post=bb_get_post($post_id); $topic_id=$bb_post->topic_id; // fetch related topic … … 331 333 $error=""; if ($_FILES['bb_attachments']['error'][$key]>0) {$error=" (".$bb_attachments['errors'][$_FILES['bb_attachments']['error'][$key]].") ";} 332 334 $output.="<li><span style='color:red'><strong>$filename "." <span class='num'>(".round($size/1024,1)." KB)</span> ".__('error:')." ".$bb_attachments['status'][$status]."</strong>$error</span></li>"; 333 } else {$output.="<li><span style='color:green'><strong>$filename "." <span class='num'>(".round($size/1024,1)." KB)</span> ".__('successful')."</strong></span></li>";} 335 } else {$output.="<li><span style='color:green'><strong>$filename "." <span class='num'>(".round($size/1024,1)." KB)</span> ".__('successful')."</strong></span></li>"; 336 if ($bb_attachments['inline']['auto']) { 337 if ($display) { 338 $location = bb_attachments_location(); $can_inline=true; 339 if (!($bb_attachments['role']['inline']=="read" || bb_current_user_can($bb_attachments['role']['inline']))) {$can_inline=false;} 340 if ($location=="edit.php" && $can_inline) { 341 $output.='<scr'.'ipt type="text/javascript" defer="defer"> 342 bbat_field = document.getElementsByTagName("textarea")[0]; 343 bbat_value=" [attachment="+'.$post_id.'+","+'.$id.'+"] "; 344 bbat_field.value += bbat_value;</script>'; 345 } // above auto-injects newly uploaded attachment if edit form present 346 } else { $inject.=" [attachment=$post_id,$id]";} 347 } 348 } 334 349 } // end !$empty 335 350 } // end while 336 351 $output.="</ol>"; 337 if ($display) {echo $output;} 352 if ($display) {echo $output;} 353 elseif (!empty($inject) && $bb_attachments['inline']['auto']) {$bb_post->post_text=apply_filters('edit_text', $bb_post->post_text.$inject); bb_insert_post($bb_post);} // auto-inject 338 354 bb_update_topicmeta( $topic_id, 'bb_attachments', $topic_attachments+$offset); 339 355 } bb-attachments/trunk/readme.txt
r1206 r1327 56 56 * 0.1.8 workaround for lack of apache_request_headers, javascript insert bug 57 57 * 0.1.9 handle missing inline images a bit better with "x" icon 58 * 0.1.11 now can auto-insert images into post after upload (default) 58 59 59 60 == To Do ==
