Search Results

Search found 51 results on 3 pages for 'bbcode'.

Page 1/3 | 1 2 3  | Next Page >

  • PHP: BBCode with SQL selection?

    - by rayne
    I would like to code a bbcode with SQL selection. Basically I want the user to be able to input [user]Anotheruser[/user] in a text field, which then is converted in the front-end to an URL that looks like this: http://mydomain.com/user/[userid]/anotheruser. So in order to get the userid, I'd need to include an SQL selection, and additionally an if else to find out of the other user actually exists. Can I do this with a preg_replace as usually used for creating bbcode, or do I need to do something more complex?

    Read the article

  • Javascript BBCode Parser recognizes only first list element

    - by nolandark
    I have a really simple Javascript BBCode Parser for client-side live preview (don't want to use Ajax for that). The problem ist, this parser only recognizes the first list element: function bbcode_parser(str) { search = new Array( /\[b\](.*?)\[\/b\]/, /\[i\](.*?)\[\/i\]/, /\[img\](.*?)\[\/img\]/, /\[url\="?(.*?)"?\](.*?)\[\/url\]/, /\[quote](.*?)\[\/quote\]/, /\[list\=(.*?)\](.*?)\[\/list\]/i, /\[list\]([\s\S]*?)\[\/list\]/i, /\[\*\]\s?(.*?)\n/); replace = new Array( "<strong>$1</strong>", "<em>$1</em>", "<img src=\"$1\" alt=\"An image\">", "<a href=\"$1\">$2</a>", "<blockquote>$1</blockquote>", "<ol>$2</ol>", "<ul>$1</ul>", "<li>$1</li>"); for (i = 0; i < search.length; i++) { str = str.replace(search[i], replace[i]); } return str;} [list] [*] adfasdfdf [*] asdfadsf [*] asdfadss [/list] only the first element is converted to a HTML List element, the rest stays as BBCode: adfasdfdf [*] asdfadsf [*] asdfadss I tried playing around with "\s", "\S" and "\n" but I'm mostly used to PHP Regex and totally new to Javascript Regex. Any suggestions?

    Read the article

  • Regex & BBCode - Perfecting Nested Quote

    - by Moe
    Hey there, I'm working on some BBcode for my website. I've managed to get most of the codes working perfectly, however the [QUOTE] tag is giving me some grief. When I get something like this: [QUOTE=1] [QUOTE=2] This is a quote from someone else [/QUOTE] This is someone else quoting someone else [/QUOTE] It will return: > 1 said: [QUOTE=2]This is a quote from > someone else This is someone else quoting someone else[/QUOTE] So what is happening is the [/quote] from the nested quote is closing the quote block. The Regex I am using is: "[quote=(.*?)\](.*?)\[/quote\]'is" How can I make it so nested Quotes will appear properly? Thank you.

    Read the article

  • How convert html to BBcode in C#

    - by Dmitriy
    Hello! I need to convert html text into bbcodes. Where i can find how should i do this? For example, I convert links: regex = new Regex("<a href=\"(.+?)\">(.+?)</a>"); htmlCode = regex.Replace(htmlCode, "[URL]$1[/URL]"); How can i convert all html tags in bbcodes (and replace to empty which isn't bb codes, tag P

    Read the article

  • bbcode hyperlink issue

    - by Jorm
    I'm having an annoying :) I use regexes from this: http://forums.codecharge.com/posts.php?post_id=77123 if you enter [url]www.bob.com[/url] it leads too http://localhost/test/www.bobsbar.com So I added before http://$1 in the replacement. That fix it but then [url]http://www.bob.com[/url] will lead to http://http://www.bobsbar.com How would you fix this? I want my users to be able to post links with AND without http:// and i want it to redirect to the site -_- Hope you understand this. Jorm

    Read the article

  • bbcode hyperlink issue (help!!)

    - by Jorm
    I'm having an annoying :) I use regexes from this: http://forums.codecharge.com/posts.php?post_id=77123 if you enter [url]www.bob.com[/url] it leads too http://localhost/test/www.bobsbar.com So I added before http://$1 in the replacement. That fix it but then [url]http://www.bob.com[/url] will lead to http://http://www.bobsbar.com How would you fix this? I want my users to be able to post links with AND without http:// and i want it to redirect to the site -_- Hope you understand this. Jorm Edit function bbcode_format($str) { $str = htmlentities($str); $find = array( '/\[url\](.*?)\[\/url\]/is', // hyperlink '/\[url\](http[s]?:\/\/)(.*?)\[\/url\]/is' // hyperlink http-protocol ); $replace = array( '<a href="$1" rel="nofollow" title="$1">$1</a>', '<a href="$1$2" rel="nofollow" title="$2">$2 THIS WORKS</a>' ); $str = preg_replace($find, $replace, $str); return $str; } both www.bob.com and http://www.bob.com uses the first replacement

    Read the article

  • PHP Fomatting Regex - BBCode

    - by Wayne
    To be honest, I suck at regex so much, I would use RegexBuddy, but I'm working on my Mac and sometimes it doesn't help much (for me). Well, for what I need to do is a function in php function replaceTags($n) { $n = str_replace("[[", "<b>", $n); $n = str_replace("]]", "</b>", $n); } Although this is a bad example in case someone didn't close the tag by using ]] or [[, anyway, could you help with regex of: [[ ]] = Bold format ** ** = Italic format (( )) = h2 heading Those are all I need, thanks :) P.S - Is there any software like RegexBuddy available for Mac (Snow Leopard)?

    Read the article

  • jQuery find text and replace (or BBcode hack)

    - by Harvengure
    Basically I am attempting to use jQuery so that it will search out text on the page and replace it with something else. For example [x]text[/x] will be converted to text which then gets converted from text to the actual html...a round about way of it I am sure but it seems to be the best way to do it given that the forum seems to understand html as plain texst anyway...but ultimately the goal is to use this jQuery to in a way create new bbcode on the forum.

    Read the article

  • TinyMCE editor - line breaks not correct

    - by Kordonme
    Hoping there's some TinyMCE guys in here ready to help. I'm using the BBCode plugin. I have the following lines in the editor window: This is line one This is line three Line two is empty. When I'm viewing this in HTML i get the following. This is line one This is line three Without the extra empty line. tinyMCE.init({ mode : "textareas", theme : "advanced", plugins : "bbcode", entity_encoding : "raw", remove_linebreaks : false, force_p_newlines : false, force_br_newlines : true, forced_root_block : '' }); What am I missing? Thanks in advance! UPDATE: Example Click the bbcode link to the left: http://flipfish.dk/examples/

    Read the article

  • Pear HTML BBcode Hyperlink

    - by rrrfusco
    Has anyone used the PEAR HTML BBcode Package? I don't really understand why hyperlink target _blank does not open a new tab in firefox. INSERT Snippet [url=http://site.com t=_blank]Link[/url] PHP Require PEAR require_once 'HTML/BBCodeParser.php'; $options = @parse_ini_file('BBCodeParser.ini'); $parser = new HTML_BBCodeParser($options); $parser->setText($text); $parser->parse(); echo $parser->getParsed(); BBCodeParser.ini [HTML_BBCodeParser] ; http://articles.sitepoint.com/article/bb-code-php-application/ ; possible values: single|double ; use single or double quotes for attributes quotestyle = double ; possible values: all|nothing|strings ; quote all attribute values, none, or only the strings quotewhat = all ; the opening tag character open = "[" ; the closing tag character close = "]" ; possible values: true|false ; use xml style closing tags for single html tags (<img> or <img />) xmlclose = true ; possible values: a comma seperated list of filters ; comma seperated list of filters to use filters = Basic,Extended,Links,Images,Lists ; filters = Basic,Extended,Links,Images,Lists,Email,MyBB

    Read the article

  • Building a Hashtag in Javascript without matching Anchor Names, BBCode or Escaped Characters

    - by Martindale
    I would like to convert any instances of a hashtag in a String into a linked URL: #hashtag - should have "#hashtag" linked. This is a #hashtag - should have "#hashtag" linked. This is a [url=http://www.mysite.com/#name]named anchor[/url] - should not be linked. This isn&#39;t a pretty way to use quotes - should not be linked. Here is my current code: String.prototype.parseHashtag = function() { return this.replace(/[^&][#]+[A-Za-z0-9-_]+(?!])/, function(t) { var tag = t.replace("#","") return t.link("http://www.mysite.com/tag/"+tag); }); }; Currently, this appears to fix escaped characters (by excluding matches with the amperstand), handles named anchors, but it doesn't link the #hashtag if it's the first thing in the message, and it seems to grab include the 1-2 characters prior to the "#" in the link. Halp!

    Read the article

  • Javascript BBcode function not working

    - by Dave
    I have a string I want to convert to divs but it doesn't close the div properly. The example string i am using is this: [quote]Quote by: user1 [quote]Quote by: user2 ads[/quote]Test[/quote]Testing 2. This results in: <div class="quote" style="margin-left:10px;margin-top:10px;"> Quote by: user1 [quote]Quote by: user2 ads </div> Test[/quote]Testing 2. But it will not convert the internal quotes properly. My Javascript function is like this: function bbcode_parser(str) { search = new Array( /\[b\](.*?)\[\/b\]/g, /\[i\](.*?)\[\/i\]/g, /\[quote](.*?)\[\/quote\]/g, /\[\*\]\s?(.*?)\n/g); replace = new Array( "<strong>$1</strong>", "<em>$1</em>", "<div class='quote' style='margin-left:10px;margin-top:10px;'>$1</div>"); for (i = 0; i < search.length; i++) { str = str.replace(search[i], replace[i]); } return str; } I have provided a JSFiddle for you to see it in action: http://jsfiddle.net/gRaFW/2/ Please help :)

    Read the article

  • Why the Markitup BBcode preview doesnt work for me?

    - by Glars
    I dont know how to make works BBcode preview on Markitup Editor. I followed all instructions and the editor is working but i really dont understand what to do to make the correct preview appear, actually I can open the windows preview but i cant get the html code. I had download the parser file (markitup.bbcode.parser.php) and settled the previewParserPath too and i readed about configure or create some preview.php but really I dont know how to do it. So if someone have experience setting markitup bbcode please help me. Thanks,

    Read the article

  • [jquery/javascript] Trigger function when mouse click inside textarea AND type stop typing...

    - by marc
    Welcome, In short, my website use BBcode system, and i want allow users to preview message without posting it. I'm using JQuery library. I need 3 actions. 1) When user click in textarea i want display DIV what will contain preview, i want animate opening. 2) When user typing, i want dynamical load parsed by PHP code to DIV. (i'm still thinking what will be best option... refresh every 2 seconds, or maybe we can detect and refresh after 1 second of inactivity [stop typing]) 3) When user click outside textarea i want close preview div with animation. For example the PHP parser will have patch /api/parser.php and variable by POST called $_POST['message']. Any idea my digital friends ?

    Read the article

  • Markup filter wanted for a public website

    - by sibidiba
    Developing a community site where everyone can post text, I'm looking for a markup filter: What is not part of the markup must be escaped (htmlspecialchars()) as it is. Should turn URL-s automatically into links Should support some form of basic markups (bold, image, url, pre, list) Should have a simple parser, that turns user input text into HTML Content on the site is public to everyone, XSS must not allowed to happen. What do you suggest? What markup language in the first place? BBCode? Wiki? Markdown? Are there any complete API-s with good examples? PHP is available on the server side. If there is a WYSIWYG-like texarea in addition (like here on SO) that would be a fantastic bonus!

    Read the article

  • Trigger function when mouse click inside textarea AND type stop typing...

    - by marc
    Welcome, In short, my website use BBcode system, and i want allow users to preview message without posting it. I'm using JQuery library. I need 3 actions. 1) When user click in textarea i want display DIV what will contain preview, i want animate opening. 2) When user typing, i want dynamical load parsed by PHP code to DIV. (i'm still thinking what will be best option... refresh every 2 seconds, or maybe we can detect and refresh after 1 second of inactivity [stop typing]) 3) When user click outside textarea i want close preview div with animation. For example the PHP parser will have patch /api/parser.php and variable by POST called $_POST['message']. Any idea my digital friends ?

    Read the article

  • How to get only a filename (not full path) into $1, using the PERL, regular expressions

    - by Scott
    I want to keep only the filenames (not full paths) and add the filename to some bbcode. Here is the HTML to be converted: <a href=/path/to/full/image.jpg rel=prettyPhoto><img rel=prettyPhoto src=/path/to/thumb/image.jpg /></a> Notice I cannot have rel="foo" (no double quotes).. Here is what I have in PERL, to perform the conversion: s/\<a href=(.+?)\ rel=prettyPhoto\>\<img rel=prettyPhoto src=(.+?) \/>\<\/a\>/\[box\]$1\[\/box\]/gi; This converts the HTML to: [box]/path/to/image.jpg[/box] But this is what I want as a result: [box]image.jpg[/box] The HTML must remain the same. So how do I change my PERL so that $1 contains only the filename?

    Read the article

  • Parse vBulletin's BB Code in PHP

    - by Josh K
    I would like a function that parses BB Code from vBulletin into a standard HTML markup. Without using the PEAR library or the PECL extension. Specifically the trouble I'm having is matching [quote=My Name]. The name 'My Name' isn't enclosed by anything and can contain spaces.

    Read the article

  • How to parse bbcodes safely?

    - by Emily
    I'm trying to parse BBcodes in php but i don't think my code is safe at all. $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<span style=\"color: $1\">$2</span>",$Text); I think you can pass an injection like this and it will work: [color=<script>alert('gotcha');</script>] How to improve my regex to only capture the two standar color formats: [color=red] OR [color=#FF0000] Thanks

    Read the article

  • Remove all html tags and content except for a div class

    - by Crazy
    I want to remove all html content from a string except for a div class : <div class="toto">blablabla</div> Should I use a Regex or DOM Parser? To answer drachenstern : It's a comment content with bbcode. And the html in this div is generated with Geshi (code highlighter) so i don't want to delete this. For example a visitor can enter <script></script> in a [code][/code] bbcode tag. All HTML outside the [code][/code] bbcode tag must be delete no?

    Read the article

  • CodePlex Daily Summary for Thursday, April 08, 2010

    CodePlex Daily Summary for Thursday, April 08, 2010New ProjectsBackUpAnyWhere: BackUpAnyWhereCustomFormbyEndUser: 在项目开发中,经常遇到不同的用户对同一报表有不同要求的情况,有时甚至用户需要从头生成一个报表,在以前可能使用第三方的开发工具来实现。在SQL Server2005中,通过使用Reporting Services可以使最终用户不通过编码,只要了解数据结构就能自行编辑报表。本例使用Adventur...DbExecutor - linq based database executor: IEnumerable based database reader. (linq like primitive sql executor)DeepZoomRenderingPack: A collection of libraries and plug-ins architecture that turns various files (like PDF, PS, etc.) into a "Visual" representation that the DeepZoom ...DotNetNuke Russian Language packs: DNNRussianLP - DotNetNuke Russian Language pack. F# Refactor: Deisgned to bring Code Refactoring capabilities to the F# Language in Visual Studio 2010. Invocando WebService e Site HTTP dinamicamente com HTTPWebRequest C#: Invocando Site HTTP e WebService dinamicamente com HTTPWebRequest Passando o SoapAction e Envelope XML Escrito em C# www.biztalkbrasil.c...Jitbit WYSWYG BBCode Editor: "Jitbit WYSIWYG-BBCode" is a browser-based JavaScript-powered WYSIWYG BBCode editorMRDS Services for Phidgets: MRDS (Microsoft Robotics Developer Studio) Services for Phidgets provides additional services for Phidgets sensors and controllers that are not inc...MSBuild Addin: This tool is a simple addin for VisualStudio 2008 used in association with Microsoft MSBuild. It allows you to run MSBuild directly inside Visual S...NISHIL-BizTalk Custom Eventlog Functiod: While testing our maps at times when it fails we cant trace it because we don’t know what the output of the functiods are. Normally in a single ma...Northest GNSG: Supinfo B3C Paris Northest University project. Galego, Neveu, Simon, Geissmann.Oily: Composite application project for oil parameters. It's developed in C#Outlook.Utility: The MSDN article Outlook Customization for Integrating with Enterprise Applications at http://msdn.microsoft.com/en-us/library/Aa479345 has quite a...Particle Plot Pivot: Scan select particle physics experiment web sites for plots and generate a Pivot display for easy browsing.project tca: project tca - translating chat application. Satisfyr: A new way of performing assertions on tests so that they remain agnostic to the underlying test framework, and leverage .NET built-in lambda syntax.sejce2008: jce se course wiki and projects linksSGB Controls: SGB Controls is a set of standard .net controls that include a number of enhancements to make life easier for the developer. These controls incl...Syringe: Syringe is a lightweight service container and dependency injection library designed for use with ASP.NET MVC2. Supported features: Dependency inj...topicbox: topicboxUr-Index: Ur-Index makes it a lot easier to create onomastic indexes for books in pdf format.VietGeeks ZohoDocApis: Implement .NET Zoho Document Apis library to help developer can intergrate Zoho Docs easy with their websitesWebometrics Dashboard: Webometrics Dashboardwebpress: It is a WebBased CMS and Blog platform.WPF Ink Canvas Toolbar: WPF Ink Canvas Toolbar makes it easy for WPF developers to use pen input in TabletPC or UMPC applications. The WPF InkCanvas control has drawing, e...WS-TMS: WS GISG HTT TMSNew ReleasesBatterySaver: Version 1.0: Fixed battery increase/decrease events not firing Fixed memory corruption error Added working set trimming (used very sparingly) Fixed poorly rende...Chargify.NET: Chargify.NET 0.65: Added in Transactions, Subscription Re-activation, and finally XML documentation (which has been missing in the previous releases).DbExecutor - linq based database executor: DbExecutor ver.1.0.0.1: renameDotNetNuke Russian Language packs: Russian Language Pack for DotNetNuke 04.09.02: Russian Language Pack for DotNetNuke 04.09.02Encrypted Notes: Encrypted Notes 1.6.3: This is the latest version of Encrypted Notes (1.6.3), with general improvements. It has an installer that will create a directory 'CPascoe' in My ...Invocando WebService e Site HTTP dinamicamente com HTTPWebRequest C#: Código projeto CallSiteHTTP: Código escrito em C#.NET 2.0 - VS2005 Contem: Solution completa(código e executável) XML de configuração - Config.xml ...Jitbit WYSWYG BBCode Editor: Main package: Contains the JS-file, CSS-file and a sample.Live Writer Picasa Plugin: Live Writer Picasa Plugin 1.1.0: Changelog Communication with Picasa Web Albums is done directly via HTTP now (v1.0.0 used Google's GData .NET Libraries) The plugin can search fo...MRDS Services for Phidgets: Phidgets for RDS 2008 R3: First Beta Release This ZIP file contains a web page called Readme_CodePlex.html that explains how to install the RDS Phidgets services for RDS 200...MSBuild Addin: MsBuildAddin-v1.0.0: Initial versionMSBuild Addin: MsBuildAddin-v1.0.0-src.zip: Initial versionOutlook.Utility: Outlook.Utility v1: I have used most of the code in previous projects and seems to be quite stable. Of course the point of open sourcing this is so this project is use...Scrum Dashboard: Scrum Dashboard v3 Alpha 1: Scrum Dashboard v3 is targeting .NET 4, TFS 2010 and the brand new Scrum for Team System v3 process templates. Most of the code has been rewritten ...SharePoint Labs: SPLab4004A-FRA-Level100: SPLab4004A-FRA-Level100 This SharePoint Lab will teach you the 4th best practice you should apply when writing code with the SharePoint API. Lab La...SharePoint Labs: SPLab5012A-FRA-Level100: SPLab5012A-FRA-Level100 This SharePoint Lab will teach you how to provision a new welcome page (how to change and rename the default.aspx page) on ...Shweet: SharePoint 2010 Team Messaging built with Pex: Shweet Source Code: Although the latest version pex and moles used with this project is not available, we thought it would be useful to provide a download to the source.Syringe: Syringe 1.0: Features Dependency injection on properties of services in container Dependency injection on constructors of services in container ASP.Net Mvc ...Text to HTML: 0.4.1.0: Cambios de la versiónOptimización del código de exportación reduciendo el código. Cambio en el icono de exportación. Añadido menú Seleccionar t...VsTortoise - a TortoiseSVN add-in for Microsoft Visual Studio: VsTortoise Build 23: Build 23 Fix: Executing "Blame" through the Solution Explorer on a file opens TortoiseMerge rather than TortoiseBlame. Build 22 (beta) New: Visua...WPF Ink Canvas Toolbar: WPF Ink Canvas Toolbar 1.0: First release - included custom colour selectionMost Popular ProjectsRawrWBFS ManagerMicrosoft SQL Server Product Samples: DatabaseASP.NET Ajax LibrarySilverlight ToolkitAJAX Control ToolkitWindows Presentation Foundation (WPF)ASP.NETMicrosoft SQL Server Community & SamplesFacebook Developer ToolkitMost Active ProjectsGraffiti CMSnopCommerce. Open Source online shop e-commerce solution.RawrShweet: SharePoint 2010 Team Messaging built with Pexpatterns & practices – Enterprise LibraryAcadsysAutoPocoIonics Isapi Rewrite FilterNcqrs Framework - The CQRS framework for .NETFarseer Physics Engine

    Read the article

1 2 3  | Next Page >