Adds two functions to allow quoting of messages.
bbPress Plugin Browser »
Quote (0.2)
Download
Version: 0.2
Last Updated: 2007-3-13
Requires bbPress Version: 0.8 or higher
Compatible up to: 0.8.1
Average Rating





Your Rating
Author: Michael Nolan
-
I can't use swedish letters like "å,ä,ö" :S
Posted: 2 years ago # -
Thanks for it. :)
I modified your function to strip paragraph tags:function bb_quote_message() { global $bbdb, $topic; $post_id = (int)$_GET['quote']; if ($post_id) { $row = $bbdb->get_row("SELECT * FROM $bbdb->posts WHERE post_id={$post_id} AND topic_id={$topic->topic_id} AND post_status=0"); $row->post_text = preg_replace( '(<p>|</p>)', '', $row->post_text ); if ($row) echo htmlentities('<blockquote>'.$row->post_text.'</blockquote>'); } }Posted: 2 years ago # -
Some information about my swedish letters? Still can't get it work.
I started a thread in the forum: http://bbpress.org/forums/topic/874?replies=1
Posted: 2 years ago # -
I've made the changes suggested and tagged 0.2.
Posted: 2 years ago # -
Is there an easy way to modify the plugin so it grabs the original author's name and includes it in the blockquote? Something like, "Mickey Mouse wrote:<br>Message text here." Phpbb does that and it's kind of a nice feature.
Also, I can't get the "blockquote" to show up. Is there no blockquote styling in the default template? If not, how would I go about adding an indent, background color, etc.? I know the css for those, but what class and/or ID should I apply them to?
Thanks!
Posted: 2 years ago # -
I answered my own question, at least in a messy, non-poetic way.
I added/modified as follows:
$the_author = get_post_author(); $the_author = str_replace(' ', '!~', $the_author); echo '<a href="'.get_topic_link( 0, $last_page ).'"e='.$post_id.'&author='.$the_author.'#postform" id="quote_'.$post_id.'">'.__('Quote').'</a>';...to the bb_quote_link() function. I was having problems with usernames containing spaces, so my workaround was to replace the spaces with
!~, which nobody will likely have in their usernames.In the
bb_quote_message()function, I changed it to:
function bb_quote_message() { global $bbdb, $topic; $post_id = (int)$_GET['quote']; $the_author = $_GET['author']; $the_author = str_replace('!~', ' ', $the_author); if ($post_id) { $row = $bbdb->get_row("SELECT * FROM $bbdb->posts WHERE post_id={$post_id} AND topic_id={$topic->topic_id} AND post_status=0"); $row->post_text = preg_replace( '(<p>|</p>)', '', $row->post_text ); if ($row) echo htmlentities('<blockquote>'.$the_author.' wrote:<br /><br />'.$row->post_text.'</blockquote>'); } }This replaces the
!~with spaces, and prints the previous author's name inside the quote.For the styling, I just added
.post blockquote { css-stuff-here }to my stylesheet.If anyone knows a cleaner way to replace the spaces, let me know. Thanks!
Posted: 2 years ago # -
This plugin seems broken with latest SVN...ideas?
Posted: 2 years ago # -
Nevermind, dunderhead here forgot to update post-form :\
Posted: 2 years ago # -
Some of my users are quoting a post that already has a post in it. It ends up looking like this:
<blockquote></blockquote> <blockquote>First person's post that was quoted by person #2. </blockquote> Person #2's stuff, that should be in a nested blockquote. Here is person #3's text, that is the new text... it shouldn't be in a blockquote.Any chance this can be fixed?
Posted: 2 years ago # -
Not sure how to fix your problem Keith, but I've made some additions to this plugin. This code is a copy of the original bb_quote_message with small additions.
function bb_quote_message() { global $bbdb, $topic; $post_id = (int)$_GET['quote']; if ($post_id) { $row = $bbdb->get_row("SELECT * FROM $bbdb->posts WHERE post_id={$post_id} AND topic_id={$topic->topic_id} AND post_status=0"); $row->post_text = preg_replace( '(<p>|</p>)', '', $row->post_text ); $quoted = bb_get_user( $row->poster_id ); $quotesince = bb_since( $row->post_time ); $quotelink = get_post_link( $row->post_id ); if ($row) echo htmlentities('<blockquote><cite>'.$quoted->user_login. ' - '.$quotesince . ' ago <a href="' . $quotelink . '"> » </a>' . "</cite>\n".$row->post_text.'</blockquote>', ENT_COMPAT, 'UTF-8'); } }Basically it automatically adds the the author you're quoting, how long ago he posted and a link to the post. It's not particularly neat or customisable now, not sure if it needs to be. You need to add the
citetag to make this work; just plonk the following code in there too.function fel_addcitetag( $tags ) { $tags['cite'] = array(); return( $tags ); } add_filter( 'bb_allowed_tags', 'fel_addcitetag' );Posted: 2 years ago # -
A great addon, fel64!
I thought that I could contribute by mentioning that I modified your code by replacing
$quoted->user_loginwith
$quoted->display_nameThis gives out the quoted person's display name, rather than the login one. (My bbPress installation is integrated with Wordpress, I'm not sure if this would work with a lone bbPress installation.)
The other modification I made is cosmetic, but I think that rather than printing out "XYZ - 2 minutes ago", it looks nicer if it reads "XYZ wrote 2 minutes earlier":
$quoted->display_name . ' wrote ' . $quotesince . ' earlierPosted: 2 years ago # -
Thanks guys! I missed your changes... and we've been going for a whole month with this weird blockquote issue.
Any chance we can have topic notifications in the bbPress forum? :D
Anyway, I'll make these changes and see what happens.
Posted: 2 years ago # -
Nested blockquotes still aren't working (when you quote somebody who quoted somebody else).
I did some searching, and found this WordPress link:
http://wordpress.org/support/topic/73825?replies=3In this thread, the user was instructed to uncheck the WP preference that automatically corrects wrongly nested XHTML markup. Obviously, this isn't included in the bbPress dashboard, but can this be addressed elsewhere? Maybe with another plug-in?
Posted: 2 years ago # -
I tried substituting DIV tags, but it didn't quite take care of it.
function bb_quote_message() { global $bbdb, $topic; $post_id = (int)$_GET['quote']; if ($post_id) { $row = $bbdb->get_row("SELECT * FROM $bbdb->posts WHERE post_id={$post_id} AND topic_id={$topic->topic_id} AND post_status=0"); $row->post_text = preg_replace( '(| )', '', $row->post_text ); $quoted = bb_get_user( $row->poster_id ); $quotesince = bb_since( $row->post_time ); $quotelink = get_post_link( $row->post_id ); if ($row) echo htmlentities('<div id="ckquote"><cite>'.$quoted->user_login . ' wrote ' . $quotesince . ' earlier <a href="' . $quotelink . '"> » </a>' . "</cite>\n".$row->post_text.'</div>', ENT_COMPAT, 'UTF-8'); } }And in my CSS file, I changed the blockquote entry to:
#ckquote { border: 0px dotted #707B8D; border-left-width: 1px; margin-left: 1em; margin-right: 1em; padding-top: 1ex; padding-left: 1em; padding-bottom: 0.2ex; background-color: #F4F8FC; }Basically just used the same styles for the DIV tag.
But it doesn't really work... the un-nested DIV code appears with the text, so it isn't styled. I think it has to do with the quote marks getting changed to HTML entities.
Posted: 2 years ago # -
Bump for Nested Blockquotes :)
Posted: 2 years ago # -
not work with .8.2
Posted: 1 year ago # -
Thanks for this plugin, Michael.
I added a php function to one line to remove any trailing newline character(s), so that the </blockquote>
tag is tucked up neatly to the exact end of quoted text, whitespace be damned.$row->post_text = preg_replace( '(| )', '', $rowbecomes
$row->post_text = rtrim(preg_replace( '(| )', '', $row->post_text));Posted: 1 year ago # -
I see here already some suggestions :D
here is mine:
function bb_quote_link($link_text = 'Quote') { global $bb, $page, $topic, $forum, $bb_post; $add = topic_pages_add(); if (!topic_is_open( $bb_post->topic_id ) || !bb_is_user_logged_in()) return; $post_id = get_post_id(); $last_page = get_page_number( $topic->topic_posts + $add ); $link = get_topic_link( 0, $last_page ); $link = add_query_arg( 'quote', $post_id, $link ); echo '<a href="'.$link.'#postform" id="quote_'.$post_id.'">'.__($link_text).'</a>'; }In this version the querystring is made with function from bbpress and that makes the plugin more compatible with other modifications.
Posted: 1 year ago # -
Handy Plugin and a great addition Fel64. Brilliant!
Nested blockquote thing is a bit of a drag but hey! That's the reality of development. A coder's work is nevery done.
;~DPosted: 1 year ago #
Add a Comment »
You must log in to post.