Can someone help me, please?
I really need this function. No one?
@l-tic unless the person clicking the link is involved in the conversation, linking to a private message will surely result in a 404?
<a href="/<?php echo bp_core_get_username( $user_id ); ?>/messages/view/<?php echo $thread_id; ?>/" title="Message">Message</a>
Yes, it’s involved in the conversation.. But it would look more elegant, if the user would be redirected to the exact page.
And yes, i get a 404 error.
You’ll need the $user_id
and $thread_id;
for the link to work.
Ok.
The user id of the admin is mostly ‘1’, right?
So I would use this one:
<a href=”/<?php echo bp_core_get_username( 1 );
Is this correct?
By thread id you mean the id of the specific user profile page?
If so, how do I get this id?
The user ID of the admin is usually 1. That assumes you have just one administrator and that was the first user created when you set up BP. The thread ID is the ID of the private message. You can get this from the URL. It’ll end something like /view/86. It is the digit that you want.
As for the user ID, it’s clear.
But I can’t read out the thread ID because to see the profile of a user, I have to set the permalinks settings to the name of the article.
And if I go to the profile with the default permalink setting, it gave me a 404.
Mine is in German, sry.
The 5th setting. So one before costum.