Index: paging.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/paging/paging.module,v
retrieving revision 1.15.2.12
diff -u -p -r1.15.2.12 paging.module
--- paging.module	25 Jan 2008 18:07:19 -0000	1.15.2.12
+++ paging.module	3 Jun 2008 23:44:01 -0000
@@ -64,8 +64,22 @@ function paging_settings() {
     '#size' => 20,
     '#maxlength' => 255,
     '#default_value' => PAGING_SEPARATOR,
+    '#required' => TRUE,
     '#description' => t('Page separator string. You should use an HTML tag that will render reasonably when paging is not enabled, such as <em>&lt;!--pagebreak--&gt;</em> or <em>&lt;HR /&gt;</em>.'),
   );
+  $form['paging_config']['paging_position'] = array(
+    '#type' => 'select',
+    '#title' => t('Position of Pager'),
+    '#options' => array(
+      'below' => t('Below content'),
+      'above' => t('Above content'),
+      'both' => t('Below and above content'),
+      'none' => t('Not output'),
+    ),
+    '#default_value' => variable_get('paging_position', 'below'),
+    '#required' => TRUE,
+    '#description' => t('Choose whether the pager should be displayed above and/or below the content.  If set to %none, your theme should output <code>@paging</code>.', array('%none' => t('Not output'), '@paging' => '$node->paging')),
+  );
   $form['paging_config']['paging_read_more_enabled'] = array(
     '#type' => 'checkbox',
     '#title' => t('Link "Read more" to the second page'),
@@ -206,17 +220,26 @@ function _paging_nodeapi(&$node, &$nodeb
           $node->pagemore = true;
         }
       }
+      break;
     case 'alter':
       if (!$node->in_preview && strpos($teaser ? $nodeteaser : $nodebody, '<!--paging_filter-->') !== FALSE) {
-        $element = 1;
+        global $pager_page_array, $pager_total;
+        $element = count($pager_total);
         if (!$teaser && $node->page_count > 1 && arg(2) != 'print' && arg(2) != 'full') {
-          global $pager_page_array, $pager_total;
           $page = isset($_GET['page']) ? $_GET['page'] : '';
           $pager_page_array = explode(',', $page);
           $pager_total[$element] = $node->page_count;
           $page = isset($pager_page_array[$element]) ? $pager_page_array[$element] : 0;
-          $node->body = check_markup($node->pages[$page], $node->format, false);
-          $node->body .= theme('pager', NULL, 1, $element);
+          $node->body = '';
+          $position = variable_get('paging_position', 'below');
+          $node->paging = theme('pager', array(), 1, $element);
+          if ($position == 'above' || $position == 'both') {
+            $node->body .= $node->paging;
+          }
+          $node->body .= check_markup($node->pages[$page], $node->format, false);
+          if ($position == 'below' || $position == 'both') {
+            $node->body .= $node->paging;
+          }
         }
       }
       break;
