profile.php
来自「BLOG HOSTER---PHP & MYSQL Create Blogs 」· PHP 代码 · 共 270 行
PHP
270 行
<?
include "header.php";
if(!isset($_GET['u'])) {
echo $head;
echo "
<h2>$profile1</h2>
$profile2";
echo $foot;
exit();
} else {
echo $head;
echo "
<table cellpadding='0' cellspacing='0'>
<tr>
<td width='100%' class='box'>
<table cellpadding='0' cellspacing='0'>
<tr>
<td width='500' valign='top'>
<!-- START LEFT PROFILE COLUMN -->
<table width='100%' cellpadding='0' cellspacing='0' class='profile'>
<tr>
<td class='profile1'>
<h2>$profile3 $user_info[username]</h2>
</td>
</tr>
<tr>
<td class='profile2'>
";
if($user_info[title] != "") { $weblogtitle = $user_info[title]; } else { $weblogtitle = "<i>$profile4</i>"; }
echo "<b>$profile5</b> <a href='".url("index", "$user_info[username]")."'>$weblogtitle</a><br>";
if($user_info[description] != "") {
echo "$user_info[description]<br>";
}
if($user_info[show_name] == 1) {
echo "<br>• <b>$profile6</b> $user_info[fname] $user_info[lname]";
} else {
if($user_info[display_name] != "") {
echo "<br>• <b>$profile6</b> $user_info[display_name]";
}
}
if($admin_info[field_gender] == 3 | (($admin_info[field_gender] == 2 | $admin_info[field_gender] == 1) & str_replace(" ", "", $user_info[gender]) != "")) {
echo "<br>• <b>$profile7</b> $user_info[gender]";
}
if($admin_info[field_birthday] == 3 | (($admin_info[field_birthday] == 2 | $admin_info[field_birthday] == 1) & str_replace(" ", "", $user_info[birthday]) != "")) {
$birthday_date = MakeDate($user_info[birthday]);
$age = myAge("$birthday_date[2]-$birthday_date[0]-$birthday_date[1]");
if($age != 0) {
echo "<br>• <b>$profile8</b> $birthday_date[3] $birthday_date[1], $birthday_date[2] ($profile9 $age)";
}
}
if(($admin_info[field_city] == 3 | (($admin_info[field_city] == 2 | $admin_info[field_city] == 1) & str_replace(" ", "", $user_info[city]) != "")) | ($admin_info[field_state] == 3 | (($admin_info[field_state] == 2 | $admin_info[field_state] == 1) & str_replace(" ", "", $user_info[state]) != "")) | ($admin_info[field_country] == 3 | (($admin_info[field_country] == 2 | $admin_info[field_country] == 1) & str_replace(" ", "", $user_info[country]) != ""))) {
$location = "";
if($user_info[city] != "") { $location .= $user_info[city]; }
if($user_info[state] != "") { if($location != "") { $location .= ", "; } $location .= $user_info[state]; }
if($user_info[country] != "") { if($location != "") { $location .= ", "; } $location .= $user_info[country]; }
if($location != "") { echo "<br>• <b>$profile10</b> $location"; }
}
$categories = mysql_query("SELECT * FROM bhost_categories");
if($admin_info[categories_on] == 1 & mysql_num_rows($categories) != 0) {
if($user_info[wc_id] != 0) {
$category_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_categories WHERE wc_id='$user_info[wc_id]'"));
echo "<br>• <b>$profile25</b> $category_info[name]";
}
}
$custom_fields = mysql_query("SHOW COLUMNS FROM bhost_profile FROM `$mysql_database`");
$user_profile = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_profile WHERE u_id='$user_info[u_id]'"));
while($custom = mysql_fetch_assoc($custom_fields)) {
if($custom[Field] != "p_id" & $custom[Field] != "u_id") {
$custom_name = str_replace("_", " ", substr($custom[Field], 0, -2));
$custom_required = substr($custom[Field], -2);
$custom_field = $custom[Field];
if($custom_required != "_0") {
if($custom_required == "_3" | (($custom_required == "_2" | $custom_required == "_1") & str_replace(" ", "", $user_profile[$custom_field]) != "")) {
echo "<br><br><b>$custom_name</b><br>$user_profile[$custom_field]";
}
}
}
}
if($admin_info[show_userstats] == 2 | ($admin_info[show_userstats] == 1 & $user_info[show_userstats] == 1)) {
$entries = mysql_num_rows(mysql_query("SELECT u_id FROM bhost_entries WHERE u_id='$user_info[u_id]'"));
$comments_received = mysql_num_rows(mysql_query("SELECT u_id FROM bhost_comments WHERE u_id='$user_info[u_id]'"));
$comments_written = mysql_num_rows(mysql_query("SELECT u_id FROM bhost_comments WHERE username='$user_info[username]'"));
$signupdate = cdate("F j, Y", $user_info[signup_date]);
$lastlogin = $user_info[last_login];
$lastlogin_date = cdate("F j, Y", $user_info[last_login]);
echo "
<br><br>
<b>$profile14</b> $entries $profile11<br>
<b>$profile15</b> $comments_written $profile12<br>
<b>$profile16</b> $comments_received $profile13<br>
<b>$profile17</b> $signupdate
";
if($lastlogin != "" AND $lastlogin != 0) {
echo "<br><b>$profile18</b> $lastlogin_date";
}
}
$memberlist = "";
$members = mysql_query("SELECT bhost_members.u_id, bhost_members.member_u_id, bhost_users.username FROM bhost_members LEFT JOIN bhost_users ON bhost_members.member_u_id=bhost_users.u_id WHERE bhost_members.u_id='$user_info[u_id]' ORDER BY bhost_users.username");
$totalmembers = mysql_num_rows($members);
$count = 0;
while($member = mysql_fetch_assoc($members)) {
$count++;
$memberlist .= "<a href='".url("profile", "$member[username]")."'>$member[username]</a>";
if($totalmembers != $count AND $member[username] != "") { $memberlist .= ", "; }
}
$memberoflist = "";
$members = mysql_query("SELECT bhost_members.u_id, bhost_members.member_u_id, bhost_users.username FROM bhost_members LEFT JOIN bhost_users ON bhost_members.u_id=bhost_users.u_id WHERE bhost_members.member_u_id='$user_info[u_id]' ORDER BY bhost_users.username");
$totalmembersof = mysql_num_rows($members);
$count = 0;
while($member = mysql_fetch_assoc($members)) {
$count++;
$memberoflist .= "<a href='".url("profile", "$member[username]")."'>$member[username]</a>";
if($totalmembersof != $count AND $member[username] != "") { $memberoflist .= ", "; }
}
// SHOW MEMBERLIST
if($group_info[allow_members] == 1) {
if($admin_info[show_memberlist] == 2 | ($admin_info[show_memberlist] == 1 & $user_info[show_memberlist] == 1)) {
if($totalmembers != 0) {
echo "
<br><br>
<b>$profile19</b> ($totalmembers)<br>
$memberlist
";
}
if($totalmembersof != 0) {
echo "
<br><br>
<b>$profile20</b> ($totalmembersof)<br>
$memberoflist
";
}
}
}
// SHOW INTERESTS LIST
if($admin_info[field_interests] != 0) {
$current_interests = str_replace("-", "", $user_info[interests]);
$interests = explode(",", $current_interests);
$total_interests = count($interests);
$count = 0;
$where = "";
while($count < $total_interests) {
if($count != 0) { $where .= " OR"; }
$where .= " int_id='$interests[$count]'";
$count++;
}
$query = "SELECT * FROM bhost_interests WHERE $where ORDER BY name";
$interest_query = mysql_query($query);
$count = 0;
while($interest = mysql_fetch_assoc($interest_query)) {
if($count != 0) { $myinterests .= ", "; }
$myinterests .= "<a href='".url("interests", "", "", "", "", "", "", "", "$interest[name]")."'>$interest[name]</a>";
$count++;
}
if($count != 0) {
echo "
<br><br>
<b>$profile26</b> ($count)<br>
$myinterests<br>
";
}}
echo "
</td></tr></table>
</td>
<td width='150' valign='top' style='padding-left: 7px;'>
<!-- START RIGHT PROFILE COLUMN -->
";
// DISPLAY AVATAR
if($admin_info[allow_avatars] == "1") {
if(str_replace(" ", "", $user_info[avatar]) == "") { $user_info[avatar] = url("/images/", "images/noavatar2.gif"); }
echo "
<table width='100%' cellpadding='0' cellspacing='0' class='profile' style='margin-bottom: 7px;'>
<tr>
<td height='130' class='profile2' align='center' valign='middle'><a href='$user_info[avatar]' target='_blank'><img src='$user_info[avatar]' border='0' class='avatar'></a><br></td>
</tr>
</table>
";
}
$contactme = "";
if($user_info[show_email] == 1) {
$contactme .= "• <a href='mailto:$user_info[email]'>$profile22</a>";
}
if($admin_info[field_website] == 3 | (($admin_info[field_website] == 2 | $admin_info[field_website] == 1) & str_replace(" ", "", $user_info[website]) != "")) {
if($contactme != "") { $contactme .= "<br>"; }
if(substr($user_info[website], 0, 7) != "http://") { $website = "http://".$user_info[website]; } else { $website = $user_info[website]; }
$contactme .= "• <a href='$website' target='_blank'>$profile23</a>";
}
if($admin_info[field_screenname] == 3 | (($admin_info[field_screenname] == 2 | $admin_info[field_screenname] == 1) & str_replace(" ", "", $user_info[screenname]) != "")) {
if($user_info[screenname_type] == "AIM") {
$imlink = "<a href='aim:goim?screenname=$user_info[screenname]'>$user_info[screenname]</a>";
} elseif($user_info[screenname_type] == "ICQ") {
$imlink = "<a href='http://web.icq.com/whitepages/message_me?action=message&uin=$user_info[screenname]'>$user_info[screenname]</a>";
} elseif($user_info[screenname_type] == "MSN") {
$imlink = "$user_info[screenname]";
} elseif($user_info[screenname_type] == "Yahoo!") {
$imlink = "<a href='ymsgr:sendIM?$user_info[screenname]'>$user_info[screenname]</a>";
} else {
$imlink = "$user_info[screenname]";
}
if($contactme != "") { $contactme .= "<br>"; }
$contactme .= "• $imlink ($user_info[screenname_type])";
}
if($contactme != "") {
echo "
<table width='100%' cellpadding='0' cellspacing='0' class='profile'>
<tr><td class='profile2' valign='top'><b>$profile24</b><br>$contactme</td></tr>
</table>
";
}
echo "
</td></tr></table>
</td></tr></table>
";
echo $foot;
}
?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?