1
pgregory
List support in Xoops Code
  • 2004/11/15 22:46

  • pgregory

  • Just popping in

  • Posts: 19

  • Since: 2004/10/30


I have finally almost finished a conversion script for my site to bring existing data/userbase from phpBB2 into XOOPS/NewBB. I am generally very pleased with the result, had to do some 'firkling' of the BBCode, as phpBB2 seems to insert some identifiers into the code markup, i.e. [b] becomes [b:bbfc187f9].

Anyway, the only one I haven't been able to convert is the [list] tag, that we use extensively, as far as I have been able to ascertain (very limited PHP knowledge) XOOPS doesn't have an equivalent.

Firstly, am I missing anything? Is there a bullet list equivalent in XOOPS, secondly, if not, are there any plans to support it, or does anyone know a simple hack to add support for it?

Cheers

Paul Gregory

2
Anonymous
Re: List support in Xoops Code
  • 2004/11/15 23:54

  • Anonymous

  • Posts: 0

  • Since:


In the files class/module.textsanitizer.php

the function:

function &xoopsCodeDecode(&$text, $allowMedia = true)

after

$patterns[] = "/[d](.*)[/d]/sU";
$replacements[] = '\1';
$patterns[] = "/[li](.*)[/li]/sU";
$replacements[] = '
  • \1
  • '
    ;


    add this

    // Support [list] [*] [/list] constructs.
    $patterns[] = '/[*](.*)r?n/sU';
    $replacements[] = '
  • \1
  • '
    ;
    $patterns[] = '/[list]r?n(.*)[/list]/sU';
    $replacements[] = '
      \1
    '
    ;
    $patterns[] = '/[list=[1a]]r?n(.*)[/list]/sU';
    $replacements[] = '
      \1
    '

    // [/rhl]


    Regards

    P.S. btw if you have success to convert all the Posts would you be so nice and share your converter for the newbb 2.0 so we save time and your work will help lots of more people.

    3
    pgregory
    Re: List support in Xoops Code
    • 2004/11/16 7:08

    • pgregory

    • Just popping in

    • Posts: 19

    • Since: 2004/10/30


    Thanks for that, it goes some way towards a solution, but doesn't seem to provide a complete solution. For one thing, the ordered lists don't seem to display as such, they show as normal bulletted lists. I couldn't understand why, so tried cutting the list out of the generated HTML and pasting it into a simple, otherwise empty HTML page and it worked, however, embedded within the page, it doesn't? I don't know much about HTML, could it be that something in the CSS, or preceding HTML is preventing it from workin?

    Here is bbcode markup and the HTML that is produced from a simple list...

    [list=1]
    [*] 
    Item 1
    [*] Item 2
    [/list]

    [list=
    a]
    [*] 
    Item A
    [*] Item B
    [/list]


    <ol type="1"><liItem 1li><liItem 2li>
    ol><ol type="a"><liItem Ali><liItem Bli>ol>


    Also I couldn't get the code you provide to properly support nested lists, i.e.

    [list=1]
    [*] 
    Item 1
    [list=a]
    [*] 
    Item A
    [*] Item B
    [/list]
    [*] 
    Item 2
    [/list]


    which produces...

    <ol type="1"><liItem 1li>
    [list=
    a]<br /><liItem Ali><liItem Bli>
    ol><br /><liItem 2li>[/list]


    Thanks for any help you can provide, of course, if I manage to get it working sufficiently, I would be happy to provide my scripts. Although I should warn you, they are written in very messy Python

    Cheers

    PaulG

    4
    pgregory
    Re: List support in Xoops Code
    • 2004/11/16 12:01

    • pgregory

    • Just popping in

    • Posts: 19

    • Since: 2004/10/30


    Got the refusal to display ordered lists sorted out, it was down to a style in the style.css for the default theme that forced all
  • tags to be type square bullet.

    However, handling of nested lists seems to be a lot more work.

    Cheers

    PaulG

  • Login

    Who's Online

    302 user(s) are online (263 user(s) are browsing Support Forums)


    Members: 0


    Guests: 302


    more...

    Donat-O-Meter

    Stats
    Goal: $100.00
    Due Date: Nov 30
    Gross Amount: $0.00
    Net Balance: $0.00
    Left to go: $100.00
    Make donations with PayPal!

    Latest GitHub Commits