Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Quote Plugin Weirdness

@aphelionz

Participant

Regex’s are a mystery to me, but I did end up doing something pretty cool with it – I added an INNER JOIN to the sql to grab the username of the quoted..

function bb_quote_message() {
global $bbdb, $topic;
$post_id = (int)$_GET['quote'];
if ($post_id) {
$row = $bbdb->get_row("SELECT * FROM $bbdb->posts INNER JOIN wp_users ON bb_posts.poster_id = wp_users.ID WHERE bb_posts.post_id={$post_id} AND bb_posts.topic_id={$topic->topic_id} AND bb_posts.post_status=0");
$row->post_text = preg_replace( '(<p>|</p>)', '', $row->post_text );
if ($row) echo htmlentities('<blockquote>"'.trim($row->post_text).'"<br /><strong>- '.$row->user_login.'</strong></blockquote>', ENT_COMPAT, 'UTF-8');
}
}

Skip to toolbar