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.

Help Finding Topic on Showing EOT in Admin?

Home Forums Community Forum Help Finding Topic on Showing EOT in Admin?

This topic contains 12 replies, has 3 voices. Last updated by  Bruce 4 years, 3 months ago.

Topic Author Topic
Posted: Tuesday Sep 11th, 2012 at 11:12 am #24908

I know its out there- because i used to have it in effect, but somewhere along the lines of updates I’ve lost the column in Admin User List that shows the user’s EOT.

Can you help me find the topic thread- or help in adding the code back to the columns?
:)

-grace

List Of Topic Replies

Viewing 12 replies - 1 through 12 (of 12 total)
Author Replies
Author Replies
Posted: Tuesday Sep 11th, 2012 at 1:57 pm #24916
Bruce
Username: Bruce
Staff Member

Hi Grace,

I believe I had released a hack awhile ago on the Old Forum System for this. I’m going to do some digging today and create a new one and put it in the Knowledge Base. I’ll reply here when it’s finished.

Also, I believe it may be possible to send email alerts through a PHP script to tell you when a user is nearing their EOT date. I will put that in the KB article as well.

Let us know of any other specific feature requests you’d like to see in s2Member, we really appreciate the input. Right now, Jason is working on the new s2Member, so new feature development is not being done at the moment, but we’ll gladly help you out with adding small features in.

Posted: Monday Sep 17th, 2012 at 6:56 am #25552
Mary May
Username: marymay

ME TOO!

We’re also interested in that hack and KB article. Soon?

Thanks,

Posted: Monday Sep 17th, 2012 at 3:14 pm #25604
Bruce
Username: Bruce
Staff Member

Hi Mary,

I’m going to try to get this up today, or some time tomorrow.

Thanks for your patience.

Posted: Sunday Sep 23rd, 2012 at 2:23 am #26160
Bruce
Username: Bruce
Staff Member

Sorry for the delay

I’ve put up the Knowledge Base article on EOT Notifications.

There has been a bit of trouble with setting up the EOT column with the ability to sort users by their EOT date. We would like to sort out this issue before posting information on this.

Thank-you for your patience! :)

Posted: Tuesday Sep 25th, 2012 at 8:15 am #26422
Mary May
Username: marymay

THANKS for that article Bruce! It is very helpful

Similar, but different, I’m wanting to implement a hack that is triggered by “ws_plugin__s2member_during_auto_eot_system_during_demote”. The codex suggests starting with:

add_action("ws_plugin__s2member_during_auto_eot_system_during_demote", "my_eot_hook_function");
function my_eot_hook_function($vars = array())

I have not been able to find a specific set of information. Maybe I haven’t looked in the right place? Other than a trial and error approach (waiting for someone to fall into EOT, then iterate…), where can I find out exactly what is passed in the $vars array? Is it associative or indexed? What keys might it have? etc.? I can eventually understand through stepwise revelation, but would prefer accurate documentation.

Posted: Tuesday Sep 25th, 2012 at 7:46 pm #26494
Bruce
Username: Bruce
Staff Member

KB Articles Finished

A post on adding the sortable EOT column to your WordPress Users list has been posted here:

http://www.s2member.com/kb/adding-a-sortable-eot-user-column/


I have not been able to find a specific set of information. Maybe I haven’t looked in the right place? Other than a trial and error approach (waiting for someone to fall into EOT, then iterate…), where can I find out exactly what is passed in the $vars array? Is it associative or indexed? What keys might it have? etc.? I can eventually understand through stepwise revelation, but would prefer accurate documentation.

Due to the way s2Member handles its Filters and Hooks, there is no specific documentation regarding all of the filters.

The Codex documents where these filters and hooks are. s2Member generally passes all of the variables it is using (with get_defined_vars()) within the function these hooks and filters are called. Therefore if you can find where s2Member declares do_action() for ws_plugin__s2member_during_auto_eot_system_during_demote either within the Codex, or within a copy of s2Member, you can find the variables that are passed.

In this case, s2Member does your action at line 248 in s2member/includes/classes/auto-eots.inc.php which means you should have a LOT of variables at your disposal, including $user_id, $existing_role and $demotion_role, which are (most likely) what you’re searching for.


To use these variables, you’ll want to do something like this:

add_action('ws_plugin__s2member_during_auto_eot_system_during_demote', 'my_eot_hook_function');
/**/
function my_eot_hook_function($vars)
	{
		extract($vars); # This allows the variables to be used as they were within s2member/includes/classes/auto-eots.inc.php
		/**/
		if($demotion_role === 's2member_level0')
			echo 'It\'s level 0!'; # Keep in mind you'll most likely never see something that's echoed out (especially on a live site) here, because it's being processed through WP_Cron, which means that a robot, such as Google may be the one to trigger this demotion, or another user
	}

If you have any further issues with this, please create a new thread for the fastest response.

Thanks!

Posted: Wednesday Sep 26th, 2012 at 8:43 am #26559

Hi Bruce :)
Thank you so much for that EOT column hack.
Have implemented it and it displays perfectly – * but is not sortable. When clicking the EOT sort shows no results at all.

-grace

Posted: Wednesday Sep 26th, 2012 at 6:10 pm #26621
Mary May
Username: marymay

Thanks Bruce for the information about passed $vars. That helps immensely.

It suggests to me that all the vars mentioned in the normal EOT API Notification email are available.
i.e. eot_del_type, subscr_id, user_first_name, user_last_name, user_full_name, user_email, etc.

Posted: Wednesday Sep 26th, 2012 at 6:27 pm #26624
Mary May
Username: marymay

Thanks also for the sortable EOT column. It works for me.

Like Grace, I wondered if something were wrong when I sorted the column and saw nothing. However, most of our members have monthly subscriptions, which have no EOT dates. The one-time-purchases for specific periods DO have EOT dates and those entries get sorted correctly … with most showing up on the last page.

Nice hack. Good to have. Thanks!

Posted: Wednesday Sep 26th, 2012 at 7:49 pm #26630
Bruce
Username: Bruce
Staff Member

Hi Grace,

Have implemented it and it displays perfectly – * but is not sortable. When clicking the EOT sort shows no results at all.

Sorry about the confusion. I believe this is being caused by the way I handled the WordPress database prefix within the hack. You have a database prefix other than ‘wp_’ correct?

Try the updated code at http://www.s2member.com/kb/adding-a-sortable-eot-user-column/


Hi Mary,

Like Grace, I wondered if something were wrong when I sorted the column and saw nothing. However, most of our members have monthly subscriptions, which have no EOT dates. The one-time-purchases for specific periods DO have EOT dates and those entries get sorted correctly … with most showing up on the last page.

Unfortunately it’s not possible to change this functionality, as WordPress does not have any specific filters for this, and I was forced to actually edit the mySQL query itself using ‘pre_user_query’. If we find a better way to do this, I’ll update the KB on it. :)

It suggests to me that all the vars mentioned in the normal EOT API Notification email are available.
i.e. eot_del_type, subscr_id, user_first_name, user_last_name, user_full_name, user_email, etc.

Yes that’s correct, as long as you extract($vars); within your filter/hook.

The functionality of get_defined_vars(); really is exceptional. You can check out some documentation on it here:

http://php.net/manual/en/function.get-defined-vars.php

Posted: Wednesday Sep 26th, 2012 at 8:51 pm #26633

Thanks Bruce – that adjustments works perfectly now! :)
(I have thousands of users with EOTs no there was no way it would be a blank result.)

-grace

Posted: Wednesday Sep 26th, 2012 at 8:53 pm #26634
Bruce
Username: Bruce
Staff Member

Thanks Bruce – that adjustments works perfectly now! :)
(I have thousands of users with EOTs no there was no way it would be a blank result.)

Great! Glad to hear it! :)

Viewing 12 replies - 1 through 12 (of 12 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.