Changeset 1182

Show
Ignore:
Timestamp:
07/22/08 22:49:21 (4 months ago)
Author:
_ck_
Message:

a bit more polish (no bump)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bb-attachments/trunk/bb-attachments.php

    r1181 r1182  
    159159        if (bb_current_user_can($bb_attachments['role']['delete'])) {$can_delete=true;} 
    160160         
    161         $file = bb_attachments_location();     $can_inline=true; 
     161        $location = bb_attachments_location();         $can_inline=true; 
    162162        if (!($bb_attachments['role']['inline']=="read" || bb_current_user_can($bb_attachments['role']['inline']))) {$can_inline=false;} 
    163163                 
     
    203203                                } 
    204204 
    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                                        } 
    207210                                }                                                
    208211         
     
    212215        } 
    213216if ($output) {$output="<h3>".__("Attachments")."</h3><ol>".$output."</ol>";} 
    214 if ($file="edit.php") { 
     217if ($location="edit.php") { 
    215218$output.='<scr'.'ipt type="text/javascript" defer="defer">function bbatt_inline_insert(post_id,id) { 
    216219        myField=document.getElementsByTagName("textarea")[0];