[Support request] Php code snippet in hook element does not work

Home Forums Support [Support request] Php code snippet in hook element does not work

Home Forums Support Php code snippet in hook element does not work

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1386362
    Carsten

    Hi there, I added this code to a hook element, but it does not render anything out. The code should be ok, any idea why it does not work in the element?

    <?php  
    /* custom Recent visitor code to list it anywhere for logged in user */
    $visitors = visitors_get_recent_visitors(get_current_user_id(), 5);//pass the user id for which we are retriving and how many we want
    foreach( (array) $visitors as $visitor_id ){
        echo bp_core_get_userlink( $visitor_id );//display the name of the 
        //bp_core_get_user_displayname( $visitor_id ); //use it to fetch the user display name
        //bp_core_get_user_domain( $visitor_id ); //use it to get user profile url
        //bp_core_fetch_avatar( array('item_id'=> $visitor_id, 'height'=>25, 'width'=> 25)); //fetch user avatar
    }
    ?>
    

    Thanks

    #1386458
    Leo
    Staff
    Customer Support

    Hi there,

    Just to confirm, you’ve checked to execute PHP?

    The element itself doesn’t change your code at all.

    Does the code work outside of a hook element?

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.