Skip Navigation

[Resolved] Unlock content

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 6 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#618088

Hi,

I am using toolset to create a database with custom entries.

I need to allow a specific user of a specific role to access X amount of custom posts of the type listings.

For example, we have a user with a limit of 60 listings. He can see the title and some fields of all the listings. He can then "check out" the listing. The checked out listing will allow him to view other fields meant only for users who checked the listing out. After checking out the listing he has 59 listings available.

I would like to implement this using toolset.

#618099

My Thoughts are to create a hidden field inside the listing called User ID's. Then the user clicks a button, which adds their User ID to the hidden field of the listing.
Then I would add another Listings Remaining field to the User. The same button would decrease the listings remaining by one

#618133

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - if you want to set specific limit count for particular role with particular user - what if you create a user custom field that will hold the limit count value - lets say 60.

And then whenever user create/checkout listing - you should decrease the user field value by 1 each time and update the custom user field value. Does this makes sense?

More info:
=> https://toolset.com/documentation/user-guides/user-fields/#create-a-group-for-user-fields

#618217

Hi Minesh,

Yes that is what I was I said in my previous post. How can I make that happen with Toolset?

Create a button that when pressed, it subtracts 1 from the posts remaining user field, then adds the user ID to the posts user ID fields.

#618219

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - you should try create CRED form and add only submit button and use CRED hook cred_save_data so when it clicked you should add the code withing the cred_save_data hook to update the total user counts.

adds the user ID to the posts user ID fields:
==> For this - you should create a repeating numeric field to hold the user IDs.

More info:
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data