function bp_example_screen_one_content() { global $bp; $high_fives = bp_example_get_highfives_for_user($bp->displayed_user->id); /** * For security reasons, we MUST use the wp_nonce_url() function on any actions. * This will stop naughty people from tricking users into performing actions without their * knowledge or intent. */ $send_link = wp_nonce_url($bp->displayed_user->domain . $bp->current_component . '/screen-one/send-h5', 'bp_example_send_high_five'); ?> <h4><?php _e('Welcome to Screen One', 'bp-example'); ?> </h4> <p><?php printf(__('Send %s a <a href="%s" title="Send high-five!">high-five!</a>', 'bp-example'), $bp->displayed_user->fullname, $send_link); ?> </p> <?php if ($high_fives) { ?> <h4><?php _e('Received High Fives!', 'bp-example'); ?> </h4> <table id="high-fives"> <?php foreach ($high_fives as $user_id) { ?> <tr> <td width="1%"><?php echo bp_core_fetch_avatar(array('item_id' => $user_id, 'width' => 25, 'height' => 25)); ?> </td> <td> <?php echo bp_core_get_userlink($user_id); ?> </td> </tr> <?php } ?> </table> <?php } ?> <?php }
bp_get_options_nav(); ?> </ul> </div> <h4><?php _e('Welcome to Screen One', 'bp-example'); ?> </h4> <p><?php printf(__('Send %s a <a href="%s" title="Send high-five!">high-five!</a>', 'bp-example'), bp_get_displayed_user_fullname(), wp_nonce_url(bp_displayed_user_domain() . bp_current_component() . '/screen-one/send-h5/', 'bp_example_send_high_five')); ?> </p> <?php if ($high_fives = bp_example_get_highfives_for_user(bp_displayed_user_id())) { ?> <h4><?php _e('Received High Fives!', 'bp-example'); ?> </h4> <table id="high-fives"> <?php foreach ($high_fives as $user_id) { ?> <tr> <td width="1%"><?php echo bp_core_fetch_avatar(array('item_id' => $user_id, 'width' => 25, 'height' => 25)); ?> </td>