start_delimiter=$configuration->start_delimiter; $this->end_delimiter=$configuration->end_delimiter; $this->delimiter_tag_name=$configuration->delimiter_tag_name; $this->paied_users_table = $configuration->paied_users_table; $this->paied_items_table = $configuration->paied_items_table; $this->bonus_posts_table = $configuration->bonus_posts_table; $this->paypal_requests_table = $configuration->paypal_requests_table; $this->paypal_field_types_table = $configuration->paypal_field_types_table; $this->paypal_fields_table = $configuration->paypal_fields_table; $this->paypal_payment_info_table=$configuration->paypal_payment_info_table; $this->paypal_url=$configuration->paypal_url; $this->paypal_email = $configuration->paypal_email; //Hook into wordpress add_action('admin_menu', array(&$this,'Are_PayPal_Configuration')); add_filter('the_content', array(&$this,'post_filter')); add_action('wp_head', array(&$this,'add_html_headers')); $install = new Are_PayPal_Install(); register_activation_hook(__FILE__,array(&$install,'install')); } function post_filter($content){ $start_delimiter=$this->start_delimiter; $end_delimiter=$this->end_delimiter; global $current_user, $user_ID,$post_ID,$post,$id; $postID=$post_ID; $userID=$user_ID; if ($userID == 0) {$userID = $current_user->id;} if ($postID == 0) {$postID = $post->id;} if ($postID == 0) {$postID = $id;} $isPostPurchased=$this->IsPostPurchased($postID,$userID); $combination=((!$this->IsGooglebot())&&(($userID == 0) || (!$isPostPurchased))); echo(""); if ((!$this->IsGooglebot())&&(($userID == 0) || (!$isPostPurchased))){ $start = strpos($content, $start_delimiter); $end = strpos($content, $end_delimiter); $pre = substr($content,0,$start); $suf = substr($content,$end,strlen($content)); $delimiterRegex="/\\[$this->delimiter_tag_name\\].*?\\[\/$this->delimiter_tag_name\\]/is"; if (!(($start===FALSE) && ($end===FALSE))){ if ($userID == 0){ $domain = $_SERVER['HTTP_HOST']; $url = "http://" . $domain . $_SERVER['REQUEST_URI']; $LoginButton="
".get_option($this->prefix.'_TextToShowIfNotLogedIn')."
"; $LoginButton.="".__("Login").""; $LoginButton.="'.$LastAction.'
Aurimas Norkevicius for help with the plugin.')); ?>
How to hide content and show paypal button?
How to configure paypal's Instant Payment Notification (IPN)?
'.$LastAction.'
|
|
'.$LastAction.'
'.$LastAction.'
'.$LastAction.'
'.$LastAction.'
| $item_id | \n"; echo "$item_title | \n"; echo "";
$users = $wpdb->get_results("SELECT user_login FROM $wpdb->users u INNER JOIN $this->paied_users_table up ON up.user_id=u.id and up.post_id=$item_id AND (ADDDATE(up.purchase_date, up.expire) > CURDATE() OR up.expire is null OR up.expire = 0)");
foreach($users as $user) {
echo $user->user_login;
echo " "; } echo " | \n";
echo "$item_name | \n"; echo "$item_number | \n"; echo "$item_amount | \n"; echo "$item_currency | \n"; echo "$item_expire | \n"; ?>if ($item->post_id){ ?>=_e('Clear Priceing')?> | ?>=_e('Edit bonus posts')?> | } ?> =_e('Edit')?> | echo '
| '.__('No Posts Found').' | ||||||||
".get_option($this->prefix.'_TextToShowIfNotPurchased')."
"; $result="".__("Purchasing current content you will also get access for posts below")."