Forum

Thread tagged as: Question, Forms, Members

Add perch member tag on login

Hi,

I'm trying to add a tag to a perch member when they login. I found this old thread where they have done it on an profile change form and tried to implement it on the login form but without the if name_change stuff

Is this possible and is there a simple way to do it?

Thanks,

Charlie

ewe agency

ewe agency 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The event members.login is fired when a member logs in. You can register a listener for that event and then add the tag when you see it.

https://docs.grabaperch.com/api/events/

Perfect i've got that working to add a tag when a member logs in. Is there anyway to add the current date/time that they logged in using strtotime() or not?

Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

To the tag you mean?

Yeah so we can tag when users have logged in

It seems to me it would be better to make a script which logs to a file rather then setting a tag on a logged in user each time...

I would set a tag with a 24 hour expiration and log this to a file, then just continue logging each login within the period...

Hmm I wouldn't really know where to start with writing a script to log in a file and it needs to be easy for my client to see who has logged in and when