Limit who can View Profile

11 years 1 month ago #223219 by stuntlist
Limit who can View Profile was created by stuntlist
Hi,

We have a Joomla 1.5 site running CB Subs 2.0.2 and CB 1.8.1.
We have set up a CB List that displays all the Users in the system, and you have to be logged in to View user Profiles. What we would like to do, is make it so only users with a current valid paid up subscription can view other user's profiles. We have a CB field that is checked when the user has a vaild subscription and unchecked when their subscription expires or they have just registered on the site. See: www.staging.stuntlist.com/west-members, the View Profile link on each subscribe needs to be changed if the person logged in doesn't have a valid subscription.

So, in /components/com_profiler/plugin/templates/custom/custom.php in
function _getUserListCell( &$cellFields ) we need to be able to access this CB paid field and see how it is set to determine if we show the View Profile link or we show a link that takes the user to a page that tells them they need to subscribe to view profiles. I see that the function _getUserListCell( &$cellFields ) has a global $my variable. Is there a way to get the CB paid field value using $my?

Thank you for any help on this.

Please Log in to join the conversation.

11 years 1 month ago #223331 by krileon
Replied by krileon on topic Limit who can View Profile
We can't advise you on core edits, sorry.

The simplest approach is using CB Auto Actions and setup a redirect with a conditional to check if a field value is set to 1 or 0 (checkbox probably) then use CBSubs to set the field based off the users subscription status. In your Redirect action you'd redirect away from profile if the field is equal to 0. This however will require a Professional subscription for CB Auto Actions.

Aside from that you can try creating your own trigger based plugin that does all your checks with the before profile request trigger. You can find information on creating your own trigger based plugin (plus example) below.

www.allmysocials.com/directory/tutorials/item/228-event-triggers


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.270 seconds

Facebook Twitter LinkedIn