See site in english Voir le site en francais
Website skin:
home  download  forum  link  contact

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Author Topic: FORUM URL: working on it  (Read 4551 times)

0 Members and 1 Guest are viewing this topic.

Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
18 March 2003, 20:30:59
As a lot of people forget the [] url tag I try to add an automatic
converter so you can click on them even without adding the tag...
It seem to work well but there is still some small error , mainly with
the url correctly "tagged"  (there is an "[url.]" text at the end

Sorry for that I'm working on it.

Dan


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #1 - 18 March 2003, 20:35:15
example:

no tag, just link: www.dansteph.com   work well
with tag still error http://www.dansteph.com


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #2 - 18 March 2003, 22:12:25
BINGO !

no need anymore for url tag, (but you can use them if you want)

You welcome :)

Dan


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #3 - 18 March 2003, 22:38:03
CRAP !

It broke the (img) tag I'll fix it tomorrow.

Dan


reekamachaa

  • Guest
Reply #4 - 19 March 2003, 02:41:23
Very Cool.
Since no-one's replied about this besides yerself...
THANKS VERY MUCH, Dan!  :)


Offline Pt

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Reply #5 - 19 March 2003, 14:58:50
Hehe fine!


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #6 - 19 March 2003, 19:56:15
is anyone good in php ? I'm brain fried and tired today...

I want to parse the url but not the one that have a tag before [//url] (url, img etc etc)
I don't know how to include a not "]" before http or www.

This routine work well but it translate also the url that have "img" tag before:

$body = preg_replace("/((http(s?):\/\/)|(www\.))([a-z0-9;\/\?:@=\&\$\-_\.\+!*'\(\),~%]+)\b/i","href=\"http$3://$4$5\"target=\"_blank\">$2$4$5",$body);

Thanks for any help

Dan


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #7 - 21 March 2003, 16:59:18
DONE:


The solution was:


$body = preg_replace( '{(?:(?[.\s<>!:;,?])|(?!:;,?]))}
ie', "'$7' != ''? \"$7\" : \"target='_blank'>$1$2$3$4$5\"", $body);    



Now link are automatically converted in URL and image tag work also.
no need for ["url"] tag anymore

Dan


« Last Edit: 21 March 2003, 16:59:18 by DanSteph »