diff --git a/www/application/controllers/User_Tweets.php b/www/application/controllers/User_Tweets.php index e5b6fb6..e756de0 100644 --- a/www/application/controllers/User_Tweets.php +++ b/www/application/controllers/User_Tweets.php @@ -1,3 +1,4 @@ +<<<<<<< HEAD load->database(); + $this->load->model('User_Tweets_Model'); + $this->output->enable_profiler(TRUE); + } + + public function index(){ + $this->data['posts'] = $this->Users_Tweets_Model2->getPosts(); + $this->load->view('user', $this->data); + } + } +>>>>>>> 41b5a2f810bd6d9f899d79ce9dd4069ec9f97dda diff --git a/www/application/models/User_Tweets_Model.php b/www/application/models/User_Tweets_Model.php index 6292bf0..3ef6c63 100644 --- a/www/application/models/User_Tweets_Model.php +++ b/www/application/models/User_Tweets_Model.php @@ -1,5 +1,6 @@ db->select("first_name, last_name, username, tweet, date_time"); @@ -32,5 +33,22 @@ function addTweet(){ return $this->db->insert('tweets', $data); */ } +======= + + function getPosts(){ + + //$this->load->library('session'); + //session_start(); + $user_id = 1; //$this->session->userdata('session_id'); + + $this->db->select("first_name, last_name, username, tweet, date_time, location"); + $this->db->from("Users, Tweets"); + $this->db->where("Users.id = Tweets.user_id and Users.id = $user_id"); + $this->db->order_by('date_time', 'DESC'); + $query = $this->db->get(); + return $query->result_array(); + } + +>>>>>>> 41b5a2f810bd6d9f899d79ce9dd4069ec9f97dda } diff --git a/www/application/views/home.php b/www/application/views/home.php index bf2eaeb..7153591 100644 --- a/www/application/views/home.php +++ b/www/application/views/home.php @@ -1,32 +1,25 @@ - -
- -diff --git a/www/application/views/templates/header.php b/www/application/views/templates/header.php index 5584cc0..de05d9c 100644 --- a/www/application/views/templates/header.php +++ b/www/application/views/templates/header.php @@ -1,8 +1,10 @@ - + + +
-
+
+ + -