Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $maxs[0] = '0|Flood';
- $maxs[1] = '20|Ban ASN';
- $maxs[2] = '80|Max Conn.';
- $maxs[3] = '40|DDoS';
- public function getTops($maxs, $types = null, $tops = null){
- $top = 0;
- $names = "";
- foreach ($maxs as $key){
- $type = explode('|', $key);
- $types[$type[0]] = $type[0];
- }
- foreach ($types as $key){
- $max = max($types);
- $keyname = $key;
- $name = '';
- foreach ($maxs as $key2){
- $value = explode('|', $key2);
- if ($value[0] == $max && !(strpos($names, $value[1]) !== false)){
- $name = $value[1];
- $names .= ','. $value[1];
- break;
- }
- }
- $tops[$top]['Name'] = $name;
- $tops[$top]['Progress'] = $max;
- unset($types[$max]);
- $top++;
- }
- return $tops;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement