Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Plugin Name: Quote Comments
- Plugin URI: http://noscope.com/journal/2008/12/quote-comments-javascript-plugin-for-wordpress
- Description: Creates a little quote icon in comment boxes which, when clicked, copies that comment to the comment box wrapped in blockquotes.
- Version: 1.7.5
- Author: Joen Asmussen
- Author URI: http://noscope.com
- Modified for BbPress by Anandasama
- */
- function quoteScripts () {
- echo '<script type="text/javascript" src="http://matsuri.moai.se/my-plugins/quote-comments/quote-comments.js"></script>';
- echo '<link rel="stylesheet" type="text/css" href="http://matsuri.moai.se/my-plugins/quote-comments/quote-comments.css" />';
- }
- function addQuoteTags($post_text) {
- if (!is_bb_feed()) {
- $commentID = get_post_id();
- $textile = ", false";
- $mce = ", true";
- $quote = "";
- //creating link
- $quote .= "\n\n<span class='quote'>";
- $quote .= '<a href="#to-post" title="' . __('Click here or select text to quote comment'). '" onmousedown="quote(\'' . get_post_id() .'\', \''. get_post_author() .'\', \'post_content\',\'div-comment-'. get_post_id() .'\''. $textile .''. $mce .'); return false;">';
- $quote .= __('Quote');
- $quote .= "</a>";
- $quote .= "</span>\n\n";
- return "\n<div id='q-".$commentID."'>\n\n\n" . $post_text . "\n\n\n</div>\n".$quote;
- } else {
- return $post_text;
- }
- }
- add_filter('get_post_text', 'addQuoteTags');
- add_action('bb_head', 'quoteScripts');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement