daily pastebin goal
35%
SHARE
TWEET

UserSpice view_all_users.php

Faguss Jul 4th, 2017 (edited) 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. UserSpice 4
  4. An Open Source PHP User Management System
  5. by the UserSpice Team at http://UserSpice.com
  6.  
  7. This program is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. ?>
  21. <?php require_once 'init.php'; ?>
  22. <?php require_once $abs_us_root.$us_url_root.'users/includes/header.php'; ?>
  23. <?php require_once $abs_us_root.$us_url_root.'users/includes/navigation.php'; ?>
  24.  
  25. <?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
  26. <?php
  27. //PHP Goes Here!
  28.  
  29. if($user->isLoggedIn()) { $thisUserID = $user->data()->id;} else { $thisUserID = 0; }
  30.  
  31. $userQ = $db->query("SELECT * FROM users LEFT JOIN profiles ON users.id = user_id ");
  32. // group active, inactive, on naughty step
  33. $users = $userQ->results();
  34. ?>
  35. <div id="page-wrapper">
  36.  
  37.   <div class="container">
  38.  
  39.     <!-- Page Heading -->
  40.     <div class="row">
  41.  
  42.       <div class="col-xs-12 col-md-6">
  43.         <h1 >View All Users</h1>
  44.       </div>
  45.  
  46.       <div class="col-xs-12 col-md-6">
  47.             <form class="">
  48.                 <label for="system-search">Search:</label>
  49.                 <div class="input-group">
  50.                     <input class="form-control" id="system-search" name="q" placeholder="Search Users..." type="text">
  51.                     <span class="input-group-btn">
  52.                         <button type="submit" class="btn btn-default"><i class="fa fa-times"></i></button>
  53.                     </span>
  54.                 </div>
  55.             </form>
  56.           </div>
  57.  
  58.      </div>
  59.  
  60.          <div class="row">
  61.              <div class="col-md-12">
  62.  
  63.  
  64. <hr />
  65.  <div class="allutable table-responsive">
  66. <table class='table table-hover table-list-search'>
  67. <thead>
  68. <tr>
  69.   <th><div class="alluinfo">&nbsp;</div></th>
  70.   <th>Username</th>
  71.  </tr>
  72. </thead>
  73.  <tbody>
  74. <?php
  75. //Cycle through users
  76. foreach ($users as $v1) {
  77.  
  78.     $ususername = ucfirst($v1->username);
  79.     $ususerbio = ucfirst($v1->bio);
  80.     $grav = empty($v1->picture) ? get_gravatar(strtolower(trim($v1->email))) : $v1->picture;
  81.     $useravatar = '<img src="'.$grav.'" class="img-responsive img-thumbnail" width=130 height=130 alt="'.$ususername.'">';
  82.  
  83. ?>
  84.  
  85.     <tr>
  86.         <td>
  87.             <a href="profile.php?name=<?=htmlentities($v1->username)?>"><?php echo $useravatar;?></a>
  88.         </td>
  89.  
  90.           <td>
  91.             <h4><a href="profile.php?name=<?=htmlentities($v1->username)?>"><?=$ususername?>  </a></h4>
  92.             <p><?=$ususerbio?></p>
  93. <?php
  94. echo "<BR /><SPAN STYLE=\"font-size:x-small; float:right\">" .
  95.      "<B>Joined</B>: " . DateTime::createFromFormat("Y-m-d H:i:s", $v1->join_date)->format("Y-m-d") . " &nbsp; &nbsp;  &nbsp; " .
  96.      "<B>Active</B>: " . DateTime::createFromFormat("Y-m-d H:i:s", $v1->last_login)->format("jS F (l) Y H:i") . "</SPAN>";
  97. ?>
  98.         </td>
  99.        
  100. <?php
  101. echo "<TD>";
  102.  
  103.     if ($settings->messaging==1   &&   $v1->id != $thisUserID)
  104.         echo "<A CLASS=\"btn btn-primary btn-xs\" HREF=\"create_message.php?id={$v1->id}\" ROLE=\"button\">Message</A>";
  105.    
  106.     if (!empty($v1->gpluslink))
  107.         echo " &nbsp; &nbsp; <A CLASS=\"btn btn-primary btn-xs\" HREF=\"{$v1->gpluslink}\" ROLE=\"button\">G+</A>";
  108.    
  109. echo "</TD>";
  110. ?>
  111.        
  112.     </tr>
  113. <?php } ?>
  114.   </tbody>
  115. </table>
  116.       </div>
  117.  
  118.       </div>
  119.     </div>
  120.  
  121.     <!-- /.row -->
  122.       </div>
  123.     </div>
  124.     <!-- footers -->
  125. <?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>
  126.  
  127.     <!-- Place any per-page javascript here -->
  128. <script src="js/search.js" charset="utf-8"></script>
  129.  
  130. <?php require_once $abs_us_root.$us_url_root.'users/includes/html_footer.php'; // currently just the closing /body and /html ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top