"watchdog_cron", "admin" => "watchdog_admin"); function watchdog_cron() { watchdog_clean(); } function watchdog_display($order = "date") { $colors = array("#D8BFD8", "#6495ED", "#6A5ADF", "#FFFFFF", "#FFA500", "#FF3C3C"); $fields = array("date" => "id DESC", "username" => "user", "location" => "location", "message" => "message DESC", "level" => "level DESC"); // Perform query: $result = db_query("SELECT l.*, u.userid FROM watchdog l LEFT JOIN users u ON l.user = u.id ORDER BY l.$fields[$order]"); // Generate output: $output .= "\n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; while ($watchdog = db_fetch_object($result)) { $output .= " level] ."\">\n"; } $output .= "
\n"; $output .= "
\n"; $output .= " \n"; $output .= " \n"; $output .= "
\n"; $output .= "
datemessageuseroperations
". format_date($watchdog->timestamp) ."". substr(check_output($watchdog->message), 0, 44) ."". format_username($watchdog->userid, 1) ."id\">details
\n"; print $output; } function watchdog_view($id) { $result = db_query("SELECT l.*, u.userid FROM watchdog l LEFT JOIN users u ON l.user = u.id WHERE l.id = $id"); if ($watchdog = db_fetch_object($result)) { $output .= "\n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= "
Level:$watchdog->level
Date:". format_date($watchdog->timestamp, "extra large") ."
User:". format_username($watchdog->userid, 1) ."
Location:$watchdog->location
Message:$watchdog->message
Hostname:$watchdog->hostname
\n"; print $output; } } function watchdog_admin() { global $op, $id, $order; switch ($op) { case "view": watchdog_view($id); break; case "Update": watchdog_display($order); break; default: watchdog_display(); } } ?>