• Resolved autox420

    (@autox420)


    Possible to make usernames clickable?
    Click on username and it redirects to …/something/username

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @autox420,

    function my_filtered_post_username($username, $userID) {
      return '<a href="MY_CUSTOM_LINK">'.$username.'</a>';
    }
    add_filter('asgarosforum_filter_post_username', 'my_filtered_post_username', 10, 2);

    Add function

    • This reply was modified 7 years, 5 months ago by Yworld.
    Thread Starter autox420

    (@autox420)

    Thanks!

    @yworld I’m not very practical, but what command do I place?
    My forum is up altervista

    • This reply was modified 7 years, 5 months ago by iriftdrako.
    • This reply was modified 7 years, 5 months ago by iriftdrako.
    Thread Starter autox420

    (@autox420)

    I have tried your script but it doesnt do what i want.
    Instead it redirects to …/forum/MY_CUSTOM_LINK
    Same link no matter what user i click.

    Can it be done so it redirects to buddypress profile?
    If i click username 1 then its redirected to username 1 buddypress profile.
    If i click username 2 then its redirected to username 2 buddy press profile.
    Etc…

    Plugin Author Asgaros

    (@asgaros)

    Hello @autox420

    Of course it can, but the code need to be changed so it will exactly do what you want. Based on the extensions you are using the code can look different, so its hard to provide you with some example code because I never worked with buddypress. Maybe someone can in their support forums can give you a working example. ??

    Hi @autox420

    function my_filtered_post_username($username, $author_id) {
     $profile = bp_core_get_userlink($author_id);
    return '<b>'.$profile.'</b>';
    }
    add_filter('asgarosforum_filter_post_username', 'my_filtered_post_username', 10, 2);
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Clickable usernames’ is closed to new replies.