[pawn]
#1

I dont even know if i could ask, but is there a way to get the code so i can use it on my forums?
every forum has but [pawn] is better because of the colors too..
is there a way to get it?

Thanks anyway.
Reply
#2

SMF
Код:
         array(
            'tag' => 'pawn',
            'type' => 'unparsed_content',
            'content' => '<div class="codeheader">' . $txt['pawn'] . ':</div><div class="code">' . ($context['browser']['is_gecko'] ? '<pre style="margin-top: 0; display: inline;">$1</pre>' : '$1') . '</div>',
            'validate' => create_function('&$tag, &$data, $disabled', '
                global $context;

               if (!isset($disabled[\'pawn\']))
               {
               
               $data = str_replace(
               array(
                  \'public\',
                  \'return\',
                  \'sizeof\',
                  \'switch\',
                  \'true\',
                  \'false\',
                  \'if\',
                  \'new\',
                  \'else\',
                  \'for(\',
                  \'while\',
                  \'(\',
                  \')\',
                  \'[\',
                  \']\',
                  \'{\',
                  \'}\',
                  \''\'
               ),
               array(
                  \'<span style="color: blue;">public</span>\',
                  \'<span style="color: blue;">return</span>\',
                  \'<span style="color: blue;">sizeof</span>\',
                  \'<span style="color: blue;">switch</span>\',
                  \'<span style="color: blue;">true</span>\',
                  \'<span style="color: blue;">false</span>\',
                  \'<span style="color: blue;">if</span>\',
                  \'<span style="color: blue;">new</span>\',
                  \'<span style="color: blue;">else</span>\',
                  \'<span style="color: blue;">for</span>(\',
                  \'<span style="color: blue;">while</span>\',
                  \'<span style="color: red;">(</span>\',
                  \'<span style="color: red;">)</span>\',
                  \'<span style="color: red;">[</span>\',
                  \'<span style="color: red;">]</span>\',
                  \'<span style="color: red;">{</span>\',
                  \'<span style="color: red;">}</span>\',
                  \'|||\'
               ), $data);
                 
                $data = preg_replace(
                  array(
                     \'~#(.+?)\<br \/>~is\',
                     \'~\/\/(.+?)\<br \/\>~i\',
                     \'~\/\*(.+?)\*\/~i\'
                  ),
                  array(
                     \'<span style="color: blue;">#$1<br /></span>\',                       
                     \'<span style="color: green;">//$1<br /></span>\',
                     \'<span style="color: green;">/*$1*/</span>\'
                   ), $data);               
                   $data = str_replace(\'|||\', \''\', $data);

                  // Older browsers are annoying, aren\'t they?
                  if ($context[\'browser\'][\'is_ie4\'] || $context[\'browser\'][\'is_ie5\'] || $context[\'browser\'][\'is_ie5.5\'])
                     $data = str_replace("\t", "<pre style=\"display: inline;\">\t</pre>", $data);
                  elseif (!$context[\'browser\'][\'is_gecko\'])
                     $data = str_replace("\t", "<span style=\"white-space: pre;\">\t</span>", $data);
               }'),
            'block_level' => true,
         ),
Reply
#3

Quote:
Originally Posted by SaW_[VrTx]
Посмотреть сообщение
SMF
Код:
         array(
            'tag' => 'pawn',
            'type' => 'unparsed_content',
            'content' => '<div class="codeheader">' . $txt['pawn'] . ':</div><div class="code">' . ($context['browser']['is_gecko'] ? '<pre style="margin-top: 0; display: inline;">$1</pre>' : '$1') . '</div>',
            'validate' => create_function('&$tag, &$data, $disabled', '
                global $context;

               if (!isset($disabled[\'pawn\']))
               {
               
               $data = str_replace(
               array(
                  \'public\',
                  \'return\',
                  \'sizeof\',
                  \'switch\',
                  \'true\',
                  \'false\',
                  \'if\',
                  \'new\',
                  \'else\',
                  \'for(\',
                  \'while\',
                  \'(\',
                  \')\',
                  \'[\',
                  \']\',
                  \'{\',
                  \'}\',
                  \''\'
               ),
               array(
                  \'<span style="color: blue;">public</span>\',
                  \'<span style="color: blue;">return</span>\',
                  \'<span style="color: blue;">sizeof</span>\',
                  \'<span style="color: blue;">switch</span>\',
                  \'<span style="color: blue;">true</span>\',
                  \'<span style="color: blue;">false</span>\',
                  \'<span style="color: blue;">if</span>\',
                  \'<span style="color: blue;">new</span>\',
                  \'<span style="color: blue;">else</span>\',
                  \'<span style="color: blue;">for</span>(\',
                  \'<span style="color: blue;">while</span>\',
                  \'<span style="color: red;">(</span>\',
                  \'<span style="color: red;">)</span>\',
                  \'<span style="color: red;">[</span>\',
                  \'<span style="color: red;">]</span>\',
                  \'<span style="color: red;">{</span>\',
                  \'<span style="color: red;">}</span>\',
                  \'|||\'
               ), $data);
                 
                $data = preg_replace(
                  array(
                     \'~#(.+?)\<br \/>~is\',
                     \'~\/\/(.+?)\<br \/\>~i\',
                     \'~\/\*(.+?)\*\/~i\'
                  ),
                  array(
                     \'<span style="color: blue;">#$1<br /></span>\',                       
                     \'<span style="color: green;">//$1<br /></span>\',
                     \'<span style="color: green;">/*$1*/</span>\'
                   ), $data);               
                   $data = str_replace(\'|||\', \''\', $data);

                  // Older browsers are annoying, aren\'t they?
                  if ($context[\'browser\'][\'is_ie4\'] || $context[\'browser\'][\'is_ie5\'] || $context[\'browser\'][\'is_ie5.5\'])
                     $data = str_replace("\t", "<pre style=\"display: inline;\">\t</pre>", $data);
                  elseif (!$context[\'browser\'][\'is_gecko\'])
                     $data = str_replace("\t", "<span style=\"white-space: pre;\">\t</span>", $data);
               }'),
            'block_level' => true,
         ),
In what file do I add that?
Reply
#4

I believe it's in Subs.php at parse_bbc() function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)