Advertisement
Guest User

UserSpice 4.3 Dev - profile.php

a guest
Sep 25th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.86 KB | None | 0 0
  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. <?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
  25. <?php
  26. //PHP Goes Here!
  27.  
  28. if(isset($_GET['id'])) $userID = Input::get('id');
  29. else $userID = $user->data()->id;
  30.  
  31. $userQ = $db->query("SELECT * FROM profiles LEFT JOIN users ON user_id = users.id WHERE user_id = ?",array($userID));
  32. if ($userQ->count() > 0) {
  33.     $thatUser = $userQ->first();
  34.  
  35.     if($user->isLoggedIn() && $user->data()->id == $userID)
  36.         {
  37.         $editbio = ' <small><a href="edit_profile.php">Edit Bio</a></small>';
  38.         }
  39.     else
  40.         {
  41.         $editbio = '';
  42.         }
  43.  
  44.     $ususername = ucfirst($thatUser->username)."'s Profile";
  45.     $grav = get_gravatar(strtolower(trim($thatUser->email)));
  46.     $useravatar = '<img src="'.$grav.'" class="img-thumbnail" alt="'.$ususername.'">';
  47.     $usbio = html_entity_decode($thatUser->bio);
  48.     //Uncomment out the line below to see what's available to you.
  49.     //dump($thisUser);
  50.     }
  51. else
  52.     {
  53.     $ususername = '404';
  54.     $usbio = 'User not found';
  55.     $useravatar = '';
  56.     $editbio = ' <small><a href="/">Go to the homepage</a></small>';
  57.     }
  58. ?>
  59.    <div id="page-wrapper">
  60.  
  61.          <div class="container">
  62.                 <!-- Main jumbotron for a primary marketing message or call to action -->
  63.                 <div class="well">
  64.                     <div class="row">
  65.                         <div class="col-xs-12 col-md-2">
  66.                             <p><?php echo $useravatar;?></p>
  67.                         </div>
  68.                         <div class="col-xs-12 col-md-10">
  69.                         <h1><?php echo $ususername;?></h1>
  70.                             <h2><?php echo $usbio.$editbio;?></h2>
  71.  
  72.                     </div>
  73.                     </div>
  74.                 </div>
  75.  
  76.                                         <a class="btn btn-success" href="view_all_users.php" role="button">All Users</a>
  77.  
  78.  
  79.     </div> <!-- /container --><br />
  80.  
  81. </div> <!-- /#page-wrapper -->
  82.  
  83. <!-- footers -->
  84. <?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>
  85. <!-- Place any per-page javascript here -->
  86. <?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