Advertisement
Guest User

Untitled

a guest
Sep 8th, 2014
2,670
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 20.90 KB | None | 0 0
  1. array(
  2.                 'tag' => 'abbr',
  3.                 'type' => 'unparsed_equals',
  4.                 'before' => '<abbr title="$1">',
  5.                 'after' => '</abbr>',
  6.                 'quoted' => 'optional',
  7.                 'disabled_after' => ' ($1)',
  8.             ),
  9.             array(
  10.                 'tag' => 'acronym',
  11.                 'type' => 'unparsed_equals',
  12.                 'before' => '<acronym title="$1">',
  13.                 'after' => '</acronym>',
  14.                 'quoted' => 'optional',
  15.                 'disabled_after' => ' ($1)',
  16.             ),
  17.             array(
  18.                 'tag' => 'anchor',
  19.                 'type' => 'unparsed_equals',
  20.                 'test' => '[#]?([A-Za-z][A-Za-z0-9_\-]*)\]',
  21.                 'before' => '<span id="post_$1">',
  22.                 'after' => '</span>',
  23.             ),
  24.             array(
  25.                 'tag' => 'b',
  26.                 'before' => '<strong>',
  27.                 'after' => '</strong>',
  28.             ),
  29.             array(
  30.                 'tag' => 'bdo',
  31.                 'type' => 'unparsed_equals',
  32.                 'before' => '<bdo dir="$1">',
  33.                 'after' => '</bdo>',
  34.                 'test' => '(rtl|ltr)\]',
  35.                 'block_level' => true,
  36.             ),
  37.             array(
  38.                 'tag' => 'black',
  39.                 'before' => '<span style="color: black;" class="bbc_color">',
  40.                 'after' => '</span>',
  41.             ),
  42.             array(
  43.                 'tag' => 'blue',
  44.                 'before' => '<span style="color: blue;" class="bbc_color">',
  45.                 'after' => '</span>',
  46.             ),
  47.             array(
  48.                 'tag' => 'br',
  49.                 'type' => 'closed',
  50.                 'content' => '<br />',
  51.             ),
  52.             array(
  53.                 'tag' => 'center',
  54.                 'before' => '<div align="center">',
  55.                 'after' => '</div>',
  56.                 'block_level' => true,
  57.             ),
  58.             array(
  59.                 'tag' => 'code',
  60.                 'type' => 'unparsed_content',
  61.                 'content' => '<div class="codeheader">' . $txt['code'] . ': <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '<pre style="margin: 0; padding: 0;">' : '') . '<code class="bbc_code">$1</code>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '</pre>' : ''),
  62.                 // !!! Maybe this can be simplified?
  63.                 'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', '
  64.                     global $context;
  65.  
  66.                     if (!isset($disabled[\'code\']))
  67.                     {
  68.                         $php_parts = preg_split(\'~(&lt;\?php|\?&gt;)~\', $data, -1, PREG_SPLIT_DELIM_CAPTURE);
  69.  
  70.                         for ($php_i = 0, $php_n = count($php_parts); $php_i < $php_n; $php_i++)
  71.                         {
  72.                             // Do PHP code coloring?
  73.                             if ($php_parts[$php_i] != \'&lt;?php\')
  74.                                 continue;
  75.  
  76.                             $php_string = \'\';
  77.                             while ($php_i + 1 < count($php_parts) && $php_parts[$php_i] != \'?&gt;\')
  78.                             {
  79.                                 $php_string .= $php_parts[$php_i];
  80.                                 $php_parts[$php_i++] = \'\';
  81.                             }
  82.                             $php_parts[$php_i] = highlight_php_code($php_string . $php_parts[$php_i]);
  83.                         }
  84.  
  85.                         // Fix the PHP code stuff...
  86.                         $data = str_replace("<pre style=\"display: inline;\">\t</pre>", "\t", implode(\'\', $php_parts));
  87.  
  88.                         // Older browsers are annoying, aren\'t they?
  89.                         if ($context[\'browser\'][\'is_ie4\'] || $context[\'browser\'][\'is_ie5\'] || $context[\'browser\'][\'is_ie5.5\'])
  90.                             $data = str_replace("\t", "<pre style=\"display: inline;\">\t</pre>", $data);
  91.                         else
  92.                             $data = str_replace("\t", "<span style=\"white-space: pre;\">\t</span>", $data);
  93.  
  94.                         // Recent Opera bug requiring temporary fix. &nsbp; is needed before </code> to avoid broken selection.
  95.                         if ($context[\'browser\'][\'is_opera\'])
  96.                             $data .= \'&nbsp;\';
  97.                     }'),
  98.                 'block_level' => true,
  99.             ),
  100.             array(
  101.                 'tag' => 'code',
  102.                 'type' => 'unparsed_equals_content',
  103.                 'content' => '<div class="codeheader">' . $txt['code'] . ': ($2) <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '<pre style="margin: 0; padding: 0;">' : '') . '<code class="bbc_code">$1</code>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '</pre>' : ''),
  104.                 // !!! Maybe this can be simplified?
  105.                 'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', '
  106.                     global $context;
  107.  
  108.                     if (!isset($disabled[\'code\']))
  109.                     {
  110.                         $php_parts = preg_split(\'~(&lt;\?php|\?&gt;)~\', $data[0], -1, PREG_SPLIT_DELIM_CAPTURE);
  111.  
  112.                         for ($php_i = 0, $php_n = count($php_parts); $php_i < $php_n; $php_i++)
  113.                         {
  114.                             // Do PHP code coloring?
  115.                             if ($php_parts[$php_i] != \'&lt;?php\')
  116.                                 continue;
  117.  
  118.                             $php_string = \'\';
  119.                             while ($php_i + 1 < count($php_parts) && $php_parts[$php_i] != \'?&gt;\')
  120.                             {
  121.                                 $php_string .= $php_parts[$php_i];
  122.                                 $php_parts[$php_i++] = \'\';
  123.                             }
  124.                             $php_parts[$php_i] = highlight_php_code($php_string . $php_parts[$php_i]);
  125.                         }
  126.  
  127.                         // Fix the PHP code stuff...
  128.                         $data[0] = str_replace("<pre style=\"display: inline;\">\t</pre>", "\t", implode(\'\', $php_parts));
  129.  
  130.                         // Older browsers are annoying, aren\'t they?
  131.                         if ($context[\'browser\'][\'is_ie4\'] || $context[\'browser\'][\'is_ie5\'] || $context[\'browser\'][\'is_ie5.5\'])
  132.                             $data[0] = str_replace("\t", "<pre style=\"display: inline;\">\t</pre>", $data[0]);
  133.                         else
  134.                             $data[0] = str_replace("\t", "<span style=\"white-space: pre;\">\t</span>", $data[0]);
  135.  
  136.                         // Recent Opera bug requiring temporary fix. &nsbp; is needed before </code> to avoid broken selection.
  137.                         if ($context[\'browser\'][\'is_opera\'])
  138.                             $data[0] .= \'&nbsp;\';
  139.                     }'),
  140.                 'block_level' => true,
  141.             ),
  142.             array(
  143.                 'tag' => 'color',
  144.                 'type' => 'unparsed_equals',
  145.                 'test' => '(#[\da-fA-F]{3}|#[\da-fA-F]{6}|[A-Za-z]{1,20}|rgb\(\d{1,3}, ?\d{1,3}, ?\d{1,3}\))\]',
  146.                 'before' => '<span style="color: $1;" class="bbc_color">',
  147.                 'after' => '</span>',
  148.             ),
  149.             array(
  150.                 'tag' => 'email',
  151.                 'type' => 'unparsed_content',
  152.                 'content' => '<a href="mailto:$1" class="bbc_email">$1</a>',
  153.                 // !!! Should this respect guest_hideContacts?
  154.                 'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
  155.             ),
  156.             array(
  157.                 'tag' => 'email',
  158.                 'type' => 'unparsed_equals',
  159.                 'before' => '<a href="mailto:$1" class="bbc_email">',
  160.                 'after' => '</a>',
  161.                 // !!! Should this respect guest_hideContacts?
  162.                 'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
  163.                 'disabled_after' => ' ($1)',
  164.             ),
  165.             array(
  166.                 'tag' => 'flash',
  167.                 'type' => 'unparsed_commas_content',
  168.                 'test' => '\d+,\d+\]',
  169.                 'content' => ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'] ? '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="$2" height="$3"><param name="movie" value="$1" /><param name="play" value="true" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="AllowScriptAccess" value="never" /><embed src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed></object>' : '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed>'),
  170.                 'validate' => create_function('&$tag, &$data, $disabled', '
  171.                     if (isset($disabled[\'url\']))
  172.                         $tag[\'content\'] = \'$1\';
  173.                     elseif (strpos($data[0], \'http://\') !== 0 && strpos($data[0], \'https://\') !== 0)
  174.                         $data[0] = \'http://\' . $data[0];
  175.                 '),
  176.                 'disabled_content' => '<a href="$1" target="_blank" class="new_win">$1</a>',
  177.             ),
  178.             array(
  179.                 'tag' => 'font',
  180.                 'type' => 'unparsed_equals',
  181.                 'test' => '[A-Za-z0-9_,\-\s]+?\]',
  182.                 'before' => '<span style="font-family: $1;" class="bbc_font">',
  183.                 'after' => '</span>',
  184.             ),
  185.             array(
  186.                 'tag' => 'ftp',
  187.                 'type' => 'unparsed_content',
  188.                 'content' => '<a href="$1" class="bbc_ftp new_win" target="_blank">$1</a>',
  189.                 'validate' => create_function('&$tag, &$data, $disabled', '
  190.                     $data = strtr($data, array(\'<br />\' => \'\'));
  191.                     if (strpos($data, \'ftp://\') !== 0 && strpos($data, \'ftps://\') !== 0)
  192.                         $data = \'ftp://\' . $data;
  193.                 '),
  194.             ),
  195.             array(
  196.                 'tag' => 'ftp',
  197.                 'type' => 'unparsed_equals',
  198.                 'before' => '<a href="$1" class="bbc_ftp new_win" target="_blank">',
  199.                 'after' => '</a>',
  200.                 'validate' => create_function('&$tag, &$data, $disabled', '
  201.                     if (strpos($data, \'ftp://\') !== 0 && strpos($data, \'ftps://\') !== 0)
  202.                         $data = \'ftp://\' . $data;
  203.                 '),
  204.                 'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
  205.                 'disabled_after' => ' ($1)',
  206.             ),
  207.             array(
  208.                 'tag' => 'glow',
  209.                 'type' => 'unparsed_commas',
  210.                 'test' => '[#0-9a-zA-Z\-]{3,12},([012]\d{1,2}|\d{1,2})(,[^]]+)?\]',
  211.                 'before' => $context['browser']['is_ie'] ? '<table border="0" cellpadding="0" cellspacing="0" style="display: inline; vertical-align: middle; font: inherit;"><tr><td style="filter: Glow(color=$1, strength=$2); font: inherit;">' : '<span style="text-shadow: $1 1px 1px 1px">',
  212.                 'after' => $context['browser']['is_ie'] ? '</td></tr></table> ' : '</span>',
  213.             ),
  214.             array(
  215.                 'tag' => 'green',
  216.                 'before' => '<span style="color: green;" class="bbc_color">',
  217.                 'after' => '</span>',
  218.             ),
  219.             array(
  220.                 'tag' => 'html',
  221.                 'type' => 'unparsed_content',
  222.                 'content' => '$1',
  223.                 'block_level' => true,
  224.                 'disabled_content' => '$1',
  225.             ),
  226.             array(
  227.                 'tag' => 'hr',
  228.                 'type' => 'closed',
  229.                 'content' => '<hr />',
  230.                 'block_level' => true,
  231.             ),
  232.             array(
  233.                 'tag' => 'i',
  234.                 'before' => '<em>',
  235.                 'after' => '</em>',
  236.             ),
  237.             array(
  238.                 'tag' => 'img',
  239.                 'type' => 'unparsed_content',
  240.                 'parameters' => array(
  241.                     'alt' => array('optional' => true),
  242.                     'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
  243.                     'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
  244.                 ),
  245.                 'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',
  246.                 'validate' => create_function('&$tag, &$data, $disabled', '
  247.                     $data = strtr($data, array(\'<br />\' => \'\'));
  248.                     if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
  249.                         $data = \'http://\' . $data;
  250.                 '),
  251.                 'disabled_content' => '($1)',
  252.             ),
  253.             array(
  254.                 'tag' => 'img',
  255.                 'type' => 'unparsed_content',
  256.                 'content' => '<img src="$1" alt="" class="bbc_img" />',
  257.                 'validate' => create_function('&$tag, &$data, $disabled', '
  258.                     $data = strtr($data, array(\'<br />\' => \'\'));
  259.                     if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
  260.                         $data = \'http://\' . $data;
  261.                 '),
  262.                 'disabled_content' => '($1)',
  263.             ),
  264.             array(
  265.                 'tag' => 'iurl',
  266.                 'type' => 'unparsed_content',
  267.                 'content' => '<a href="$1" class="bbc_link">$1</a>',
  268.                 'validate' => create_function('&$tag, &$data, $disabled', '
  269.                     $data = strtr($data, array(\'<br />\' => \'\'));
  270.                     if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
  271.                         $data = \'http://\' . $data;
  272.                 '),
  273.             ),
  274.             array(
  275.                 'tag' => 'iurl',
  276.                 'type' => 'unparsed_equals',
  277.                 'before' => '<a href="$1" class="bbc_link">',
  278.                 'after' => '</a>',
  279.                 'validate' => create_function('&$tag, &$data, $disabled', '
  280.                     if (substr($data, 0, 1) == \'#\')
  281.                         $data = \'#post_\' . substr($data, 1);
  282.                     elseif (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
  283.                         $data = \'http://\' . $data;
  284.                 '),
  285.                 'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
  286.                 'disabled_after' => ' ($1)',
  287.             ),
  288.             array(
  289.                 'tag' => 'left',
  290.                 'before' => '<div style="text-align: left;">',
  291.                 'after' => '</div>',
  292.                 'block_level' => true,
  293.             ),
  294.             array(
  295.                 'tag' => 'li',
  296.                 'before' => '<li>',
  297.                 'after' => '</li>',
  298.                 'trim' => 'outside',
  299.                 'require_parents' => array('list'),
  300.                 'block_level' => true,
  301.                 'disabled_before' => '',
  302.                 'disabled_after' => '<br />',
  303.             ),
  304.             array(
  305.                 'tag' => 'list',
  306.                 'before' => '<ul class="bbc_list">',
  307.                 'after' => '</ul>',
  308.                 'trim' => 'inside',
  309.                 'require_children' => array('li', 'list'),
  310.                 'block_level' => true,
  311.             ),
  312.             array(
  313.                 'tag' => 'list',
  314.                 'parameters' => array(
  315.                     'type' => array('match' => '(none|disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-alpha|upper-alpha|lower-greek|lower-latin|upper-latin|hebrew|armenian|georgian|cjk-ideographic|hiragana|katakana|hiragana-iroha|katakana-iroha)'),
  316.                 ),
  317.                 'before' => '<ul class="bbc_list" style="list-style-type: {type};">',
  318.                 'after' => '</ul>',
  319.                 'trim' => 'inside',
  320.                 'require_children' => array('li'),
  321.                 'block_level' => true,
  322.             ),
  323.             array(
  324.                 'tag' => 'ltr',
  325.                 'before' => '<div dir="ltr">',
  326.                 'after' => '</div>',
  327.                 'block_level' => true,
  328.             ),
  329.             array(
  330.                 'tag' => 'me',
  331.                 'type' => 'unparsed_equals',
  332.                 'before' => '<div class="meaction">* $1 ',
  333.                 'after' => '</div>',
  334.                 'quoted' => 'optional',
  335.                 'block_level' => true,
  336.                 'disabled_before' => '/me ',
  337.                 'disabled_after' => '<br />',
  338.             ),
  339.             array(
  340.                 'tag' => 'move',
  341.                 'before' => '<marquee>',
  342.                 'after' => '</marquee>',
  343.                 'block_level' => true,
  344.                 'disallow_children' => array('move'),
  345.             ),
  346.             array(
  347.                 'tag' => 'nobbc',
  348.                 'type' => 'unparsed_content',
  349.                 'content' => '$1',
  350.             ),
  351.             array(
  352.                 'tag' => 'php',
  353.                 'type' => 'unparsed_content',
  354.                 'content' => '<span class="phpcode">$1</span>',
  355.                 'validate' => isset($disabled['php']) ? null : create_function('&$tag, &$data, $disabled', '
  356.                     if (!isset($disabled[\'php\']))
  357.                     {
  358.                         $add_begin = substr(trim($data), 0, 5) != \'&lt;?\';
  359.                         $data = highlight_php_code($add_begin ? \'&lt;?php \' . $data . \'?&gt;\' : $data);
  360.                         if ($add_begin)
  361.                             $data = preg_replace(array(\'~^(.+?)&lt;\?.{0,40}?php(?:&nbsp;|\s)~\', \'~\?&gt;((?:</(font|span)>)*)$~\'), \'$1\', $data, 2);
  362.                     }'),
  363.                 'block_level' => false,
  364.                 'disabled_content' => '$1',
  365.             ),
  366.             array(
  367.                 'tag' => 'pre',
  368.                 'before' => '<pre>',
  369.                 'after' => '</pre>',
  370.             ),
  371.             array(
  372.                 'tag' => 'quote',
  373.                 'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote'] . '</div></div><blockquote>',
  374.                 'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div>',
  375.                 'block_level' => true,
  376.             ),
  377.             array(
  378.                 'tag' => 'quote',
  379.                 'parameters' => array(
  380.                     'author' => array('match' => '(.{1,192}?)', 'quoted' => true),
  381.                 ),
  382.                 'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote_from'] . ': {author}</div></div><blockquote>',
  383.                 'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div>',
  384.                 'block_level' => true,
  385.             ),
  386.             array(
  387.                 'tag' => 'quote',
  388.                 'type' => 'parsed_equals',
  389.                 'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote_from'] . ': $1</div></div><blockquote>',
  390.                 'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div>',
  391.                 'quoted' => 'optional',
  392.                 // Don't allow everything to be embedded with the author name.
  393.                 'parsed_tags_allowed' => array('url', 'iurl', 'ftp'),
  394.                 'block_level' => true,
  395.             ),
  396.             array(
  397.                 'tag' => 'quote',
  398.                 'parameters' => array(
  399.                     'author' => array('match' => '([^<>]{1,192}?)'),
  400.                     'link' => array('match' => '(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?|action=profile;u=\d+)'),
  401.                     'date' => array('match' => '(\d+)', 'validate' => 'timeformat'),
  402.                 ),
  403.                 'before' => '<div class="quoteheader"><div class="topslice_quote"><a href="' . $scripturl . '?{link}">' . $txt['quote_from'] . ': {author} ' . $txt['search_on'] . ' {date}</a></div></div><blockquote>',
  404.                 'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div>',
  405.                 'block_level' => true,
  406.             ),
  407.             array(
  408.                 'tag' => 'quote',
  409.                 'parameters' => array(
  410.                     'author' => array('match' => '(.{1,192}?)'),
  411.                 ),
  412.                 'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote_from'] . ': {author}</div></div><blockquote>',
  413.                 'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div>',
  414.                 'block_level' => true,
  415.             ),
  416.             array(
  417.                 'tag' => 'red',
  418.                 'before' => '<span style="color: red;" class="bbc_color">',
  419.                 'after' => '</span>',
  420.             ),
  421.             array(
  422.                 'tag' => 'right',
  423.                 'before' => '<div style="text-align: right;">',
  424.                 'after' => '</div>',
  425.                 'block_level' => true,
  426.             ),
  427.             array(
  428.                 'tag' => 'rtl',
  429.                 'before' => '<div dir="rtl">',
  430.                 'after' => '</div>',
  431.                 'block_level' => true,
  432.             ),
  433.             array(
  434.                 'tag' => 's',
  435.                 'before' => '<del>',
  436.                 'after' => '</del>',
  437.             ),
  438.             array(
  439.                 'tag' => 'shadow',
  440.                 'type' => 'unparsed_commas',
  441.                 'test' => '[#0-9a-zA-Z\-]{3,12},(left|right|top|bottom|[0123]\d{0,2})\]',
  442.                 'before' => $context['browser']['is_ie'] ? '<span style="display: inline-block; filter: Shadow(color=$1, direction=$2); height: 1.2em;">' : '<span style="text-shadow: $1 $2">',
  443.                 'after' => '</span>',
  444.                 'validate' => $context['browser']['is_ie'] ? create_function('&$tag, &$data, $disabled', '
  445.                     if ($data[1] == \'left\')
  446.                         $data[1] = 270;
  447.                     elseif ($data[1] == \'right\')
  448.                         $data[1] = 90;
  449.                     elseif ($data[1] == \'top\')
  450.                         $data[1] = 0;
  451.                     elseif ($data[1] == \'bottom\')
  452.                         $data[1] = 180;
  453.                     else
  454.                         $data[1] = (int) $data[1];') : create_function('&$tag, &$data, $disabled', '
  455.                     if ($data[1] == \'top\' || (is_numeric($data[1]) && $data[1] < 50))
  456.                         $data[1] = \'0 -2px 1px\';
  457.                     elseif ($data[1] == \'right\' || (is_numeric($data[1]) && $data[1] < 100))
  458.                         $data[1] = \'2px 0 1px\';
  459.                     elseif ($data[1] == \'bottom\' || (is_numeric($data[1]) && $data[1] < 190))
  460.                         $data[1] = \'0 2px 1px\';
  461.                     elseif ($data[1] == \'left\' || (is_numeric($data[1]) && $data[1] < 280))
  462.                         $data[1] = \'-2px 0 1px\';
  463.                     else
  464.                         $data[1] = \'1px 1px 1px\';'),
  465.             ),
  466.             array(
  467.                 'tag' => 'size',
  468.                 'type' => 'unparsed_equals',
  469.                 'test' => '([1-9][\d]?p[xt]|small(?:er)?|large[r]?|x[x]?-(?:small|large)|medium|(0\.[1-9]|[1-9](\.[\d][\d]?)?)?em)\]',
  470.                 'before' => '<span style="font-size: $1;" class="bbc_size">',
  471.                 'after' => '</span>',
  472.             ),
  473.             array(
  474.                 'tag' => 'size',
  475.                 'type' => 'unparsed_equals',
  476.                 'test' => '[1-7]\]',
  477.                 'before' => '<span style="font-size: $1;" class="bbc_size">',
  478.                 'after' => '</span>',
  479.                 'validate' => create_function('&$tag, &$data, $disabled', '
  480.                     $sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95);
  481.                     $data = $sizes[$data] . \'em\';'
  482.                 ),
  483.             ),
  484.             array(
  485.                 'tag' => 'sub',
  486.                 'before' => '<sub>',
  487.                 'after' => '</sub>',
  488.             ),
  489.             array(
  490.                 'tag' => 'sup',
  491.                 'before' => '<sup>',
  492.                 'after' => '</sup>',
  493.             ),
  494.             array(
  495.                 'tag' => 'table',
  496.                 'before' => '<table class="bbc_table">',
  497.                 'after' => '</table>',
  498.                 'trim' => 'inside',
  499.                 'require_children' => array('tr'),
  500.                 'block_level' => true,
  501.             ),
  502.             array(
  503.                 'tag' => 'td',
  504.                 'before' => '<td>',
  505.                 'after' => '</td>',
  506.                 'require_parents' => array('tr'),
  507.                 'trim' => 'outside',
  508.                 'block_level' => true,
  509.                 'disabled_before' => '',
  510.                 'disabled_after' => '',
  511.             ),
  512.             array(
  513.                 'tag' => 'time',
  514.                 'type' => 'unparsed_content',
  515.                 'content' => '$1',
  516.                 'validate' => create_function('&$tag, &$data, $disabled', '
  517.                     if (is_numeric($data))
  518.                         $data = timeformat($data);
  519.                     else
  520.                         $tag[\'content\'] = \'[time]$1[/time]\';'),
  521.             ),
  522.             array(
  523.                 'tag' => 'tr',
  524.                 'before' => '<tr>',
  525.                 'after' => '</tr>',
  526.                 'require_parents' => array('table'),
  527.                 'require_children' => array('td'),
  528.                 'trim' => 'both',
  529.                 'block_level' => true,
  530.                 'disabled_before' => '',
  531.                 'disabled_after' => '',
  532.             ),
  533.             array(
  534.                 'tag' => 'tt',
  535.                 'before' => '<tt class="bbc_tt">',
  536.                 'after' => '</tt>',
  537.             ),
  538.             array(
  539.                 'tag' => 'u',
  540.                 'before' => '<span class="bbc_u">',
  541.                 'after' => '</span>',
  542.             ),
  543.             array(
  544.                 'tag' => 'url',
  545.                 'type' => 'unparsed_content',
  546.                 'content' => '<a href="$1" class="bbc_link" target="_blank">$1</a>',
  547.                 'validate' => create_function('&$tag, &$data, $disabled', '
  548.                     $data = strtr($data, array(\'<br />\' => \'\'));
  549.                     if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
  550.                         $data = \'http://\' . $data;
  551.                 '),
  552.             ),
  553.             array(
  554.                 'tag' => 'url',
  555.                 'type' => 'unparsed_equals',
  556.                 'before' => '<a href="$1" class="bbc_link" target="_blank">',
  557.                 'after' => '</a>',
  558.                 'validate' => create_function('&$tag, &$data, $disabled', '
  559.                     if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
  560.                         $data = \'http://\' . $data;
  561.                 '),
  562.                 'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
  563.                 'disabled_after' => ' ($1)',
  564.             ),
  565.             array(
  566.                 'tag' => 'white',
  567.                 'before' => '<span style="color: white;" class="bbc_color">',
  568.                 'after' => '</span>',
  569.             ),
  570.         );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement