I have just upgraded to Pro. When a user logs in they are directed to their profile page. I would like them directed to the home feed but I can't see how to do this. I have tried Jomsocial Redirect but when I use this, a green message appears which reads 'Login Successful' which I definitely do not want.
Hope you can help.
Hi Ben,
Would you mind provide me backend and FTP access, please? I will give you the solution for it :)
thank you!
you're welcome, glad to know that :)
Can you implement new switch in JomSocial Redirect plugin that can disable welcome message on successful login, because erasing message in settings just restores default message string. Since successful login results in drastic change of what user is presented with, message that confirms that is unnecessary.
1) Add new choice to jomsocialredirect.xml line 30:
<field name="redirect_login_msg_display" type="radio" default="1" label="Display welcome message on successful" login="">
<option value="0">No</option>
<option value="1">Yes</option>
</field>
2) Change line 88 to 90 on jomsocialredirect.php from:
88> if(count($mainframe->getMessageQueue()) == 0){
89> $mainframe->redirect($link, JText::_($this->params->get('redirect_login_msg', 'LOGIN_SUCCESSFUL')), 'message');
90> }
to look like this:
88> if(count($mainframe->getMessageQueue()) == 0){
89> if ($this->params->get('redirect_login_msg_display')){
90> $mainframe->redirect($link, JText::_($this->params->get('redirect_login_msg', 'LOGIN_SUCCESSFUL')), 'message');
91> } else {
92> $mainframe->redirect($link); } }
Hi Vladimir,
Thanks for sharing you code. I'm interested to do it because I don't want to show this message to my users when they Login into the site. I'm trying to implement your code but I detected to problems.
1.- First of them is related with:
<field name="redirect_login_msg_display" type="radio" default="1" label="Display welcome message on successful" login="">
<option value="0">No</option>
<option value="1">Yes</option>
</field>
in jomsocialredirect.php and I try to login with some user account it shows the following error message:if(count($mainframe->getMessageQueue()) == 0 && $this->params->get('redirect_login_msg_display') == 1){
Sry for errors in code was typing without testing.
Yes, one " was missing on first edit
I have corrected my previous post with correct code. Here is full code, once more, without line numbers for easier copy/paste:
1) Add new choice to jomsocialredirect.xml like:
<field name="redirect_login_msg_display" type="radio" default="1" label="Display welcome message on successful" login="">
<option value="0">No</option>
<option value="1">Yes</option>
</field>
2) Change line 88 to 90 on jomsocialredirect.php from:
if(count($mainframe->getMessageQueue()) == 0){
$mainframe->redirect($link, JText::_($this->params->get('redirect_login_msg', 'LOGIN_SUCCESSFUL')), 'message');
}
to look like this:
if(count($mainframe->getMessageQueue()) == 0){
if ($this->params->get('redirect_login_msg_display')){
$mainframe->redirect($link, JText::_($this->params->get('redirect_login_msg', 'LOGIN_SUCCESSFUL')), 'message');
} else {
$mainframe->redirect($link); } }
If you need to keep lines in check you can format above code in 3 lines:
if(count($mainframe->getMessageQueue()) == 0){
if ($this->params->get('redirect_login_msg_display')){$mainframe->redirect($link, JText::_($this->params->get('redirect_login_msg', 'LOGIN_SUCCESSFUL')), 'message');
} else {$mainframe->redirect($link); } }
Added new if ... else to check if there should be message for successful login and if so, show message after redirect. If there should be no message, just do redirect.
Thank you for the sharing idea :)
yeah right, we already implemented it on latest version