Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Which filter/action hook should I use?

That got me thinking… why reinvent the wheel when I can just use the bbcode plugin.

What I did was change the current quote plugin to insert the quote with

Quote:
instead of the other syntax, as well as strip out any blockquotes from the original post that you are quoting, which eliminates the multiple levels of quoting.

So here’s my new bb_quote_message() function:

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 );
$ret = preg_replace("/<blockquote>((.|[nr])*?)</blockquote>/", "",$row->post_text);
if ($row) echo htmlentities('
Quote:
'.$ret.'
', ENT_COMPAT, 'UTF-8');
}
}

So far it works great… except it’s annoying that the cursor isn’t positioned at the end of the textbox… I’m gonna look for some javascript to fix that.

Skip to toolbar