Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with Free downloads Mod after Moving to server


plazman65

Recommended Posts

 I have this mod installed http://addons.oscommerce.com/info/8080. It works perfect on my local server and downloads correctly

.

When I transferred everything online including the database,this was updating the database from 2.2 to 2.3  It completes the order online no problem but when you go to download the file you get this error

 

Warning: mktime() expects parameter 6 to be long, string given in /home4/tristan1/public_html/download.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /home4/tristan1/public_html/download.php:31) in /home4/tristan1/public_html/download.php on line 122

 

In comparing databases etc the the only thing I have been able to figure out that the column "last_modified" in the new orders table database doesnt have a value in it. If I add a date manually in the database the error goes away and the product downloads correctly. I double checked the structure and they are both the same. Since the files are synchronized. I think I need to be looking at something in the database but Im not sure what?  Thanks for any help :)

Link to comment
Share on other sites

I think you would be better to spend time working out why the last modified column is not being set when the order is created.

 

Check the field default value and the code that adds the order to the db.

 

HTH

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

@@plazman65 It is an incompatibility problem with the versions of php. Look at the code given at that line and it will have the mktime function. After the first comma, add (int) at the beginning of the second parameter. Since that function is used to set the date, it is also most likely the reason for the empty column.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@plazman65 It is an incompatibility problem with the versions of php. Look at the code given at that line and it will have the mktime function. After the first comma, add (int) at the beginning of the second parameter. Since that function is used to set the date, it is also most likely the reason for the empty column.

Thanks!

 Here is the code

  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);

 

Im unsure where to put the (int) in it? Can you help? Thanks!

 

Link to comment
Share on other sites

I'm sorry. I misread the error. It said parameter 6, not 2. The code should be changed to

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

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

 

I'm sorry. I misread the error. It said parameter 6, not 2. The code should be changed to

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

 Thank you it works like a charm! (w00t)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...