Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: bbcode, <img>, and url generation?

  1. #1
    Join Date
    Aug 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default bbcode, <img>, and url generation?

    hi.

    I wasn't sure where to put this topic so since my site is in php, i hope it is correct.

    I couldn't find this script anywhere but does anyone know how to generate the bbcode [img], the <img>, and the direct url for a specific picture that is put in a textbox?

    an example would be like photobucket:



    thanks everyone in advance

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Hmm.. Whoever invented BBCode wasn't exactly looking for a complicating, well.. I'll even go to say it that it's a language. I don't think complex functions were meant for BBCode
    - Mike

  3. #3
    Join Date
    Aug 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by mburt
    Hmm.. Whoever invented BBCode wasn't exactly looking for a complicating, well.. I'll even go to say it that it's a language. I don't think complex functions were meant for BBCode
    Last edited by abcdefGARY; 08-22-2006 at 11:38 PM.

  4. #4
    Join Date
    Aug 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    bump.
    still looking for an answer / help
    thanks in advance.

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Huh?
    Code:
    <?php
      $img = 'http://www.mysite.com/folder/image.png';
      $htm = '<img src="' . $img . '">';
      $bbc = '[img]' . $img . '[/img]';
    ?>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    I thought you were asking for something more difficult
    - Mike

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Nor do we, since you didn't give us any info.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Oct 2005
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Assuming your using it for a forum, you'll have to hard code it into the php file where all the other BBCodes are located. It's different for each type of forum I think.

  9. #9
    Join Date
    Aug 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i think i got it using the code twey provided.

    thanks!

  10. #10
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    mines almost like twey's part...

    Code:
    <?php
      $img = 'http://www.mysite.com/folder/image.png';
      $htm = '<img src="' . $img . '">';
      $bbc = '[img]' . $img . '[/img]';
    ?>
    but I would have just done

    Code:
    <?php
    $pic = $_POST['pic'];
    
    function here that I dont wanna write
    
    <form name="changepic" action="" method="post">
    <input name="pic" size="50" type="text" id="pic">
    <input type="submit" name="Submit" value="Submit">
    <input name="htm" size= "50" type="text" id="htm" value="<img src='$pic'>">
    <input name="bbc" size= "50" type="text" id="bbc" value="[img]$pic[/img]>
        </form>
    that probably wouldn't have worked though.

Bookmarks

Posting Permissions

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