Beispiel #1
0
 /**
  * BBCodes initialisation. Filling in message::regexp array
  *
  */
 function init_bbcodes()
 {
     $this->regexp[0] = array();
     $this->regexp[1] = array("#\\[b\\](.*?)\\[/b\\]#is" => '<span style="font-weight: bold">\\1</span>', "#\\[i\\](.*?)\\[/i\\]#is" => '<span style="font-style: italic">\\1</span>', "#\\[u\\](.*?)\\[/u\\]#is" => '<span style="text-decoration: underline">\\1</span>', "#\\[del\\](.*?)\\[/del\\]#is" => '<span style="text-decoration: line-through">\\1</span>', "#\\[url\\][\\s\n\r]*(((https?|ftp|ed2k|irc)://)[^ \"\n\r\t\\<]*)[\\s\n\r]*\\[/url\\]#is" => '<a href="\\1" target="_blank">\\1</a>', "#\\[url\\][\\s\n\r]*(www\\.[^ \"\n\r\t\\<]*?)[\\s\n\r]*\\[/url\\]#is" => '<a href="http://\\1" target="_blank">\\1</a>', "#\\[url\\][\\s\n\r]*((ftp)\\.[^ \"\n\r\t\\<]*?)[\\s\n\r]*\\[/url\\]#is" => '<a href="\\2://\\1" target="_blank">\\1</a>', "#\\[url=(\"|&quot;|)(((https?|ftp|ed2k|irc)://)[^ \"\n\r\t\\<]*?)(\"|&quot;|)\\](.*?)\\[/url\\]#is" => '<a href="\\2" target="_blank">\\6</a>', "#\\[url=(\"|&quot;|)(www\\.[^ \"\n\r\t\\<]*?)(\"|&quot;|)\\](.*?)\\[/url\\]#is" => '<a href="http://\\2" target="_blank">\\4</a>', "#\\[url=(\"|&quot;|)((ftp)\\.[^ \"\n\r\t\\<]*?)(\"|&quot;|)\\](.*?)\\[/url\\]#is" => '<a href="\\3://\\2" target="_blank">\\5</a>', "#\\[mailto\\][\\s\n\r]*([a-z0-9&\\-_.]+?@[\\w\\-]+\\.([\\w\\-\\.]+\\.)?[\\w]+)[\\s\n\r]*\\[/mailto\\]#is" => '<a href="mailto:\\1">\\1</a>', "#\\[mailto=(\"|&quot;|)([a-z0-9&\\-_.]+?@[\\w\\-]+\\.([\\w\\-\\.]+\\.)?[\\w]+)(\"|&quot;|)\\](.*?)\\[/mailto\\]#is" => '<a href="mailto:\\2">\\5</a>', "#\\[color=(\"|&quot;|)([\\#\\w]*)(\"|&quot;|)\\](.*?)\\[/color(.*?)\\]#is" => '<span style="color:\\2">\\4</span>', "#\\[size=(\"|&quot;|)([0-9]*)(\"|&quot;|)\\](.*?)\\[/size(.*?)\\]#is" => '<span style="font-size: \\2pt">\\4</span>', "#\\[align=(\"|&quot;|)(left|right|center|justify)(\"|&quot;|)\\](.*?)\\[/align(.*?)\\]#is" => '<div style="text-align: \\2">\\4</span>', "#\\[user\\]([\\d\\w]*?)\\[/user\\]#is" => ' [ <a href="' . RCMS_ROOT_PATH . '?module=user.list&amp;user=\\1">\\1</a> ] ', "#\\[user=([\\d\\w]*?)\\](.*?)\\[/user\\]#is" => ' [ <a href="' . RCMS_ROOT_PATH . '?module=user.list&amp;user=\\1">\\2</a> ] ', "#\\[hidden\\](.*?)\\[/hidden\\]#is" => return_hidden_bb_text());
     $this->regexp[1] = array_merge(get_animated_to_array(), $this->regexp[1]);
     $this->regexp[2] = array("#[\\s\n\r]*\\[img\\][\\s\n\r]*([\\w]+?://[^ \"\n\r\t<]*?)\\.(gif|png|jpe?g)[\\s\n\r]*\\[/img\\][\\s\n\r]*#is" => '<br /><img src="\\1.\\2" alt="" /><br />', "#[\\s\n\r]*\\[img=(\"|&quot;|)(left|right)(\"|&quot;|)\\][\\s\n\r]*([\\w]+?://[^ \"\n\r\t<]*?)\\.(gif|png|jpe?g)[\\s\n\r]*\\[/img\\][\\s\n\r]*#is" => '<img src="\\4.\\5" alt="" align="\\2" />');
 }
Beispiel #2
0
 /**
  * BBCodes initialisation. Filling in message::regexp array
  *
  */
 function init_bbcodes()
 {
     global $system, $lightbox_config;
     $addtolink = empty($system->config['addtolink']) ? '' : $system->config['addtolink'];
     if (empty($lightbox_config['iframe_width'])) {
         $lightbox_config['iframe_width'] = 420;
     }
     if (empty($lightbox_config['iframe_height'])) {
         $lightbox_config['iframe_height'] = 315;
     }
     $this->regexp[0] = array();
     $this->regexp[1] = array("#\\[b\\](.*?)\\[/b\\]#is" => '<span style="font-weight: bold">\\1</span>', "#\\[(h[1-5])\\](.*?)\\[/(h[1-5])\\]#is" => '<\\1>\\2</\\3>', "#\\[i\\](.*?)\\[/i\\]#is" => '<span style="font-style: italic">\\1</span>', "#\\[u\\](.*?)\\[/u\\]#is" => '<span style="text-decoration: underline">\\1</span>', "#\\[del\\](.*?)\\[/del\\]#is" => '<span style="text-decoration: line-through">\\1</span>', "#\\[\\[ul\\]\\](.*?)\\[/\\[ul\\]\\]#is" => '<ul>\\1</ul>', "#\\[\\*\\](.*?)\\[/\\*\\]#is" => '<li>\\1</li>', "#\\[url\\][\\s\n\r]*(((https?|ftp|ed2k|irc)://|" . RCMS_ROOT_PATH . ")[^ \"\n\r\t\\<]*)[\\s\n\r]*\\[/url\\]#is" => '<a href="\\1" ' . $addtolink . '>\\1</a>', "#\\[url\\][\\s\n\r]*((" . RCMS_ROOT_PATH . ")[^ \"\n\r\t\\<]*)[\\s\n\r]*\\[/url\\]#is" => '<a href="\\1" >\\1</a>', "#\\[url\\][\\s\n\r]*(www\\.[^ \"\n\r\t\\<]*?)[\\s\n\r]*\\[/url\\]#is" => '<a href="http://\\1" >\\1</a>', "#\\[url\\][\\s\n\r]*((ftp)\\.[^ \"\n\r\t\\<]*?)[\\s\n\r]*\\[/url\\]#is" => '<a href="\\2://\\1" target="_blank">\\1</a>', "#\\[url=(\"|&quot;|)(((https?|ftp|ed2k|irc)://)[^ \"\n\r\t\\<]*?)(\"|&quot;|)\\](.*?)\\[/url\\]#is" => '<a href="\\2" ' . $addtolink . '>\\6</a>', "#\\[url=(\"|&quot;|)((" . RCMS_ROOT_PATH . ")[^ \"\n\r\t\\<]*?)(\"|&quot;|)\\](.*?)\\[/url\\]#is" => '<a href="\\2" >\\5</a>', "#\\[url=(\"|&quot;|)(www\\.[^ \"\n\r\t\\<]*?)(\"|&quot;|)\\](.*?)\\[/url\\]#is" => '<a href="http://\\2" >\\4</a>', "#\\[url=(\"|&quot;|)((ftp)\\.[^ \"\n\r\t\\<]*?)(\"|&quot;|)\\](.*?)\\[/url\\]#is" => '<a href="\\3://\\2" target="_blank">\\5</a>', "#\\[mailto\\][\\s\n\r]*([a-z0-9&\\-_.]+?@[\\w\\-]+\\.([\\w\\-\\.]+\\.)?[\\w]+)[\\s\n\r]*\\[/mailto\\]#is" => '<a href="mailto:\\1">\\1</a>', "#\\[mailto=(\"|&quot;|)([a-z0-9&\\-_.]+?@[\\w\\-]+\\.([\\w\\-\\.]+\\.)?[\\w]+)(\"|&quot;|)\\](.*?)\\[/mailto\\]#is" => '<a href="mailto:\\2">\\5</a>', "#\\[color=(\"|&quot;|)([\\#\\w]*)(\"|&quot;|)\\](.*?)\\[/color(.*?)\\]#is" => '<span style="color:\\2">\\4</span>', "#\\[size=(\"|&quot;|)([0-9]*)(\"|&quot;|)\\](.*?)\\[/size(.*?)\\]#is" => '<span style="font-size: \\2pt">\\4</span>', "#\\[align=(\"|&quot;|)(left|right|center|justify)(\"|&quot;|)\\](.*?)\\[/align(.*?)\\]#is" => '<div style="text-align: \\2">\\4</div>', "#\\[user\\]([\\d\\w]*?)\\[/user\\]#is" => ' [ <a href="' . RCMS_ROOT_PATH . '?module=user.list&amp;user=\\1">\\1</a> ] ', "#\\[user=([\\d\\w]*?)\\](.*?)\\[/user\\]#is" => ' [ <a href="' . RCMS_ROOT_PATH . '?module=user.list&amp;user=\\1">\\2</a> ] ', "#\\[hidden\\](.*?)\\[/hidden\\]#is" => return_hidden_bb_text());
     $this->regexp[1] = array_merge(get_animated_to_array(), $this->regexp[1]);
     $this->regexp[2] = array("#\\[img\\][\\s\n\r]*([\\w]+?://[^ \"\n\r\t<]*?|" . RCMS_ROOT_PATH . "[^ \"\n\r\t<]*?)\\.(gif|png|jpe?g)[\\s\n\r]*\\[/img\\]#is" => !empty($lightbox_config['articles']) ? ' <a href="\\1.\\2"  class="gallery" title="\\1.\\2"><img src="\\1.\\2" alt="\\2" width="' . $lightbox_config['width'] . 'px" style="padding: 5px;" /></a>' : '<img src="\\1.\\2" alt="\\2" style="padding: 5px;" />', "#\\[img=(\"|&quot;|)([\\d\\w\\.]*?)(\"|&quot;|)\\][\\s\n\r]*([\\w]+?://[^ \"\n\r\t<]*?|" . RCMS_ROOT_PATH . "[^ \"\n\r\t<]*?)\\.(gif|png|jpe?g)[\\s\n\r]*\\[/img\\]#is" => !empty($lightbox_config['articles']) ? ' <a href="\\4.\\5"  class="gallery" title="\\2"><img src="\\4.\\5" alt="\\2" width="' . $lightbox_config['width'] . 'px" style="padding: 5px;" /></a>' : '<img src="\\4.\\5" alt="\\2" style="padding: 5px;" />', "#\\[img=(\"|&quot;|)(left|right)(\"|&quot;|)\\][\\s\n\r]*([\\w]+?://[^ \"\n\r\t<]*?|" . RCMS_ROOT_PATH . "[^ \"\n\r\t<]*?)\\.(gif|png|jpe?g)[\\s\n\r]*\\[/img\\]#is" => ' <img src="\\4.\\5" alt="\\5" align="\\2" style="padding: 5px;" /> ', "#\\[img=(\"|&quot;|)(\\d+)(\"|&quot;|)\\][\\s\n\r]*([\\w]+?://[^ \"\n\r\t<]*?|" . RCMS_ROOT_PATH . "[^ \"\n\r\t<]*?)\\.(gif|png|jpe?g)[\\s\n\r]*\\[/img\\]#is" => ' <img src="\\4.\\5" alt="\\5" width="\\2px" /> ', "#\\[img=(\"|&quot;|)(100%|[1-9]?[0-9]%)(\"|&quot;|)\\][\\s\n\r]*([\\w]+?://[^ \"\n\r\t<]*?|" . RCMS_ROOT_PATH . "[^ \"\n\r\t<]*?)\\.(gif|png|jpe?g)[\\s\n\r]*\\[/img\\]#is" => ' <img src="\\4.\\5" alt="\\5" width="\\2" /> ', '#\\[youtube\\]\\s*[a-zA-Z\\/\\/:\\.]*youtube.com\\/watch\\?v=([a-zA-Z0-9\\-_]+)([a-zA-Z0-9\\/\\*\\-\\_\\?\\&\\;\\%\\=\\.]*)\\[/youtube\\]#is' => '<iframe width="' . $lightbox_config['iframe_width'] . '" height="' . $lightbox_config['iframe_height'] . '" src="https://www.youtube.com/embed/\\1" frameborder="0" allowfullscreen></iframe>');
 }