--- shoutbox/shoutbox.module 2006-03-17 22:37:03.000000000 +0100 +++ shoutbox.new/shoutbox.module 2006-06-19 22:45:30.000000000 +0200 @@ -429,7 +429,11 @@ $links = theme('shoutbox_links'); // get array of links $color = 0; - $result = db_query("SELECT * FROM {shoutbox} WHERE status=1 ORDER BY created LIMIT %d", $show_amount); + $show_start = count_shouts() - $show_amount; + if ($show_start < 0) { + $show_start = 0; + } + $result = db_query("SELECT * FROM {shoutbox} WHERE status=1 ORDER BY created LIMIT %d, %d", $show_start, $show_amount); while ($shout = db_fetch_object($result)) { // all filtering (including urls, email addresses, censored words, and emoticons) is handled by the drupal filter system $shout->nick = check_markup($shout->nick); @@ -745,4 +749,4 @@ return $links; } -?> \ No newline at end of file +?>