Please or Register to create posts and topics.

I can't see other members' posts. Why?

Hello!
First of all, thanks for creating this nice plugin 🙂
I found it easy to use right from the beginning.

That being said, there is something strange that I see once in a while.
For example, take a look at this.


Those are the first discussions started by members.
If I click the one I started, everything’s fine. But if I click other members’ discussions, I can’t see them.
It just shows me their account.


And I can’t even see their answers to my posts. Do you have any suggestions?

Livello 100 has reacted to this post.
Livello 100

Hello @livello-100

Have you modified your forum with custom code via hooks/filters? If so, please show me that code (I guess its in your themes functions.php file) so I can give you an updated version for it.

Livello 100 has reacted to this post.
Livello 100
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Yes, I have. Since I don’t understand these codes very well, I don’t know where to start.
I’ll show you from where I can find the name of the plugin.
Is there anything wrong I’ve pasted in?

add_action('asgarosforum_after_post_author', 'my_asgarosforum_after_post_administration', 10, 2);
function getUserRoles($id) {
$user = new WP_User((int)$id);
return implode(' and ', $user->roles);
}
function my_asgarosforum_after_post_administration($author_id, $author_posts) {
if (getUserRoles($author_id)=='administrator') {
echo '<div class="icon-status-admin">'.__('Admin','rcl-asgaros').' <i class="fa fa-info-circle"></i></div>';
} else {
if (AsgarosForumPermissions::isModerator($author_id)) {
echo '<div class="icon-status-moderator">'.__('Moderator','rcl-asgaros').' <i class="fa fa-info-circle"></i></div>';
} else {
if(getUserRoles($author_id)=='contributor') {
echo '<div class="icon-status-contributor">'.__('Contributor','rcl-asgaros').' <i class="fa fa-info-circle"></i></div>';
} else {
if(getUserRoles($author_id)=='author') {
echo '<div class="icon-status-author">'.__('Author','rcl-asgaros').' <i class="fa fa-info-circle"></i></div>';
} else {
if(getUserRoles($author_id)=='editor') {
echo '<div class="icon-status-editor">'.__('Editor','rcl-asgaros').' <i class="fa fa-info-circle"></i></div>';};
}
}
}
}
}

add_filter('register_url', 'my_register_url');
function my_register_url($register_url) {
return home_url('/registrati');
}

 

Hello again @livello-100

Please replace it with the following code:

add_action('asgarosforum_after_post_author', 'my_asgarosforum_after_post_administration', 10, 2);
function getUserRoles($id) {
$user = new WP_User((int)$id);
return implode(' and ', $user->roles);
}
function my_asgarosforum_after_post_administration($author_id, $author_posts) {
global $asgarosforum;
if (getUserRoles($author_id)=='administrator') {
echo '<div class="icon-status-admin">'.__('Admin','rcl-asgaros').' <i class="fa fa-info-circle"></i></div>';
} else {
if ($asgarosforum->permissions->isModerator($author_id)) {
echo '<div class="icon-status-moderator">'.__('Moderator','rcl-asgaros').' <i class="fa fa-info-circle"></i></div>';
} else {
if(getUserRoles($author_id)=='contributor') {
echo '<div class="icon-status-contributor">'.__('Contributor','rcl-asgaros').' <i class="fa fa-info-circle"></i></div>';
} else {
if(getUserRoles($author_id)=='author') {
echo '<div class="icon-status-author">'.__('Author','rcl-asgaros').' <i class="fa fa-info-circle"></i></div>';
} else {
if(getUserRoles($author_id)=='editor') {
echo '<div class="icon-status-editor">'.__('Editor','rcl-asgaros').' <i class="fa fa-info-circle"></i></div>';};
}
}
}
}
}

add_filter('register_url', 'my_register_url');
function my_register_url($register_url) {
return home_url('/registrati');
}

 

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

It works now! Thank you so much 😊

Asgaros has reacted to this post.
Asgaros