I'm using the pushbuttons theme and the style.css defines

img {
  display: block;
  border: 0;
}

So the smileys always appears in a new line.
I had to change the smileys.module and include an [code]style="display: inline;"[/code] into each img tag. The changed function ended this way:

function smileys_filter_process($text) {
  $text = ' '. $text .' ';

  $list = _smileys_list();
  foreach ($list as $smiley) {
    $acronyms = explode(" ", $smiley->acronyms);
    $alt = str_replace('\\', '\\\\', drupal_specialchars($smiley->description));
    foreach ($acronyms as $a) {
      if ($smiley->standalone)
        $text = eregi_replace("([ ,\.\?!:\(\)\r\n\<\>])". preg_quote($a) ."([ ,\.\?!:\(\)\r\n\<\>])", "\\1<img style=\"display: inline;\" src=\"". ($smiley->image) ."\" alt=\"". $alt ."\" >\\2", $text);
      else
        $text = eregi_replace(preg_quote($a), '<img style="display: inline;" src="/'. ($smiley->image) .'" alt="'. $alt .'" >', $text);
    }
  }
  $text = substr($text, 1, -1);

  return $text;
}

Comments

Marduk’s picture

and so, the smileys are always inline, even if the theme configure the img to block.
btw: above i mean style="display: inline;", not [code]style="display: inline;"[/code]

kzeng’s picture

It's really helpful!

--------------------------
http://www.kzeng.info