Changeset 1182
- Timestamp:
- 07/22/08 22:49:21 (4 months ago)
- Files:
-
- bb-attachments/trunk/bb-attachments.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bb-attachments/trunk/bb-attachments.php
r1181 r1182 159 159 if (bb_current_user_can($bb_attachments['role']['delete'])) {$can_delete=true;} 160 160 161 $ file= bb_attachments_location(); $can_inline=true;161 $location = bb_attachments_location(); $can_inline=true; 162 162 if (!($bb_attachments['role']['inline']=="read" || bb_current_user_can($bb_attachments['role']['inline']))) {$can_inline=false;} 163 163 … … 203 203 } 204 204 205 if ($attachment->status==0 && $file=="edit.php" && $can_inline) { 206 $output.=" [<a href='#' onclick='bbatt_inline_insert($attachment->post_id,$attachment->id); return false;'>".__("INSERT")."</a>] "; 205 if ($attachment->status==0 && $location=="edit.php" && $can_inline) { 206 $fullpath=$bb_attachments['path'].floor($file->id/1000)."/".$attachment->id.".".$attachment->filename; 207 if (list($width, $height, $type) = getimagesize($fullpath)) { 208 $output.=" [<strong><a href='#' onclick='bbatt_inline_insert($attachment->post_id,$attachment->id); return false;'>".__("INSERT")."</a></strong>] "; 209 } 207 210 } 208 211 … … 212 215 } 213 216 if ($output) {$output="<h3>".__("Attachments")."</h3><ol>".$output."</ol>";} 214 if ($ file="edit.php") {217 if ($location="edit.php") { 215 218 $output.='<scr'.'ipt type="text/javascript" defer="defer">function bbatt_inline_insert(post_id,id) { 216 219 myField=document.getElementsByTagName("textarea")[0];
