latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

database eot search script?

Home Forums Community Forum Unofficial Extensions/Hacks database eot search script?

This topic contains 2 replies, has 2 voices. Last updated by  Danny Kim 3 years, 5 months ago.

Topic Author Topic
Posted: Wednesday Jul 24th, 2013 at 2:25 am #53948
Danny Kim
Username: dannyk1m

Hello. I’m looking for a script to search the database for member eot dates.
I have a script I want to run but I first need to search for the current members eot dates.

something like..

$USER_EOT_DATE = global($s2member_eot_date)
if ($USER_EOT_DATE = ("+30 DAYS", 'CURRENT DATE')) {
	[RUN MY SCRIPT]
}

is there a script or variable that searches all the members eot dates?

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Sunday Aug 4th, 2013 at 11:18 pm #55186
Moderator

You’ll need something like this.

global $wpdb;

$query = "SELECT `user_id`, `meta_value` FROM `wp_usermeta` WHERE `meta_key` = 'wp_s2member_auto_eot_time' AND `meta_value` != ''";

foreach($wpdb->get_results($query) as $result)
	echo $result->user_id.' EOT Time = '.$result->meta_value."\n";
Posted: Monday Aug 5th, 2013 at 5:44 am #55217
Danny Kim
Username: dannyk1m

Thank you for your reply.

So how would I use this if trying to implement an if statement like..

(wordpress eot date search)
if (wp_s2member_auto_eot_time >= “31 July 2014”) {
blah blah blah
}

global $wpdb;

$query = "SELECT `user_id`, `meta_value` FROM `wp_usermeta` WHERE `meta_key` = 'wp_s2member_auto_eot_time' AND `meta_value` != ''";

foreach($wpdb->get_results($query) as $result)
	if (wp_s2member_auto_eot_time >= "31 July 2014" {
	    [do this action]
	}

..would that be correct? lets say the action is sending an e-mail. would the e-mail send? (assuming the e-mail code is correct of course)

Viewing 2 replies - 1 through 2 (of 2 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.