PDA

View Full Version : Paid subscription renewel email, how to change the time.


huskermax
12-11-2010, 01:26 AM
This is from vbulletin.com so I wanted to post this here to see if any one can help me out here as I describe below. Here is the original thread (http://www.vbulletin.com/forum/showthread.php?368606-Paid-Subscription-script-not-sending-out-email-Globle-set-up-for-paid-subscription&p=2086340#post2086340) on the .com board.

The timing is hard-coded into the includes/cron/subscriptions.php file around line 48 (for 4.1). You can change this value here.

Note that we cannot officially support code modifications or forums running modified code. If you require support from us, we may ask you to re-upload all original files thus overwriting any changes you make.

Regarding mass moving users, you can use AdminCP > Users > Prune/Move Users to do this. There is no way to mass-subscribe people at this time however.

// time for the reminders
$subscriptions_reminders = $vbulletin->db->query_read("
SELECT subscriptionlog.subscriptionid, subscriptionlog.userid, subscriptionlog.expirydate, user.username, user.email, user.languageid
FROM " . TABLE_PREFIX . "subscriptionlog AS subscriptionlog
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = subscriptionlog.userid)
WHERE subscriptionlog.expirydate >= " . (TIMENOW + (86400 * 2)) . "
AND subscriptionlog.expirydate <= " . (TIMENOW + (86400 * 3)) . "
AND status = 1
");

Is it the "(TIMENOW + (86400 * 2)) . " and "(TIMENOW + (86400 * 3)) ."?

I got basic html knowledge and that is about it. Would like to change this to 2 weeks and then 3 days. Is this the right section?

calorie
12-11-2010, 01:56 AM
TIMENOW is the time when the script runs, and there are 86400 seconds in a 24 hour period, so this:

subscriptionlog.expirydate >= " . (TIMENOW + (86400 * 2)) . "

Means the expiry date is more than two days in the future from TIMENOW and this:

subscriptionlog.expirydate <= " . (TIMENOW + (86400 * 3)) . "

Means that the expiry date is less than three days in the future from TIMENOW.

So when the subscriptions cron runs it looks for subscription data from those active subscriptions set to expire between two and three days into the future.

Not sure what you mean by "change this to 2 weeks and then 3 days" but maybe you can now edit that query using the above information.

huskermax
12-12-2010, 05:17 PM
TIMENOW is the time when the script runs, and there are 86400 seconds in a 24 hour period, so this:

subscriptionlog.expirydate >= " . (TIMENOW + (86400 * 2)) . "

Means the expiry date is more than two days in the future from TIMENOW and this:

subscriptionlog.expirydate <= " . (TIMENOW + (86400 * 3)) . "

Means that the expiry date is less than three days in the future from TIMENOW.

So when the subscriptions cron runs it looks for subscription data from those active subscriptions set to expire between two and three days into the future.

Not sure what you mean by "change this to 2 weeks and then 3 days" but maybe you can now edit that query using the above information.

That makes sense! Thanks for explaining that I can do what I need to do.