--- inline.module~	Sun Jan  9 22:00:42 2005
+++ inline.module	Mon Jan 24 14:40:16 2005
@@ -16,7 +16,9 @@
   }
 }
 function inline_settings() {
-  return form_textfield(t('Maximum width and height for the displayed inline images (format: XXX,YYY)'), 'inline_img_dim', variable_get('inline_img_dim', '150,150'), 10, 10, t('This setting will affect the dimensions of displayed images. They will not be resized.'));
+  $output = form_textfield(t('Maximum width and height for the displayed inline images (format: XXX,YYY)'), 'inline_img_dim', variable_get('inline_img_dim', '150,150'), 10, 10, t('This setting will affect the dimensions of displayed images. They will not be resized.'));
+  $output .= form_textfield(t('Extra style attributes to inline images'), 'inline_extra_style', variable_get('inline_extra_style', ''), 60, 100, t('With this setting you can add css style attributes to inline images, e.g. float: right; will make the images float to the right.'));
+  return $output;
 }
 
 function inline_filter($op, $delta = 0, $format = -1, $text = '') {
@@ -102,7 +104,7 @@
 
 function _inline_filename(&$node, $id) {
   if (is_numeric($id)) {
-    $n=1;
+    $n = 1;
     foreach ($node->files as $file) {
       if ($n == $id) {
         //return array($file->filename, file_create_url($file->filepath));
@@ -128,24 +130,25 @@
   $extensions = 'jpg jpeg gif png';
   $regex = '/\.('. ereg_replace(' +', '|', preg_quote($extensions)) .')$/i';
   if (preg_match($regex, $filepath) && $allow_inline_image) {
-    $f_dim=getimagesize($filepath);
-    $f_width=$f_dim[0];
-    $f_height=$f_dim[1];
-    $ratio = 0; if ($f_height) $ratio=($f_width*100)/$f_height;
+    $f_dim = getimagesize($filepath);
+    $f_width = $f_dim[0];
+    $f_height = $f_dim[1];
+    $ratio = 0; if ($f_height) $ratio = ($f_width*100)/$f_height;
     // read settings
-    $dim=explode(',',variable_get('inline_img_dim', '150,150'));
-    $width=$dim[0];
-    $height=$dim[0];
+    $dim = explode(',',variable_get('inline_img_dim', '150,150'));
+    $extra_style = variable_get('inline_extra_style', '');
+    $width = $dim[0];
+    $height = $dim[0];
     // maintain aspect ration
     if ($f_width > $width)   {
-       $f_width=$width;
-       $f_height=intval($f_width*100/$ratio);
+       $f_width = $width;
+       $f_height = intval($f_width*100/$ratio);
     }
     if ($title != "") {
-      $html = '<img style="width: '.$f_width.'px; height: '.$f_height.'px;" src="'. $filepath. '" class="inline" alt="'. $title .'" title="'.$title.'">';
+      $html = '<img style="width: '.$f_width.'px; height: '.$f_height.'px; '.$extra_style.'" src="'. $filepath. '" class="inline" alt="'. $title .'" title="'.$title.'">';
     } 
     else {
-      $html = '<img style="width: '.$f_width.'px; height: '.$f_height.'px;" src="'. $filepath. '" class="inline" alt="">';
+      $html = '<img style="width: '.$f_width.'px; height: '.$f_height.'px; '.$extra_style.'" src="'. $filepath. '" class="inline" alt="">';
     }
   }
   else {
