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/>.
- */
- require_once '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';
- if (!securePage($_SERVER['PHP_SELF']))
- die();
- //PHP Goes Here!
- if ($user->isLoggedIn())
- $thisUserID = $user->data()->id;
- else
- $thisUserID = 0;
- $userID = Input::get('id');
- $name = Input::get('name');
- $ususername = '404';
- $usbio = "User not found";
- $useravatar = "";
- $editbio = " <SMALL><A HREF=\"/\">Go to the homepage</A></SMALL>";
- $sql = "SELECT * FROM profiles LEFT JOIN users ON user_id = users.id WHERE " . (empty($name) ? "user_id=" : "username LIKE ") . "?";
- $arg = empty($name) ? [$userID] : [$name];
- $userQ = $db->query($sql, $arg);
- $thatUser = $userQ->first();
- $found = !$db->error() && $db->count()>0;
- if ($found) {
- $userID = $thatUser->id;
- $ususername = ucfirst($thatUser->username)."'s Profile";
- $grav = empty($thatUser->picture) ? get_gravatar(strtolower(trim($thatUser->email))) : $thatUser->picture;
- $useravatar = '<IMG SRC="'.$grav.'" CLASS="img-thumbnail" WIDTH=130 HEIGHT=130 ALT="'.$ususername.'">';
- $usbio = html_entity_decode($thatUser->bio);
- $editbio = $thisUserID == $userID ? " <SMALL><A HREF=\"edit_profile.php\">Edit Bio</A></SMALL>" : "";
- }
- echo "
- <DIV ID=\"page-wrapper\">
- <DIV CLASS=\"container\">
- <!-- Main jumbotron for a primary marketing message or call to action -->
- <DIV CLASS=\"well\">
- <DIV CLASS=\"row\">
- <DIV CLASS=\"col-xs-12 col-md-2\">
- <P>{$useravatar}</P>
- </DIV>
- <DIV CLASS=\"col-xs-12 col-md-10\">
- <H2>{$ususername}</H2>
- <BR />
- {$usbio} {$editbio}
- <BR /><BR />";
- if ($found)
- echo
- "<SPAN STYLE=\"font-size:small; float:right\">
- <B>Joined</B>: " . DateTime::createFromFormat("Y-m-d H:i:s", $thatUser->join_date)->format("Y-m-d") . "
- <B>Active</B>: " . DateTime::createFromFormat("Y-m-d H:i:s", $thatUser->last_login)->format("jS F (l) Y H:i") .
- "</SPAN>";
- echo "
- </DIV>
- </DIV>
- </DIV>";
- if ($settings->messaging==1 && $found && $thisUserID!=$userID)
- echo "<A CLASS=\"btn btn-primary\" HREF=\"create_message.php?id={$thatUser->id}\" ROLE=\"button\">Message</A> ";
- if (!empty($thatUser->gpluslink))
- echo "<A CLASS=\"btn btn-primary\" HREF=\"{$thatUser->gpluslink}\" ROLE=\"button\">G+ Profile</A> ";
- ?>
- <a class="btn btn-success" href="view_all_users.php" role="button">All Users</a>
- <BR /><BR />
- </div> <!-- /container -->
- </div> <!-- /#page-wrapper -->
- <!-- 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 -->
- <?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