--- revision_moderation_original.module	2008-12-28 01:26:42.000000000 +0100
+++ revision_moderation.module	2009-07-09 12:06:06.000000000 +0200
@@ -259,7 +259,8 @@ function revision_moderation_pending_rev
  * Displays list of nodes with pending revisions.
  */
 function theme_revision_moderation_pending_revisions_admin() {
-  $nodes = revision_moderation_get_all_pending_revisions(50);
+  $limit = 25; // The number of revisions to retrieve
+  $nodes = revision_moderation_get_all_pending_revisions($limit);
   if (count($nodes)) {
     $header = array(
       t('Title'),
@@ -276,7 +277,7 @@ function theme_revision_moderation_pendi
         format_date($node->timestamp),
       );
     }
-    return theme('table', $header, $rows);
+    return theme('table', $header, $rows) . theme('pager', $limit);
   }
   else {
     return '<p>'. t('No pending revisions found.') .'</p>';
@@ -287,12 +288,17 @@ function theme_revision_moderation_pendi
  * Retrieve list of all pending revisions.
  *
  * @param $limit
- *  The number of pending revisions to retrieve.
+ *  The number of pending revisions to retrieve. 
+ * @return
+ *  An array of nodes pending revisions, or an empty array if no revisions where found.
  */
 function revision_moderation_get_all_pending_revisions($limit) {
   // Obtain a list of nodes with revisions higher than current published revision.
-  $sql = "SELECT n.nid, r.vid, n.type, r.title, r.body, r.uid, r.timestamp FROM {node} n INNER JOIN {node_revisions} r ON n.nid = r.nid WHERE r.vid > n.vid ORDER BY r.vid DESC LIMIT %d";
-  $result = db_query($sql, $limit);
+  $sql = "SELECT n.nid, r.vid, n.type, r.title, r.body, r.uid, r.timestamp FROM {node} n INNER JOIN {node_revisions} r ON n.nid = r.nid WHERE r.vid > n.vid ORDER BY r.vid DESC";
+  // Counts the total nodes matched to be able to calculate the number of pages for the pager.
+  $count_sql = "SELECT COUNT(*) FROM {node} n INNER JOIN {node_revisions} r ON n.nid = r.nid WHERE r.vid > n.vid";
+  
+  $result = pager_query($sql, $limit, 0, $count_sql);
   $revisions = array();
   while ($revision = db_fetch_object($result)) {
     $revisions[$revision->nid] = $revision;
