Members List - Show only Paid Members

11 years 3 months ago #103503 by kenlyle
Members List - Show only Paid Members was created by kenlyle
Is there a way to get CB to restrict the Members List to only holders of a specific CB Subs membership type?

Best,
Ken

Please Log in to join the conversation.

11 years 3 months ago #103527 by nant
Replied by nant on topic Re:Members List - Show only Paid Members
kenlyle wrote:

Is there a way to get CB to restrict the Members List to only holders of a specific CB Subs membership type?

Best,
Ken


What does restrict mean?

Please Log in to join the conversation.

11 years 3 months ago #103531 by kenlyle
Replied by kenlyle on topic Re:Members List - Show only Paid Members
Good one.

Only show paid Members in the list, particularly those of a certain level or status, like Show Only Gold level members.

K

Please Log in to join the conversation.

11 years 3 months ago #103551 by nant
Replied by nant on topic Re:Members List - Show only Paid Members
kenlyle wrote:

Good one.

Only show paid Members in the list, particularly those of a certain level or status, like Show Only Gold level members.

K


Using CB Fields integration set a value of a CB field according to subscribed plan.

Then use field value as a filter for your CB list - I think I have included a similar example inone ofthe use cases in the doc.

Please Log in to join the conversation.

11 years 3 months ago #105676 by jingato
Replied by jingato on topic Re:Members List - Show only Paid Members
or you can do what I did and write a custom plugin that accomplishes this. That way it is always used instead of just a filter that could be bypassed. I used the code below to only show users that have actives subscriptions.

[code:1]

global $_PLUGINS;


$_PLUGINS->registerFunction( 'onBeforeUsersListQuery', 'onBeforeUsersListQuery', 'getUserlist' );


class getUserlist extends cbTabHandler {


function onBeforeUsersListQuery ( $queryFrom ) {


$query = explode("WHERE", $queryFrom);
$queryFrom = $query[0];
$queryFrom .= ", #__cbsubs_subscriptions AS sub";
$queryFrom .= " WHERE ue.user_id = sub.user_id AND" . $query[1];
$queryFrom .= " AND sub.status = 'A'";


}
}[/code:1]

Please Log in to join the conversation.

10 years 9 months ago #120218 by ThePiston
Replied by ThePiston on topic Re:Members List - Show only Paid Members
jingato, how does one go about implementing that plugin? Anyone know?

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

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.439 seconds

Facebook Twitter LinkedIn