forked from lincanbin/Carbon-Forum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.php
23 lines (23 loc) · 1.04 KB
/
user.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
require(dirname(__FILE__) . '/common.php');
require(dirname(__FILE__) . '/language/' . ForumLanguage . '/user.php');
$UserName = Request('Get', 'username');
$UserInfo = array();
$UserInfo = $DB->row('SELECT * FROM ' . $Prefix . 'users Where UserName=:UserName', array(
'UserName' => $UserName
));
if (!$UserInfo)
AlertMsg('404 Not Found', '404 Not Found', 404);
if ($CurUserID)
$IsFavorite = $DB->single("SELECT ID FROM " . $Prefix . "favorites Where UserID=:UserID and Type=3 and FavoriteID=:FavoriteID", array(
'UserID' => $CurUserID,
'FavoriteID' => $UserInfo['ID']
));
$PostsArray = $DB->query('SELECT * FROM ' . $Prefix . 'posts Where UserName=:UserName and IsDel=0 ORDER BY PostTime DESC LIMIT 30', array(
'UserName' => $UserInfo['UserName']
));
$DB->CloseConnection();
$PageTitle = $UserInfo['UserName'];
$PageMetaDesc = $UserInfo['UserName'] . ' - ' . htmlspecialchars(strip_tags(mb_substr($UserInfo['UserIntro'], 0, 150, 'utf-8')));
$ContentFile = $TemplatePath . 'user.php';
include($TemplatePath . 'layout.php');