SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Sep 2000
    Ontario, Canada
    0 Post(s)
    0 Thread(s)

    custom [img] tag

    I've seen some examples of replacing [img] with its html equivalent posted here however I would like to take it a bit further. I was wondering if it would be possible to allow the user to specify width, height and alignment?

    I was thinking along the lines of the floowing for example:
    The problem is that a user might not enter the width, height and alignment all the time so it needs to determine whether or not they are present. I've messed around with it a bit but I can't get it to figure out if the advanced features are being used.

    Is this kind of thing possible? Any suggestion are appraciated

    Happy Holidays
    Jason Dulberg
    Extreme MTB

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2001
    London, UK.
    0 Post(s)
    0 Thread(s)
    I made my custom image tag alignable (If that's a word!) by users.
    What they entered was something like so:


    Not too sure if you could use something like this:


    Where 40 is the width and 60 is the height.
    You'd need to explode the values out from the above.

    PHP Code:
    $txt = eregi_replace("\\[simg=([^\\[]*)\\]([^\\[]*)\\[/simg\\]","<img src=\"\\2\" align=\"\\1\" border=\"0\">",$txt);
    ^^ is the code used for alignment. You may be able to play with this to make it work for what you need.

    Do you fear the obselescence of the
    metanarrative apparatus of legitimation?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts