index.php 487 B

1234567891011121314151617
  1. <?php
  2. // A user must be logged in.
  3. $_template['show_message'] = false;
  4. if (!api_is_anonymous()) {
  5. $_template['show_message'] = true;
  6. // Getting the current user id.
  7. $user_id = api_get_user_id();
  8. //Getting the current user info.
  9. $user_info = api_get_user_info($user_id);
  10. // You can also use template setting variables in the special variable called template.
  11. $_template['user_info'] = $user_info;
  12. $_template['username'] = $user_info['username'];
  13. }