emoticons formatter
git-svn-id: file:///home/shish/svn/shimmie2/trunk@243 7f39781d-f577-437e-ae19-be835c7a54ca
BIN
contrib/emoticons/default/arrow.gif
Executable file
After Width: | Height: | Size: 170 B |
BIN
contrib/emoticons/default/biggrin.gif
Executable file
After Width: | Height: | Size: 172 B |
BIN
contrib/emoticons/default/confused.gif
Executable file
After Width: | Height: | Size: 171 B |
BIN
contrib/emoticons/default/cool.gif
Executable file
After Width: | Height: | Size: 172 B |
BIN
contrib/emoticons/default/cry.gif
Executable file
After Width: | Height: | Size: 498 B |
BIN
contrib/emoticons/default/eek.gif
Executable file
After Width: | Height: | Size: 170 B |
BIN
contrib/emoticons/default/evil.gif
Executable file
After Width: | Height: | Size: 236 B |
BIN
contrib/emoticons/default/exclaim.gif
Executable file
After Width: | Height: | Size: 236 B |
BIN
contrib/emoticons/default/frown.gif
Executable file
After Width: | Height: | Size: 171 B |
BIN
contrib/emoticons/default/idea.gif
Executable file
After Width: | Height: | Size: 176 B |
BIN
contrib/emoticons/default/lol.gif
Executable file
After Width: | Height: | Size: 336 B |
BIN
contrib/emoticons/default/mad.gif
Executable file
After Width: | Height: | Size: 174 B |
BIN
contrib/emoticons/default/mrgreen.gif
Executable file
After Width: | Height: | Size: 349 B |
BIN
contrib/emoticons/default/neutral.gif
Executable file
After Width: | Height: | Size: 171 B |
BIN
contrib/emoticons/default/question.gif
Executable file
After Width: | Height: | Size: 248 B |
BIN
contrib/emoticons/default/razz.gif
Executable file
After Width: | Height: | Size: 176 B |
BIN
contrib/emoticons/default/redface.gif
Executable file
After Width: | Height: | Size: 650 B |
BIN
contrib/emoticons/default/rolleyes.gif
Executable file
After Width: | Height: | Size: 485 B |
BIN
contrib/emoticons/default/sad.gif
Executable file
After Width: | Height: | Size: 171 B |
BIN
contrib/emoticons/default/smile.gif
Executable file
After Width: | Height: | Size: 174 B |
BIN
contrib/emoticons/default/surprised.gif
Executable file
After Width: | Height: | Size: 174 B |
BIN
contrib/emoticons/default/twisted.gif
Executable file
After Width: | Height: | Size: 238 B |
BIN
contrib/emoticons/default/wink.gif
Executable file
After Width: | Height: | Size: 170 B |
24
contrib/emoticons/main.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
class Emoticons extends Extension {
|
||||
public function receive_event($event) {
|
||||
if(is_a($event, 'TextFormattingEvent')) {
|
||||
$event->formatted = $this->bbcode_to_html($event->formatted);
|
||||
$event->stripped = $this->bbcode_to_text($event->stripped);
|
||||
}
|
||||
}
|
||||
|
||||
private function bbcode_to_html($text) {
|
||||
global $config;
|
||||
$data_href = $config->get_string("data_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);
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
add_event_listener(new Emoticons());
|
||||
?>
|