if (strtolower(trim($p->ipn_data['business'])) == trim($CONFIG['photo_shop_paypal_email']) && trim($p->ipn_data['mc_currency']) == trim($CONFIG['photo_shop_paypal_currency']) && trim($p->ipn_data['mc_gross']) == trim($gross)) { //mark items of the current order paid $result2 = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP']} WHERE oid=" . $invoice . ";"); while ($i = mysql_fetch_array($result2)) { $id = $i['id']; $status = $i['status'] | 2; cpg_db_query("UPDATE {$CONFIG['TABLE_SHOP']} SET status={$status} WHERE id ='" . $i['id'] . "';"); } mysql_free_result($result2); //if we set download instead of prints if ($CONFIG['photo_shop_download_enable'] == '1') { //first check if we have items to download, if yes, create down dir, send passwords etc if (photo_shop_ipn_download_check($uid, $invoice)) { $CONFIG['photo_shop_download_passwd_mail'] == '1' ? $send_admin_mail = true : ($send_admin_mail = false); //create download folder, htaccess, htpasswd, resize images and copy them to download folder if (photo_shop_ipn_download($uid, $invoice, $send_admin_mail, true)) { //success, email admin cpg_mail('admin', $lang_photoshop_ipn['ipn_email_admin_ipn_download_success'] . " [{$date}]", nl2br(make_clickable($error . $body)), 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'], $body); } else { cpg_mail('admin', $lang_photoshop_ipn['ipn_email_admin_ipn_download_problem'] . " [{$date}]", nl2br(make_clickable($error . $body)), 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'], $body); } } } else { // email user admin, order is paid... prints need to be sent cpg_mail('admin', $lang_photoshop_ipn['ipn_email_admin_ipn_success'] . " [{$date}]", nl2br(make_clickable($error . $body)), 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'], $body); //mail user... maybe redundant.. has already received shop thank you message and all the paypal emails } } else { $body = $lang_photoshop_ipn['ipn_email_manipulated'] . $body; cpg_mail('admin', $lang_photoshop_ipn['ipn_email_admin_ipn_failed'] . " [{$date}]", nl2br(make_clickable($body)), 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'], $body); }
} $sql = "SELECT order_md5_id FROM {$CONFIG['TABLE_SHOP']} WHERE oid='{$_GET['oid']}' AND cd='1'"; $result = cpg_db_query($sql); $row = cpg_db_fetch_row($result); mysql_free_result($result); $hash = $row['order_md5_id']; header('Location: ' . str_replace('&', '&', "index.php?file=photo_shop/photo_shop_download_order&order={$hash}")); die; break; case "create_dir": if (!verify_paid($_GET['oid'])) { cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__); } $CONFIG['photo_shop_download_passwd_mail'] == '1' ? $send_admin_mail = true : ($send_admin_mail = false); pageheader($lang_photoshop_admin['o_board_title']); if (photo_shop_ipn_download(USER_ID, $_GET['oid'], $send_admin_mail, false)) { msg_box("{$lang_photoshop_ipn['ipn_created_folder']} {$_GET['oid']}", "{$lang_photoshop_ipn['ipn_created_folder']} {$_GET['oid']}", $lang_photoshop_ipn['ipn_continue'], "index.php?file=photo_shop/photo_shop_myorders", '100%'); } else { msg_box("{$lang_photoshop_ipn['ipn_created_folder_error']} {$_GET['oid']}", "{$lang_photoshop_ipn['ipn_created_folder_error']} {$_GET['oid']}", $lang_photoshop_ipn['ipn_continue'], "index.php?file=photo_shop/photo_shop_myorders", '100%'); } pagefooter(); die; break; } } // end dowhat //now we do the bridging, this is very sucky... //we have to get all object vars from the bridge child and save them in an array, then we extend core_udb with photo shop functions $udb_var = get_object_vars($cpg_udb); class photo_shop_udb extends core_udb {
/* $result2 = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP']} WHERE oid=".$order_id.";"); while($i=mysql_fetch_array($result2)) { $id = $i['id']; $status = $i['status'] | 2; cpg_db_query("UPDATE {$CONFIG['TABLE_SHOP']} SET status=$status WHERE id ='".$i['id']."';"); } mysql_free_result($result2); */ if ($CONFIG['photo_shop_download_enable'] == '1') { //first check if we have items to download, if yes, create down dir, send passwords etc if (photo_shop_ipn_download_check(USER_ID, $order_id)) { $CONFIG['photo_shop_download_passwd_mail'] == '1' ? $send_admin_mail = true : ($send_admin_mail = false); //create download folder, htaccess, htpasswd, resize images and copy them to download folder if (photo_shop_ipn_download(USER_ID, $order_id, $send_admin_mail, true)) { //success, email admin cpg_mail('admin', $lang_photoshop_ipn['ipn_email_admin_ipn_download_success'] . " [{$date}]", nl2br(make_clickable($error . $body)), 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'], $body); } else { cpg_mail('admin', $lang_photoshop_ipn['ipn_email_admin_ipn_download_problem'] . " [{$date}]", nl2br(make_clickable($error . $body)), 'text/plain', $CONFIG['gallery_name'], $CONFIG['gallery_admin_email'], $body); } } } } msg_box('', $msg_box_txt, $lang_continue, $CONFIG['ecards_more_pic_target'] . 'index.php'); //comment out if you don't want the orders to appeare on the order confirmed page starttable('100%', $lang_photoshop['myorders'], 1); echo photoshop_create_table($shop_array_photos, 'photo', 'html'); echo photoshop_create_table($shop_array_cd, 'cd', 'html'); echo photoshop_format_price($cd_price, $cd_counter, '', 'html'); endtable();