Example #1
0
 public function statsAction()
 {
     $this->view->threads = Posts::count();
     $this->view->replies = Posts::sum(array('column' => 'number_replies'));
     $this->view->votes = Posts::sum(array('column' => 'votes_up + votes_down'));
     $this->view->users = Users::count();
     $this->view->karma = Users::sum(array('column' => 'karma'));
     $this->view->notifications = Notifications::count();
     $this->view->unotifications = ActivityNotifications::count();
     $this->view->views = Posts::sum(array('column' => 'number_views'));
     $this->view->irc = IrcLog::count();
 }
Example #2
0
 /**
  * Shows the latest activity on the IRC
  */
 public function ircAction()
 {
     $parameters = ['order' => 'datelog DESC', 'limit' => 250];
     $ircLog = IrcLog::find($parameters);
     $activities = [];
     foreach ($ircLog as $log) {
         $who = explode('@', $log->who);
         $parts = explode('!', $who[0]);
         $log->who = substr($parts[0], 1);
         $activities[] = $log;
     }
     $this->view->setVar('activities', array_reverse($activities));
     $this->tag->setTitle('Recent Activity on the IRC');
 }
Example #3
0
 public function statsAction()
 {
     $this->breadcrumbs->add('Help', '/help')->add('Statistics', '/help/stats', ['linked' => false]);
     $this->tag->setTitle("Statistics");
     $this->view->setVars(['threads' => Posts::count(), 'replies' => Posts::sum(['column' => 'number_replies']), 'votes' => Posts::sum(['column' => 'votes_up + votes_down']), 'users' => Users::count(), 'karma' => Users::sum(['column' => 'karma']), 'notifications' => Notifications::count(), 'unotifications' => ActivityNotifications::count(), 'views' => Posts::sum(['column' => 'number_views']), 'irc' => IrcLog::count()]);
 }