BBcode Programming Web Development by 54uydf I'm using the TinyMce and switched it to BBcode, it's saves the data fine, but it displays it later with the bbcode tags, should I write functions on my own that turn the bbcode into html tags, or is there something ready for that? bbcode help Programming Web Development by ryuk … done through a forum, I have to write up a bbcode script, I have some of the basic's done already… hand? here's the code I have so fare. function bbcode($msg){ //bold $msg = str_replace("[b]", "<b… Re: bbcode help Programming Web Development by diafol You've messed up the code with bbcode! urls have at least 2 elements: href and the content. So a bbcode for an url would be: replace url=[B]href[/B] with <a href="[B]href[/B]"> and the ending /url with </a> BBcode Programming Web Development by web3 I made little javascript bbcode editor on my website. How to display that code from mysql? Or how to save in mysql as html that code? Re: BBcode Programming Web Development by diafol Looks good. How about having allowable bbcode tags set to different html tags? b -> strong, i -> em. That should make it more xhtml-compliant. bbcode help Programming Web Development by MDanz when posting a new message on my forum and it contains a url. How do i automatically add the bbcode url tags to a url in the message? BBCode Interferes With Code Community Center Meta DaniWeb by AstroNox …have happened if I did not use a close italic BBCode in this line further below (the italicised part is … such a thing from happening somehow? Removing the parsing of BBCode within [CODE] and [INLINECODE] tags alone will not do … them. I would also like to suggest providing an alternate BBCode to [INLINECODE], like [C] or something. That's because [… BBCode Using Regex Programming Web Development by joshl_1995 …code I'm using: <?php function convertBBCode($input) { $bbCode = array( "/\[b\](.*?)\[\/b\]/", "/\[u\](.*?)\[\/u\]/"…;<code>\\1</code>" ); return preg_replace($bbCode, $htmlCode, $input); } echo convertBBCode($_POST['inputText']); ?>… BBCode link does not work Community Center Meta DaniWeb by TrustyTony In Python Forum's intro text link to bbcode document does not work (blank page). [url]http://www.daniweb.com/software-development/python/114[/url] link: [url]http://www.daniweb.com/forums/misc-explaincode.html[/url] Re: bbcode help Programming Web Development by ryuk hey there, that works kinda, but when I put the code in and view it on a beta page it only links to http:// or gives out a link back to my test folder where I store my test scripts. and not where it should go to in the thread. Re: bbcode help Programming Web Development by diafol what's your code for this transformation? Re: BBcode Programming Web Development by php? [CODE] <?php function parseBBCode($text) { $ALLOWABLE_TAGS = array("b", "i", "u"); //Add tags here static $PATTERNS = array(); static $REPLACEMENTS = array(); if (count($PATTERNS) == 0) { foreach ($ALLOWABLE_TAGS as $tag) { $PATTERNS[] = "/[$tag]/i";… Re: BBcode Programming Web Development by web3 Thanks, but i have option for code like on this site. How to display php code on website i tried [CODE]<pre>[/CODE] but it doesn't work. Re: BBcode Programming Web Development by diafol This site uses '<pre class="code">' and ordered lists ('<ol><li>..</li>....</ol>') on every line to ensure line numbers. Re: BBcode Programming Web Development by web3 How to transform every line to <li>? Re: BBcode Programming Web Development by diafol I assume it's: Search for newline and replace with '</li><li>'. Place a '<li>' at the start and a '</li>' at the end. Re: bbcode help Programming Web Development by metalix do a php explode between http:// and a space, and between www. and a space. add the <a href=" and </a> Fairly straightforward akternatively: I suggest you use a wysiwyg editor such as [URL="http://openwebware.com"]openwysiwyg[/URL] and turn off the features you don't need. remember if you are allowing html tags … Re: bbcode help Programming Web Development by MDanz thanks for the help... i'm trying this but it is not working. It doesn't turn the text into a hyperlink. [code] $info = mysql_real_escape_string($_POST['content']); $data = preg_replace('/\[url\](.+?)\[\/url\]/', '<a href="$1">$1</a>', $info); echo $data; [/code] $info is e.g. [url]www.google.com[/url] ... when i put … Re: bbcode help Programming Web Development by metalix try this <?php $string = mysql_real_escape_string($_POST['content']); $pattern[0] = "%(http|https|ftp)(://.*?)%"; $pattern[1] = "%((http|https|ftp)(://.*?)(jpg|bmp|gif|jpeg|png))%"; $replacement[0] = "<a href=\"\$1\$2\">\$1\$2</a>"; $replacement[1] = "<img src=\"\$1\" … Re: bbcode and pear Programming Web Development by uncle_smith Like this: [code=php]$BbParser = new HTML_BBCodeParser($settings); $BbParser->setText( $strContent ); $BbParser->parse(); $PrarsedContent = $BbParser->getParsed();[/code] $settings is array of settings $strContent is your content that contains bbcode and $ParsedContent is the html with all bbcode replaced by html tags Re: Problem wih PHP BBcode Programming Web Development by cwarn23 If you want somebody to embed bbcode for you then I don't think many people will … [URL="http://au2.php.net/manual/en/book.bbcode.php"]bbcode library[/URL] or alternatively if that library isn't… Custom bbcode - problem with the tag list & <br /> to \n Programming Web Development by piotrekw … I have a problem. I have this code: function bbcode($tresc) { //... $tresc=str_replace("\n",'<br />',$tresc); $… Help on how to get the username in front of the [quote= in the bbcode tag Programming Web Development by Farouq21 … have a problem on how to create the [quote] bbcode . The quote bbcode tag is in the format [quote=username]. The user… Re: Help on how to get the username in front of the [quote= in the bbcode tag Programming Web Development by diafol Slightly off-topic, but have you considered **markdown** (MD) as an alternative to BBCode? It's very flexible and there are a number of libs available. This editor uses MD and IMO, is far superior to BBCode. Re: Very simple bbcode Programming Web Development by tax14 As cccgal jas mentioned, replace the line [CODE]$bcode = $bbcode('[i]this is testing text[/i]');// This is how you use it on a forum or a page[/CODE] with [CODE]$bcode = bbcode('[i]this is testing text[/i]');// This is how you use it on a forum or a page[/CODE] Re: Help on how to get the username in front of the [quote= in the bbcode tag Programming Web Development by MsF.Shawahneh … from you but if you want the value of the bbcode take this <style> .qoute { background:#333; color:#fff… Problem with BBcode Community Center by Quast Hi I need you'r help my friend to make my site i want to know how can make BBcode work on my site [img]http://www.syarashtools.com/dl/Datalife-Skins/BBCodes.JPG[/img] like you see on photo every thing is OK but if you Click on any thing Nothing happen ? How can make it work ? Re: Problem with BBcode Community Center by Quast see this photo i want to make it work when any member on my website want to Repit about any Topic they the can't find BBcode he can write but he can't (( [COLOR="red"]Change the Colour[/COLOR], [B]Blod[/B]or [I]Italic[/I]..etc )) What i have to do to make it work ? PHP bbcode url code not working Programming Web Development by csharplearner Hi all, i have this bbcode for a [URL] which is not working. Please let me … Re: PHP bbcode url code not working Programming Web Development by JRSofty …; } return $ret; } > Hi all, > > i have this bbcode for a [URL] which is not working. > Please let…