<?

include "header.php";

if(!isset($_GET['u'])) {
echo $head;
echo "
<h2>$profile1</h2>
$profile2";
echo $foot;
exit();
}


$error = "";
$options = "";
if($owner_group_info[allow_profileprivacy] == "1") {
 if($owner_info[profile_privacy] == "2" & $is_logged_in != "yes" & $is_admin_logged_in != "yes") {
  $error = "$profile34";
  $options = "<br><br><ul><li><a href='".url("login", "")."'>$profile37</a></li><li><a href='".url("signup", "")."'>$profile38</a></li>";
 } elseif($owner_info[profile_privacy] == "1" & $is_admin_logged_in != "yes" & ($is_logged_in != "yes" | mysql_num_rows(mysql_query("SELECT fr_id FROM bhost_friends WHERE u_id='$owner_info[u_id]' AND friend_u_id='$user_info[u_id]'")) == 0) & $user_info[u_id] != $owner_info[u_id]) {
  $error = "$profile35";
  $options = "<br><br><ul><li><a href='".url("login", "")."'>$profile37</a></li><li><a href='".url("signup", "")."'>$profile38</a></li>";
 } elseif($owner_info[profile_privacy] == "0" & $user_info[u_id] != $owner_info[u_id] & $is_admin_logged_in != "yes") {
  $error = "$profile36";
 }
}

if($error != "") {
echo $head;
echo $error;
echo $options;
echo $foot;
exit();
}




echo $head;

echo "
<h2>$owner_info[username]$profile3</h2>

<table width='100%' cellpadding='0' cellspacing='0' class='profile'>
<tr>
<td class='profile'>
";





// AVATAR INFO
$avatar = "";
$contactme = "";
if($admin_info[allow_avatars] == "1" & str_replace(" ", "", $owner_info[avatar]) != "") {
$avatar = "<img src='$owner_info[avatar]' border='0' class='profile_avatar'><br>";
}

// SHOW WHOS ONLINE
if($admin_info[show_whosonline] == "1") {
 if($owner_info[last_activity] >= time()-15*60) {
  $contactme .= "<div>$profile32</div>";
 } else {
  $contactme .= "<div>$profile33</div>";
 }
}

// SHOW EMAIL ADDRESS
if($owner_info[show_email] == 1) {
$contactme .= "<div><a href='mailto:$owner_info[email]'>$profile22</a></div>";
}

// SHOW WEBSITE URL
if($admin_info[field_website] == 3 | (($admin_info[field_website] == 2 | $admin_info[field_website] == 1) & str_replace(" ", "", $owner_info[website]) != "")) {
if(substr($owner_info[website], 0, 7) != "http://") { $website = "http://".$owner_info[website]; } else { $website = $owner_info[website]; }
$contactme .= "<div><a href='$website' target='_blank'>$profile23</a></div>";
}

// SHOW PHOTO ALBUM
if($group_info[allow_album] == 1) {

	// IF THERE ARE ANY IMAGES IN ALBUM BASE FOLDER
	$album_info = mysql_query("SELECT location FROM bhost_uploads WHERE u_id='$owner_info[u_id]' AND location='album' LIMIT 1");
	if(mysql_num_rows($album_info) != 0) {
		$show_albumlink = 1;
	} else {
		// IF THERE ARE ANY FOLDERS IN ALBUM BASE FOLDER
		$album_folders = mysql_query("SELECT in_album FROM bhost_folders WHERE u_id='$owner_info[u_id]' AND in_album='1' LIMIT 1"); 
		if(mysql_num_rows($album_folders) != 0) {
		$show_albumlink = 1;
		}
	}

	// SHOW ALBUM LINK
	if($show_albumlink == 1) {
	$contactme .= "<div><a href='".url("album", "", "$owner_info[username]")."' target='_blank'>$profile31</a></div>";
	}

}

// SHOW ADD TO FRIENDS LINK
if($is_logged_in == "yes" & $user_info[u_id] != $owner_info[u_id] & $group_info[allow_friends] == 1 & mysql_num_rows(mysql_query("SELECT fr_id, friend_u_id FROM bhost_friends WHERE u_id='$user_info[u_id]' AND friend_u_id='$owner_info[u_id]'")) == 0) {
 $contactme .= "<div><a href='".url("manager/view_friends.php?task=adddyn&new_u=$owner_info[username]", "")."' target='_blank'>$profile29</a></div>";
}

// SHOW SEND MESSAGE
if($is_logged_in == "yes" & $user_info[u_id] != $owner_info[u_id] & $group_info[allow_pms] == 1 & $owner_group_info[allow_pms] == 1) {
 $contactme .= "<div><a href='".url("manager/messages.php?task=send&to=$owner_info[username]", "")."' target='_blank'>$profile30</a></div>";
}

// SHOW THE AVATAR BOX
if($contactme != "" | $avatar != "") {
 echo "<div class='profile_avatar'>$avatar";
 if($contactme != "") {
  echo "$contactme";
 }
 echo "</div>";
}






// SHOW NAME
if($owner_info[show_name] == 1) {
 echo "&#149; <font class='bold'>$profile6</font> ";
 if($admin_info[search_fname] == "2") { echo "<a href='".url("browse", "", "", "", "", "", "fname=$owner_info[fname]")."'>$owner_info[fname]</a>"; } else { echo "$owner_info[fname]"; }
 if($admin_info[search_lname] == "2") { echo " <a href='".url("browse", "", "", "", "", "", "lname=$owner_info[lname]")."'>$owner_info[lname]</a>"; } else { echo " $owner_info[lname]"; }
} else {
 if($owner_info[display_name] != "") {
  echo "&#149; <font class='bold'>$profile6</font> ";
  if($admin_info[search_display_name] == "2") { echo "<a href='".url("browse", "", "", "", "", "", "display_name=$owner_info[display_name]")."'>$owner_info[display_name]</a>"; } else { echo "$owner_info[display_name]"; }
 }
}

// SHOW GENDER
if($admin_info[field_gender] == 3 | (($admin_info[field_gender] == 2 | $admin_info[field_gender] == 1) & str_replace(" ", "", $owner_info[gender]) != "")) {
 echo "<br>&#149; <font class='bold'>$profile7</font> ";
 if($admin_info[search_gender] == "2") { echo "<a href='".url("browse", "", "", "", "", "", "gender=$owner_info[gender]")."'>$owner_info[gender]</a>"; } else { echo "$owner_info[gender]"; }
}

// SHOW BIRTHDAY
if($admin_info[field_birthday] == 3 | (($admin_info[field_birthday] == 2 | $admin_info[field_birthday] == 1) & $owner_info[birthday] != "-2019787262")) {
  $birthday_date = MakeDate($owner_info[birthday]);
  $age = myAge("$birthday_date[2]-$birthday_date[0]-$birthday_date[1]");
 if($age != 0) {
  echo "<br>&#149; <font class='bold'>$profile8</font> ";
  if($admin_info[search_birthday] == "2") { echo "<a href='".url("browse", "", "", "", "", "", "birthday=$owner_info[birthday]")."'>".cdate("$admin_info[signup_format_date]", $owner_info[birthday])."</a> ($profile9 <a href='".url("browse", "", "", "", "", "", "age=$age")."'>$age</a>)"; } else { echo "$birthday_date[3] $birthday_date[1], $birthday_date[2] ($profile9 $age)"; }
 }
}

// SHOW IM SCREENNAME
if($admin_info[field_screenname] == 3 | (($admin_info[field_screenname] == 2 | $admin_info[field_screenname] == 1) & str_replace(" ", "", $owner_info[screenname]) != "")) {
if($owner_info[screenname_type] == "AIM") {
$imlink = "<a href='aim:goim?screenname=$owner_info[screenname]'>$owner_info[screenname]</a>";
} elseif($owner_info[screenname_type] == "ICQ") {
$imlink = "<a href='http://web.icq.com/whitepages/message_me?action=message&uin=$owner_info[screenname]'>$owner_info[screenname]</a>";
} elseif($owner_info[screenname_type] == "MSN") {
$imlink = "$owner_info[screenname]";
} elseif($owner_info[screenname_type] == "Yahoo!") {
$imlink = "<a href='ymsgr:sendIM?$owner_info[screenname]'>$owner_info[screenname]</a>";
} else {
$imlink = "$owner_info[screenname]";
}
echo "<br>&#149; <font class='bold'>$profile39</font> $imlink ($owner_info[screenname_type])";
}

// SHOW LOCATION
if(($admin_info[field_city] == 3 | (($admin_info[field_city] == 2 | $admin_info[field_city] == 1) & str_replace(" ", "", $owner_info[city]) != "")) | ($admin_info[field_state] == 3 | (($admin_info[field_state] == 2 | $admin_info[field_state] == 1) & str_replace(" ", "", $owner_info[state]) != "")) | ($admin_info[field_country] == 3 | (($admin_info[field_country] == 2 | $admin_info[field_country] == 1) & str_replace(" ", "", $owner_info[country]) != ""))) {
  $location = "";
  if($owner_info[city] != "") {
   if($admin_info[search_city] == "2") { $location .= "<a href='".url("browse", "", "", "", "", "", "city=$owner_info[city]")."'>$owner_info[city]</a>"; } else { $location .= $owner_info[city]; }
  }
  if($owner_info[state] != "") { 
   if($location != "") { $location .= ", "; } 
   if($admin_info[search_state] == "2") { $location .= "<a href='".url("browse", "", "", "", "", "", "state=$owner_info[state]")."'>$owner_info[state]</a>"; } else { $location .= $owner_info[state]; }
  }
  if($owner_info[country] != "") {
   if($location != "") { $location .= ", "; }
   if($admin_info[search_country] == "2") { $location .= "<a href='".url("browse", "", "", "", "", "", "country=$owner_info[country]")."'>$owner_info[country]</a>"; } else { $location .= $owner_info[country]; }
  }

if($location != "") { echo "<br>&#149; <font class='bold'>$profile10</font> $location"; }
}


// SHOW CUSTOM FIELDS
$custom_fields = mysql_query("SHOW COLUMNS FROM bhost_profile FROM `$mysql_database`");
$owner_user_profile = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_profile WHERE u_id='$owner_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, -3));
  $custom_required = substr($custom[Field], -3, 2);
  $custom_search = substr($custom[Field], -1);
  $custom_field = $custom[Field];
  if($custom_required != "_0") {
   if($custom_required == "_3" | (($custom_required == "_2" | $custom_required == "_1") & str_replace(" ", "", $owner_user_profile[$custom_field]) != "")) {
    echo "<br><br><font class='bold'>$custom_name</font><br>";
    if($custom_search == "2") {
     $custom_values = explode(",", $owner_user_profile[$custom_field]);
     $total_values = count($custom_values);
     $count = 0;
     $where = "";
     while($count < $total_values) {
      if($count != 0) { echo ", "; }
      echo "<a href='".url("browse", "", "", "", "", "", "$custom[Field]=$custom_values[$count]")."'>$custom_values[$count]</a>";
      $count++;
     }
    } else {
     echo "$owner_user_profile[$custom_field]";
    }
   } 
  }
 }
}


if($admin_info[show_userstats] == 2 | ($admin_info[show_userstats] == 1 & $owner_info[show_userstats] == 1)) {
$entries = mysql_num_rows(mysql_query("SELECT author_u_id FROM bhost_entries WHERE author_u_id='$owner_info[u_id]'"));
$comments_written = mysql_num_rows(mysql_query("SELECT author_u_id FROM bhost_comments WHERE author_u_id='$owner_info[u_id]'"));
$signupdate = cdate("F j, Y", $owner_info[signup_date]);
$lastlogin = $owner_info[last_login];
$lastlogin_date = cdate("F j, Y", $owner_info[last_login]);
echo "
<br><br>
<font class='bold'>$profile14</font> $entries $profile11<br>
<font class='bold'>$profile15</font> $comments_written $profile12<br>
<font class='bold'>$profile17</font> $signupdate
";
if($lastlogin != "" AND $lastlogin != 0) {
echo "<br><font class='bold'>$profile18</font> $lastlogin_date";
}
}


$friendlist = "";
$friends = mysql_query("SELECT bhost_friends.u_id, bhost_friends.friend_u_id, bhost_users.username FROM bhost_friends LEFT JOIN bhost_users ON bhost_friends.friend_u_id=bhost_users.u_id WHERE bhost_friends.u_id='$owner_info[u_id]' ORDER BY bhost_users.username");
$totalfriends = mysql_num_rows($friends);
$count = 0;
while($friend = mysql_fetch_assoc($friends)) {
$count++;
$friendlist .= "<a href='".url("profile", "", "$friend[username]")."'>$friend[username]</a>";
if($totalfriends != $count AND $friend[username] != "") { $friendlist .= ", "; }
}

$friendoflist = "";
$friends = mysql_query("SELECT bhost_friends.u_id, bhost_friends.friend_u_id, bhost_users.username FROM bhost_friends LEFT JOIN bhost_users ON bhost_friends.u_id=bhost_users.u_id WHERE bhost_friends.friend_u_id='$owner_info[u_id]' ORDER BY bhost_users.username");
$totalfriendsof = mysql_num_rows($friends);
$count = 0;
while($friend = mysql_fetch_assoc($friends)) {
$count++;
$friendoflist .= "<a href='".url("profile", "", "$friend[username]")."'>$friend[username]</a>";
if($totalfriendsof != $count AND $friend[username] != "") { $friendoflist .= ", "; }
}



// SHOW FRIENDLIST
if($owner_group_info[allow_friends] == 1) {
if($admin_info[show_friendlist] == 2 | ($admin_info[show_friendlist] == 1 & $owner_info[show_friendlist] == 1)) {
if($totalfriends != 0) {
echo "
<br><br>
<font class='bold'><a href='".url("browse", "", "", "", "", "", "friendsof=$owner_info[username]")."'>$profile19</a></font> ($totalfriends)<br>
$friendlist
";
}
if($totalfriendsof != 0) {
echo "
<br><br>
<font class='bold'><a href='".url("browse", "", "", "", "", "", "friend=$owner_info[username]")."'>$profile20</a></font> ($totalfriendsof)<br>
$friendoflist
";
}
}
}





// SHOW INTERESTS LIST
if($admin_info[field_interests] != 0) {
$interests = explode(",", trim($owner_info[interests]));
$total_interests = count($interests);
if(str_replace(" ", "", $owner_info[interests]) == "") { $total_interests = 0; }

$count = 0;
$where = "";
$myinterests = "";
while($count < $total_interests) {
if($count != 0) { $myinterests .= ", "; }
$interest_url =  urlencode($interests[$count]);
$myinterests .= "<a href='".url("browse", "", "", "", "", "", "interest=$interest_url")."'>$interests[$count]</a>";
$count++;
}



if($count != 0) {
echo "
<br><br>
<font class='bold'>$profile26</font> ($count)<br>
$myinterests<br>
";
}}

echo "
</td></tr></table>
<br>
";







echo "
<h2>$owner_info[username]$profile5</h2>
<table cellpadding='0' cellspacing='0' class='profile'>
";

// GET WEBLOG INFO
$weblogs_own = mysql_query("SELECT * FROM bhost_weblogs WHERE u_id='$owner_info[u_id]'");
$weblogs_admin = mysql_query("SELECT * FROM bhost_weblogs WHERE level1 LIKE '%,$owner_info[u_id],%'");
$weblogs_member = mysql_query("SELECT * FROM bhost_weblogs WHERE level2 LIKE '%,$owner_info[u_id],%'");

$weblogs_own_total = 0;
$weblogs_admin_total = 0;
$weblogs_member_total = 0;
$total = 0;




// WEBLOGS OWNED
$weblogs_own_total = mysql_num_rows($weblogs_own);
while($weblogs_own_info = mysql_fetch_assoc($weblogs_own)) {
 $total++;
 if($total == 1) { $class = "2"; } else { $class = "3"; }

 if($weblogs_own_info[title] != "") { $weblogtitle = $weblogs_own_info[title]; } else { $weblogtitle = "<i>$profile4</i>"; }
 $total_entries = mysql_num_rows(mysql_query("SELECT e_id FROM bhost_entries WHERE w_id='$weblogs_own_info[w_id]'"));
 $total_comments = mysql_num_rows(mysql_query("SELECT c_id FROM bhost_comments WHERE w_id='$weblogs_own_info[w_id]'"));
 echo "<tr><td width='90%' class='profile$class'><img src='".url("/images/", "/images/openfolder.gif")."' border='0' class='icon'> <font class='bold'><a href='".url("index", "$weblogs_own_info[weblog]")."'>$weblogtitle</a></font></td><td class='profile$class' width='5%' valign='top' NOWRAP><font class='profile_blogstat'>$total_entries $profile27, $total_comments $profile28</font></td></tr>";

 // SHOW CATEGORY
 if($admin_info[categories_on] == 1 & mysql_num_rows(mysql_query("SELECT * FROM bhost_categories")) != 0 & $weblogs_own_info[wc_id] != 0) {
 $category_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_categories WHERE wc_id='$weblogs_own_info[wc_id]'"));
 echo "<tr><td colspan='2' class='profile_category'>$profile25 <a href='".url("browse", "", "", "", "", "", "category=$category_info[name]")."'>$category_info[name]</a></td></tr>";
 }

 // SHOW DESCRIPTION
 if(str_replace(" ", "", $weblogs_own_info[description]) != "") {
 echo "<tr><td colspan='2' class='profile_description'>$weblogs_own_info[description]</td></tr>";
 }

 // SHOW OTHER MEMBERS
 if(($admin_info[show_teammembers] == 2 | ($admin_info[show_teammembers] == 1 & $owner_info[show_teammembers] == "1")) & $owner_group_info[allow_multiauthor] == "1") {
  $where = "";
  $admins = explode(",", trim($weblogs_own_info[level1]));
  for($a=0;$a<count($admins);$a++) {
  if($admins[$a] != "") {
  if($where != "") { $where .= " OR "; }
  $where .= "u_id='$admins[$a]'"; 
  }
  }
  $members2 = explode(",", trim($weblogs_own_info[level2]));
  for($a=0;$a<count($members2);$a++) {
  if($members2[$a] != "") { 
  if($where != "") { $where .= " OR "; }
  $where .= "u_id='$members2[$a]'"; 
  }
  }
  if($where != "") {
   $allmembers = mysql_query("SELECT username FROM bhost_users WHERE $where");
   if(mysql_num_rows($allmembers) != 0) {
    echo "<tr><td colspan='2' class='profile_members'>$profile16 ";
    $count = 0;
    while($member_info = mysql_fetch_assoc($allmembers)) {
     if($count != 0) { echo ", "; }
     echo "<a href='".url("profile", "", $member_info[username])."'>$member_info[username]</a>";
     $count++;
    }
    echo "</td></tr>";
   }
  }
 }
}





if($owner_group_info[allow_multiauthor] == "1") {

// WEBLOGS ADMINED
$weblogs_admin_total = mysql_num_rows($weblogs_admin);
while($weblogs_admin_info = mysql_fetch_assoc($weblogs_admin)) {
 $total++;
 if($total == 1) { $class = "2"; } else { $class = "3"; }
 
 if($weblogs_admin_info[title] != "") { $weblogtitle = $weblogs_admin_info[title]; } else { $weblogtitle = "<i>$profile4</i>"; }
 $total_entries = mysql_num_rows(mysql_query("SELECT e_id FROM bhost_entries WHERE w_id='$weblogs_admin_info[w_id]'"));
 $total_comments = mysql_num_rows(mysql_query("SELECT c_id FROM bhost_comments WHERE w_id='$weblogs_admin_info[w_id]'"));
 echo "<tr><td width='90%' class='profile$class' NOWRAP><img src='".url("/images/", "/images/openfolder.gif")."' border='0' class='icon'> <font class='bold'><a href='".url("index", "$weblogs_admin_info[weblog]")."'>$weblogtitle</a></font></td><td class='profile$class' width='5%' valign='top' NOWRAP><font class='profile_blogstat'>$total_entries $profile27, $total_comments $profile28</font></td></tr>";

 // SHOW CATEGORY
 if($admin_info[categories_on] == 1 & mysql_num_rows(mysql_query("SELECT * FROM bhost_categories")) != 0 & $weblogs_admin_info[wc_id] != 0) {
 $category_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_categories WHERE wc_id='$weblogs_admin_info[wc_id]'"));
 echo "<tr><td colspan='2' class='profile_category'>$profile25 <a href='".url("browse", "", "", "", "", "", "category=$category_info[name]")."'>$category_info[name]</a></td></tr>";
 }

 // SHOW DESCRIPTION
 if(str_replace(" ", "", $weblogs_admin_info[description]) != "") {
 echo "<tr><td colspan='2' class='profile_description'>$weblogs_admin_info[description]</td></tr>";
 }

 // SHOW OTHER MEMBERS
 if(($admin_info[show_teammembers] == 2 | ($admin_info[show_teammembers] == 1 & $owner_info[show_teammembers] == "1")) & $owner_group_info[allow_multiauthor] == "1") {
  $where = "u_id='$weblogs_admin_info[u_id]'";
  $admins = explode(",", trim($weblogs_admin_info[level1]));
  for($a=0;$a<count($admins);$a++) {
  if($admins[$a] != "" & $admins[$a] != $owner_info[u_id]) { 
  if($where != "") { $where .= " OR "; }
  $where .= "u_id='$admins[$a]'"; 
  }
  }
  $members2 = explode(",", trim($weblogs_admin_info[level2]));
  for($a=0;$a<count($members2);$a++) {
  if($members2[$a] != "") { 
  if($where != "") { $where .= " OR "; }
  $where .= "u_id='$members2[$a]'"; 
  }
  }
  $allmembers = mysql_query("SELECT username FROM bhost_users WHERE ($where)");
  if(mysql_num_rows($allmembers) != 0) {
   echo "<tr><td colspan='2' class='profile_members'>$profile16 ";
   $count = 0;
   while($member_info = mysql_fetch_assoc($allmembers)) {
    if($count != 0) { echo ", "; }
    echo "<a href='".url("profile", "", $member_info[username])."'>$member_info[username]</a>";
    $count++;
   }
   echo "</td></tr>";
  }
 }
}




// WEBLOGS MEMBERED
$weblogs_member_total = mysql_num_rows($weblogs_member);
while($weblogs_member_info = mysql_fetch_assoc($weblogs_member)) {
 $total++;
 if($total == 1) { $class = "2"; } else { $class = "3"; }
 
 if($weblogs_member_info[title] != "") { $weblogtitle = $weblogs_member_info[title]; } else { $weblogtitle = "<i>$profile4</i>"; }
 $total_entries = mysql_num_rows(mysql_query("SELECT e_id FROM bhost_entries WHERE w_id='$weblogs_member_info[w_id]'"));
 $total_comments = mysql_num_rows(mysql_query("SELECT c_id FROM bhost_comments WHERE w_id='$weblogs_member_info[w_id]'"));
 echo "<tr><td width='90%' class='profile$class' NOWRAP><img src='".url("/images/", "/images/openfolder.gif")."' border='0' class='icon'> <font class='bold'><a href='".url("index", "$weblogs_member_info[weblog]")."'>$weblogtitle</a></font></td><td class='profile$class' width='5%' valign='top' NOWRAP><font class='profile_blogstat'>$total_entries $profile27, $total_comments $profile28</font></td></tr>";

 // SHOW CATEGORY
 if($admin_info[categories_on] == 1 & mysql_num_rows(mysql_query("SELECT * FROM bhost_categories")) != 0 & $weblogs_member_info[wc_id] != 0) {
 $category_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_categories WHERE wc_id='$weblogs_member_info[wc_id]'"));
 echo "<tr><td colspan='2' class='profile_category'>$profile25 <a href='".url("browse", "", "", "", "", "", "category=$category_info[name]")."'>$category_info[name]</a></td></tr>";
 }

 // SHOW DESCRIPTION
 if(str_replace(" ", "", $weblogs_member_info[description]) != "") {
 echo "<tr><td colspan='2' class='profile_description'>$weblogs_member_info[description]</td></tr>";
 }

 // SHOW OTHER MEMBERS
 if(($admin_info[show_teammembers] == 2 | ($admin_info[show_teammembers] == 1 & $owner_info[show_teammembers] == "1")) & $owner_group_info[allow_multiauthor] == "1") {
  $where = "u_id='$weblogs_member_info[u_id]'";
  $admins = explode(",", trim($weblogs_member_info[level1]));
  for($a=0;$a<count($admins);$a++) {
  if($admins[$a] != "") { 
  if($where != "") { $where .= " OR "; }
  $where .= "u_id='$admins[$a]'"; 
  }
  }
  $members2 = explode(",", trim($weblogs_member_info[level2]));
  for($a=0;$a<count($members2);$a++) {
  if($members2[$a] != "" & $members2[$a] != $owner_info[u_id]) { 
  if($where != "") { $where .= " OR "; }
  $where .= "u_id='$members2[$a]'"; 
  }
  }
  $allmembers = mysql_query("SELECT username FROM bhost_users WHERE ($where)");
  if(mysql_num_rows($allmembers) != 0) {
   echo "<tr><td colspan='2' class='profile_members'>$profile16 ";
   $count = 0;
   while($member_info = mysql_fetch_assoc($allmembers)) {
    if($count != 0) { echo ", "; }
    echo "<a href='".url("profile", "", $member_info[username])."'>$member_info[username]</a>";
    $count++;
   }
   echo "</td></tr>";
  }
 }
}


}


$total_weblogs = $weblogs_own_total + $weblogs_admin_total + $weblogs_member_total;
if($total_weblogs == 0) {
echo "
<tr>
<td class='profile'>$profile13</td>
</tr>
";
}

echo "</table>";






















echo $foot;
?>