scorify the emoticons extension
This commit is contained in:
parent
737d2f4268
commit
fc9eddd08b
@ -6,22 +6,14 @@
|
||||
* Description: Turn :smile: into a link to smile.gif
|
||||
*/
|
||||
|
||||
class Emoticons implements Extension {
|
||||
public function receive_event(Event $event) {
|
||||
if($event instanceof TextFormattingEvent) {
|
||||
$event->formatted = $this->bbcode_to_html($event->formatted);
|
||||
$event->stripped = $this->bbcode_to_text($event->stripped);
|
||||
}
|
||||
}
|
||||
|
||||
private function bbcode_to_html($text) {
|
||||
class Emoticons extends FormatterExtension {
|
||||
public function format($text) {
|
||||
$data_href = get_base_href();
|
||||
$text = preg_replace("/:([a-z]*?):/s", "<img src='$data_href/ext/emoticons/default/\\1.gif'>", $text);
|
||||
return $text;
|
||||
}
|
||||
|
||||
private function bbcode_to_text($text) {
|
||||
// $text = preg_replace("/:([a-z]*?):/s", "\\1", $text);
|
||||
public function strip($text) {
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user