smarty Posted May 26, 2005 Report Share Posted May 26, 2005 vai kaadam ir aizkjeeries skripts, kas tekstaa linkus paarveido par spiezhamu prieku, samazinot to garumu (taa, lai tos nesabojaatu visam tekstam uzlaizhot wordwrap), ljoti nodereetu Link to comment Share on other sites More sharing options...
bubu Posted May 26, 2005 Report Share Posted May 26, 2005 http://hackers.lv/?mid=cat&upcat=40&id=538 Atliek tik pielikt callback funkciju, kas samazina teksta garumu, ta tas par garu. Link to comment Share on other sites More sharing options...
smarty Posted May 26, 2005 Author Report Share Posted May 26, 2005 taa diivaini, tik daudz materiaalu inetaa par php, bet shiis lietas nav (vismaz nevaru atrast) Link to comment Share on other sites More sharing options...
leisure Posted May 26, 2005 Report Share Posted May 26, 2005 iisteniibaa ir gan, sho te ar kaadiem vairaakiem variantiem atradu mieriigi... var jau arii pachekot kaadu OpenSourci... Link to comment Share on other sites More sharing options...
smarty Posted May 26, 2005 Author Report Share Posted May 26, 2005 nu kaa, ja es uzrakstu function find_res($text) { $patt='/(http(s?):\/\/|ftp:\/\/)([^\/]*)([^ ]*)/i'; return preg_replace_callback($patt, 'wrapurl', htmlspecialchars($text)); } function wrapurl($matches) { return '<a href="'.$matches[1].$matches[3].$matches[4].'">'.$matches[3].'</a>'; } bet peec tam tekstu wrapoju $txt = find_res($txt);$txt = ereg_replace("([^ ]{60})","\\1<br />", $txt); tad tas urlis shaa vai taa tiek sabojaats Link to comment Share on other sites More sharing options...
blackhalt Posted May 26, 2005 Report Share Posted May 26, 2005 http://paste.php.lv/217/nonum Link to comment Share on other sites More sharing options...
smarty Posted May 26, 2005 Author Report Share Posted May 26, 2005 (edited) jaa viss jau buutu labi, ja man nevajadzeetu wrapot textu!! respektiivi, ja teksts ir sdfs sgd fgdfg http://www.google.lv/search?hl=lv&q=baigi+...%C5%A1ana&meta=sdfsdfsf s gsdg tad rezultaats ir sdfs sgd fgdfg <a class="clink" href="http://www.google.lv/search?hl=lv&q=baigi+labais+skrip<br />ts&btnG=Google+mekl%C4%93%C5%A1ana&meta=" target="_blank">http://www.google.lv/search?hl=lv&q=baig&hel<br />lip;</a>sdfsdfsf s gsdg (pa vidu ir atstarpe linkaa) Edited May 26, 2005 by smarty Link to comment Share on other sites More sharing options...
bubu Posted May 26, 2005 Report Share Posted May 26, 2005 Tak netaisi savu ereg_replace("([^ ]{60})","\\1<br />", $txt); pēc tās fjas izsaukšanas, bet gan IEKŠĀ tai wrapurl funkcijā. Link to comment Share on other sites More sharing options...
smarty Posted May 26, 2005 Author Report Share Posted May 26, 2005 taa wraposhana tiek taisiita visam tekstam!! funkcija wrapurl nesanjem pashu tekstu, tikai izkasiito urli Link to comment Share on other sites More sharing options...
Recommended Posts