Scripting BBCode for tIMG tag on vBulletin

Discussion in 'Web Design and Development' started by alphaod, Apr 26, 2009.

  1. alphaod macrumors Core

    alphaod

    Joined:
    Feb 9, 2008
    Location:
    NYC
    #1
    I added this to my custom BBCode:
    Code:
    <a href="{param}"><img alt="" border="0" src="{param}" style="width:400px; margin: 0px 0px 0px 0px;"/></a>
    The issue is that it doesn't work. Did I do something wrong?

    It's suppose to display a 400px wide thumbnail.

    Regards.
     
  2. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    What is your tag set to and explain its purpose?

    I don't see you using {option} at all, as {param} represents the editor text wrapped by the tag. Each {option} displays a dialog input box to the user.

    My wild guess solution assuming that you want editor text to be replaced with a linked image 400 pixels wide and no margin, where the user supplies both the link and the image URL's:

    Code:
    <a href="{option}"><img alt="" border="0" src="{option}" style="width:400px; margin: 0px 0px 0px 0px;"/></a>
    From the vB help page on adding bbCode:




    As an aside: I also wish to very informally point out that since vB uses XHTML transitional a best practice is to add an ID to the IMG tag and remove the inline styling and instead reference the ID in an appropriate style sheet with the height,width, etc. set there. I know it's transitional and not strict, but I advise so you can get in the habit of doing it, plus separating content from style is the way to go and of course all your styling is centralized. No biggie, of course.

    -jim
     

Share This Page