Advertisement
Guest User

anandasama

a guest
Jul 26th, 2009
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.42 KB | None | 0 0
  1. /*
  2. Plugin Name: Quote Comments
  3. Plugin URI: http://noscope.com/journal/2008/12/quote-comments-javascript-plugin-for-wordpress
  4. Description: Creates a little quote icon in comment boxes which, when clicked, copies that comment to the comment box wrapped in blockquotes.
  5. Version: 1.7.5
  6. Author: Joen Asmussen
  7. Author URI: http://noscope.com
  8.  
  9. Modified for BbPress by Anandasama
  10. */
  11. function quoteScripts () {
  12.  
  13.     echo '<script type="text/javascript" src="http://matsuri.moai.se/my-plugins/quote-comments/quote-comments.js"></script>';
  14.     echo '<link rel="stylesheet" type="text/css" href="http://matsuri.moai.se/my-plugins/quote-comments/quote-comments.css" />';
  15. }  
  16.  
  17. function addQuoteTags($post_text) {
  18.     if (!is_bb_feed()) {       
  19.    
  20.         $commentID = get_post_id();
  21.         $textile = ", false";
  22.         $mce = ", true";
  23.         $quote = "";
  24.  
  25.         //creating link
  26.         $quote .= "\n\n<span class='quote'>";
  27.         $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;">';
  28.         $quote .= __('Quote');
  29.         $quote .= "</a>";
  30.         $quote .= "</span>\n\n";
  31.  
  32.  
  33.         return "\n<div id='q-".$commentID."'>\n\n\n" . $post_text . "\n\n\n</div>\n".$quote;
  34.  
  35.     } else {
  36.         return $post_text;
  37.     }
  38. }
  39. add_filter('get_post_text', 'addQuoteTags');
  40. add_action('bb_head', 'quoteScripts');
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement