KingOfHeart Posted February 15, 2011 Share Posted February 15, 2011 I have a script that I can't figure out how to do an order list. // [list] '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[\*(?::\w+)?\](.*?)(?=(?:\s*<br\s*\/?>\s*)?\[\*|(?:\s*<br\s*\/?>\s*)?\[\/?list)/si' => "\n<li class=\"bb-listitem\">\\1</li>", '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[\/list(?!u|o)\w+)?\](?:<br\s*\/?>)?/si' => "\n</ul>", '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[\/list:u(:\w+)?\](?:<br\s*\/?>)?/si' => "\n</ul>", '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[\/list:o(:\w+)?\](?:<br\s*\/?>)?/si' => "\n</ol>", '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[list(?!u|o)\w+)?\]\s*(?:<br\s*\/?>)?/si' => "\n<ul class=\"bb-list-unordered\">", '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[list:u(:\w+)?\]\s*(?:<br\s*\/?>)?/si' => "\n<ul class=\"bb-list-unordered\">", '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[list:o(:\w+)?\]\s*(?:<br\s*\/?>)?/si' => "\n<ol class=\"bb-list-ordered\">", '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[list(?:)?(:\w+)?=1\]\s*(?:<br\s*\/?>)?/si' => "\n<ol class=\"bb-list-ordered,bb-list-ordered-d\">", '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[list(?:)?(:\w+)?=i\]\s*(?:<br\s*\/?>)?/s' => "\n<ol class=\"bb-list-ordered,bb-list-ordered-lr\">", '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[list(?:)?(:\w+)?=I\]\s*(?:<br\s*\/?>)?/s' => "\n<ol class=\"bb-list-ordered,bb-list-ordered-ur\">", '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[list(?:)?(:\w+)?=a\]\s*(?:<br\s*\/?>)?/s' => "\n<ol class=\"bb-list-ordered,bb-list-ordered-la\">", '/(?<!\\\\)(?:\s*<br\s*\/?>\s*)?\[list(?:)?(:\w+)?=A\]\s*(?:<br\s*\/?>)?/s' => "\n<ol class=\"bb-list-ordered,bb-list-ordered-ua\">", I typed and which worked for your basic list, but I need to know how to order it. Also is there an option for bullets, if not I'll need the code for that as well. Quote Link to comment https://forums.phpfreaks.com/topic/227685-whats-the-code/ Share on other sites More sharing options...
requinix Posted February 15, 2011 Share Posted February 15, 2011 1. Your CSS classes are off. Needs spaces, not commas. 2. It'd be easier to sort the list in JavaScript, actually 3. If #2 isn't good enough, then the answer is tricky. You have to pull out everything inside the list - a task that your array of regular expressions can't handle. It needs dedicated code which probably won't be magically written for you. 4. For bullets, write your CSS appropriately. Quote Link to comment https://forums.phpfreaks.com/topic/227685-whats-the-code/#findComment-1174346 Share on other sites More sharing options...
KingOfHeart Posted February 15, 2011 Author Share Posted February 15, 2011 That's not the whole script. I just needed help reading this code and understand what tags it created. It does bold (), it does size(). As far as I know it does list as well, and by the way it's written it has an number option but not sure what. All those symbols make it hard to understand. Quote Link to comment https://forums.phpfreaks.com/topic/227685-whats-the-code/#findComment-1174384 Share on other sites More sharing options...
requinix Posted February 15, 2011 Share Posted February 15, 2011 Summarized: [*] -> </pre> <li class="bb-listitem"> [list:o] -> [list] and [list:u] -> [list=1] and [list:o=1] -> [list=i] and [list:o=i] -> [list=I] and [list:o=I] -> [list=a] and [list:o=a] -> [list=A] and [list:o=A] -> Quote Link to comment https://forums.phpfreaks.com/topic/227685-whats-the-code/#findComment-1174418 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.