22 lines
482 B
PHP
Raw Normal View History

<?php
/**
* Name: Emoticon Filter
* Author: Shish <webmaster@shishnet.org>
* License: GPLv2
* Description: Turn :smile: into a link to smile.gif
*/
2009-01-04 08:33:32 -08:00
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;
}
2009-01-04 08:33:32 -08:00
public function strip($text) {
return $text;
}
}
add_event_listener(new Emoticons());
?>