function message_owner() { $group = new Group(); $group->get_by_id($this->group_id); if ($group->name) { return $group->name; } $user = new User(); $user->get_by_id($this->user_id); return $user->full_name(); }
<div class="container main-container "> <header class="row header"> <div class="navbar navbar-default"> <div class="navbar-header"> <a class="navbar-brand" href="#"> <!-- <img alt="Brand" class="img-responsive" src="--><?php //echo admin_url('home') ?> <!--/assets/img/logo.png">--> </a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav pull-right"> <?php if ($user->full_name($sesion->userName) != NULL) { ?> <li class="active username"><a href="<?php echo get_home_url(); ?> /logout.php"> <?php echo $user->full_name($sesion->userName); ?> </a></li> <?php } ?> <?php if ($sesion->is_logedIn()) { ?> <li><a href="<?php
<?php require_once "includes/database.php"; require_once "includes/user2.php"; $record = User::find_by_id(1); // Selects one User from DB and creates array with record data $user = new User(); // Instantiate an object instance of the User class $user->userId = $record['userId']; // updating this specific user object with data for this user $user->username = $record['username']; $user->hashed_password = $record['hashed_password']; $user->firstname = $record['firstname']; $user->lastname = $record['lastname']; echo "<h1>Display User Object Instance Attributes:</h1>"; echo "Username: "******"<br />"; echo "Fullname (from Instance Method): "; echo $user->full_name();
/** * @param $facebook_id * @return JSON-formatted data of user */ public function getUserInfo($facebook_id) { try { $user_id = User::getUserIdByFbId($facebook_id); } catch (Exception $e) { $user_id = null; } if ($user_id) { $full_name = User::full_name($user_id); $email = User::email($user_id); $phone = User::phone($user_id); $local_address = User::local_address($user_id); $details = ['name' => $full_name, 'email' => $email, 'phone' => $phone, 'address' => $local_address]; return Response::json($details, 200, array(), JSON_PRETTY_PRINT); } else { return json_encode(['error' => 'You are not registered to FeatherQ.']); } }