PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |

Go Back   PhotoPost Community > PhotoPost Support > PhotoPost Classifieds Support > Classifieds Installation & Upgrades

Classifieds Installation & Upgrades If you're having install or upgrade problems, post here.

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old December 19th, 2009, 04:27 PM   #1 (permalink)
Member
Verified Customer
 
Join Date: Jul 2004
Posts: 49
Sendnotice.php emails 10 days before ads expire

Hi,
I have a problem with sendnotice.
It runs for ads expiring within 10 days, not 3 as written in code.
I tried to understand without success :
I printed out $today $expire enddate $mday ...
everything is ok but all ads that are expiring within 10 days are considered.
(not exclusively 10, but from 1 to 10)
Any idea ?

my sendnotice.php according to my Classifieds version :
Code:
Content visible to verified customers only.
fabz is offline   Reply With Quote
Old December 19th, 2009, 07:17 PM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
Well if you printed the variables what was the result for $expire?

The code itself is pretty explicit. $expire should be 3 days.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 19th, 2009, 07:44 PM   #3 (permalink)
Member
Verified Customer
 
Join Date: Jul 2004
Posts: 49
Here are some informations (abstract) executing the script just now :

(print out)

--> datas
today=1261273010 mday=23 expire=1262137010

translation :
today: Sunday, December 20th 2009, 01:36:50 (GMT)
expire: Wednesday, December 30th 2009, 01:36:50 (GMT)


Email to: xxx@hotmail.com [xxx] about ad 6564:
[xxx, your ad Canon ixus 800is on xx.com will expire in 6 days.
If you want to renew it 60 more days, click on the link below:
http://...../renew.php?product=6564&unlock=1261753868]
(unlock : Friday, December 25th 2009, 15:11:08 (GMT) )

Email to: xxx@gmail.com [xx] about ad 6828:
[xxx, your ad EHS-ST9 on xx.com will expire in 10 days.
If you want to renew it 30 more days, click on the link below:
http://...../renew.php?product=6828&unlock=1262099825]
(unlock : Tuesday, December 29th 2009, 15:17:05 (GMT) )
fabz is offline   Reply With Quote
Old December 19th, 2009, 08:18 PM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
dont know what to tell you unless some php bug on your server this is pretty explicit to me here

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 19th, 2009, 11:51 PM   #5 (permalink)
Member
Verified Customer
 
Join Date: Jul 2004
Posts: 49
I run PHP Version 4.4.9

I can also run PHP 5 for this script because I run both on my server.
Do you think I risk anything in running only this sendnotice in php5 ?
fabz is offline   Reply With Quote
Old December 20th, 2009, 05:13 AM   #6 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
No I am merely saying I dont know why yours would be 10 days. I mean look at the lines I posted

$mday is a day so we do that plus 3 to get the time 3 days from right now
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 20th, 2009, 11:39 AM   #7 (permalink)
Member
Verified Customer
 
Join Date: Jul 2004
Posts: 49
What I don't understand is that the values are correct, $mday + 3 is right, $today, $expire too.
Everything is good except the select collect ads expiring from 0 to 10 days (I never saw more).

Yesterday I checked quickly one of those products in the database and I cannot see what is the problem.
fabz is offline   Reply With Quote
Old December 20th, 2009, 05:09 PM   #8 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
$mday + 3 is right hense why I dont know why your server would be doing 10 days and not 3
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 20th, 2009, 09:23 PM   #9 (permalink)
Member
Verified Customer
 
Join Date: Jul 2004
Posts: 49
I try to see what is the problem without success.
So I ran the script and printed out every command at each step to see what PHP is doing :

running sendnotice.php

$today=1261365284

Query to close expired ads :
UPDATE pa_products SET approved=2,status='1261365284' WHERE enddate < 1261365284 AND isauction=0

test : if ( $timediff > 86399 )
$timediff=1261365284
1261365284 >86399 so run the query :
UPDATE pa_stats SET lastupdate='1261365284' WHERE id=1

Select ads that expire in 3 days:
SELECT id,user,userid,title,enddate,duration FROM pa_products WHERE enddate < 1262229284 AND status=0 AND isauction=0

Then it deals with ads that expire within 0 to 10 days.

Do you see something wrong ?
regards
fabz is offline   Reply With Quote
Old December 21st, 2009, 05:35 AM   #10 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
How about maybe trying to make this line

Code:
Content visible to verified customers only.
Obviously that line simply means in php to give me the unix timestamp 3 days from right now lets use another way in php and see what you get

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 21st, 2009, 09:38 PM   #11 (permalink)
Member
Verified Customer
 
Join Date: Jul 2004
Posts: 49
I replaced as suggested the $expire calculation, and it's better.
It shows me only one expiring ad in 1 day.

If I run sendnotice with the previous method (mktime with day+3) I noticed ads expiring in 3 days, that don't show with time() + 86399;
It might be due to timezone between server and users ?
fabz is offline   Reply With Quote
Old December 22nd, 2009, 12:45 AM   #12 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
There has to be some kind of bug in your PHP version.

mktime with $mday + 3 and the other calculation I posted are the SAME THING. Just different ways of doing it.

The expire calculation is simply the time right now plus 3 days. 86399 seconds is 3 days.

I am just trying to figure out why your server is doing 10 days not 3 when the code math whatever you want to call it is all 3 days.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 22nd, 2009, 02:33 AM   #13 (permalink)
Member
Verified Customer
 
Join Date: Jul 2004
Posts: 49
... in few words... you're right and I d'ont know
fabz is offline   Reply With Quote
Old December 22nd, 2009, 07:22 AM   #14 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
Try this one

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Old December 22nd, 2009, 11:54 AM   #15 (permalink)
Member
Verified Customer
 
Join Date: Jul 2004
Posts: 49
First glance.... it seems to be ok
I check next days and I tell you.

Thank you very much Chuck.
fabz is offline   Reply With Quote
Old December 22nd, 2009, 11:55 AM   #16 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,069
Not a problem glad to help.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
'sendnotice.php' has Deleted Ads? Ronseal Classifieds Bug Reports 19 January 8th, 2009 10:04 AM
Ads don't expire... PanamaRed Classifieds Bug Reports 10 May 16th, 2007 03:09 PM
Ads will not expire? CrimsonGT Classifieds How do I...? 3 September 18th, 2006 08:40 AM
Does sendnotice.php remove the ads from the database? Andy R Classifieds Installation & Upgrades 7 November 22nd, 2005 09:06 PM
How do ads expire? kraftworkz Before You Buy 1 October 30th, 2004 08:08 PM


All times are GMT -5. The time now is 06:19 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0