4 function array_sort($array, $on, $order=SORT_ASC
) {
6 $sortable_array = array();
7 if (count($array) > 0) {
8 foreach ($array as $k => $v) {
10 foreach ($v as $k2 => $v2) {
12 $sortable_array[$k] = $v2;
16 $sortable_array[$k] = $v;
22 asort($sortable_array);
25 arsort($sortable_array);
29 foreach ($sortable_array as $k => $v) {
30 $new_array[$k] = $array[$k];
38 echo "Conversation Count | Be Messaging Monitoring System".PHP_EOL
;
42 $dir = file(DB_PATH
."idlist.log");
43 foreach($dir as $key){
44 $array[0] = explode("<><>", $key);
45 $worldofArray['directory'] = $inbox->loggedEmail($array[0][1], MDB_PATH
);
46 $worldofArray['id'] = $array[0][0];
47 if(is_dir($worldofArray['directory'])){
50 $hi = explode("/", $worldofArray['directory']);
51 $strReplaced = trim($array[0][1]);
52 // echo $strReplaced.PHP_EOL;
53 foreach (glob($worldofArray['directory']."*.dat") as $filename){
54 // echo $filename.PHP_EOL;
55 // while(($file = readdir($d))!==false){
57 $fi = fopen($filename, "r");
62 $linecount = $linecount-1;
63 // echo $linecount . "||". $filename.PHP_EOL
64 if(isset($arrayContainer[$strReplaced])){
65 if($arrayContainer[$strReplaced]['msgcount'] < $linecount){
66 $arrayContainer[$strReplaced] = array('msgcount' => $linecount, 'email' => $strReplaced, 'filename' => $filename);
70 $arrayContainer[$strReplaced] = array('msgcount' => $linecount, 'email' => $strReplaced, 'filename' => $filename);
75 $arrayContainer = array_sort($arrayContainer, 'msgcount', SORT_DESC
);
76 $arrayContainer = array_values($arrayContainer);
79 for ($i=0; $i <= 10; $i++
) {
80 if(isset($arrayContainer[$i]))
81 echo "{$arrayContainer[$i]['filename']} || ".trim($arrayContainer[$i]['email'])." || {$arrayContainer[$i]['msgcount']}".PHP_EOL
;