$value) { if ( strlen(stristr($_GET[$key],'?'))=='1' ) { $_GET[$key]=substr($_GET[$key],0,(strlen($_GET[$key])-1)); } } //print_r($_GET); /* // End of the code to filter query string */ if ( isset( $_GET['action'] ) ) { if (strpos($_GET['action'],'?')) { $_GET['action']=substr($_GET['action'],0,(strlen($_GET['action'])-1)); } else { $_GET['action']=$_GET['action']; } switch ( $action = trim($_GET['action']) ) { case 'premium_comment' : if ( isset($_SESSION['QIXIT_POST_COMMENTS_DATA']) ) { $_SESSION['QIXIT_POST_COMMENTS_DATA']['qixit_id']=( isset($_GET['qixit_id']) )?$_GET['qixit_id']:''; } ?> insert( $wpdb->prefix.QIXIT_PAYMENT_DETAILS, array( 'product_id' => 0, // we do not have a qixit product record for this type of QIXIT product 'qixit_PID' => $qixit_settings['qixit_admin_product_for_registration'], 'qixit_id' => $_GET['qixit_id'], 'total' => $qixit_settings['cost_to_be_author'], 'payment_for' => 'author_registration', 'wp_user_id' => $user_id, 'date_purchased' => date('Y-m-d H:i:s') )); // insert data into author settings $wpdb->insert( $wpdb->prefix.QIXIT_AUTHOR_SETTINGS, array( 'wp_user_id' => $user_id, 'qixit_id' => $_GET['qixit_id'], 'date_created' => date('Y-m-d H:i:s') )); // notify user wp_new_user_notification($user_id, $user_pass); unset($_SESSION['AUTHOR_REGISTRATION']); $_SESSION['AUTO_LOGIN']['log']=$user_login; $_SESSION['AUTO_LOGIN']['pwd']=$user_pass; if (version_compare($wp_version, '3.0') >= 0) { update_user_meta( $user_id, 'wp_user_level','2'); update_user_meta( $user_id, 'wp_capabilities',array('author'=>'1')); } else { update_usermeta( $user_id, 'wp_user_level','2'); update_usermeta( $user_id, 'wp_capabilities',array('author'=>'1')); } ?> insert( $wpdb->prefix.QIXIT_PAYMENT_DETAILS, array('product_id' => $qixit_product->get_product_id(), 'qixit_PID' => $qixit_settings['qixit_admin_product_for_author_post_publish'], 'qixit_id' => $_GET['qixit_id'], 'total' => $qixit_settings['cost_to_publish_post_by_author'], 'payment_for' => 'add_post', 'date_purchased' => date('Y-m-d H:i:s') )); // insert/update product in qixit products qixit_author_post_product_add($_SESSION['POST_ID']); $author_info=qixit_get_author_settings($current_user->ID); if ( $author_info->qixit_id != $_GET['qixit_id'] ) { qixit_author_post_publish_wrong_creator_notification($_SESSION['POST_ID'],$_GET['qixit_id']); } else { qixit_author_post_publish_notification($_SESSION['POST_ID'],$_GET['qixit_id']); } $post = array(); $post['ID'] = $_SESSION['POST_ID']; $post['post_status'] = 'publish'; wp_update_post( $post ); unset($_SESSION['POST_ID']); //close the popup window and take the user back to the post edit page echo ""; die(' '); break; default : die(' '); break; }// End of switch } else { ?>   post_parent == 0) { $qixit_post_id = $post_id; } else { $qixit_post_id = $post->post_parent; } $qixit_settings = get_option('qixit_settings'); $user_info = get_userdata($post->post_author); $qixit_product = new QixitProduct($qixit_post_id); if ($qixit_product->get_qixit_post_type() == QIXIT_PREMIUM_PAY_ONCE_VIEW_ANYTIME || $qixit_product->get_qixit_post_type() == QIXIT_PREMIUM_PAY_PER_VIEW) { if ($qixit_product->get_premium_post_cost() == 0) { // no need to connect to QIXIT return; } $qixit_product_object = new ProductAdd(); $author_info = qixit_get_author_settings($user_info->ID); $qixit_product_object->set_vend($qixit_settings['qixit_id']); $password = base64_decode($qixit_settings['qixit_password']); $qixit_product_object->set_vendpw($password); $qixit_product_object->set_aff($author_info->qixit_id); $qixit_product_object->set_affpct($qixit_settings['percent_to_author']); $desc = trim($post->post_title)!=''?$post->post_title:$post_id; $qixit_product_object->set_desc($desc); $qixit_product_object->set_cost($qixit_product->get_premium_post_cost()); $qixit_product_object->set_purl(get_option('siteurl')); if ($qixit_product->get_qixit_post_type() == QIXIT_PREMIUM_PAY_ONCE_VIEW_ANYTIME) { $qixit_product_object->set_perm('Y'); } elseif ($qixit_product->get_qixit_post_type() == QIXIT_PREMIUM_PAY_PER_VIEW) { $qixit_product_object->set_perm('N'); } $qixit_product_object->set_siteurl(get_option('siteurl')); $qixit_product_object->set_permalink(get_permalink($post_id)); $qixit_product_object->set_rmsg('Thanks+for+reading+' . get_option('siteurl') . '.Here\'s+the+link+if+you+want+to+see+' . $qixit_product_object->get_desc() .'+again..'); $qixit_product_object->set_durl(QIXIT_PLUGIN_URL.'/wp-qixit-redirect.php?post_id='. $post_id); $qixit_product_object->set_echo('qixit_id=(userid)'); $url=$qixit_product_object->construct_product_url(); if (is_array($url)) { $_SESSION['qixit_script_error_msg'] = $url['error_message']; return; } $html=@file_get_contents($url); $matches = explode("|", $html); if (is_array($matches)) { $PID = trim(substr(strip_tags(nl2br($matches[3])),16)); if ($PID != '' && (strtolower(trim(strip_tags(nl2br($matches[1])))) == 'success') ) { $wpdb->update( $wpdb->prefix.QIXIT_PRODUCTS, array( 'post_qixit_PID' => $PID, 'qixit_post_type' => $qixit_product->get_qixit_post_type(), 'premium_post_cost' => $qixit_product->get_premium_post_cost(), 'date_updated' => date('Y-m-d H:i:s')), array('post_id' => $post_id)); // everything looks good, so lets return return; } //looks like we encountered an error $_SESSION['qixit_script_error_msg'] = qixit_get_qixit_system_error($matches); return; } else { $_SESSION['qixit_script_error_msg']='There was an error in connecting to the Qixit system.'; } } } ?>