Link bb code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Link bb code

    Hi coders.
    I need a bb code that makes the text http://site.site a link.
    I use this:
    PHP Code:
    $text ereg_replace("http://[A-Za-z0-9./=?-_]+","<a href=\"\\0\">\\0</a>"$text); 
    But if the link is http://site-a.site the link will be only http://site , a-.site will appear as text.

    Thx.
    whatmp3.name - search mp3 on mobile

    #2
    ..try using '-'
    Did I help you?
    You can help me too
    Your donations will help me finance my studies.

    Comment


      #3
      try
      Code:
      $text = preg_replace("/\[url\=(.*?)\]/is","<a href=\"$1\">$1</a>",$text);
      tinyurl.com/earnbymobile
      Easy earning for Indians
      ---------------------
      Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android
      goo.gl/6vub3

      Comment


        #4
        Originally posted by kei_ki7
        ..try using '-'
        Good idea. lol

        Originally posted by morse
        $text = preg_replace("/\[url\=(.*?)\]/is","<a href=\"$1\">$1</a>",$text);
        That is bb code for link in lavalair :D ... I have bb codes from lavalair :D ...

        I want text starting like http://site.com to be 'transformed' into a link ...
        whatmp3.name - search mp3 on mobile

        Comment


          #5
          its beyond my scope at the moment, i read it wrong, will look up if there is a solution

          or probably you posted it wrong
          Hi coders.
          I need a bb code that makes the text http://site.site a link.
          Last edited by morse; 12.08.09, 17:56.
          tinyurl.com/earnbymobile
          Easy earning for Indians
          ---------------------
          Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android
          goo.gl/6vub3

          Comment


            #6
            PHP Code:
            $texteregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
                
            '\\1<a href="http://\\2">\\2</a>'$text); 
            Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
            Visit: WapMasterz Coming Back Soon!
            _______
            SCRIPTS FOR SALE BY SUBZERO
            Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
            FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
            _______
            Info & Tips
            php.net
            w3schools.com

            Comment


              #7
              Originally posted by subzero View Post
              PHP Code:
              $texteregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
                  
              '\\1<a href="http://\\2">\\2</a>'$text); 
              Not working ....
              whatmp3.name - search mp3 on mobile

              Comment


                #8
                [QUOTE=shad0w;35119]Hi coders.
                I need a bb code that makes the text http://site.site a link.
                I use this:
                PHP Code:
                $text ereg_replace("http://[A-Za-z0-9.-_]+[A-Za-z0-9./=?-_]","<a href=\"\\0\">\\0</a>"$text); 
                try dat.

                Comment


                  #9
                  [QUOTE=mobileGIGS;35249]
                  Originally posted by shad0w View Post
                  Hi coders.
                  I need a bb code that makes the text http://site.site a link.
                  I use this:
                  PHP Code:
                  $text ereg_replace("http://[A-Za-z0-9.-_]+[A-Za-z0-9./=?-_]","<a href=\"\\0\">\\0</a>"$text); 
                  try dat.
                  It's not working ... :D
                  whatmp3.name - search mp3 on mobile

                  Comment

                  Working...
                  X