Autor Zpráva
cert
Profil
Potreboval bych poradit nemuzu prijit na to jak v regularnim vyrazu zapsat obrazek aby se neprevedl do odkazu script mam tento:


// prevod textu na odkaz http/ftp
$text = eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a class=\"certcv_d\" href=\"\\0\">\\0</a>",$text);
// prevod textu na obrazek
$text = eregi_replace('\[img\]http://([a-zA-Z0-9_%\,\./=\?-]*)\[/img\]', '<img src="http://\1" border="0">', $text);

at to zaradim jak chci vzdy stoho vyjde odkaz zkousel jsem i zapsat [url][[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/][/url]
ale ani to nepomohlo nevim si s regularnimy vyrazy moc rady takze kombinace neznam pomuze mi nekdo ?
Kdyz zakazu odkaz obrazek se vlozi.
Jeste dodam nejde o smajliky ale o obrazky nekde treba z webu dane odkazem.
cert
Profil
Problem jsem jiz vyresil , vse pracuje jak ma zrusil jsem toto
("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a class=\"certcv_d\" href=\"\\0\">\\0</a>",$text);

a prekopal na

$text = eregi_replace("\[url\]www.([^\[]*)","<a class=\"certcv_d\" href=\"http://www.\\1\" target=_blank>\\1", $text);
$text= eregi_replace("\[url\]([^\[]*)","<a class=\"certcv_d\" href=\"\\1\" target=_blank>\\1", $text);
$text = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a class=\"certcv_d\" href=\"\\2\" target=_blank>", $text);
$text = eregi_replace("\[url](http://(.*))", "<a class=\"certcv_d\" href=\"\\1\" target=\"_blank\">\\1", $text);
$text = eregi_replace("(\[/url\])", "</a>", $text);
a vse funguje super aspon kdo nebude vedet muze mu to pomoct , ten predchozi je dobry treba do Chatu a je kratouckej ahoj.
Toto téma je uzamčeno. Odpověď nelze zaslat.

0