Advertisement
Viruthagiri

Untitled

Dec 12th, 2011
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_filter( "the_content", "cp_module_pcontent_post_content" );
  2. function cp_module_pcontent_post_content($content){
  3.         global $post;
  4.         global $cp_module_pcontent_hide;
  5.         if(!in_array($post->ID,(array)$cp_module_pcontent_hide)){
  6.             return $content;
  7.         }
  8.         $c = '<p>' . get_option('cp_module_pcontent_text_pay') . '</p>';
  9.         $c .= apply_filters('cp_module_pcontent_post_content_'.$post->ID, '');
  10.         $c .= '<form method="post">';
  11.         $c .= '<input type="hidden" name="cp_module_pcontent_pay" value="'.$post->ID.'" />';
  12.         $c .= '<p><input type="submit" value="'.get_option('cp_module_pcontent_text_button').'" /></p>';
  13.         $c .= '</form>';
  14.         if(!is_user_logged_in()){
  15.             $c = get_option('cp_module_pcontent_text_logout');
  16.         }
  17.         $c = str_replace('%points%',cp_formatPoints(get_post_meta($post->ID,'cp_pcontent_points', 1)),$c);
  18.         return $c;
  19.     }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement