From eac8bea4095d362923785a34325c76ed11e78620 Mon Sep 17 00:00:00 2001 From: Shemona Singh Date: Mon, 4 Dec 2017 12:23:58 -0500 Subject: [PATCH] edited all tweets page and got information from database per user --- www/application/models/User_Tweets_Model.php | 10 ++-- www/application/views/home.php | 51 +++++++++----------- www/application/views/templates/footer.php | 2 +- www/application/views/templates/header.php | 12 +++-- www/application/views/user.php | 1 + www/css/styles.css | 24 +++++++++ 6 files changed, 62 insertions(+), 38 deletions(-) create mode 100644 www/css/styles.css diff --git a/www/application/models/User_Tweets_Model.php b/www/application/models/User_Tweets_Model.php index 002bf21..9e01b77 100644 --- a/www/application/models/User_Tweets_Model.php +++ b/www/application/models/User_Tweets_Model.php @@ -3,14 +3,18 @@ class User_Tweets_Model extends CI_Model { 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"); - $this->db->from('Users, Tweets'); - $this->db->where('Users.id = Tweets.user_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(); } + } ?> 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 @@ - - - - All Tweets - - - - -

Tweets Feed

-
-
- -
- - - -
-
- - -
- -
-
- - - +
+

All Tweets

+ +
+
+
+ " . $post['first_name'] . " " . $post['last_name'] . ""; ?> + " . "@" . $post['username'] . "";?> +
+
+ +
+
+
+
+ +
+
+
+ +
diff --git a/www/application/views/templates/footer.php b/www/application/views/templates/footer.php index f531270..f9a1892 100644 --- a/www/application/views/templates/footer.php +++ b/www/application/views/templates/footer.php @@ -1,4 +1,4 @@ - © 2017 + © 2017 Stumper and Singh Studios 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 @@ - + + + - Twitter + Twitter Clone + + - - -

Hello

+ diff --git a/www/application/views/user.php b/www/application/views/user.php index 9365408..69b996b 100644 --- a/www/application/views/user.php +++ b/www/application/views/user.php @@ -16,6 +16,7 @@
+
diff --git a/www/css/styles.css b/www/css/styles.css new file mode 100644 index 0000000..bb75e82 --- /dev/null +++ b/www/css/styles.css @@ -0,0 +1,24 @@ +.home{ + max-width:60%; + margin:0 auto +} + + .tweet-container{ + border:1px solid #eeeeee; + padding:15px; + margin-bottom:15px; + max-width:100%; + } + + .tweet-container h3{ + margin-top:0!important + } + + .date{ + color:grey + } + + .tweet{ + font-size: 16px; + font-style: italic; + }