Smiley.module

function _smileys_select_table($promoted = 0) {
  $content = '';
  $show_titles = variable_get('smileys_dialog_titles', TRUE) && !$promoted;
  if ($promoted == 1) {
    $list = _smileys_list(1, " WHERE promote_to_box=1 ORDER BY weight");
  _smileys_list(1);
  }
  else if($promoted == 0) {
    $list = _smileys_list(0 , " WHERE promote_to_box=0 ORDER by weight");
  }
  else if($promoted == -1) {
    $list = _smileys_list(0 , " WHERE promote_to_box=-1 ORDER by weight");
  }
  $first_package = NULL;

....

return $content . ($promoted==0 || $promoted==-1 ? '<br /><br />' : '');

...

function smileys_theme() {
  return array(
    'smileys_select_table' => array(
      'arguments' => array('promoted' => 1),
    ),
  );
}

function theme_smileys_select_table($promoted = 0) {
  return '<div class="smileys">'. _smileys_select_table($promoted) .'</div>';
}