Added register_special_page() function, to make it much easier to create special pages. Also, rewrote Special:Memberlist to use more efficient fetch method and not use an unbuffered whole-table query.
authorDan
Sun, 10 May 2009 14:44:37 -0400
changeset 960 e74741b8360b
parent 959 68a91587271a
child 961 e5abd87bccef
Added register_special_page() function, to make it much easier to create special pages. Also, rewrote Special:Memberlist to use more efficient fetch method and not use an unbuffered whole-table query.
includes/paths.php
plugins/PrivateMessages.php
plugins/SpecialAdmin.php
plugins/SpecialCSS.php
plugins/SpecialGroups.php
plugins/SpecialLog.php
plugins/SpecialPageFuncs.php
plugins/SpecialSearch.php
plugins/SpecialUpdownload.php
plugins/SpecialUserFuncs.php
plugins/SpecialUserPrefs.php
--- a/includes/paths.php	Sun May 10 14:43:00 2009 -0400
+++ b/includes/paths.php	Sun May 10 14:44:37 2009 -0400
@@ -1115,4 +1115,28 @@
   
 }
 
+/**
+ * Register a special page.
+ * @param string urlname of the page ("Administration" in "Special:Administration")
+ * @param string Page title; if in the right format, will be treated as a l10n string identifier
+ * @param bool If true, page is visible (shown in lists/search). Otherwise, hidden. Defaults to true.
+ */
+
+function register_special_page($urlname, $name, $visible = true)
+{
+  global $paths;
+  
+  return $paths->add_page(Array(
+      'name' => $name,
+      'urlname' => $urlname,
+      'namespace' => 'Special',
+      'special' => 0,
+      'visible' => $visible ? 1 : 0,
+      'comments_on' => 0,
+      'protected' => 1,
+      'delvotes' => 0,
+      'delvote_ips' => '',
+    ));
+}
+
 ?>
--- a/plugins/PrivateMessages.php	Sun May 10 14:43:00 2009 -0400
+++ b/plugins/PrivateMessages.php	Sun May 10 14:44:37 2009 -0400
@@ -5,7 +5,7 @@
   "Plugin URI"   : "http://enanocms.org/",
   "Description"  : "plugin_privatemessages_desc",
   "Author"       : "Dan Fuhry",
-  "Version"      : "1.1.5",
+  "Version"      : "1.1.6",
   "Author URI"   : "http://enanocms.org/"
 }
 **!*/
@@ -24,17 +24,9 @@
  
 global $db, $session, $paths, $template, $plugins; // Common objects
 
-// $plugins->attachHook('session_started', 'PrivateMessages_paths_init();');
-
 function PrivateMessages_paths_init()
 {
-  global $paths;
-  $paths->add_page(Array(
-      'name'=>'specialpage_private_messages',
-      'urlname'=>'PrivateMessages',
-      'namespace'=>'Special',
-      'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
+  register_special_page('PrivateMessages', 'specialpage_private_messages');
 }
 
 function page_Special_PrivateMessages()
--- a/plugins/SpecialAdmin.php	Sun May 10 14:43:00 2009 -0400
+++ b/plugins/SpecialAdmin.php	Sun May 10 14:44:37 2009 -0400
@@ -5,7 +5,7 @@
   "Plugin URI"   : "http://enanocms.org/",
   "Description"  : "plugin_specialadmin_desc",
   "Author"       : "Dan Fuhry",
-  "Version"      : "1.1.5",
+  "Version"      : "1.1.6",
   "Author URI"   : "http://enanocms.org/"
 }
 **!*/
@@ -29,19 +29,9 @@
 function SpecialAdmin_paths_init()
 {
   global $paths;
-  $paths->add_page(Array(
-    'name'=>'specialpage_administration',
-    'urlname'=>'Administration',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
   
-  $paths->add_page(Array(
-    'name'=>'specialpage_manage_sidebar',
-    'urlname'=>'EditSidebar',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
+  register_special_page('Administration', 'specialpage_administration');
+  register_special_page('EditSidebar', 'specialpage_manage_sidebar');
 }
 
 $plugins->attachHook('base_classes_initted', 'SpecialAdmin_include();');
--- a/plugins/SpecialCSS.php	Sun May 10 14:43:00 2009 -0400
+++ b/plugins/SpecialCSS.php	Sun May 10 14:44:37 2009 -0400
@@ -5,7 +5,7 @@
   "Plugin URI"   : "http://enanocms.org/",
   "Description"  : "plugin_specialcss_desc",
   "Author"       : "Dan Fuhry",
-  "Version"      : "1.1.5",
+  "Version"      : "1.1.6",
   "Author URI"   : "http://enanocms.org/"
 }
 **!*/
@@ -24,17 +24,10 @@
  
 global $db, $session, $paths, $template, $plugins; // Common objects
 
-// $plugins->attachHook('session_started', 'SpecialCSS_paths_init();');
-
 function SpecialCSS_paths_init()
 {
   global $paths;
-  $paths->add_page(Array(
-    'name'=>'specialpage_css',
-    'urlname'=>'CSS',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>0,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
+  register_special_page('CSS', 'specialpage_css', false);
 }
 
 // function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace>
--- a/plugins/SpecialGroups.php	Sun May 10 14:43:00 2009 -0400
+++ b/plugins/SpecialGroups.php	Sun May 10 14:44:37 2009 -0400
@@ -5,7 +5,7 @@
   "Plugin URI"   : "http://enanocms.org/",
   "Description"  : "plugin_specialgroups_desc",
   "Author"       : "Dan Fuhry",
-  "Version"      : "1.1.5",
+  "Version"      : "1.1.6",
   "Author URI"   : "http://enanocms.org/"
 }
 **!*/
@@ -26,13 +26,7 @@
 
 function SpecialGroups_paths_init()
 {
-  global $paths;
-  $paths->add_page(Array(
-    'name'=>'specialpage_groupcp',
-    'urlname'=>'Usergroups',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
+  register_special_page('Usergroups', 'specialpage_groupcp');
 }
 
 function page_Special_Usergroups()
--- a/plugins/SpecialLog.php	Sun May 10 14:43:00 2009 -0400
+++ b/plugins/SpecialLog.php	Sun May 10 14:44:37 2009 -0400
@@ -24,13 +24,7 @@
 
 function SpecialLog_paths_init()
 {
-  global $paths;
-  $paths->add_page(Array(
-    'name'=>'specialpage_log',
-    'urlname'=>'Log',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
+  register_special_page('Log', 'specialpage_log');
 }
 
 function page_Special_Log()
--- a/plugins/SpecialPageFuncs.php	Sun May 10 14:43:00 2009 -0400
+++ b/plugins/SpecialPageFuncs.php	Sun May 10 14:44:37 2009 -0400
@@ -5,7 +5,7 @@
   "Plugin URI"   : "http://enanocms.org/",
   "Description"  : "plugin_specialpagefuncs_desc",
   "Author"       : "Dan Fuhry",
-  "Version"      : "1.1.5",
+  "Version"      : "1.1.6",
   "Author URI"   : "http://enanocms.org/"
 }
 **!*/
@@ -28,55 +28,13 @@
 
 function SpecialPageFuncs_paths_init()
 {
-  global $paths;
-  $paths->add_page(Array(
-    'name'=>'specialpage_create_page',
-    'urlname'=>'CreatePage',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_all_pages',
-    'urlname'=>'AllPages',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_special_pages',
-    'urlname'=>'SpecialPages',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_about_enano',
-    'urlname'=>'About_Enano',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_gnu_gpl',
-    'urlname'=>'GNU_General_Public_License',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_tag_cloud',
-    'urlname'=>'TagCloud',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_autofill',
-    'urlname'=>'Autofill',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
+  register_special_page('CreatePage', 'specialpage_create_page');
+  register_special_page('AllPages', 'specialpage_all_pages');
+  register_special_page('SpecialPages', 'specialpage_special_pages');
+  register_special_page('About_Enano', 'specialpage_about_enano');
+  register_special_page('GNU_General_Public_License', 'specialpage_gnu_gpl');
+  register_special_page('TagCloud', 'specialpage_tag_cloud');
+  register_special_page('Autofill', 'specialpage_autofill', false);
 }
 
 // function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace>
--- a/plugins/SpecialSearch.php	Sun May 10 14:43:00 2009 -0400
+++ b/plugins/SpecialSearch.php	Sun May 10 14:44:37 2009 -0400
@@ -5,7 +5,7 @@
   "Plugin URI"   : "http://enanocms.org/",
   "Description"  : "plugin_specialsearch_desc",
   "Author"       : "Dan Fuhry",
-  "Version"      : "1.1.5",
+  "Version"      : "1.1.6",
   "Author URI"   : "http://enanocms.org/"
 }
 **!*/
@@ -26,20 +26,8 @@
 
 function SpecialSearch_paths_init()
 {
-  global $paths;
-  $paths->add_page(Array(
-    'name'=>'specialpage_search_rebuild',
-    'urlname'=>'SearchRebuild',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_search',
-    'urlname'=>'Search',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
+  register_special_page('SearchRebuild', 'specialpage_search_rebuild');
+  register_special_page('Search', 'specialpage_search');
 }
 
 function page_Special_SearchRebuild()
--- a/plugins/SpecialUpdownload.php	Sun May 10 14:43:00 2009 -0400
+++ b/plugins/SpecialUpdownload.php	Sun May 10 14:44:37 2009 -0400
@@ -5,7 +5,7 @@
   "Plugin URI"   : "http://enanocms.org/",
   "Description"  : "plugin_specialupdownload_desc",
   "Author"       : "Dan Fuhry",
-  "Version"      : "1.1.5",
+  "Version"      : "1.1.6",
   "Author URI"   : "http://enanocms.org/"
 }
 **!*/
@@ -29,22 +29,10 @@
 
 function SpecialUpDownload_paths_init()
 {
-  global $paths;
-  $paths->add_page(Array(
-    'name'=>'specialpage_upload_file',
-    'urlname'=>'UploadFile',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
+  register_special_page('UploadFile', 'specialpage_upload_file');
+  register_special_page('DownloadFile', 'specialpage_download_file');
+}
   
-  $paths->add_page(Array(
-    'name'=>'specialpage_download_file',
-    'urlname'=>'DownloadFile',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-}
-
 function page_Special_UploadFile()
 {
   global $db, $session, $paths, $template, $plugins; // Common objects
--- a/plugins/SpecialUserFuncs.php	Sun May 10 14:43:00 2009 -0400
+++ b/plugins/SpecialUserFuncs.php	Sun May 10 14:44:37 2009 -0400
@@ -5,7 +5,7 @@
   "Plugin URI"   : "http://enanocms.org/",
   "Description"  : "plugin_specialuserfuncs_desc",
   "Author"       : "Dan Fuhry",
-  "Version"      : "1.1.5",
+  "Version"      : "1.1.6",
   "Author URI"   : "http://enanocms.org/"
 }
 **!*/
@@ -28,87 +28,18 @@
 
 function SpecialUserFuncs_paths_init()
 {
-  global $paths;
-  $paths->add_page(Array(
-    'name'=>'specialpage_log_in',
-    'urlname'=>'Login',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  $paths->add_page(Array(
-    'name'=>'specialpage_log_out',
-    'urlname'=>'Logout',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  $paths->add_page(Array(
-    'name'=>'specialpage_register',
-    'urlname'=>'Register',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  $paths->add_page(Array(
-    'name'=>'specialpage_preferences',
-    'urlname'=>'Preferences',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_contributions',
-    'urlname'=>'Contributions',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_change_theme',
-    'urlname'=>'ChangeStyle',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_activate_account',
-    'urlname'=>'ActivateAccount',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_captcha',
-    'urlname'=>'Captcha',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_password_reset',
-    'urlname'=>'PasswordReset',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-  
-  $paths->add_page(Array(
-    'name'=>'specialpage_member_list',
-    'urlname'=>'Memberlist',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-    
-  $paths->add_page(Array(
-    'name'=>'specialpage_language_export',
-    'urlname'=>'LangExportJSON',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>0,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
-    
-  $paths->add_page(Array(
-    'name'=>'specialpage_avatar',
-    'urlname'=>'Avatar',
-    'namespace'=>'Special',
-    'special'=>0,'visible'=>0,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
-    ));
+  register_special_page('Login', 'specialpage_log_in');
+  register_special_page('Logout', 'specialpage_log_out');
+  register_special_page('Register', 'specialpage_register');
+  register_special_page('Preferences', 'specialpage_preferences');
+  register_special_page('Contributions', 'specialpage_contributions');
+  register_special_page('ChangeStyle', 'specialpage_change_theme');
+  register_special_page('ActivateAccount', 'specialpage_activate_account');
+  register_special_page('Captcha', 'specialpage_captcha');
+  register_special_page('PasswordReset', 'specialpage_password_reset');
+  register_special_page('Memberlist', 'specialpage_member_list');
+  register_special_page('LangExportJSON', 'specialpage_language_export', false);
+  register_special_page('Avatar', 'specialpage_avatar', false);
 }
 
 // function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace>
@@ -1641,7 +1572,9 @@
   }
   
   // offset
-  $offset = ( isset($_GET['offset']) && strval(intval($_GET['offset'])) === $_GET['offset']) ? intval($_GET['offset']) : 0;
+  $perpage = 25;
+  $page = (( isset($_GET['offset']) && strval(intval($_GET['offset'])) === $_GET['offset']) ? intval($_GET['offset']) : 1) - 1;
+  $offset = $page * $perpage;
   
   // sort order
   $sortkeys = array(
@@ -1719,11 +1652,11 @@
                </tr>';
                
   // determine number of rows
-  $q = $db->sql_query('SELECT u.user_id FROM '.table_prefix.'users AS u WHERE ' . $username_where . ' AND u.username != \'Anonymous\';');
+  $q = $db->sql_query('SELECT COUNT(u.user_id) FROM '.table_prefix.'users AS u WHERE ' . $username_where . ' AND u.username != \'Anonymous\';');
   if ( !$q )
     $db->_die();
   
-  $num_rows = $db->numrows();
+  list($num_rows) = $db->fetchrow_num();
   $db->free_result();
   
   if ( !empty($finduser_url) )
@@ -1731,7 +1664,7 @@
     switch ( $num_rows )
     {
       case 0:
-        $str = $lang->get('userfuncs_ml_msg_matches_zero'); break;
+        $str = ''; /* $lang->get('userfuncs_ml_msg_matches_zero'); */ break;
       case 1:
         $str = $lang->get('userfuncs_ml_msg_matches_one'); break;
       default:
@@ -1742,14 +1675,15 @@
   
   // main selector
   $pgsql_additional_group_by = ( ENANO_DBLAYER == 'PGSQL' ) ? ', u.username, u.reg_time, u.email, u.user_level, u.user_has_avatar, u.avatar_type, x.email_public' : '';
-  $q = $db->sql_unbuffered_query('SELECT \'\' AS infobit, u.user_id, u.username, u.reg_time, u.email, u.user_level, u.user_has_avatar, u.avatar_type, x.email_public, COUNT(c.comment_id) AS num_comments FROM '.table_prefix.'users AS u
+  $q = $db->sql_query('SELECT \'\' AS infobit, u.user_id, u.username, u.reg_time, u.email, u.user_level, u.user_has_avatar, u.avatar_type, x.email_public, COUNT(c.comment_id) AS num_comments FROM '.table_prefix.'users AS u
                                     LEFT JOIN '.table_prefix.'users_extra AS x
                                       ON ( u.user_id = x.user_id )
                                     LEFT JOIN ' . table_prefix . 'comments AS c
                                       ON ( u.user_id = c.user_id )
                                     WHERE ' . $username_where . ' AND u.username != \'Anonymous\'
                                     GROUP BY u.user_id' . $pgsql_additional_group_by . '
-                                    ORDER BY ' . $sort_sqllet . ' ' . $target_order . ';');
+                                    ORDER BY ' . $sort_sqllet . ' ' . $target_order . '
+                                    LIMIT ' . $perpage . ' OFFSET ' . $offset . ';');
   if ( !$q )
     $db->_die();
   
@@ -1763,56 +1697,61 @@
     'infobit' => array($formatter, 'infobit')
     );
   
-  $html = paginate(
-            $q,                                                                                                       // MySQL result resource
-            '<tr>
-               <td class="{_css_class}">{user_id}</td>
-               <td class="{_css_class}" style="text-align: left;">{username}</td>
-               <td class="{_css_class}">{user_level}</td>
-               <td class="{_css_class}">{email}</small></td>
-               <td class="{_css_class}">{reg_time}</td>
-             </tr>
-             <tr>
-               <td colspan="5" class="row3" style="text-align: left;">
-                 <div id="ml_moreinfo_{user_id}" style="display: none;">
-                   {infobit}
+  $result_url = makeUrlNS('Special', 'Memberlist', ( str_replace('%', '%%', $finduser_url) ) . 'letter=' . $startletter . '&offset=%s&sort=' . $sortby . '&orderby=' . $target_order );
+  $paginator = generate_paginator($page, ceil($num_rows / $perpage), $result_url);
+  
+  if ( $num_rows > 0 )
+  {
+    if ( $num_rows > $perpage )
+      echo $paginator;
+    
+    echo '<div class="tblholder">
+                <table border="0" cellspacing="1" cellpadding="4" style="text-align: center;">
+                  ' . $headings;
+                  
+    $i = 0;
+    while ( $row = $db->fetchrow($q) )
+    {
+      $i++;
+      $cls = ( $i % 2 == 0 ) ? 'row2' : 'row1';
+      echo '<tr>';
+      echo '<td class="' . $cls . '">' . $row['user_id'] . '</td>';
+      echo '<td class="' . $cls . '" style="text-align: left;">' . $formatter->username($row['username'], $row) . '</td>';
+      echo '<td class="' . $cls . '">' . $formatter->user_level($row['user_level'], $row) . '</td>';
+      echo '<td class="' . $cls . '">' . $formatter->email($row['email'], $row) . '</td>';
+      echo '<td class="' . $cls . '">' . $formatter->reg_time($row['reg_time'], $row) . '</td>';
+      echo '</tr>';
+      echo '<tr>';
+      echo '<td colspan="5" class="row3" style="text-align: left;">
+                 <div id="ml_moreinfo_' . $row['user_id'] . '" style="display: none;">
+                   ' . $formatter->infobit(true, $row) . '
                  </div>
-               </td>
-             </tr>
-             ',                                                                                                       // TPL code for rows
-             $num_rows,                                                                                               // Number of results
-             makeUrlNS('Special', 'Memberlist', ( str_replace('%', '%%', $finduser_url) ) . 'letter=' . $startletter . '&offset=%s&sort=' . $sortby . '&orderby=' . $target_order ), // Result URL
-             $offset,                                                                                                 // Start at this number
-             25,                                                                                                      // Results per page
-             $formatters,                                                                                             // Formatting hooks
-             '<div class="tblholder">
-                <table border="0" cellspacing="1" cellpadding="4" style="text-align: center;">
-                  ' . $headings . '
-                 ',                                                                                                   // Header (printed before rows)
-             '  ' . $headings . '
+               </td>';
+      echo '</tr>';
+    }
+    
+    echo '  ' . $headings . '
                  </table>
               </div>
-              ' .
-              '<div style="float: left;">
-                <form action="' . makeUrlNS('Special', 'Memberlist') . '" method="get" onsubmit="if ( !submitAuthorized ) return false;">'
-               . ( urlSeparator == '&' ? '<input type="hidden" name="title" value="' . htmlspecialchars( $paths->page ) . '" />' : '' )
-               . ( $session->sid_super ? '<input type="hidden" name="auth"  value="' . $session->sid_super . '" />' : '')
-               . '<p>' . $lang->get('userfuncs_ml_lbl_finduser') . ' ' . $template->username_field('finduser') . ' <input type="submit" value="' . $lang->get('userfuncs_ml_btn_go') . '" /><br />
-                  <small>' . $lang->get('userfuncs_ml_tip_wildcard') . '</small></p>'
-               . '</form>
-               </div>'                                                                                                // Footer (printed after rows)
-          );
-  
-  if ( $num_rows < 1 )
-  {
-    echo ( isset($_GET['finduser']) ) ? '<p>' . $lang->get('userfuncs_ml_err_nousers_find') . '</p>' :
-                                        '<p>' . $lang->get('userfuncs_ml_err_nousers') . '</p>';
+              ';
+    
+    if ( $num_rows > $perpage )
+      echo $paginator;
   }
   else
   {
-    echo $html;
+    echo '<h2 class="emptymessage">' . $lang->get('log_msg_no_results') . '</h2>';
   }
   
+  echo '<div style="float: left;">
+          <form action="' . makeUrlNS('Special', 'Memberlist') . '" method="get" onsubmit="if ( !submitAuthorized ) return false;">'
+         . ( urlSeparator == '&' ? '<input type="hidden" name="title" value="' . htmlspecialchars( $paths->page ) . '" />' : '' )
+         . ( $session->sid_super ? '<input type="hidden" name="auth"  value="' . $session->sid_super . '" />' : '')
+         . '<p>' . $lang->get('userfuncs_ml_lbl_finduser') . ' ' . $template->username_field('finduser') . ' <input type="submit" value="' . $lang->get('userfuncs_ml_btn_go') . '" /><br />
+            <small>' . $lang->get('userfuncs_ml_tip_wildcard') . '</small></p>'
+         . '</form>
+         </div>';
+  
   $template->footer();
 }
 
--- a/plugins/SpecialUserPrefs.php	Sun May 10 14:43:00 2009 -0400
+++ b/plugins/SpecialUserPrefs.php	Sun May 10 14:44:37 2009 -0400
@@ -5,7 +5,7 @@
   "Plugin URI"   : "http://enanocms.org/",
   "Description"  : "plugin_specialuserprefs_desc",
   "Author"       : "Dan Fuhry",
-  "Version"      : "1.1.5",
+  "Version"      : "1.1.6",
   "Author URI"   : "http://enanocms.org/"
 }
 **!*/