JoshDreamland icon

BBCode Lists for fucking sirxemic

JoshDreamland | PRO | 01/27/14 05:05:40 PM UTC | 0 ⭐ | 230 👁️ | Never ⏰ | []
PHP |

640 B

|

None

|

0 👍

/

0 👎

'list' => array(
        'type' => TT_CALLBACK, 'args' => 1,
        'func' => function($arg) {
            $bullets = array(
              'o' => 'circle', 'O' => 'circle', '0' => 'circle',
              '*' => 'disc',   '@' => 'disc',
              '+' => 'square', 'x' => 'square', '#' => 'square'
            );
            $points = preg_split('/\[([oO0*@+x])\]/', $arg, -1, PREG_SPLIT_DELIM_CAPTURE);
            if (count($points) < 3)
                $type = 'disc';
            else
                $type = $bullets[$points[1]];
            
            $res = "<ul type=\"$type\">";
            for ($i = (trim($points[0]) == false? 2 : 0); $i < count($points); $i += 2)
                $res .= '<li>' . $points[$i] . '</li>';
            $res .= '</ul>';
            return $res;
        }
    ),

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎