You are here

function forward_top5_list in Forward 5

Same name and namespace in other branches
  1. 6 forward.module \forward_top5_list()
  2. 7 forward.module \forward_top5_list()
  3. 7.2 forward.module \forward_top5_list()
1 call to forward_top5_list()
forward_form_submit in ./forward.module

File

./forward.module, line 1271

Code

function forward_top5_list($query, $base_url, $type) {
  $items = '<ol>';
  $result = db_query_range($query, 0, 5);
  while ($item = db_fetch_object($result)) {
    if ($type == 'user') {
      $items .= '<li>' . l($item->name, 'user/' . $item->uid, array(), NULL, NULL, TRUE) . '</li>';
    }
    elseif ($type == 'comment') {
      $items .= '<li>' . l($item->subject, 'node/' . $item->cid . '#comment-' . $item->cid, array(), NULL, NULL, TRUE) . '</li>';
    }
    else {
      $items .= '<li>' . l($item->title, 'node/' . $item->nid, array(), NULL, NULL, TRUE) . '</li>';
    }
  }
  return $items . '</ol>';
}