Exemplo n.º 1
0
function CheckFriendShipByNameAndKickOut($username, $loggedUserID)
{
    $SQL = "SELECT user.UID FROM user WHERE user.Name = '" . $username . "'";
    $Result = mysql_query($SQL);
    $userid = mysql_fetch_array($Result);
    if ($userid[0] != $loggedUserID) {
        if (CheckIfFriends($userid[0], $loggedUserID) == 0) {
            header('Location: you_are_not_friends.php?secured_user=' . $username) and exit;
        }
    }
}
Exemplo n.º 2
0
echo '<div class="page-header">';
echo '<h1>Търсене за <spam style = "color: #006600">"' . $searched_string . '"</spam><small id = "smalltag"> (резултати: ' . $row3[0] . ')</small></h1>';
echo '</div>';
if ($row3[0] <= 0) {
    echo 'Няма съвпадения';
} else {
    $SQL = "SELECT DISTINCT user.Name FROM user WHERE ((user.Name LIKE '%" . $searched_string . "%') || (user.FirstName LIKE '%" . $searched_string . "%') || (user.LastName LIKE '%" . $searched_string . "%') || (user.Text LIKE '%" . $searched_string . "%')) ORDER BY user.Name ASC";
    //echo $SQL;
    $result = mysql_query($SQL);
    while ($row = mysql_fetch_array($result)) {
        echo '<div style = "margin-top:30px;">';
        $MyCurrentUserInfo = ReturnALLUserInfoByIdOrByName($row[0]);
        $MyUserIDResult = mysql_query("SELECT user.UID FROM user WHERE user.Name = '" . $row[0] . "'");
        $currentuserid = mysql_fetch_array($MyUserIDResult);
        if ($currentuserid[0] != Get_Logged_users_id()) {
            if (CheckIfFriends($currentuserid[0], Get_Logged_users_id()) == 0) {
                if (CheckIfRequestSent(Get_Logged_users_id(), $currentuserid[0]) == 0) {
                    echo '<a href = "send_friend_request_to.php?user='******'"><button class="btn btn-default" style = "min-width:100%;color:#837d7c;background:#d2c9c6;font-weight:bold;border-radius:7px;font-size:16px;font-family: Arial;font-weight:bold;margin-top:0px;" type="button"><span class = "glyphicon glyphicon-user"></span><span class = "glyphicon glyphicon-user"></span> Изпрати покана на ' . $MyCurrentUserInfo["FirstName"] . " " . $MyCurrentUserInfo["LastName"] . '</button></a>';
                } else {
                    echo '<a href = "#"><button class="btn btn-default" style = "min-width:100%;color:#837d7c;background:#d2c9c6;font-weight:bold;border-radius:7px;font-size:16px;font-family: Arial;font-weight:bold;margin-top:0px;" type="button"><span class = "glyphicon glyphicon-user"></span><span class = "glyphicon glyphicon-user"></span> Поканата е изпратена</button></a>';
                }
            } else {
                echo '<a href = "#"><button class="btn btn-default" style = "min-width:100%;color:#837d7c;background:#d2c9c6;font-weight:bold;border-radius:7px;font-size:16px;font-family: Arial;font-weight:bold;margin-top:0px;" type="button"><span class = "glyphicon glyphicon-user"></span><span class = "glyphicon glyphicon-user"></span> Приятели</button></a>';
            }
        }
        PrintAccountInfoByUSERNAME($row[0], 1);
        //echo '<div class="panel-footer">'.$row[2].'</div>';
        //echo $row[0];
        //echo $row[1];
        //echo $row[2];
        //echo $row[3];