From 9a5406a049f42e1940e9ab62726400d30b7399fa Mon Sep 17 00:00:00 2001
From: Chris
Date: Tue, 5 Dec 2017 12:15:48 -0500
Subject: [PATCH 1/4] styles galore
---
index.php | 5 ++
www/application/controllers/All_Tweets.php | 6 +-
www/application/controllers/Login.php | 14 +++-
www/application/controllers/Register.php | 7 +-
www/application/controllers/Tweet.php | 29 --------
www/application/controllers/User_Tweets.php | 2 +
www/application/views/home.php | 28 +++++---
www/application/views/login.php | 30 ++++----
www/application/views/register.php | 63 +++++++++--------
www/application/views/templates/footer.php | 2 +-
www/application/views/templates/header.php | 1 +
www/application/views/templates/nav.php | 12 ++++
www/application/views/tweet.php | 9 ---
www/application/views/user.php | 15 ++--
www/contributing.md | 4 +-
www/css/styles.css | 77 ++++++++++++++++-----
16 files changed, 182 insertions(+), 122 deletions(-)
create mode 100644 index.php
delete mode 100644 www/application/controllers/Tweet.php
create mode 100644 www/application/views/templates/nav.php
delete mode 100644 www/application/views/tweet.php
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..139509d
--- /dev/null
+++ b/index.php
@@ -0,0 +1,5 @@
+format('m/d/y'); ?>
diff --git a/www/application/controllers/All_Tweets.php b/www/application/controllers/All_Tweets.php
index 4e32d65..6974b1a 100644
--- a/www/application/controllers/All_Tweets.php
+++ b/www/application/controllers/All_Tweets.php
@@ -14,6 +14,7 @@ public function index() {
$this->data['posts'] = $this->All_Tweets_Model->getPosts(); // calling Post model method getPosts()
$this->load->view('templates/header', NULL);
+ $this->load->view('templates/nav', NULL);
$this->load->view('home', $this->data); // load the view file , we are passing $data array to view file
$this->load->view('templates/footer', NULL);
}
@@ -22,9 +23,10 @@ function search_keyword(){
$keyword = $this->input->post('keyword');
$data['results'] = $this->All_Tweets_Model->search($keyword);
- $this->load->view('templates/header');
+ $this->load->view('templates/header', NULL);
+ $this->load->view('templates/nav', NULL);
$this->load->view('home', $data); // load the view file , we are passing $data array to view file
- $this->load->view('templates/footer');
+ $this->load->view('templates/footer', NULL);
}
}
diff --git a/www/application/controllers/Login.php b/www/application/controllers/Login.php
index da638ce..2fb8078 100644
--- a/www/application/controllers/Login.php
+++ b/www/application/controllers/Login.php
@@ -5,7 +5,7 @@ function __Construct(){
parent::__Construct();
$this->load->database(); // load database
$this->load->model('User_Info_Model'); // load model
- $this->output->enable_profiler(TRUE);
+ //$this->output->enable_profiler(TRUE);
}
public function index(){
@@ -15,8 +15,12 @@ public function index(){
$this->form_validation->set_rules('username', 'Username', 'required');
$this->form_validation->set_rules('password', 'Password', 'required');
- if ($this->form_validation->run() == FALSE)
+ if ($this->form_validation->run() == FALSE){
+ $this->load->view('templates/header');
$this->load->view('login');
+ $this->load->view('templates/footer');
+ }
+
// load the homepage if login successful
// https://www.codeigniter.com/user_guide/libraries/form_validation.html#callbacks-your-own-validation-methods
@@ -30,7 +34,11 @@ public function index(){
redirect('/all_tweets');
}
// if no, refresh login
- else $this->load->view('login', $data);
+ else {
+ $this->load->view('templates/header');
+ $this->load->view('login', $data);
+ $this->load->view('templates/footer');
+ }
}
}
diff --git a/www/application/controllers/Register.php b/www/application/controllers/Register.php
index f8ff82b..5b6db13 100644
--- a/www/application/controllers/Register.php
+++ b/www/application/controllers/Register.php
@@ -22,8 +22,11 @@ public function index(){
array('required' => 'You must provide a %s.'));
$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
- if ($this->form_validation->run() == FALSE)
- $this->load->view('register');
+ if ($this->form_validation->run() == FALSE){
+ $this->load->view('templates/header');
+ $this->load->view('register');
+ $this->load->view('templates/footer');
+ }
// load the homepage once properly submitted
// https://www.codeigniter.com/user_guide/libraries/form_validation.html#callbacks-your-own-validation-methods
diff --git a/www/application/controllers/Tweet.php b/www/application/controllers/Tweet.php
deleted file mode 100644
index 6f8945d..0000000
--- a/www/application/controllers/Tweet.php
+++ /dev/null
@@ -1,29 +0,0 @@
-load->database(); // load database
- $this->load->model('User_Tweets_Model'); // load model
- $this->output->enable_profiler(TRUE);
- }
-
- public function index(){
- $this->load->helper('form');
- $this->load->library('form_validation');
-
- $data['title'] = 'Create a tweet';
-
- $this->form_validation->set_rules('tweet', 'Tweet', 'required');
-
- if ($this->form_validation->run() === FALSE)
- {
- $this->load->view('tweet', $data);
- }
- else
- {
- $this->User_Tweets_Model->addTweet();
- $this->load->view('formsuccess');
- }
- }
-}
diff --git a/www/application/controllers/User_Tweets.php b/www/application/controllers/User_Tweets.php
index fc5b71c..8f7cedb 100644
--- a/www/application/controllers/User_Tweets.php
+++ b/www/application/controllers/User_Tweets.php
@@ -14,6 +14,7 @@ function __Construct(){
public function index() {
$this->data['posts'] = $this->User_Tweets_Model->getPosts(); // calling Post model method getPosts()
$this->load->view('templates/header', NULL);
+ $this->load->view('templates/nav', NULL);
$this->load->view('user', $this->data); // load the view file , we are passing $data array to view file
$this->load->view('templates/footer', NULL);
}
@@ -27,6 +28,7 @@ public function create(){
{
$this->data['posts'] = $this->User_Tweets_Model->getPosts(); // calling Post model method getPosts()
$this->load->view('templates/header', NULL);
+ $this->load->view('templates/nav');
$this->load->view('user', $this->data); // load the view file , we are passing $data array to view file
$this->load->view('templates/footer', NULL);
}
diff --git a/www/application/views/home.php b/www/application/views/home.php
index e2d71ab..b981a2b 100644
--- a/www/application/views/home.php
+++ b/www/application/views/home.php
@@ -14,20 +14,27 @@
load->library('form_validation'); ?>
-
-
-
+
+
diff --git a/www/application/views/templates/nav.php b/www/application/views/templates/nav.php
new file mode 100644
index 0000000..4c9ec14
--- /dev/null
+++ b/www/application/views/templates/nav.php
@@ -0,0 +1,12 @@
+
diff --git a/www/application/views/tweet.php b/www/application/views/tweet.php
deleted file mode 100644
index 1d67d47..0000000
--- a/www/application/views/tweet.php
+++ /dev/null
@@ -1,9 +0,0 @@
-load->library('form_validation'); ?>
-
-
- Tweet
-
-
-
-
-
diff --git a/www/application/views/user.php b/www/application/views/user.php
index b23ef2d..dd61f01 100644
--- a/www/application/views/user.php
+++ b/www/application/views/user.php
@@ -5,10 +5,12 @@
load->library('form_validation'); ?>
-
+
+
+
+
-
@@ -16,11 +18,14 @@
format('m/d/y h:s A');
- ?>
+ $startDate = $post['date_time'];
+ $start = new DateTime($startDate);
+ $timestring = $start->format('m/d/y h:s A');
+ $time_arr = str_split($timestring);
+ if($time_arr[count($time_arr) - 8] === '0')
+ unset($time_arr[count($time_arr) - 8]);
+ echo implode("",$time_arr);
+ ?>