--- modules/chatblock/chatblock.module.orig 2009-03-01 21:09:12.000000000 +0100 +++ modules/chatblock/chatblock.module 2009-03-01 21:03:39.000000000 +0100 @@ -185,10 +185,12 @@ function chatblock_database($op, $messag // get the maximum messageid $max = db_result(db_query("SELECT MAX(messageid) FROM {chatblock}")); + $min = db_result(db_query("SELECT MIN(messageid) FROM {chatblock}")); + $msg_count = $max - $min; if ($limit) { // find the place to start our limit - $start = $max - $limit; + $start = $msg_count - $limit; // no negative starting values in db queries if ($start < 0) { @@ -492,7 +494,7 @@ function chatblock_logs_page_view() { } foreach ($messages as $timestamp => $row) { $message = chatblock_filter_message($row['message']); - $output .= '
'.$row['username'].': '. $message .'
'; + $output .= '
'.$row['username'].': '. $message .'
'; } $output .= theme_pager(array(), 20, 0); return $output;