| 1 |
<?php |
| 2 |
|
| 3 |
$QSWPOptions = new QSWPOptions(); |
| 4 |
$content = get_option('thankyou_page',$QSWPOptions->thankyou_page); |
| 5 |
|
| 6 |
$ebook_order = ebook_get_order('ebook_key', $_REQUEST['ebook_key']); |
| 7 |
$time = strtotime(@$ebook_order['payment_date'][0]); |
| 8 |
//wp_die("$time-".time().'='.$time - time() ); |
| 9 |
//print_r($ebook_order); |
| 10 |
if (@$ebook_order['item_name'][0] == '') { |
| 11 |
$ebook_order['item_name'][0] = get_the_title(@$ebook_order['ebook'][0]); |
| 12 |
} |
| 13 |
|
| 14 |
//wp_die('ebook order var ' . var_export($ebook_order,true)); |
| 15 |
if (!$ebook_order || @strtotime($ebook_order['payment_date'][0]) == 0 || isset($ebook_order['ebook']) == false) { // || time() < @strtotime($ebook_order['payment_date'][0]) + 25 || |
| 16 |
return '<img src="' . plugins_url( 'img/pp_logo.png', __FILE__ ) . '"><h4>' . $locale['confirmation'] . '</h4>' . '<script> window.setTimeout(\'location.reload()\', 5000); |
| 17 |
</script>'; |
| 18 |
} |
| 19 |
$file = get_post_meta($ebook_order['ebook'][0],'ebook_wp_custom_attachment',true); |
| 20 |
//wp_die(print_r($file,true)); |
| 21 |
$ebook_order['downloadlink'][0] = ebook_download_link($ebook_order); |
| 22 |
$ebook_order['download_links'][0] = implode("<br />",ebook_download_links($ebook_order)); |
| 23 |
$ebook_order['ebook_bonus'][0] = implode("<br />",ebook_download_links_bonus($ebook_order)); |
| 24 |
$ebook_order['filesize'][0] = humanFileSize(filesize($file['file'])); |
| 25 |
if (!isset($ebook_order['password'][0]) || $ebook_order['password'][0] === '') { |
| 26 |
if (intval(get_option('ebook_store_blank_password')) == 1) { |
| 27 |
$ebook_order['password'][0] = ''; |
| 28 |
} else { |
| 29 |
$ebook_order['password'][0] = isset($ebook_order['payer_email'][0]) ? $ebook_order['payer_email'][0] : ''; |
| 30 |
} |
| 31 |
} |
| 32 |
if (get_post_meta($ebook_order['ebook'][0],'ebook_store_alternative_location_1', true) != '') { |
| 33 |
$ebook_order['ebook_store_alternative_location_1'] = array(0 => '<p style="color:gray;">Download to Your Device: (This will take a very long time and requires some technical knowledge but we have provided an instructions page)</p><a href="' . get_post_meta($ebook_order['ebook'][0],'ebook_store_alternative_location_1', true) . '" target="_blank"> |
| 34 |
<h1 style="color:red;"">Add to Your Device</h1> |
| 35 |
</a>'); |
| 36 |
|
| 37 |
} |
| 38 |
if (get_post_meta($ebook_order['ebook'][0],'ebook_store_alternative_location_2', true) != '') { |
| 39 |
$ebook_order['ebook_store_alternative_location_2'] = array(0 => '<a href="' . get_post_meta($ebook_order['ebook'][0],'ebook_store_alternative_location_2', true) . '" target="_blank"> |
| 40 |
<h1 style="color:red;">View Book Online Now</h1> |
| 41 |
</a>'); |
| 42 |
} |
| 43 |
|
| 44 |
if (get_post_meta($ebook_order['ebook'][0],'ebook_store_alternative_location_3', true) != '') { |
| 45 |
$ebook_order['ebook_store_alternative_location_3'] = array(0 => '<a href="' . get_post_meta($ebook_order['ebook'][0],'ebook_store_alternative_location_3', true) . '" target="_blank"> |
| 46 |
<h1 style="color:red;">Download PDF</h1> |
| 47 |
</a>'); |
| 48 |
} |
| 49 |
foreach ($ebook_order as $k => $arr) { |
| 50 |
$content = str_replace('%%' . $k . '%%', $arr[0], $content); |
| 51 |
} |
| 52 |
return apply_filters('the_content',$content); |
| 53 |
|
| 54 |
?> |
| 55 |
|