smilies_location; } /** * @deprecated 4.0 Use the "BBCodeParser.smilies_location" config setting instead */ public static function set_icon_folder($path) { Deprecation::notice('4.0', 'Use the "BBCodeParser.smilies_location" config setting instead'); static::config()->smilies_location = $path; } /** * @deprecated 4.0 Use the "BBCodeParser.autolink_urls" config setting instead */ public static function autolinkUrls() { Deprecation::notice('4.0', 'Use the "BBCodeParser.autolink_urls" config setting instead'); return static::config()->autolink_urls; } /** * @deprecated 4.0 Use the "BBCodeParser.autolink_urls" config setting instead */ public static function disable_autolink_urls($autolink = false) { Deprecation::notice('4.0', 'Use the "BBCodeParser.autolink_urls" config setting instead'); static::config()->autolink_urls = $autolink; } /** * @deprecated 4.0 Use the "BBCodeParser.allow_smilies" config setting instead */ public static function smiliesAllowed() { Deprecation::notice('4.0', 'Use the "BBCodeParser.allow_smilies" config setting instead'); return static::config()->allow_smilies; } /** * @deprecated 4.0 Use the "BBCodeParser.allow_smilies" config setting instead */ public static function enable_smilies() { Deprecation::notice('4.0', 'Use the "BBCodeParser.allow_smilies" config setting instead'); static::config()->allow_similies = true; } public static function usable_tags() { return new ArrayList( array( new ArrayData(array( "Title" => _t('BBCodeParser.BOLD', 'Bold Text'), "Example" => '[b]'._t('BBCodeParser.BOLDEXAMPLE', 'Bold').'[/b]' )), new ArrayData(array( "Title" => _t('BBCodeParser.ITALIC', 'Italic Text'), "Example" => '[i]'._t('BBCodeParser.ITALICEXAMPLE', 'Italics').'[/i]' )), new ArrayData(array( "Title" => _t('BBCodeParser.UNDERLINE', 'Underlined Text'), "Example" => '[u]'._t('BBCodeParser.UNDERLINEEXAMPLE', 'Underlined').'[/u]' )), new ArrayData(array( "Title" => _t('BBCodeParser.STRUCK', 'Struck-out Text'), "Example" => '[s]'._t('BBCodeParser.STRUCKEXAMPLE', 'Struck-out').'[/s]' )), new ArrayData(array( "Title" => _t('BBCodeParser.COLORED', 'Colored text'), "Example" => '[color=blue]'._t('BBCodeParser.COLOREDEXAMPLE', 'blue text').'[/color]' )), new ArrayData(array( "Title" => _t('BBCodeParser.ALIGNEMENT', 'Alignment'), "Example" => '[align=right]'._t('BBCodeParser.ALIGNEMENTEXAMPLE', 'right aligned').'[/align]' )), new ArrayData(array( "Title" => _t('BBCodeParser.CODE', 'Code Block'), "Description" => _t('BBCodeParser.CODEDESCRIPTION', 'Unformatted code block'), "Example" => '[code]'._t('BBCodeParser.CODEEXAMPLE', 'Code block').'[/code]' )), new ArrayData(array( "Title" => _t('BBCodeParser.EMAILLINK', 'Email link'), "Description" => _t('BBCodeParser.EMAILLINKDESCRIPTION', 'Create link to an email address'), "Example" => "[email]you@yoursite.com[/email]" )), new ArrayData(array( "Title" => _t('BBCodeParser.EMAILLINK', 'Email link'), "Description" => _t('BBCodeParser.EMAILLINKDESCRIPTION', 'Create link to an email address'), "Example" => "[email=you@yoursite.com]Email[/email]" )), new ArrayData(array( "Title" => _t('BBCodeParser.UNORDERED', 'Unordered list'), "Description" => _t('BBCodeParser.UNORDEREDDESCRIPTION', 'Unordered list'), "Example" => '[ulist][*]'._t('BBCodeParser.UNORDEREDEXAMPLE1', 'unordered item 1').'[/ulist]' )), new ArrayData(array( "Title" => _t('BBCodeParser.IMAGE', 'Image'), "Description" => _t('BBCodeParser.IMAGEDESCRIPTION', 'Show an image in your post'), "Example" => "[img]http://www.website.com/image.jpg[/img]" )), new ArrayData(array( "Title" => _t('BBCodeParser.LINK', 'Website link'), "Description" => _t('BBCodeParser.LINKDESCRIPTION', 'Link to another website or URL'), "Example" => '[url]http://www.website.com/[/url]' )), new ArrayData(array( "Title" => _t('BBCodeParser.LINK', 'Website link'), "Description" => _t('BBCodeParser.LINKDESCRIPTION', 'Link to another website or URL'), "Example" => "[url=http://www.website.com/]Website[/url]" )) ) ); } public function useable_tagsHTML(){ $useabletags = ""; } /** * Main BBCode parser method. This takes plain jane content and * runs it through so many filters * * @return Text */ public function parse() { $this->content = str_replace(array('&', '<', '>'), array('&', '<', '>'), $this->content); $p = new SSHTMLBBCodeParser(); $this->content = $p->qparse($this->content); unset($p); $this->content = "

".$this->content."

"; $this->content = preg_replace('/(]*>)\s+/i', '\\1', $this->content); $this->content = preg_replace('/\s+(<\/p[^>]*>)/i', '\\1', $this->content); $this->content = preg_replace("/\n\s*\n/", "

", $this->content); $this->content = str_replace("\n", "
", $this->content); if($this->config()->allow_smilies) { $smilies = array( '#(? " ", // :D '#(? " ", // :) '#(? " ", // :-) '#(? " ", // :( '#(? " ", // :-( '#(? " ", // :p '#(? " ", // 8-) '#(? " " // :^) ); $this->content = preg_replace(array_keys($smilies), array_values($smilies), $this->content); } return $this->content; } }