ISSUE SUMMARY:
Tried to use the code snippet you are giving to integrate jomsocial messaging. I managed to show a link in frontend that obens a box with message window, but page keeps loading and after 2-3 seconds it ends up with "
www.mydomain.de/#
" which leads to start page.
Snippet I found:
include_once JPATH_ROOT.'/components/com_community/libraries/core.php';
include_once JPATH_ROOT.'/components/com_community/libraries/messaging.php';
// Add a onclick action to any link to send a message
// Here, we assume $usrid contain the id of the user we want to send message to
$onclick = CMessaging::getPopup($userid);
echo '<a onclick="'.$onclick.'" href="#">Send message</a>';
Chrome console shows error:
GET
ajax.googleapis.com/ajax/libs/jqueryui/1...s/base/jquery-ui.css
404 ()
I guess it is an issue caused by wrong jquery loaded by my site?
Regards,
Daniel
HI, Daniel.
Thank you for contacting us.
Where did you find that snippet?
HI,
here:
documentation.jomsocial.com/wiki/Integrating_Your_Component
Regards,
Daniel
PS.: I was able to fix the query error but it did not fix the error with redirection to www.domain.de/#
HI, Daniel.
I assign developer to take a look.
Hi Daniel,
Can you provide me the stepsto test this action, please?
thank you!
Hi Dimas,
Not easy. I have a custom component with a user list. I want to have a button in this user list to use jomsocial messanging. Since it did not work to insert the given code, I just use a button that leads to jomsocial profile - where user can use "sent message" button. But I cannot implement the code snippet in the user list since it does not work and I have only my life site and no testing surrounding, so all users would have the feature not working. Understand?
Please see image.
Regards,
Daniel
Hi Daniel,
Please provide me the URL to access your screenshoot, you need upload your code to your staging site so we can test it .. I really need to test the "send message" on the live action directly, so I can you then :)
thank you
Hi Dimas,
pls login and go to:
testberichte.reviews/?option=com_events&...9&user_type=approved
And click on link "Nachricht senden (in Entwicklung)" (see screenshot).
Thx!
Regards,
Daniel
Hi,
Edit the html <a code to be like this :
<a onclick="joms.api.pmSend('1')" href="javascript:void(0)">Nachricht senden (in Entwicklung)</a>
HI,
replacing
<a onclick="'.$onclick.'" href="#">Send message</a>
with
<a onclick="joms.api.pmSend('1')" href="javascript:void(0)">Nachricht senden (in Entwicklung)</a>
gave me a blank page when loading the url :-(
With no chrome errors.
Regards,
Daniel
change to be like this
<a onclick="'.$onclick.'" href="javascript:void(0)">Nachricht senden (in Entwicklung)</a>
HI,
getting near...
now message can be sent but it is sent to "a guest", not to the user with id set in code.
I have added two examples:
$onclick = CMessaging::getPopup($row-id);
echo '<a onclick="'.$onclick.'" href="javascript:void(0)">Nachricht senden (in Entwicklung)</a>';
echo "</br>";
$onclick = CMessaging::getPopup($row->id);
echo '<a onclick="'.$onclick.'" href="#">Nachricht senden (in Entwicklung)</a>';
First one works properly in meaning of opening popup but send message to "a guest" (see attachement), second works in terms of opening the popup with message to correct user but page keeps loading and ends up at start page (as described initially) .
Pls check.
THX,
Daniel
Hi daniel,
I already logged and then I go to this page
testberichte.reviews/?option=com_events&...9&user_type=approved
but its redirected to another URL, so how can I test this issue again?
thank you!