I'm tired.. i Can't solve this:

Developers
2003-07-05
2013-04-08
  • Igor Konforti

    Igor Konforti - 2003-07-05

    It's regular expression :(

    Here is how i've made it so far:
    http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/txtforum1/txtforum1/view_topic.php?rev=1.20&content-type=text/vnd.viewcvs-markup (look at function ubbc_tag())
    But the problem is if i type nasted tags ([quote] text[quote]text[/quote]text[/quote]) it will parse only first [tag].And not just for [quote] but for all ubbc code.
    I've try to use some class like:http://www.phpclasses.org/browse.html/package/951.html but it dosen't support close tag...
    I give up .....
    Any Ideas?

     
    • Thomas R. Koll

      Thomas R. Koll - 2003-07-07

      Did you look at other projects like phpBB yet?

       
    • Igor Konforti

      Igor Konforti - 2003-07-07

      i've take a look at phpBB one.
      http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpbb/phpBB2/includes/bbcode.php
      but they design they code for phpBB and not for others :(

       
    • Goran Rakic

      Goran Rakic - 2003-07-19

      What do you think about this like solution:

      You have generic function for parsing whatever UBBC tags or HTML if you like. First you can count how many times does [tag] repeats in text and then add iteration to change it with regexp. In first pass it will fetch most wider tags, and in next pass it will fetch neasted tag and so one...

      Another solution is to fetch the first and last character of the UBB code and than iterate for all characters between them.

      In general, I donot recommend you using of regexps for this. I donot know what does phpBB use, but as this code is executes on every post display, with many posts and many users this can be slow part of code.

      Danilo Segan left nice and handy parser on Elitesecurity.org web forums so I am giving you an URL, look at that it is very powerful becouse it adds automatic closing of tags, some checkers and the best of all, you can addopt it for using with SGML sintax in against of UBBC one.

      http://www.elitesecurity.org/tema/23874/0#162859
      (you have examples too on that link)

      I hope this helps you.
      Goran Rakic

       
    • Igor Konforti

      Igor Konforti - 2004-10-30

      Hello Goran,
      I've just checked Danilos code and it dosen't help...
      It have lot of problems and i don't like the way he code it. Perhaps the best solution for this is to take somebody else class and to marge it with txtforum.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks