Exemple #1
0
 function onJoin()
 {
     $user_count = sizeof($this->Channel->users);
     if ($user_count > $this->Channel->getVar('peak')) {
         if ($this->getConfig('peakshow') === 'yes') {
             $this->reply(sprintf("New channel peak for %s: %d users online. Old one was %d users online at %s (%s ago)", $this->Channel->name, $user_count, $this->Channel->getVar('peak'), $this->Channel->getVar('peak_date'), libTime::secondsToString(libTime::getSecondsDifference(date('r'), $this->Channel->getVar('peak_date')))));
         }
         $this->Channel->saveVar('peak', $user_count);
         $this->Channel->saveVar('peak_date', date('Y-m-d H:i:s'));
     }
 }