Skip Navigation

[Résolu] Unlock content

This support ticket is created Il y a 6 années et 9 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par Minesh Il y a 6 années et 9 mois.

Assisté par: Minesh.

Auteur
Publications
#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

Les langues: Anglais (English )

Fuseau horaire: 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

Les langues: Anglais (English )

Fuseau horaire: 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