Esempio n. 1
0
     // submit the fields to paypal
     break;
 case 'success':
     // Order was successful...
 // Order was successful...
 case 'ipn':
     if (isset($_POST['custom'])) {
         $cust = $_POST['custom'];
         $cust = explode("|", $cust);
         $pid = $cust[0];
         $uid = $cust[1];
         $datemade = $cust[2];
         //--------------------------------------------
         update_post_meta($pid, "paid", "1");
         update_post_meta($pid, "closed", "0");
         ProjectTheme_mark_images_cost_extra($pid);
         //--------------------------------------------
         update_post_meta($pid, 'base_fee_paid', '1');
         $featured = get_post_meta($pid, 'featured', true);
         if ($featured == "1") {
             update_post_meta($pid, 'featured_paid', '1');
         }
         $private_bids = get_post_meta($pid, 'private_bids', true);
         if ($private_bids == "1" or $private_bids == "yes") {
             update_post_meta($pid, 'private_bids_paid', '1');
         }
         $hide_project = get_post_meta($pid, 'hide_project', true);
         if ($hide_project == "1" or $hide_project == "yes") {
             update_post_meta($pid, 'hide_project_paid', '1');
         }
         $ProjectTheme_get_images_cost_extra = ProjectTheme_get_images_cost_extra($pid);
Esempio n. 2
0
function projecttheme_listing_payza_resp()
{
    $c = $_POST['apc_1'];
    $c = explode('|', $c);
    $pid = $c[0];
    $uid = $c[1];
    $datemade = $c[2];
    //---------------------------------------------------
    $amount = $_POST['ap_amount'];
    $op = get_option('ProjectTheme_listing_' . $pid . $datemade);
    if ($op != "1") {
        //---------------------------------------------------
        global $wpdb;
        $pref = $wpdb->prefix;
        //--------------------------------------------
        update_post_meta($pid, "paid", "1");
        update_post_meta($pid, "paid_listing_date", current_time('timestamp', 0));
        update_post_meta($pid, "closed", "0");
        ProjectTheme_mark_images_cost_extra($pid);
        //--------------------------------------------
        update_post_meta($pid, 'base_fee_paid', '1');
        $featured = get_post_meta($pid, 'featured', true);
        if ($featured == "1" or $featured == "yes") {
            update_post_meta($pid, 'featured_paid', '1');
        }
        $private_bids = get_post_meta($pid, 'private_bids', true);
        if ($private_bids == "1" or $private_bids == "yes") {
            update_post_meta($pid, 'private_bids_paid', '1');
        }
        $hide_project = get_post_meta($pid, 'hide_project', true);
        if ($hide_project == "1" or $hide_project == "yes") {
            update_post_meta($pid, 'hide_project_paid', '1');
        }
        $ProjectTheme_get_images_cost_extra = ProjectTheme_get_images_cost_extra($pid);
        $image_fee_paid = get_post_meta($pid, 'image_fee_paid', true);
        update_post_meta($pid, 'image_fee_paid', $image_fee_paid + $ProjectTheme_get_images_cost_extra);
        //--------------------------------------------
        do_action('ProjectTheme_moneybookers_listing_response', $pid);
        $projectTheme_admin_approves_each_project = get_option('projectTheme_admin_approves_each_project');
        if ($projectTheme_admin_approves_each_project != "yes") {
            $xx = current_time('timestamp', 0);
            $post_pr_new_date = date('Y-m-d H:i:s', $xx);
            $gmt = get_gmt_from_date($post_pr_new_date);
            $post_pr_info = array("ID" => $pid, "post_date" => $post_pr_new_date, "post_date_gmt" => $gmt, "post_status" => "publish");
            wp_publish_post($pid);
            wp_update_post($post_pr_info);
            ProjectTheme_send_email_posted_project_approved($pid);
            ProjectTheme_send_email_posted_project_approved_admin($pid);
        } else {
            ProjectTheme_send_email_posted_project_not_approved($pid);
            ProjectTheme_send_email_posted_project_not_approved_admin($pid);
            ProjectTheme_send_email_subscription($pid);
        }
        //---------------------------
    }
}