Exemplo n.º 1
0
 public function formatMessage(Event $event)
 {
     $message = strip_tags($event->getData());
     $message = preg_replace('/\\[b\\](.+?)\\[\\/b\\]/is', '<span style="font-weight:bold">$1</span>', $message);
     $message = preg_replace('/\\[u\\](.+?)\\[\\/u\\]/is', '<span style="text-decoration:underline">$1</span>', $message);
     $message = preg_replace('/\\[url=([^\\[\\]]+)\\](.+?)\\[\\/url\\]/is', '<a href="$1">$2</a>', $message);
     $message = preg_replace('/\\[url\\](.+?)\\[\\/url\\]/is', '<a href="$1">$1</a>', $message);
     return nl2br($message);
 }
Exemplo n.º 2
0
 public function makePost(Event $event)
 {
     $result = '<div style="padding: 9px 16px;border:1px solid #EEE;margin-bottom:16px;">' . '<strong>Posted by</strong> ' . $this->podiya->publish(new Event('format_username', $event->getData('username'), $this)) . ' (' . $this->podiya->publish(new Event('format_group', $event->getData('group'), $this)) . ')<br /><strong>Posted Date</strong> ' . $this->podiya->publish(new Event('format_date', $event->getData('date'), $this)) . '<br />' . $this->podiya->publish(new Event('format_message', $event->getData('message'), $this)) . '</div>';
     return $result;
 }
Exemplo n.º 3
0
 public function betterDate(Event $event)
 {
     return date('F j, Y h:i:s A T', $event->getData());
 }
Exemplo n.º 4
0
 public function fancyPost(Event $event)
 {
     return str_replace('border:1px solid #EEE;', 'border:1px solid #DADADA;background:#F1F1F1;font-family:Arial;font-size:15px;', $event->getPreviousResult());
 }