Jump to content
Sign in to follow this  
harikatt

Warning for downloads.php

Recommended Posts

hi.

 

any body can please solve or reply my problem.. i am getting this error.. i am not sure why i am getting this error.. though i have used everything fine as per osCommerce_PayPal_IPN_v2.3.3 contribution.

 

i am not getting download links.. but getting this error.

 

what to do next .. to solve ????

 

 

Download links

 

Warning: mktime() expects parameter 6 to be long, string given in /home/domain/public_html/includes/modules/downloads.php on line 49

 

Warning: mktime() expects parameter 6 to be long, string given in /home/domain/public_html/includes/modules/downloads.php on line 49

 

file Link expires:

Wednesday 31 December, 1969 5 downloads remaining

file Link expires:

Wednesday 31 December, 1969 10 downloads remaining

 

 

i am also using.. Super_Download_Shop_v1_1 contribution for admin controlling for downloads

Edited by harikatt

Share this post


Link to post
Share on other sites

MAKE A BACKUP BEFORE MAKING ANY EDITS.

 

I don't know a lot about the download side of osC, but maybe I can help get rid of the error.

 

Line 49 of /includes/modules/downloads.php probably looks like this:

 

	  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);

Try these two lines of code in it's place:

 

	  $dty = intval($dt_year);
  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dty);


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites
MAKE A BACKUP BEFORE MAKING ANY EDITS.

 

I don't know a lot about the download side of osC, but maybe I can help get rid of the error.

 

Line 49 of /includes/modules/downloads.php probably looks like this:

 

	  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);

Try these two lines of code in it's place:

 

	  $dty = intval($dt_year);
  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dty);

 

 

 

 

 

 

Now i get this error..

 

Parse error: syntax error, unexpected '}' in /home/domain/public_html/includes/modules/downloads.php on line 2

Share this post


Link to post
Share on other sites

That would have nothing to do with the change I suggested.

 

Restore the original with your backup and try again.


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

Post the contents of your original download.php between CODE tags.

 

Still getting an error way up on line 2???

:unsure:


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

here is the complete.. downloads.php

 

 

 

<?php

/*

 $Id: downloads.php,v 1.3 2003/06/09 22:49:58 hpdl Exp $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2003 osCommerce



 Released under the GNU General Public License

*/

?>

<!-- downloads //-->

<?php

 if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {

// Get last order id for checkout_success

$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by orders_id desc limit 1");

$orders = tep_db_fetch_array($orders_query);

$last_order = $orders['orders_id'];

 } else {

$last_order = $HTTP_GET_VARS['order_id'];

 }



// Now get all downloadable products in that order

// BOF: WebMakers.com Added: Downloads Controller

// DEFINE WHICH ORDERS_STATUS TO USE IN downloads_controller.php

// USE last_modified instead of date_purchased

 $downloads_query = tep_db_query("select o.orders_status, date_format(o.last_modified, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' and o.orders_status >= '" . DOWNLOADS_CONTROLLER_ORDERS_STATUS . "' and o.orders_id = '" . (int)$last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != ''");

// EOF: WebMakers.com Added: Downloads Controller



 if (tep_db_num_rows($downloads_query) > 0) {

?>

  <tr>

	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

  </tr>

  <tr>

	<td class="main"><b><?php echo HEADING_DOWNLOAD; ?></b></td>

  </tr>

  <tr>

	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

  </tr>

  <tr>

	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<!-- list of products -->

<?php

while ($downloads = tep_db_fetch_array($downloads_query)) {

// MySQL 3.22 does not have INTERVAL

  list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);

  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);

  $download_expiry = date('Y-m-d H:i:s', $download_timestamp);

?>

	  <tr class="infoBoxContents">

<!-- left box -->

<?php

// The link will appear only if:

// - Download remaining count is > 0, AND

// - The file is present in the DOWNLOAD directory, AND EITHER

// - No expiry date is enforced (maxdays == 0), OR

// - The expiry date is not reached

  if ( ($downloads['download_count'] > 0) && (file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) && ( ($downloads['download_maxdays'] == 0) || ($download_timestamp > time())) ) {

// BOF Super Download Shop v1.0 mod

	$file_desc = 0;

	if (DOWNLOADS_CONTROLLER_FILEGROUP_STATUS == 'Yes') {

	  // Check if a file description exists

	  $file_query = tep_db_query("select padg2f.download_group_file_description

								  from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD_GROUPS_FILES . " padgf

								  left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD_GROUPS_TO_FILES . " padg2f

								  on padgf.download_groups_file_id = padg2f.download_groups_file_id

								  where padgf.download_group_filename = '" . $downloads['orders_products_filename'] . "'

								  and padg2f.language_id = '" . (int)$languages_id . "'");

	  if (tep_db_num_rows($file_query) > 0) {

		$file_array = tep_db_fetch_array($file_query);

		if (tep_not_null($file_array['download_group_file_description'])) $file_desc = 1;

	  }

	}

	$file_size = filesize(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);

	if ($file_size > (1024*1024)) {

	  $factor = 1024*1024;

	  $symbol = 'Mb';

	} else if ($file_size > 1024 ){

	  $factor = 1024;

	  $symbol = 'Kb';

	} else {

	  $factor = 1;

	  $symbol = 'Bytes';

	}

	switch ($symbol) {

	  case 'Bytes' :

		$decimal = 0;

		break;

	  default :

		$decimal = 2;

		break;

	}

	$file_size /= $factor;

	$file_size = number_format($file_size, $decimal) . $symbol;



	if ($file_desc == 1) {

	  echo '			<td class="main" align="center">' . $downloads['products_name'] . ' - <a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $file_array['download_group_file_description'] . '<br>' . tep_image_button('button_download.gif', 'Download') . '</a> - ' . $file_size . '</td>' . "\n";

	} else {

// WebMakers.com Added: Downloads Controller Show Button

	  echo '			<td class="main" align="center"><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $downloads['products_name'] . '<br>' . tep_image_button('button_download.gif', 'Download') . '</a> - ' . $file_size . '</td>' . "\n";

	}

// EOF Super Download Shop v1.0 mod

  } else {

	echo '			<td class="main">' . $downloads['products_name'] . '</td>' . "\n";

  }

?>

<!-- right box -->

<?php

// BOF: WebMakers.com Added: Downloads Controller

  echo '			<td class="main">' . TABLE_HEADING_DOWNLOAD_DATE . '<br>' . tep_date_long($download_expiry) . '</td>' . "\n" .

	   '			<td class="main" align="right">' . $downloads['download_count'] . TABLE_HEADING_DOWNLOAD_COUNT . '</td>' . "\n" .

	   '		  </tr>' . "\n";

// EOF: WebMakers.com Added: Downloads Controller

}

?>

	  </tr>

	</table></td>

  </tr>

<?php

if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {

?>

  <tr>

	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

  </tr>

  <tr>

	<td class="smalltext" colspan="4"><p><?php printf(FOOTER_DOWNLOAD, '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>'); ?></p></td>

  </tr>

<?php

}

 }

?>

<?php

// BOF: WebMakers.com Added: Downloads Controller

// If there is a download in the order and they cannot get it, tell customer about download rules

 $downloads_check_query = tep_db_query("select o.orders_id, opd.orders_products_download_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.orders_id = opd.orders_id and o.orders_id = '" . (int)$last_order . "' and opd.orders_products_filename != ''");



if (tep_db_num_rows($downloads_check_query) > 0 && tep_db_num_rows($downloads_query) < 1) {

?>

  <tr>

	<td colspan="3" align="center" valign="top" class="main" height="30"><FONT FACE="Arial" SIZE=1 COLOR="FF000"><?php echo DOWNLOADS_CONTROLLER_ON_HOLD_MSG ?></FONT></td>

  </tr>

<?php

}

// EOF: WebMakers.com Added: Downloads Controller

?>

<!-- downloads_eof //-->

Share this post


Link to post
Share on other sites

What program are you using to edit this file with?

:unsure:

 

I wouldn't use the File Manager in your osC admin. If you have an upatched version it will screw up PHP files in a heartbeat.

 

Use your site's Control Panel File Manager (NOT OSC!!!), or edit it on your local PC and transfer it to the server.

 

Again, BE SURE YOU MAKE A BACKUP!

 

I took out the unnecessary empty lines, and made the changes I suggested:

 

<?php
/*
 $Id: downloads.php,v 1.3 2003/06/09 22:49:58 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License

*/
?>
<!-- downloads //-->
<?php
 if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
// Get last order id for checkout_success
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by orders_id desc limit 1");
$orders = tep_db_fetch_array($orders_query);
$last_order = $orders['orders_id'];
 } else {
$last_order = $HTTP_GET_VARS['order_id'];
 }

// Now get all downloadable products in that order
// BOF: WebMakers.com Added: Downloads Controller
// DEFINE WHICH ORDERS_STATUS TO USE IN downloads_controller.php
// USE last_modified instead of date_purchased
 $downloads_query = tep_db_query("select o.orders_status, date_format(o.last_modified, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' and o.orders_status >= '" . DOWNLOADS_CONTROLLER_ORDERS_STATUS . "' and o.orders_id = '" . (int)$last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != ''");

// EOF: WebMakers.com Added: Downloads Controller
 if (tep_db_num_rows($downloads_query) > 0) {
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo HEADING_DOWNLOAD; ?></b></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<!-- list of products -->
<?php
while ($downloads = tep_db_fetch_array($downloads_query)) {
// MySQL 3.22 does not have INTERVAL
  list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);
  $dty = intval($dt_year);
  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dty);
  $download_expiry = date('Y-m-d H:i:s', $download_timestamp);
?>
	  <tr class="infoBoxContents">
<!-- left box -->
<?php
// The link will appear only if:
// - Download remaining count is > 0, AND
// - The file is present in the DOWNLOAD directory, AND EITHER
// - No expiry date is enforced (maxdays == 0), OR
// - The expiry date is not reached
  if ( ($downloads['download_count'] > 0) && (file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) && ( ($downloads['download_maxdays'] == 0) || ($download_timestamp > time())) ) {
// BOF Super Download Shop v1.0 mod
	$file_desc = 0;
	if (DOWNLOADS_CONTROLLER_FILEGROUP_STATUS == 'Yes') {
	  // Check if a file description exists
	  $file_query = tep_db_query("select padg2f.download_group_file_description
								  from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD_GROUPS_FILES . " padgf
								  left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD_GROUPS_TO_FILES . " padg2f
								  on padgf.download_groups_file_id = padg2f.download_groups_file_id
								  where padgf.download_group_filename = '" . $downloads['orders_products_filename'] . "'
								  and padg2f.language_id = '" . (int)$languages_id . "'");
	  if (tep_db_num_rows($file_query) > 0) {
		$file_array = tep_db_fetch_array($file_query);
		if (tep_not_null($file_array['download_group_file_description'])) $file_desc = 1;
	  }
	}
	$file_size = filesize(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);
	if ($file_size > (1024*1024)) {
	  $factor = 1024*1024;
	  $symbol = 'Mb';
	} else if ($file_size > 1024 ){
	  $factor = 1024;
	  $symbol = 'Kb';
	} else {
	  $factor = 1;
	  $symbol = 'Bytes';
	}
	switch ($symbol) {
	  case 'Bytes' :
		$decimal = 0;
		break;
	  default :
		$decimal = 2;
		break;
	}
	$file_size /= $factor;
	$file_size = number_format($file_size, $decimal) . $symbol;
	if ($file_desc == 1) {
	  echo '			<td class="main" align="center">' . $downloads['products_name'] . ' - <a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $file_array['download_group_file_description'] . '<br>' . tep_image_button('button_download.gif', 'Download') . '</a> - ' . $file_size . '</td>' . "\n";
	} else {
// WebMakers.com Added: Downloads Controller Show Button
	  echo '			<td class="main" align="center"><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $downloads['products_name'] . '<br>' . tep_image_button('button_download.gif', 'Download') . '</a> - ' . $file_size . '</td>' . "\n";
	}
// EOF Super Download Shop v1.0 mod
  } else {
	echo '			<td class="main">' . $downloads['products_name'] . '</td>' . "\n";
  }
?>
<!-- right box -->
<?php
// BOF: WebMakers.com Added: Downloads Controller
  echo '			<td class="main">' . TABLE_HEADING_DOWNLOAD_DATE . '<br>' . tep_date_long($download_expiry) . '</td>' . "\n" .
	   '			<td class="main" align="right">' . $downloads['download_count'] . TABLE_HEADING_DOWNLOAD_COUNT . '</td>' . "\n" .
	   '		  </tr>' . "\n";
// EOF: WebMakers.com Added: Downloads Controller
}
?>
	  </tr>
	</table></td>
  </tr>
<?php
if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="smalltext" colspan="4"><p><?php printf(FOOTER_DOWNLOAD, '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>'); ?></p></td>
  </tr>
<?php
}
 }
?>
<?php
// BOF: WebMakers.com Added: Downloads Controller
// If there is a download in the order and they cannot get it, tell customer about download rules
 $downloads_check_query = tep_db_query("select o.orders_id, opd.orders_products_download_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.orders_id = opd.orders_id and o.orders_id = '" . (int)$last_order . "' and opd.orders_products_filename != ''");

if (tep_db_num_rows($downloads_check_query) > 0 && tep_db_num_rows($downloads_query) < 1) {
?>
  <tr>
	<td colspan="3" align="center" valign="top" class="main" height="30"><FONT FACE="Arial" SIZE=1 COLOR="FF000"><?php echo DOWNLOADS_CONTROLLER_ON_HOLD_MSG ?></FONT></td>
  </tr>
<?php
}
// EOF: WebMakers.com Added: Downloads Controller
?>
<!-- downloads_eof //-->


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

i make use of notepad plus,, but some times.. i edit in notepad itself.. if the code is small..

 

 

 

i succeeded in making the oscommerce work with contribution of 2.2.3 with paypal IPN.. but have to try regarding the super download shop.. how it works... i have worked with paypal and tested on sandbox.. and found working.. now.. after somuch struggle..

 

since i wiped out everything.. have to see now .. for my fresh copy..

Share this post


Link to post
Share on other sites

But the only problem is i am not getting the donwload link...

 

 

 

 

Warning: mktime() expects parameter 6 to be long, string given in /home/domain/public_html/includes/modules/downloads.php on line 49

 

 

how to solve this.. .. this message is appearing instead of the link for download

Share this post


Link to post
Share on other sites

OK.

 

If you have this code:

 

	  $dty = intval($dt_year);
  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dty);

And still get that error, change the first line to this:

 

	  $dty = (long)(intval($dt_year));

Let me know how PHP smokes that pipe.

;)


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

I've done some experimenting with the code on a test page on my site.

 

I'd like you to use this code instead:

 

	  $dty = intval($dt_year);
  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], (int)$dty);


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

hi.. thank you for your help..

 

these two codes worked for me. but unfortunately.. the link is not clickable.. for download.. also the date for download its showing as

Wednesday 29 November, 2000

 

 

 

 

 

these two codes worked from getting error.. mktime...

 

 

 

 $dty = intval($dt_year);
  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], (int)$dty);

 

$dty = intval($dt_year);
  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dty);

Share this post


Link to post
Share on other sites

Even i delete these two lines .. it doesnt give any error..,, but the download link expiry date is being set to 2000 year.. why its giving like this???

 

 

 

CAn you please.. let me know.. how to change this , i have given the expiry for 10 days.. from the present date. but its taking default of 2000 year

 

 

Link expires:

Wednesday 29 November, 2000

Edited by harikatt

Share this post


Link to post
Share on other sites
Even i delete these two lines .. it doesnt give any error..,, but the download link expiry date is being set to 2000 year.. why its giving like this???

CAn you please.. let me know.. how to change this , i have given the expiry for 10 days.. from the present date. but its taking default of 2000 year

Link expires:

Wednesday 29 November, 2000

 

 

Hi for this , right now i am entering the expiry of the product for download as 3000 days. And the testing is working.. i able to download the files.. .. can anybody post alternate.. correct coding to do in downloads.php

Edited by harikatt

Share this post


Link to post
Share on other sites

hari, can you pull up the order in your osC admin?

 

From this code:

 

date_format(o.last_modified, '%Y-%m-%d') as date_purchased_day

 

It looks like it's using the 'last modified' field of the order to determine the expiration date later in the code.

 

On the orders in the admin, what is showing as the 'last modified' field?

:unsure:

 

I'm not even sure you can find this field using your osC admin. You may have to go to your site's control panel and use PhpMyadmin to examine the DB to find this.

 

I really don't have any experience with this kind of stuff. I'm just trying to track the "date bug" down.

 

Since the code in downloads.php uses this other date (from the order), this seems like the logical place to start.


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

No. i couldnt able to find this way . MR.JIM/

 

any other way.. or any other way to change default product to work expiry from the purchased date.

Share this post


Link to post
Share on other sites

In this code segment from downloads.php, change what I have in RED and see if it works for you:

 

$downloads_query = tep_db_query("select o.orders_status, date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' and o.orders_status >= '" . DOWNLOADS_CONTROLLER_ORDERS_STATUS . "' and o.orders_id = '" . (int)$last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != ''");

As always, MAKE A BACKUP BEFORE MAKING ANY MODIFICATIONS.


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

I'm afraid I'll have to stop here, Hari.

 

I guess "two out of three" aint bad.

:lol:

 

I haven't a clue where to begin to solve your latest problem.

:blush:

 

I'd suggest starting a post in the "General Support Forum", and provide a link to this thread.

 

Good luck, and I'm sorry I can't be of service any more.


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

but i feel ,, you are on the right track.. but i should also have to edit in the root folder file download.php also.. .. along with the downloads.php, which is in includes..module..

Share this post


Link to post
Share on other sites

Thank you very much it worked now.

 

we should also edit the download.php. along with the downloads.php for the date stamping..

 

 

But. i am very much thankful to your knowledge.. ...

 

Now its working download along with super download store contribution with paypal IPN 2.3.3 for oscommerce 2.2 release..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×