/**
  * Renders shortcode: [wise-chat-channel-stats]
  *
  * @param array $attributes
  * @return string
  */
 public function getRenderedChannelStatsShortcode($attributes)
 {
     if (!is_array($attributes)) {
         $attributes = array();
     }
     $attributes['channel'] = $this->service->getValidChatChannelName(array_key_exists('channel', $attributes) ? $attributes['channel'] : '');
     $channel = $this->channelsDAO->getByName($attributes['channel']);
     if ($channel !== null) {
         $this->options->replaceOptions($attributes);
         $this->messagesService->startUpMaintenance($channel);
         return $this->renderer->getRenderedChannelStats($channel);
     } else {
         return 'ERROR: channel does not exist';
     }
 }
Exemple #2
0
 /**
  * Shortcode backend function: [wise-chat]
  *
  * @param array $attributes
  * @return string
  */
 public function getRenderedShortcode($attributes)
 {
     if (!is_array($attributes)) {
         $attributes = array();
     }
     $attributes['channel'] = $this->service->getValidChatChannelName(array_key_exists('channel', $attributes) ? $attributes['channel'] : '');
     $this->options->replaceOptions($attributes);
     $this->shortCodeOptions = $attributes;
     return $this->getRenderedChat($attributes['channel']);
 }
 private function verifyCheckSum()
 {
     $checksum = $this->getParam('checksum');
     if ($checksum !== null) {
         $decoded = unserialize(WiseChatCrypt::decrypt(base64_decode($checksum)));
         if (is_array($decoded)) {
             $this->options->replaceOptions($decoded);
         }
     }
 }