Advertisement
Guest User

Profile.php

a guest
Sep 13th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. if(isset($_GET['id'])){
  2.     $userID = Input::get('id');
  3.    
  4.     $userQ = $db->query("SELECT * FROM profiles LEFT JOIN users ON user_id = users.id WHERE user_id = ?",array($userID));
  5.     $thatUser = $userQ->first();
  6.  
  7.     if($thatUser!=null){
  8.         if($thisUserID == $userID){
  9.             $editbio = ' <small><a href="edit_profile.php">Edit Bio</a></small>';
  10.         }else{
  11.             $editbio = '';
  12.         }          
  13.         $ususername = ucfirst($thatUser->username)."'s Profile";
  14.         $grav = get_gravatar(strtolower(trim($thatUser->email)));
  15.         $useravatar = '<img src="'.$grav.'" class="img-thumbnail" alt="'.$ususername.'">';
  16.         $usbio = html_entity_decode($thatUser->bio);
  17.     }else{
  18.         $ususername = "404's Profile";
  19.         $usbio = 'User not found';
  20.         $useravatar = '';
  21.         $editbio = ' <small><a href="/">Go to the homepage</a></small>';       
  22.     }
  23. }else{
  24.     $ususername = "404's Profile";
  25.     $usbio = 'User not found';
  26.     $useravatar = '';
  27.     $editbio = ' <small><a href="/">Go to the homepage</a></small>';
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement