teocomi

rating

Sep 15th, 2011
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1.  
  2. class TeocomiRatingFieldPlugin {
  3.  
  4.     function TeocomiRatingFieldPlugin() {
  5.     // some stuff  ...  
  6.         add_action('comment_text', array(&$this, 'DisplayRating'));            
  7.     // some stuff  ...  
  8.     }
  9.    
  10.     function DisplayAverageRating() {
  11.         // some stuff  ...      
  12.         echo ( '...');     
  13.     }
  14.     function DisplayRating($comment) {
  15.         // some stuff  ...  
  16.         return $comment;    
  17.     }    
  18. }
  19.  
  20. function teocomi_rating_start() {  
  21.     $crfp = new TeocomiRatingFieldPlugin();
  22. }
  23.    
  24. add_action( 'plugins_loaded', 'teocomi_rating_start' );
  25.  
  26. function display_avg_rating() {
  27.     $trfp = new TeocomiRatingFieldPlugin();
  28.     $trfp->DisplayAverageRating();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment