diff --git a/www/application/config/config.php b/www/application/config/config.php index ee3d60a..0a94a4e 100755 --- a/www/application/config/config.php +++ b/www/application/config/config.php @@ -23,7 +23,7 @@ | a PHP script and you can easily do that on your own. | */ -$config['base_url'] = 'http://twitter-clone.lndo.site/'; +$config['base_url'] = 'http://' . $_SERVER['HTTP_HOST'] . '/'; /* |-------------------------------------------------------------------------- diff --git a/www/application/controllers/All_Tweets.php b/www/application/controllers/All_Tweets.php index 4e32d65..df80855 100644 --- a/www/application/controllers/All_Tweets.php +++ b/www/application/controllers/All_Tweets.php @@ -7,13 +7,14 @@ function __Construct(){ parent::__Construct (); $this->load->database(); // load database $this->load->model('All_Tweets_Model'); // load model - $this->output->enable_profiler(TRUE); + //$this->output->enable_profiler(TRUE); } 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 bd765d0..260b5b0 100644 --- a/www/application/controllers/Login.php +++ b/www/application/controllers/Login.php @@ -13,12 +13,16 @@ public function index(){ $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); + $this->form_validation->set_error_delimiters('', ''); $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'); + } + // load the homepage if login successful // https://www.codeigniter.com/user_guide/libraries/form_validation.html#callbacks-your-own-validation-methods @@ -35,7 +39,10 @@ public function index(){ redirect('/User_Tweets'); } // if no, refresh login - else $this->load->view('login', $data); + else { + $this->load->view('templates/header'); + $this->load->view('login', $data); + } } } diff --git a/www/application/controllers/Register.php b/www/application/controllers/Register.php index f8ff82b..603ce97 100644 --- a/www/application/controllers/Register.php +++ b/www/application/controllers/Register.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(){ @@ -22,8 +22,10 @@ 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'); + } // 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 6774e60..29eff36 100644 --- a/www/application/controllers/User_Tweets.php +++ b/www/application/controllers/User_Tweets.php @@ -7,12 +7,14 @@ function __Construct(){ parent::__Construct(); $this->load->database(); // load database $this->load->model('User_Tweets_Model'); // load model - $this->output->enable_profiler(TRUE); + //$this->output->enable_profiler(TRUE); } public function index() { + // get posts based on user ID $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); } @@ -26,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 85c8318..820fcf7 100644 --- a/www/application/views/home.php +++ b/www/application/views/home.php @@ -13,21 +13,30 @@

All Tweets

load->library('form_validation'); ?> - - - - +
+
+ +
+
- " . $row['first_name'] . " " . $row['last_name'] . ""; ?> - " . "@" . $row['username'] . "";?> + " . $row['first_name'] . " " . $row['last_name'] . " " . "" . "@" . $row['username'] . "" . ""; ?> +
- + 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); + ?>
@@ -42,11 +51,18 @@
- " . $post['first_name'] . " " . $post['last_name'] . ""; ?> - " . "@" . $post['username'] . "";?> + " . $post['first_name'] . " " . $post['last_name'] . " " . "" . "@" . $post['username'] . "" . ""; ?>
- + 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); + ?>
diff --git a/www/application/views/login.php b/www/application/views/login.php index 50e6b2a..cbfd9cd 100644 --- a/www/application/views/login.php +++ b/www/application/views/login.php @@ -1,21 +1,32 @@ load->library('form_validation'); +<<<<<<< HEAD echo validation_errors(); echo form_open('login'); ?> >>>>>> a024e265e94e8addb4b7953ae90dbdb94e25e7af ?> + + + + + diff --git a/www/application/views/register.php b/www/application/views/register.php index e375ec1..47a10f7 100644 --- a/www/application/views/register.php +++ b/www/application/views/register.php @@ -1,33 +1,44 @@ load->library('form_validation'); - echo validation_errors(); echo form_open('register'); ?> -

Register

-
First Name
- - - -
Last Name
- - - -
Email Address
- - - -
Location
- - - -
Username
- - - -
Password
- - - -

-
- + + + + + + diff --git a/www/application/views/templates/footer.php b/www/application/views/templates/footer.php index ada7589..b404e09 100644 --- a/www/application/views/templates/footer.php +++ b/www/application/views/templates/footer.php @@ -1,4 +1,6 @@ - © 2017 Singh and Stumper Studios +

+ © 2017 Stingh Design +

diff --git a/www/application/views/templates/header.php b/www/application/views/templates/header.php index 9b498e7..63a8bb1 100644 --- a/www/application/views/templates/header.php +++ b/www/application/views/templates/header.php @@ -6,5 +6,7 @@ + + diff --git a/www/application/views/templates/nav.php b/www/application/views/templates/nav.php new file mode 100644 index 0000000..ae34f99 --- /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..92c30e9 100644 --- a/www/application/views/user.php +++ b/www/application/views/user.php @@ -3,24 +3,31 @@

My Tweets

load->library('form_validation'); ?> - - - - -
- +
+ + +
+ +
- " . $post['first_name'] . " " . $post['last_name'] . ""; ?> - " . "@" . $post['username'] . "";?> + " . $post['first_name'] . " " . $post['last_name'] . " " . "" . "@" . $post['username'] . "" . ""; ?>
- + 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); + ?>
diff --git a/www/contributing.md b/www/contributing.md index 2037e04..509cf97 100755 --- a/www/contributing.md +++ b/www/contributing.md @@ -72,7 +72,7 @@ Hard way The best way to contribute is to "clone" your fork of CodeIgniter to yo 2. Go to the CodeIgniter repo 3. Fork it 4. Clone your CodeIgniter repo: git@github.com:/CodeIgniter.git -5. Checkout the "develop" branch At this point you are ready to start making changes. +5. Checkout the "develop" branch At this point you are ready to start making changes. 6. Fix existing bugs on the Issue tracker after taking a look to see nobody else is working on them. 7. Commit the files 8. Push your develop branch to your fork @@ -92,4 +92,4 @@ If you are using command-line you can do the following: 2. `git pull codeigniter develop` 3. `git push origin develop` -Now your fork is up to date. This should be done regularly, or before you send a pull request at least. \ No newline at end of file +Now your fork is up to date. This should be done regularly, or before you send a pull request at least. diff --git a/www/css/styles.css b/www/css/styles.css index bb75e82..8c78b30 100644 --- a/www/css/styles.css +++ b/www/css/styles.css @@ -1,24 +1,67 @@ +body { + background-color: #E3F3FD; + font-family: 'Source Sans Pro', sans-serif; +} + +img.home-icon { + width: 50px; + margin-top: -.85em; + margin-left: 4em; +} + +.login { + max-width:45%; + margin:0 auto; + margin-top: 100px; +} + +.register { + margin-top: 25px; +} + +.icon { + width: 45%; + margin-left: 30%; +} + +img.icon.reg { + width: 25%; + margin-left: 38%; +} + .home{ max-width:60%; - margin:0 auto + margin:0 auto; +} + +.tweet-container{ + border:1px solid #eeeeee; + margin-bottom:15px; + margin-top: 15px; + max-width:100%; + background-color: white; + border-radius: 25px; + padding: 20px; +} + +.tweet-container h3{ + margin-top:0!important } - .tweet-container{ - border:1px solid #eeeeee; - padding:15px; - margin-bottom:15px; - max-width:100%; - } +.handle { + color: grey; +} - .tweet-container h3{ - margin-top:0!important - } +.date{ + color:grey; + float: right; +} - .date{ - color:grey - } +.tweet{ + font-size: 16px; + font-style: italic; +} - .tweet{ - font-size: 16px; - font-style: italic; - } +.footer { + margin-left: 2em; +}