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 'init.php'; ?>
- <?php require_once $abs_us_root.$us_url_root.'users/includes/header.php'; ?>
- <?php require_once $abs_us_root.$us_url_root.'users/includes/navigation.php'; ?>
- <?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
- <?php
- //PHP Goes Here!
- if($user->isLoggedIn()) { $thisUserID = $user->data()->id;} else { $thisUserID = 0; }
- $userQ = $db->query("SELECT * FROM users LEFT JOIN profiles ON users.id = user_id ");
- // group active, inactive, on naughty step
- $users = $userQ->results();
- ?>
- <div id="page-wrapper">
- <div class="container">
- <!-- Page Heading -->
- <div class="row">
- <div class="col-xs-12 col-md-6">
- <h1 >View All Users</h1>
- </div>
- <div class="col-xs-12 col-md-6">
- <form class="">
- <label for="system-search">Search:</label>
- <div class="input-group">
- <input class="form-control" id="system-search" name="q" placeholder="Search Users..." type="text">
- <span class="input-group-btn">
- <button type="submit" class="btn btn-default"><i class="fa fa-times"></i></button>
- </span>
- </div>
- </form>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <hr />
- <div class="allutable table-responsive">
- <table class='table table-hover table-list-search'>
- <thead>
- <tr>
- <th><div class="alluinfo"> </div></th>
- <th>Username</th>
- </tr>
- </thead>
- <tbody>
- <?php
- //Cycle through users
- foreach ($users as $v1) {
- $ususername = ucfirst($v1->username);
- $ususerbio = ucfirst($v1->bio);
- $grav = empty($v1->picture) ? get_gravatar(strtolower(trim($v1->email))) : $v1->picture;
- $useravatar = '<img src="'.$grav.'" class="img-responsive img-thumbnail" width=130 height=130 alt="'.$ususername.'">';
- ?>
- <tr>
- <td>
- <a href="profile.php?name=<?=htmlentities($v1->username)?>"><?php echo $useravatar;?></a>
- </td>
- <td>
- <h4><a href="profile.php?name=<?=htmlentities($v1->username)?>"><?=$ususername?> </a></h4>
- <p><?=$ususerbio?></p>
- <?php
- echo "<BR /><SPAN STYLE=\"font-size:x-small; float:right\">" .
- "<B>Joined</B>: " . DateTime::createFromFormat("Y-m-d H:i:s", $v1->join_date)->format("Y-m-d") . " " .
- "<B>Active</B>: " . DateTime::createFromFormat("Y-m-d H:i:s", $v1->last_login)->format("jS F (l) Y H:i") . "</SPAN>";
- ?>
- </td>
- <?php
- echo "<TD>";
- if ($settings->messaging == 1 && $v1->id != $thisUserID)
- echo "<BUTTON TYPE=\"button\" CLASS=\"btn btn-info btn-xs\" DATA-TOGGLE=\"modal\" DATA-TARGET=\"#compose\" DATA-ID=\"{$v1->id};{$v1->username}\"><I CLASS=\"glyphicon glyphicon-plus\" STYLE=\"font-size:0.8em;\"></I> New Message</BUTTON> ";
- if (!empty($v1->gpluslink))
- echo "<A CLASS=\"btn btn-primary btn-xs\" TARGET=\"_blank\" HREF=\"{$v1->gpluslink}\" ROLE=\"button\">G+</A>";
- echo "</TD>";
- ?>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div id="compose" class="modal fade" role="dialog">
- <div class="modal-dialog">
- <!-- Modal content-->
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal">×</button>
- <h4 class="modal-title">New Message</h4>
- </div>
- <div class="modal-body">
- <form name="create_message" action="messages.php" method="post">
- <select name="user_id" id="combobox" class="form-control combobox" required disabled>
- <option readonly></option>
- </select><br />
- <label>Subject:</label>
- <input required size='100' class='form-control' type='text' name='msg_subject' value='' required/>
- <br /><label>Body:</label>
- <textarea rows="20" cols="80" id="mytextarea" name="msg_body"></textarea>
- <input required type="hidden" name="csrf" value="<?=Token::generate();?>" >
- </p>
- <p>
- <br />
- </div>
- <div class="modal-footer">
- <div class="btn-group"> <input type="hidden" name="csrf" value="<?=Token::generate();?>" />
- <input class='btn btn-primary' type='submit' name="send_message" value='Send Message' class='submit' /></div>
- </form>
- <div class="btn-group"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button></div>
- </div>
- </div>
- </div>
- </div>
- <!-- /.row -->
- </div>
- </div>
- <!-- footers -->
- <?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 -->
- <script src='https://cdn.tinymce.com/4/tinymce.min.js'></script>
- <script src="../usersc/js/bootstrap-combobox.js"></script>
- <script src="../usersc/js/messages.php.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $(".btn-info").click(function(){
- var userdata = $(this).data('id');
- var userID = userdata.substr(0, userdata.indexOf(';'));
- var inputs = document.getElementsByName("user_id");
- for (i=0, max=inputs.length; i<max; i++)
- inputs[i].value = userID;
- document.getElementById("comboboxundefined").value = userdata.substr(userdata.indexOf(';')+1);
- });
- });
- </script>
- <script src="js/search.js" charset="utf-8"></script>
- <?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