Membership and Favourite Plugin. Can I add a URL to the Login Req Message
2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: December 22, 2017 (RSS)
By JeffC - December 4, 2017 - edited: December 5, 2017
Currently if a person try’s to add a favourite and they are not logged in they see the message. "You must login to use this feature!"
This is achieved with the code:
$GLOBALS['WSF_LOGIN_REQ_MESSAGE'] = "You must login to use this feature!"; // This is displayed if the user tries to add a favorite and isn't logged in
Is it fairly straightforward to add a bit of extra functionality to this code?
I would like to direct the user to a login page. I'm thinking this could be done in one of two ways, Either:
1. as a url link in the message… You must login to use this feature [link]
or
2 as an action. When user clicks [close] go to url
Thanks
By Dave - December 22, 2017
Hi Jeff,
Just saw this older post. Sorry for the delay. If you're still working on this you can checkout this code (and anywhere WSF_LOGIN_REQ_MESSAGE is referenced)
if (!$GLOBALS['CURRENT_USER']) { $onClick = "alert('" .jsEncode($GLOBALS['WSF_LOGIN_REQ_MESSAGE']). "'); return false;"; }
You could change that $onClick to have any javascript you wanted in it.
Hope that helps!
interactivetools.com