News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[pawn] bbode

Started by lauris3722, July 09, 2010, 08:41:37 PM

Previous topic - Next topic

lauris3722

Name: [pawn] BBCode
Version: 2.0 RC3
Description;
Pawno scripting language Bulletin Board code.
Wiki: hxxp:wiki.sa-mp.com/wiki/PAWN_tutorial [nonactive]
Exemple (Not fixed, for old versions and i don't know how to use it)
Quotearray(
            '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,
         ),

Permissions; Default bbcode permissions.
Feature Set: No need for advanced admin panels and so so. It's enought with ready bbcode and pawn button in New Post/topic page.

Masterd


Luis-

#2
Quote from: Masterd on February 21, 2011, 08:01:05 AM
Do you still need this?
I would like this :), If you want to do it. Also can it be for RC 5?

Masterd

I will create this in several days. Yes, it will work on SMF 2.0 RC5.

Luis-

Quote from: Masterd on February 21, 2011, 02:21:30 PM
I will create this in several days. Yes, it will work on SMF 2.0 RC5.
Alright, Cheers.

Masterd

Here you go! ;)

Remember that this mod is not approved by SMF Customization Team!

http://www.simplemachines.org/community/index.php?topic=423281.0

Advertisement: