Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- UserSpice 4
- An Open Source PHP User Management System
- by the UserSpice Team at http://UserSpice.com
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- ?>
- <?php
- require_once 'users/init.php';
- require_once $abs_us_root.$us_url_root.'users/includes/header.php';
- require_once $abs_us_root.$us_url_root.'users/includes/navigation.php';
- ?>
- <?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
- <?php
- //Find Encouragement
- $encQ=$db->query("SELECT * FROM encouragement ORDER BY id DESC");
- $enc=$encQ->results();
- if (!empty($_POST['encouragement'])){
- $note = Input::get('notes');
- $date = date('Y-m-d');
- $fields = array(
- 'user' => $user->data()->id,
- 'email' => $user->data()->email,
- 'date' => $date,
- 'note' => $note,
- );
- $db->insert('encouragement',$fields);
- Redirect::to('encouragement.php?err=Encouragement+Added!');
- }
- ?>
- <div id="page-wrapper">
- <div class="container-fluid">
- <div class="row">
- <div class="col-sm-12">
- <div class="col-xs-8 panel panel-primary">
- <h1 align="center" class="page-header">
- Wall of Encouragement
- </h1>
- <?php foreach ($enc as $v1){ ?>
- <div class="row">
- <div class="col-sm-12">
- <div class="col-xs-2">
- <?php
- $grav = get_gravatar(strtolower(trim($v1->email)));
- ?>
- <img src="<?=$grav?>" class="img-responsive img-thumbnail" >
- </div>
- <div class="col-xs-10">
- <strong><p align="left">Posted by <?php echouser($v1->user);?> on <?=$v1->date?></strong><br>
- <p><?=$v1->note?></p>
- </div>
- <hr>
- </div>
- </div>
- <?php } ?>
- </div> <!-- /col2/3 -->
- <div class="col-sm-4">
- <form class="" action="encouragement.php" name="encourage" method="post">
- <div class="form-group">
- <div class="form-group">
- <label for="notes"><h3>Post your encouragement!</h3></label>
- <textarea rows='4' cols='100'" class="form-control" name="notes" id="notes" "></textarea>
- </div>
- <p><input class='btn btn-large btn-primary' type='submit' name="encouragement" value='Post your encouragement!'/></p>
- </form>
- </div>
- <!-- Content Ends Here -->
- </div> <!-- /.col -->
- </div> <!-- /.row -->
- </div> <!-- /.container -->
- </div> <!-- /.wrapper -->
- <?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>
- <!-- Place any per-page javascript here -->
- <?php require_once $abs_us_root.$us_url_root.'users/includes/html_footer.php'; // currently just the closing /body and /html ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement