Kemito Posted September 27, 2011 Report Share Posted September 27, 2011 Sveiki. Tātad sekojošu BBkodu kā "color" šajā gadījumā ir neveikli uztaisīts man te. Problēma tāda, ka notiek replace uz color=red, kur red tiek pievienots kā style attribūts, bet problēma ir tāda, ka sekojot kļūdai, tas ir - color=red;width:10000px; utt. garš liels melns klucis visu sarežģī. Labojums tam? Nevaru tā īsti aizdomāties, bet nu tomēr, varbūt kāds savādāk taisa vai ko, vai attiecīgi šādam veidam ir labojums vai vienkārši ir jāveido savādākā stilā? Paldies. Quote Link to comment Share on other sites More sharing options...
nemakuphp Posted September 27, 2011 Report Share Posted September 27, 2011 preg_replace('/\[color\=(([a-z]+)|#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}))\](.*?)\[\/color\]/is', '<span style="color: $1;">$2</span>', '[color=red]Text[/color]'); Quote Link to comment Share on other sites More sharing options...
daGrevis Posted September 27, 2011 Report Share Posted September 27, 2011 Interesanta teikumu uzbūve, Kemi. :D Quote Link to comment Share on other sites More sharing options...
Kemito Posted September 27, 2011 Author Report Share Posted September 27, 2011 Nu centos :D Katrā ziņā, paldies, kas atbildēja. Es rakstu tagad savā stilā Grevi :D Quote Link to comment Share on other sites More sharing options...
briedis Posted September 27, 2011 Report Share Posted September 27, 2011 (edited) Tak pietiks to riteni pārgudrot atkal un atkal... http://php.net/manua...book.bbcode.php Edited September 27, 2011 by briedis Quote Link to comment Share on other sites More sharing options...
Kemito Posted September 27, 2011 Author Report Share Posted September 27, 2011 Nu briedis atbrauca ar savu riteni un samala visus miltos. Paldies par palīdzību, galvenais bija viedoklis nevis zupa manā mutē :) Quote Link to comment Share on other sites More sharing options...
daGrevis Posted September 28, 2011 Report Share Posted September 28, 2011 Ja jau par viedokļiem... Markdown, ne BB code! Quote Link to comment Share on other sites More sharing options...
marcis Posted September 28, 2011 Report Share Posted September 28, 2011 Tas viss tak ir pagājušais gadsimts. Nafig klientam (vidējais interneta lietotājs?) mācīties kaut kādu neeksistējošu markup valodu? Manuprāt WYSIWYG ir vienīgais derīgais risinājums. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted September 28, 2011 Report Share Posted September 28, 2011 Neeksistējošu? :) Izlasi, kas ir Markdown. :D Quote Link to comment Share on other sites More sharing options...
marcis Posted September 28, 2011 Report Share Posted September 28, 2011 http://en.wikipedia.org/wiki/List_of_markup_languages Da labi, bullshits tas viss. Vidējais interneta lietotājs jau tāpat nav diezko apķērīgs. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted September 28, 2011 Report Share Posted September 28, 2011 Nu jā, jā. Bet nesaki, ka Markdown nav populārs. Markdown users Stack Overflow and other Stack Exchange Network sites use a modified dialect of Markdown as its default formatting system.[4][5] Posterous offers Markdown as a markup option.[6] Reddit uses Markdown.[7] GitHub uses a dialect of Markdown for formatting comments, messages, etc.[8][9] John Gruber has described this dialect as a "superior variant" for "situations like user-submitted comments".[10] Bitbucket offers Markdown as an option for markup in project's README.[11] Instiki uses a Markdown extension to wiki syntax. The extended syntax is called Maruku.[12] Squarespace offers Markdown as a blog entry option.[13] Tumblr allows Markdown edits to posts.[14] The WordPress plugin system utilizes a dialect of Markdown in "readme.txt" files submitted by developers, and has plugins for Markdown.[15] G+ Tweaks v0.33, a Greasemonkey user script for adding functionality to Google's G+ social networking site.[16] Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted September 28, 2011 Report Share Posted September 28, 2011 Un kã var redzēt - gandrīz visas no minētajām lapām ir saistītas ar programmētājiem vai cilvēkiem kas aizraujas ar rakstīšanu. Nav Markdown (un cits markup language) domāts parastajam average Joe...WYSIWYG is vienīgais ko sapratīs vairums...diemžēl. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.