MyBB Community Forums

Full Version: Sort Banned IP Addresses
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I like to sort IPs in a meaningful order. When selecting banned IPs, I suggest we sort them based on octets:

$query = $db->simple_select("banfilters", "*",
"type='{$type}'",
array("order_by" => "INET_ATON(REPLACE(filter, '*', 0)), filter",
"order_dir"=>"asc"));

Any wildcard bannings get sorted in the right place, too. ASCII sorting is almost meaningless.
Feel free to submit a pull request for this Wink