Members account with associated file uploads
Hi there.
I am trying to produce a members area for a site where the member can upload various documents that are required before they can hire equipment from my client. The client requires proof of address, identity and insurance.
I have the members section working, and I have a form where they can upload the relevant files. What I am unsure of is how to link those files to the member who uploaded them? I would like to display on the account page an indication if the files have been uploaded and that they are awaiting verification. Then once the member is tagged with 'Verified' display success on their account page.
How can I test for file uploads and connect it with the relevant member? Ideally I would also like to output these files next to the member information in the Perch Admin, at the moment the client will have to look at the members section to get member information, and then look at the forms section to get the files. Can these two be linked?
Many thanks, Rob
How are you handling the file uploads?
The file uploads are being handled by perch forms. Is there another option?
Is there a search feature for the members section as well? The client is worried as to how they will find individual members when there are lots in there.
Please could you also shed some light as to why this isnt working. Currently it automatically adds the 'unverified' tag correctly but doesn't remove it when the 'verified' tag is added in the CMS:
It is on my main members account page which is the first thing they arrive to after registering. I want to automatically tag all members as 'unverified' when they sign up, but then remove that if they have been tagged as 'verified'. Then if the 'verified' tag has expired I would like them to be retagged with 'unverified'.
Also If I remove the 'verified' tag and refresh the page the output is still as if verified:
However...updating the form on the page seems to make it all work. Why would this be?
Updating which form on which page, sorry?
The member form on the account page:
Either way, when logging into the account a member who is tagged as 'verified' still has the tag 'unverified' despite:
at the top of the page.
If you change a tag, typically it won't take effect until the next page load.
Indeed, but this is not happening. Both tags stay assigned to the member despite multiple page loads, logging in and out of the member account page and refreshing of the admin etc.
But not when submitting one particular form?
I've removed all forms from the page to try and get this functionality working on its own. It still doesn't work within that if statement. However, lets turn this around because I'm not sure that will achieve what I want any way if it requires a reload of the members account page.
I'm trying to find a way to display in the perch admin all the members that are verified, and all the members that are unverified. The client needs to be able to quickly look and see if someone they are hiring to has been checked and verified. Verification tags will have an expiry date so ideally I need the unverified tag to be added to the member on the expiry of the verified tag...is that possible?
Equally, back to my original question...you hinted there was a possible solution to linking files from a form with a member account?
I've been trying a suggestion from another post and its almost working. I'm planning on putting this as a dashboard app so that everytime the client logs into the Perch UI they update all the member tags. So far this removes the 'unverified' tag if a member has the tag 'verified'. But is doesn't add the 'unverified' tag if the user DOES NOT have the 'verified' tag. So close! Verified and unverified are being output to the page correctly via the echo but its just the final member tag not updating. Any idea why not?
perch_member_add_tag()
andperch_member_remove_tag()
act on the current authenticated member account. They won't work in this context.I think you want to use
$Member->add_tag()
instead.Great thank you, that is adding the tags. How do you remove a tag?
$Member->remove_tag()
doesn't do it. The if statement still doesn't seem to work, it adds tags regardless if true or not:Alternatively, is there a way in the perch admin to display all members who dont have a tag? that would solve this issue completely. So view everyone without the tag 'verified'.
Adding a tag removes the existing tag and adds the new one. If you add the tag you want to remove, setting an expiry of the current time (or a time in the past) that will remove the tag.
That doesn't seem to work? My page looks like so:
The tag 'unverified' stays attached in the Perch UI.
The expiry date is the third argument.
Thank you, we are getting there step by step. How would one test for members with a certain tag? I've tried:
and
I can get a list of all the tags with:
But not sure how to work out if a member has a tag assigned?
get_by_tag_for_admin_listing()
will get members by tag, but it's for admin purposes, not for use on the site front end.So how would you get either a list of members tags or a list of members with a certain tag?
In what context are you trying to get the list? In an app, or as part of your site?