Ok, here is the solution you may try to put under
bb_codes.php.
Before the
function enCodeBB starts declaring, paste the following function:
function encodeList($matches){
$preg=preg_replace("#[\r\n]
+#", '</li><li>', trim($matches[1]));
return '<ul class="limbb"><li>'.$preg.'</li></ul><br />';
}
After the line which in
encodeBB function says
$msg=preg_replace($pattern, $replacement, $msg);
paste:
$msg=preg_replace_callback("/\[list\][\r\n]+(.+?)[\r\n]
+\[\/list\][\r\n]*/is", 'encodeList', $msg);
Then modify decodeBB function and before the line
$msg=preg_replace($pattern, $replacement, $msg);
paste:
/* List BB code */
$pattern[] = '/<ul class="limbb">(.+?)<\/ul>/is';
$replacement[] = "[list]\r\n\\1[/list]\n";
$pattern[] = '/<li>(.+?)<\/li>/is';
$replacement[] = "\\1\r\n";
/* --List BB code */
In the final I think there is no need to complicate the code with <ul>/<ol> tags. The example above works with <ul> tag. If you need to introduce <ol> tag as well, just create another function, let's say encodeListA, and put the proper references everywhere, creating just 2 different BB codes.
Then let me know how it works ;-)