BBCode - anyone out there who could help a rather simple implementation of it?

Discussion in 'Web Design and Development' started by Doju, Feb 19, 2009.

  1. Doju macrumors 68000

    Joined:
    Jun 16, 2008
    #1
    BBCode is rather easy to use, and I have a simple understanding of it, but my issue is in making it easier to use.

    For example, if I wanted to create an IMDB BBCode, I'd have to do [imdb={NUMBER}]{TEXT}[/imdb] in order to do it. The number would be the ID of the IMDB entry, and the text would be what one would like to name the link.

    The code would be:

    Code:
    <a href="www.imdb.com/title/tt{NUMBER}">{TEXT}</a>
    So the user would have to do [imdb=0405422]40 Year Old Virgin[/imdb] which is a bit of a hassle.

    Is there anyway I could make it easier on the users than having to find the ID, then name it? They could basically have just used the bbcode with not much more trouble....ficly better. Is there anyway I can do this?
     
  2. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    You might want to use IMDB's search engine to your advantage, i.e.

    http://www.imdb.com/find?s=all&q=wizard+of+oz&x=0&y=0

    See the "q=wizard+of+oz" part? You can tell I typed in "wizard of oz" on their web site and submitted the search. All you need to do is encode the user submitted input. "q" is the argument they use for the query field in their search tool. Yeah, it takes them to a page of matches, not direct to the ID as you originally wanted, but this is pretty intuitive for the user to figure out.

    Code: <a href="http://www.imdb.com/find?s=all&q={ENCODED_TEXT}&x=0&y=0">{TEXT}</a>
    User types in: [imdb]wizard of oz[/imdb]

    Note: The better BBCODE engines add icons at the top of the editor and when clicked have little dialogs that popup and prompt the user to supply whatever fields are involved.

    -jim
     
  3. Doju thread starter macrumors 68000

    Joined:
    Jun 16, 2008
    #3
    Okay, but that was only for an example, some sites only have IDs. :(

    Any others?
     
  4. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #4
    @OP:

    Let's be clear - using my method and the Wizard of Oz example which ties into the search engine query really works for all situations. Did you know that on IMDB if you search for "tt0032138" it will take you directly to that record, i.e. the Wizard of Oz page? Try it so you can see the behavior.

    Knowing this, here is what I would do to account for the ID not always being known and also to exploit the behavior I just explained above:

    1) Create an icon called IMDB
    2) Users highlights text in their message, i.e. "The Wizard of OZ (1939)"
    3) Users click the IMDB icon
    4) Display input prompt "ID number if known (otherwise leave blank)"
    5) If ID is blank, display "Search terms: " (auto-fill with text from step 2)

    Then create the URL based on the user input, i.e.

    If ID is known: <a href="www.imdb.com/title/tt{NUMBER}">{TEXT}</a>
    If ID is not known: <a href="http://www.imdb.com/find?s=all&q={ENCODED_SEARCH_TERMS}&x=0&y=0">{TEXT}</a>

    Obviously you can tweak this, it depends on how well you know how to code BBCODEs in your software, i.e. it might be possible to add in multiple input prompts into the popup, and you obviously would need to add logic to account for an ID code existing or not. Or, you could create two different BBCODE tags, one for ID, one for search term.

    You must make the effort to use what's offered and design a solution that works for you. Good luck and please do not bump again, it's a weekend for most of us and response time is longer than usual.

    -jim
     
  5. Doju thread starter macrumors 68000

    Joined:
    Jun 16, 2008
  6. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #6
    What about it? How what?

    In your first post you said, "For example, if I wanted to create an IMDB BBCode..." so that set the precedent that this topic is about:

    IMDB = Internet Movie Database
    BBCode = code tags and associated icons used in WYSIWYG editors on bulletin board ("BB") software such as phpBB, vBulletin and many others, i.e. you need help adding BBCodes for integrating IMDB.com records.

    The page you linked now seems to be a game site, I checked for any instance of the words IMDB or movie and struck out (did find databases, but nothing related to movies) nor did I see a WYSIWYG editor with bbcodes -- so I can only speculate you are completely changing subject in the middle of a topic. Hey, you never even commented on the very helpful and explicit advice I gave in my last reply about what this topic was about before your last reply!

    Um, I'm beginning to lose interest and patience here, and mighty confused.

    -jim
     
  7. Doju thread starter macrumors 68000

    Joined:
    Jun 16, 2008
    #7
    Sorry sir.

    I wanted to know about it in general, so I used IMDB as an example, as I wanted to use that, as well as others. I'm now asking for the other. :)
     
  8. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #8
    Here is general help on BBCode for various forums to assist you in core development.

    Based on the specific site you (finally) listed (and should have listed first), you really should be able to do what you want using the same basic concept in design as I described in detail: just plug in the correct names, arguments and URL's for that site and code as required. This topic is fully answered, I think. If after all this you still cannot figure it out, then maybe you're indirectly asking us to write it for you. Um, good luck with that.

    -jim
     

Share This Page