Преглед на файлове

Merge pull request #1544 from moteus/dashboard_session_count

Fix. Display session count on User Dashboard.
Nate преди 9 години
родител
ревизия
35076a925d
променени са 1 файла, в които са добавени 7 реда и са изтрити 8 реда
  1. 7 8
      core/user_settings/user_dashboard.php

+ 7 - 8
core/user_settings/user_dashboard.php

@@ -1092,14 +1092,13 @@
 
 			//channel count
 				if ($fp) {
-					$tmp = event_socket_request($fp, 'api show channels');
-					$tmp = explode("\n", $tmp);
-					$tmp = preg_replace('!\s+!', ' ', trim($tmp[3]));
-					$tmp = explode(' ', $tmp);
-					$tmp = $tmp[0];
-					$channels = (is_numeric($tmp)) ? $tmp : 0;
-					$hud[$n]['html'] .= "<tr class='tr_link_void'>\n";
-					$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-channels']."</td>\n";
+					$tmp = event_socket_request($fp, 'api status');
+					$matches = Array();
+					preg_match("/(\d+)\s+session\(s\)\s+\-\speak/", $tmp, $matches);
+					$channels = $matches[1] ? $matches[1] : 0;
+					$tr_link = "href='".PROJECT_PATH."/app/calls_active/calls_active.php'";
+					$hud[$n]['html'] .= "<tr ".$tr_link." style='cursor: pointer;'>\n";
+					$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text'><a href='javascript:void(0);'>".$text['label-channels']."</a></td>\n";
 					$hud[$n]['html'] .= "<td valign='top' class='".$row_style[$c]." hud_text' style='text-align: right;'>".$channels."</td>\n";
 					$hud[$n]['html'] .= "</tr>\n";
 					$c = ($c) ? 0 : 1;