Example #1
0
            $result = $t->muteUser($_POST['id']);
            break;
        case 'unmute':
            $result = $t->unmuteUser($_POST['id']);
            break;
        case 'block':
            $result = $t->blockUser($_POST['id']);
            break;
        case 'unblock':
            $result = $t->unblockUser($_POST['id']);
            break;
        case 'report':
            $result = $t->reportSpam($_POST['id']);
            break;
        case 'show':
            $result = getRelationship($_POST['id']);
            if ($result) {
                echo $result;
                return;
            }
            break;
    }
    if ($result) {
        refreshProfile($t);
        echo 'success';
    } else {
        echo 'error';
    }
}
?>
Example #2
0
<?php

$title = "Index";
require_once $_SERVER['DOCUMENT_ROOT'] . '/../includes/init.php';
require_once 'templates/header.php';
require_once 'lib/businessLogic.php';
is_logged_in();
$relationship = null;
//other user's index page
if (isset($_GET['u_id'])) {
    $user = selectUser($_GET['u_id']);
    $mineProfile = false;
    $relationship = getRelationshipStatus($_SESSION['loggedInUser']['u_id'], $_GET['u_id']);
    $rr = getRelationship($_SESSION['loggedInUser']['u_id'], $_GET['u_id']);
} else {
    //index of a currently logged in user
    $user = selectUser($_SESSION['loggedInUser']['u_id']);
    $mineProfile = true;
}
?>
    <main>
        <div class="container border">
            <div id="profile">
                <!--public data-->
                <div class="public">
                    <img src="/userpic.php?u_id=<?php 
echo $user['u_id'];
?>
&type=public" width="170" height="235" alt="public-picture">

                    <div>
Example #3
0
if ($statuses === false) {
    header('location: error.php?code=' . $t->http_code);
    exit;
}
if ($t->http_code == 429) {
    $apiout = true;
} else {
    $aptout = false;
}
$user = $t->showUser($userid);
if (strcasecmp($userid, $t->username) == 0) {
    header('location: profile.php');
    exit;
}
$isProtected = $statuses->error == 'Not authorized.';
$r = getRelationship($user->screen_name);
$isFriend = ($r & 1) != 0;
$isFollower = ($r & 2) != 0;
$isBlocked = ($r & 4) != 0;
$isMuted = ($r & 8) != 0;
if (!$isProtected) {
    $userinfo = array();
    $userinfo['name'] = $user->name;
    $userinfo['screen_name'] = $user->screen_name;
    $userinfo['friends_count'] = $user->friends_count;
    $userinfo['statuses_count'] = $user->statuses_count;
    $userinfo['followers_count'] = $user->followers_count;
    $userinfo['url'] = $user->entities->url->urls[0]->expanded_url ? $user->entities->url->urls[0]->expanded_url : $user->url;
    $userinfo['description'] = formatText($user->description);
    $userinfo['location'] = $user->location;
    $userinfo['date_joined'] = date('Y-m-d', format_time($user->created_at));