xuanxuan.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. class admin extends control
  3. {
  4. /**
  5. * Configuration of xuanxuan.
  6. *
  7. * @access public
  8. * @return void
  9. */
  10. public function xuanxuan()
  11. {
  12. $this->app->loadLang('client');
  13. $xxdStatus = $this->loadModel('im')->getXxdStatus();
  14. $lastPoll = $this->loadModel('setting')->getItem("owner=system&module=common&section=xxd&key=lastPoll");
  15. $polling = !empty($this->config->xuanxuan->pollingInterval) ? $this->config->xuanxuan->pollingInterval : 0;
  16. $xxdStart = !empty($this->config->xxd->start) ? $this->config->xxd->start : '';
  17. $runtimeLabel = $this->lang->client->xxdStartDate;
  18. $runtimeValue = $xxdStart ?: $this->lang->client->noData;
  19. if(!empty($lastPoll) && $xxdStatus == 'online' && $polling < 600 && !empty($this->config->xxd))
  20. {
  21. $runtimeLabel = $this->lang->client->xxdRunTime;
  22. $runtimeValue = $xxdStart ? $this->im->getXxdRunTime(strtotime(helper::now()) - strtotime($xxdStart)) : $this->lang->client->noData;
  23. }
  24. $this->view->title = $this->lang->im->common;
  25. $this->view->onlineUsers = $xxdStatus == 'offline' ? 0 : count($this->loadModel('im')->userGetList('online'));
  26. $this->view->totalUsers = count($this->loadModel('im')->userGetList());
  27. $this->view->totalGroups = count($this->im->chatGetGroupPairs());
  28. $this->view->messages = $this->im->messageGetCountForBlock();
  29. $this->view->fileSize = $this->admin->getXxcAllFileSize();
  30. $this->view->polling = $polling ? $polling . 's' : $this->lang->client->noData;
  31. $this->view->lastPoll = $lastPoll;
  32. $this->view->xxdStatus = $xxdStatus;
  33. $this->view->runtimeLabel = $runtimeLabel;
  34. $this->view->runtimeValue = $runtimeValue;
  35. $this->display();
  36. }
  37. }