Advertisement
JoshDreamland

BBCode Lists for fucking sirxemic

Jan 27th, 2014
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. 'list' => array(
  2.         'type' => TT_CALLBACK, 'args' => 1,
  3.         'func' => function($arg) {
  4.             $bullets = array(
  5.               'o' => 'circle', 'O' => 'circle', '0' => 'circle',
  6.               '*' => 'disc',   '@' => 'disc',
  7.               '+' => 'square', 'x' => 'square', '#' => 'square'
  8.             );
  9.             $points = preg_split('/\[([oO0*@+x])\]/', $arg, -1, PREG_SPLIT_DELIM_CAPTURE);
  10.             if (count($points) < 3)
  11.                 $type = 'disc';
  12.             else
  13.                 $type = $bullets[$points[1]];
  14.            
  15.             $res = "<ul type=\"$type\">";
  16.             for ($i = (trim($points[0]) == false? 2 : 0); $i < count($points); $i += 2)
  17.                 $res .= '<li>' . $points[$i] . '</li>';
  18.             $res .= '</ul>';
  19.             return $res;
  20.         }
  21.     ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement