add friends
parent
9d0b185884
commit
eaedf8d4c5
|
@ -41,6 +41,44 @@
|
|||
return $rowUser['FirstName']." ".$rowUser['LastName'];
|
||||
}
|
||||
|
||||
$statementGridUser = $RUNTIME['PDO']->prepare("SELECT * FROM GridUser");
|
||||
$statementGridUser->execute(array($userID));
|
||||
|
||||
while($rowGridUser = $statementGridUser->fetch())
|
||||
{
|
||||
$UserData = explode(";", $rowGridUser['UserID']);
|
||||
|
||||
if(count($UserData) >= 3)
|
||||
{
|
||||
$DBUserID = $UserData[0];
|
||||
$DBUserName = $UserData[2];
|
||||
|
||||
$RUNTIME['CACHE']['USERNAME'][$userID] = $DBUserName;
|
||||
|
||||
if($DBUserID == $userID)
|
||||
return $DBUserName;
|
||||
}
|
||||
}
|
||||
|
||||
$statementFriends = $RUNTIME['PDO']->prepare("SELECT * FROM Friends");
|
||||
$statementFriends->execute(array($userID));
|
||||
|
||||
while($rowFriends = $statementFriends->fetch())
|
||||
{
|
||||
$UserData = explode(";", $rowFriends['PrincipalID']);
|
||||
|
||||
if(count($UserData) == 4)
|
||||
{
|
||||
$DBUserID = $UserData[0];
|
||||
$DBUserName = $UserData[2];
|
||||
|
||||
$RUNTIME['CACHE']['USERNAME'][$userID] = $DBUserName;
|
||||
|
||||
if($DBUserID == $userID)
|
||||
return $DBUserName;
|
||||
}
|
||||
}
|
||||
|
||||
return "Unknown User";
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
$HTML->setHTMLTitle("Online Anzeige");
|
||||
$HTML->importSeitenInhalt("pages/HTML/online-anzeige.html");
|
||||
|
||||
$table = '<table class="table"><thead><tr><th scope="col">Name</th><th scope="col">Optionen</th></thead><tbody>%%ENTRY%%</tbody></table>';
|
||||
|
||||
$statement = $RUNTIME['PDO']->prepare("SELECT * FROM Friends WHERE PrincipalID = ? ORDER BY Friend ASC");
|
||||
$statement->execute([$_SESSION['UUID']]);
|
||||
|
||||
while($row = $statement->fetch())
|
||||
{
|
||||
$PrincipalID = explode(";", $row['PrincipalID'])[0];
|
||||
$FriendData = explode(";", $row['Friend']);
|
||||
$Friend = $FriendData[0];
|
||||
|
||||
$entry = '<tr><td>'.trim($RUNTIME['OPENSIM']->getUserName($Friend)).'</td><td>LÖSCHEN</td></tr>';
|
||||
|
||||
if(count($FriendData) > 1)
|
||||
{
|
||||
$FriendData[1] = str_replace("http://", "", $FriendData[1]);
|
||||
$FriendData[1] = str_replace("https://", "", $FriendData[1]);
|
||||
$FriendData[1] = str_replace("/", "", $FriendData[1]);
|
||||
$entry = '<tr><td>'.trim($RUNTIME['OPENSIM']->getUserName($Friend)).' @ '.strtolower($FriendData[1]).'</td><td>LÖSCHEN</td></tr>';
|
||||
|
||||
}
|
||||
|
||||
$table = str_replace("%%ENTRY%%", $entry."%%ENTRY%%", $table);
|
||||
}
|
||||
|
||||
$table = str_replace("%%ENTRY%%", "", $table);
|
||||
$HTML->ReplaceSeitenInhalt("%%ONLINE-LIST%%", $table);
|
||||
|
||||
$HTML->build();
|
||||
echo $HTML->ausgabe();
|
||||
?>
|
|
@ -71,6 +71,12 @@
|
|||
<i class="fas fa-users"></i>
|
||||
<span>Deine Gruppen</span></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="index.php?page=friends">
|
||||
<i class="fas fa-street-view"></i>
|
||||
<span>Deine Freunde</span></a>
|
||||
</li>
|
||||
|
||||
<div class="nav-link" style="padding: 1.75rem 1rem 0.75rem; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; color: rgba(255, 255, 255, 0.25)">
|
||||
Administration
|
||||
|
|
|
@ -70,7 +70,12 @@
|
|||
<i class="fas fa-users"></i>
|
||||
<span>Deine Gruppen</span></a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="index.php?page=friends">
|
||||
<i class="fas fa-users"></i>
|
||||
<span>Deine Freunde</span></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div id="content-wrapper">
|
||||
|
|
Loading…
Reference in New Issue