Commit 3701c02e authored by Dries's avatar Dries

- Small watchdog module optimization by Morbus.

parent d279d16c
......@@ -85,7 +85,6 @@ function watchdog_overview($type = '') {
foreach (_watchdog_get_message_types() as $key) {
$query[$key] = "WHERE type = '". check_query($key) ."'";
}
$query['actions'] = "WHERE link != ''";
$header = array(
array('data' => t('date'), 'field' => 'w.timestamp', 'sort' => 'desc'),
......@@ -93,8 +92,7 @@ function watchdog_overview($type = '') {
array('data' => t('user'), 'field' => 'u.name'),
array('data' => t('operations'), 'colspan' => '2')
);
$sql = 'SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid '. ($type ? $query[$type] : '');
$sql .= tablesort_sql($header);
$sql = 'SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid '. ($type ? $query[$type] : '') . tablesort_sql($header);
$result = pager_query($sql, 50);
while ($watchdog = db_fetch_object($result)) {
......
......@@ -85,7 +85,6 @@ function watchdog_overview($type = '') {
foreach (_watchdog_get_message_types() as $key) {
$query[$key] = "WHERE type = '". check_query($key) ."'";
}
$query['actions'] = "WHERE link != ''";
$header = array(
array('data' => t('date'), 'field' => 'w.timestamp', 'sort' => 'desc'),
......@@ -93,8 +92,7 @@ function watchdog_overview($type = '') {
array('data' => t('user'), 'field' => 'u.name'),
array('data' => t('operations'), 'colspan' => '2')
);
$sql = 'SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid '. ($type ? $query[$type] : '');
$sql .= tablesort_sql($header);
$sql = 'SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid '. ($type ? $query[$type] : '') . tablesort_sql($header);
$result = pager_query($sql, 50);
while ($watchdog = db_fetch_object($result)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment