Autor | Zpráva | ||
---|---|---|---|
hiska Profil |
#1 · Zasláno: 4. 9. 2009, 17:18:22
jak je mozne udelat aby po vlozeni odkazu do textarea (prosty text) pri zobrazovani byl odkaz aktivni?
|
||
Joker Profil |
#2 · Zasláno: 4. 9. 2009, 17:20:37
Je možné detekovat URL (obvykle podle "http://" nebo "www." a potom z toho vyrobit odkaz. Jestli teda tohle byl předmět dotazu.
|
||
hiska Profil |
#3 · Zasláno: 4. 9. 2009, 17:20:53
ano tak to myslim ale nevim jak - lama
|
||
Str4wberry Profil |
#4 · Zasláno: 4. 9. 2009, 17:20:53
|
||
Radek9 Profil |
#5 · Zasláno: 4. 9. 2009, 17:39:45
Myslíš něco jako toto? To nahradí textareu za div a odkazy v něm jsou aktivní...
|
||
Giga Profil * |
#6 · Zasláno: 5. 9. 2009, 11:14:26
Riešil som taky problem a urobil som to takto:
$Text=ereg_replace("(http://[^ ]+\.[^ ]+)", " <a href=\"\\1\">\\1</a> ", $Text); podmienkou je, aby adresa bola cela - teda zacinala http:// |
||
fopen Profil * |
#7 · Zasláno: 5. 9. 2009, 20:12:13
public function replace_links($text){ //http://sk2.php.net/manual/sk/function.eregi-replace.php // convert support@pogoda.in into // <a href="mailto:support@pogoda.in"> // support@pogoda.in</a> $text=ereg_replace('[-a-z0-9!#$%&\'*+/=?^_`{|}~]+@([.]?[a-zA-Z0-9_/-])*', '<a href="mailto:\\0" target="_blank">\\0</a>',$text); // convert http://www.pogoda.in/new_york/eng/ into // <a href="http://pogoda.in/new_york/eng/"> // pogoda.in/new_york/eng/</a> $text=ereg_replace('[a-zA-Z]+://(([.]?[a-zA-Z0-9_/?$&-=%])*)', '<a href="\\0" target="_blank">\\0</a>',$text); // convert www.pogoda.in/new_york/eng/ into // <a href="http://www.pogoda.in/new_york/eng/"> // www.pogoda.in/new_york/eng/</a> $text=ereg_replace('(^| )(www([-]*[.]?[a-zA-Z0-9_/?&-=%])*)', '<a href="http://\\2" target="_blank">\\2</a>',$text); return $text; } |
||
Časová prodleva: 15 let
|
0