Replace dash icons in topics posted by users
a1ex@a1ex
1 Post
#1 · May 22, 2018, 11:22 pm
Quote from a1ex on May 22, 2018, 11:22 pmHey, thank you for providing this fine forum! I’d like to know if it’s possible to replace the dash icons with the posting user’s profile picture instead. Thank you.
Hey, thank you for providing this fine forum! I’d like to know if it’s possible to replace the dash icons with the posting user’s profile picture instead. Thank you.
Click for thumbs down.0Click for thumbs up.0
#2 · May 23, 2018, 12:05 am
Quote from Asgaros on May 23, 2018, 12:05 amHello @a1ex
It is not possible yet to replace the icon with the avatar, but you can add an additional column containing the avatar with the following code:
add_action('asgarosforum_custom_topic_column', 'custom_column'); function custom_column($topic_id) { global $asgarosforum; $author_id = $asgarosforum->db->get_var("SELECT (SELECT author_id FROM {$asgarosforum->tables->posts} WHERE parent_id = t.id ORDER BY id ASC LIMIT 1) AS author_id FROM {$asgarosforum->tables->topics} AS t WHERE t.id = {$topic_id};"); echo '<div class="topic-status">'; echo get_avatar($author_id, 40); echo '</div>'; }Just add it to your themesĀ functions.php file.
Hello @a1ex
It is not possible yet to replace the icon with the avatar, but you can add an additional column containing the avatar with the following code:
add_action('asgarosforum_custom_topic_column', 'custom_column'); function custom_column($topic_id) { global $asgarosforum; $author_id = $asgarosforum->db->get_var("SELECT (SELECT author_id FROM {$asgarosforum->tables->posts} WHERE parent_id = t.id ORDER BY id ASC LIMIT 1) AS author_id FROM {$asgarosforum->tables->topics} AS t WHERE t.id = {$topic_id};"); echo '<div class="topic-status">'; echo get_avatar($author_id, 40); echo '</div>'; }
Just add it to your themesĀ functions.php file.
Click for thumbs down.0Click for thumbs up.0
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!