How about the ability to show the membership expiry date on the user's profile page as well as being able to post it in a custom view?

Comments

boobaa’s picture

Good idea, and it is not too difficult to implement.

mdowsett’s picture

cool! I thought Views integration may require a lot of work. I'm looking forward to seeing that.

boobaa’s picture

Well, do you want to have complete Views integration, or just a simple field added onto the user's profile page? ;)

mdowsett’s picture

Views integration....so you can show a member's expiry date in a View Table

boobaa’s picture

Status: Active » Closed (fixed)

The just released membership-5.x-1.1 has views support in it.

mdowsett’s picture

Status: Closed (fixed) » Active

I upgraded my test site OK, it shows the "Membership Expires" field in Views....but now I go to update the live site to the v1.1 of the membership module and it doesn't show that field in the Views creation.

But then again, it doesn't show some other module's fields (signup) so it may be a deeper problem...any ideas? I even tried to create a brand new View and those fields aren't listed to be chosen.

mdowsett’s picture

Status: Active » Closed (fixed)

Nevermind...I disabled and re-enabled the membership module and that fixed it....strange...

mdowsett’s picture

Version: 5.x-1.0 » 5.x-1.2
Status: Closed (fixed) » Active

I'm re-opening this...

I just noticed that the 'Membership Expires' field IS in the View's field listing.....but not in the Views' Filter listing

I'd like to create a View that only has member's with current memberships (ie the membership expires date hasn't passed)

mdowsett’s picture

Status: Active » Needs work

I took a stab at adding it to the filters....I'm no coder (at all) so I don't know how to create a patch.

I tried putting this code in the existing views section of the membership.module file:

'filters' => array(
	  'expires' => array(
		'field' => 'expires',
		'name' => t('Membership: Expires'),
		'operator' => 'views_handler_operator_gtlt',
		'value' => views_handler_filter_date_value_form(),
		'option' => 'string',
		'handler' => $handler,
		'help' => t('This filter allows bios to be filtered by their Membership expiry date. Enter dates in the format: CCYY-MM-DD HH:MM:SS. Enter \'now\' to use the current time. You may enter a delta (in seconds) to the option that will be added to the time; this is most useful when combined with now. If you have the jscalendar module from jstools installed, you can use a popup date picker here.'),
	  ),
	),

I didn't get errors so I was proud! :) But it doesn't list the "Membership: Expires" item in the list of available filters.

Can someone review to see if I was close?!

Many thanks.

mdowsett’s picture

Status: Needs work » Closed (won't fix)

I found a work-around....linking membership processing to a role and then using that role as a filter in the view.

Works nicely and opens the door to other features (auto denied access to site/features as membership expires)

mdowsett’s picture

Status: Closed (won't fix) » Active

now for the opposite...how would I create a Views list of people with an expired membership?

I believe once a user's membership has expired, it reads 'never' as the date and removes them from the Membership role.

#1 I tried using the 'Membership Expires' field is less than 'now'. That showed noone.
#2 I tried using the 'Membership Expires' field equals 'never'. That showed noone.
#3 I tried using the 'Role: Author Role' is 'none of' and selected the Membership role but that showed all users.

I didn't expect the 'Role: Author Role' one to work since it's wording talks about INCLUDING node owners that fit the selected role(s) whereas I want to EXCLUDE users...I don't think I'm using that field right.

It seems to me the best solution would be go get #1 or #2 from above working

boobaa’s picture

Status: Active » Closed (won't fix)

Development of membership.module is being discontinued for now (and you failed to submit a proper patch, anyway). Check Role Expire module which claims to have much better Views integration, and countless other improvements (eg. multiple managed roles). Anyway, sticking with D5 seem to be a bit dull nowadays without stating proper reasons.