Expiration email question

13 years 4 months ago #147451 by ThePiston
Replied by ThePiston on topic Re:Expiration email questi
I sent out a test email for this expiration:
[code:1]$zero = strtotime($today) + 3600;[/code:1]
and my expiration was set to 2010-11-30 07:59:59. (should have been midnight of my test day) When I went to the website at about 11am I was already expired. Should I add 24 hours to that time if I want it to be an expiration of "today"?

**edit**

I think the bigger question is why this date in the backend (2010-11-30 07:59:59) equals 2010-11-29 on frontend. To me that says 8am in the morning of 11-30 but it says I expired on 11-29. What's going on with the time difference?

**edit2**
I just added 24 hours to the "today" code so it looks like this:
[code:1]$zero = strtotime($today) + 24*3600;[/code:1] I think this will work

Post edited by: ThePiston, at: 2010/12/01 16:03

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X

Please Log in to join the conversation.

13 years 4 months ago #148535 by ThePiston
Replied by ThePiston on topic Re:Expiration email questi
getting an unexpected error and I cannot find out why. The error

Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/site/public_html/my_scripts/renew.php on line 18

is talking about this line:
[code:1]$4week = strtotime($today) + 672*3600;[/code:1]

and the full code is:
[code:1]<?php
require ("db_info.php"«»); // grabs the database info
$today=date('Y-m-d');

// Opens a connection to a mySQL server
$connection=mysql_connect ($hostname, $username, $password);
if (!$connection) {
die('Not connected : ' . mysql_error());
}

// Set the active mySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
die ('Can\'t use db : ' . mysql_error());
}

$4week = strtotime($today) + 672*3600;
$3week = strtotime($today) + 504*3600;
$2week = strtotime($today) + 336*3600;
$1week = strtotime($today) + 168*3600;
$zero = strtotime($today) + 24*3600;

$expire= date('Y-m-d', $4week);
$expire2= date('Y-m-d', $3week);
$expire3= date('Y-m-d', $2week);
$expire4= date('Y-m-d', $1week);
$expire5= date('Y-m-d', $zero);[/code:1]

What's wrong with that code?

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X

Please Log in to join the conversation.

13 years 4 months ago #148537 by ThePiston
Replied by ThePiston on topic Re:Expiration email questi
*edit* you cannot start a variable with a number - I changed $4week to $week4 and fixed issue

Post edited by: ThePiston, at: 2010/12/15 16:35

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X

Please Log in to join the conversation.

13 years 4 months ago #148733 by ThePiston
Replied by ThePiston on topic Re:Expiration email questi
does anyone know of a php snippet that will allow us to throttle emails? This php script could potentially send thousands of emails at one time

Post edited by: ThePiston, at: 2010/12/15 16:36

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X

Please Log in to join the conversation.

13 years 4 months ago #149236 by thirdsun
Replied by thirdsun on topic Re:Expiration email questi
Does anyone have the latest version of this script, or is the first one posted still valid?

I guess this feature didn't make it into 1.1.2?

Thanks

Please Log in to join the conversation.

13 years 4 months ago #149269 by Aly
Replied by Aly on topic Re:Expiration email questi
Am wondering the same thing in both cases. I sent Rod an email but didn't get a response and am unsure whether this feature made it into 1.1.12 I would really love to be able to give my users a head's up when their membership is about to expire.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.304 seconds