[drupal-devel] Multiple sortable tables on one page?

Tim Altman web at timaltman.com
Tue Jul 26 19:05:19 UTC 2005


On Tue, 26 Jul 2005 20:35:41 +0200, Evan Heidtmann  
<evan.heidtmann at gmail.com> wrote:

> The pager API provides a nice way to have multiple page-able tables on
> one page: the $element argument to theme('pager') and pager_query().
>
> But as far as I can tell, there is no way to do the same with the
> tablesort API. Am I mistaken?

	I think so.  Check out  
http://drupaldocs.org/api/4.6/function/comment_admin_overview.   
Specifically, the following lines should do what you want (IINM):

   $sql = 'SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp,  
c.status, c.name, c.homepage, u.name AS registered_name, u.uid FROM  
{comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = '.  
db_escape_string($status);
   $sql .= tablesort_sql($header);
   $result = pager_query($sql, 50);

-- 
Tim Altman



More information about the drupal-devel mailing list