bbPress Plugin Browser »

BBcode Lite for bbPress (1.0.5)

Download

Version: 1.0.5

Last Updated: 2011-12-24

Requires bbPress Version: 0.8.2 or higher

Compatible up to: 0.9

Author Homepage »

Plugin Homepage »

Donate to this plugin »

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(26)

Your Rating

Author: _ck_

Tags: ,

  1. Today I finally did it, for my own forum, a way to have nested phpbb-like quote tags! You wanna see it?! It's ugly as hell, but works very well. There are a few problems with the creation of «p» and «br /» tags, but it's fixable through plain CSS if they ever show up. So, here's how I did it. I had to edit both the quote.php plugin and the BBcode-lite.php one. On quote.php you edit the line 37 (or somewhere around there) and change it into this:

    'if ($row) echo htmlentities('[quote='.$quoted->user_login.' url='.$quotelink.']'.$row->post_text."[/quote]\n", ENT_COMPAT, 'UTF-8');

    (I hope the code tag's working...)

    Anyway, this change is about what your "quote" button will echo. It will echo something like this:

    [quote=UserName url=http://forum.com/topic.php?id=1#post-12]This is the quoted text[/quote]

    Now the second change is on BBcode-lite.php. First, you erase the support for the quote tag. On line 29, delete where it says:

    'quote' => 'blockquote',

    And now add the support for the real, decent quote tag. On line 31, add the following:

    $superquote = array('quote' => 'blockquote');
    foreach($superquote as $bbcode=>$html){
    	$text = preg_replace('/\['.$bbcode.'\]/is','<'.$html.'>',$text);
    }
    
    $superquote2 = array('\/quote' => 'blockquote');
    foreach($superquote2 as $bbcode=>$html){
    	$text = preg_replace('/\['.$bbcode."\]/is",'</'.$html.'>',$text);
    }
    $supercite = array('quote\=' => 'cite');
    foreach($supercite as $bbcode=>$html){
    	$text = preg_replace('/\['.$bbcode.'(.+?)\ url=(.+?)\]/is','<blockquote><'.$html.'><a href="$2">$1</a>&nbsp;</'.$html.'>',$text);
    	$text = preg_replace('/\['.$bbcode.'(.+?)\]/is','<blockquote><'.$html.'><a href='.get_post_link().'>$1</a>&nbsp;</'.$html.'>',$text);
    }

    The superquote, superquote2 and supercite names can be altered as you please, I gave them that because that's what came to mind at the moment. They add support for [quote][/quote] tags, for ease of use, and they support advanced referencing supporting both [quote=UserName][/quote] and [quote= UserName url=Link][/quote] tags. You may tweak the result as you please, if you know how.

    The secret for this is called superquote2. By only supporting the opening quote tags in the other vars, and by separating the closing tag, we are able to create nested quotes naturally. There may be another way to do this, but this works, and that's what counts for me.

    You can visit my site ( http://nocontinues.net/ ) and my forum ( http://nocontinues.net/forum ) to see what a newbie is able to do with WordPress and bbPress. Code is poetry... my code certainly isn't :P

    Posted: 3 years ago #
  2. I'm sorry, I didn't realize I could edit :\ Anyway, hope it helps. I've been searching for something like this for months.

    :EDIT:

    I should add I didn't bother with post-time support because bbPress uses the diabolic "x time ago" thingy, which I hate, but it's easily addable, if you like it. It won't work well though. It never did.

    Posted: 3 years ago #
  3. A better way to do it would not to hard code the url and use post instead and let the plugin do the hard work of looking up the post link dynamically.

    [quote=UserName #12]blah blah[/quote]

    Posted: 3 years ago #
  4. I tried that but wasn't able to make it work. It has always been hardcoded, though. I tried the get_post_link($1) thing but it just didn't work for some reason. And my miserable knowledge of php doesn't help either.

    Posted: 3 years ago #
  5. wilcosky

    Member

    The <font> tag doesn't appear to work. I even tried visiting bbpress showcase and the <font> tag didn't work there either.

    Posted: 3 years ago #
  6. ibnuasad

    Member

    Hello _ck_,

    First of all, I would like to thank you for developing this plugin :)

    I have a question, is it possible to disable links or auto linking when using the *code* bbcode? I found your post @ links longer than page width! but I don't know where to place the code you posted.

    Thanks in advance!

    Best Regards,
    Ibnu Asad

    Posted: 3 years ago #
  7. BBCode doesn't get rendered in the bbPress RSS feeds; what would I need to add to enable it?

    Posted: 3 years ago #
  8. It works in my tests on RSS feeds, what version of bbPress are you using?

    Posted: 3 years ago #
  9. 1.0alpha6.

    Curious, it seems to be working for me now too. Nevermind, sorry to bother you!

    Posted: 3 years ago #
  10. amazing7

    Member

    Hi Ck, I know you dont wont to toch the code until december 09, but I really need some of this functionallity for latest bbpress release. Can I pay you 100$-150$ to help me get bbcode lite and image in posts working. I will no require you to update it if they release new versions before december 2009. I just need to be able to post images in my forum and currently that is not really working. So can I hire you to help me personally with this? I can't wait till december to have [img] and [url] working in my forums, I really need that functionallity now :) Plz let me know if you are interested

    Posted: 2 years ago #
  11. Sorry I am not for hire and this is the wrong place to make such a request in the first place.

    Posted: 2 years ago #
  12. Sorry for the newb question....but, I'm brand new to bbPress (formerly used vBulletin only) and most of the plugins that I'm seeing were already built-in on the vB script. So, please excuse my silly questions :)

    At any rate, is this plugin working with bbPress 1.0? I just installed it and want to get a few plugins / features added before I launch my new site next week.

    Posted: 2 years ago #
  13. citizenkeith

    5 stars
    4 stars
    3 stars
    2 stars
    1 star

    Member

    ArnyVee: It's working for me. :)

    Posted: 2 years ago #
  14. Looks like this is working well for me :D

    Posted: 2 years ago #
  15. katastrov

    Member

    Hi all,

    I have just installed the plugin (what's the difference between "bb-plugins" and "my-plugins" anyway...) and it doesnt work. I have tried to place them in both folder each time and nothing happens on the editor...

    I'm using bbpress 1.0.1

    I can't believe that this functionality doesn't come by default, this is a standard forum tool.

    thanks for your help on this one

    Posted: 2 years ago #
  16. Works fine for in 1.01.
    Be sure to also install
    http://bbpress.org/plugins/topic/bbcode-buttons/

    or you get no GUI and many forum users would be confused.

    Posted: 2 years ago #
  17. wonderful plugin but [size] tags have mysteriously stopped working on my forum! They used to work but not many people used them because there is no GUI for them. But now I've found a way to set up new bbCode buttons but the parser is not working for [size] tags....
    Running bbPress 0.9.6 with a lot of plugins. But I tried deactivating all except bbCode lite and it still does not work.
    What could be wrong?

    Posted: 2 years ago #
  18. [size] requires the font tag to work. Do you see font in your list of allowed tags?

    It's possible you made some changes in your stylesheet that's preventing size changes from working.

    Do a view source where the size change should be an make sure you see the font tag in there.

    Posted: 2 years ago #
  19. <font> is in the list of allowed tags but you are right about the CSS issue! After the last redesign of the theme I included a CSS browser reset that contains this rule:

    font-size:100%;

    So, anyone using the famous Meyer reset should bear that in mind.

    Posted: 2 years ago #
  20. Thanks for the great plugin :)

    We've implemented this into the SitePoint bbPress community theme project:
    http://www.sitepoint.com/forums/showthread.php?t=630548

    Posted: 2 years ago #

RSS feed for this topic

Add a Comment »

You must log in to post.