Exemplo n.º 1
0
function formatConversation($status_id)
{
    global $t;
    global $user_id;
    global $reply_to_id;
    $status = $t->showStatus($status_id);
    if (!isset($status->user)) {
        return "";
    }
    $user = $status->user;
    if ($reply_to_id == "") {
        $reply_to_id = $user->id;
    }
    $date = format_time($status->created_at);
    $text = formatEntities($status->entities, isset($status->extended_entities) ? $status->extended_entities : null, $status->text);
    $end = !isset($status->in_reply_to_user_id) || $user_id != $status->in_reply_to_user_id && $reply_to_id != $status->in_reply_to_user_id;
    $html = '<li class="round">
			<span class="status_author">
			<a href="user.php?id=' . $user->screen_name . '" target="_blank"><img src="' . getAvatar($user->profile_image_url) . '" style="height: 30px; width: 30px;"></a>
			</span>
			<span class="status_body">
			<span class="status_id">' . $status_id . '</span>
			<span class="status_word" style="font-size: 12px;"><a class="user_name" href="user.php?id=' . $user->screen_name . '" id="' . $user->screen_name . '">' . ($_COOKIE['shownick'] == 'true' ? $user->name : $user->screen_name) . '</a> <span class="tweet">' . $text['text'] . '</span></span>' . '<span class="extended_entities">' . $text['extended'] . '</span>' . '<span class="status_info" style="font-size: 11px; margin: 0px;">';
    if ($end && isset($status->in_reply_to_user_id)) {
        $html .= '<span class="in_reply_to"> <a class="ajax_reply" href="ajax/status.php?id=' . $status->in_reply_to_status_id_str . '&uid=' . $user->id . '">in reply to ' . $status->in_reply_to_screen_name . '</a></span>';
    }
    $html .= '<span class="source">via ' . $status->source . '</span>
			<span class="date"><a href="status.php?id=' . $status->id_str . '" id="' . $date . '" target="_blank">' . date('Y-m-d H:i:s', $date) . '</a></span>
			</span>
			</span>
			</li>';
    if (!$end) {
        $html .= formatConversation($status->in_reply_to_status_id_str);
    }
    return $html;
}
Exemplo n.º 2
0
function format_message($message, $isSentPage = false)
{
    if ($isSentPage) {
        $name = $message->recipient_screen_name;
        $nick = $message->recipient->name;
        $imgurl = getAvatar($message->recipient->profile_image_url);
        $messenger = $message->recipient;
    } else {
        $name = $message->sender_screen_name;
        $nick = $message->sender->name;
        $imgurl = getAvatar($message->sender->profile_image_url);
        $messenger = $message->sender;
    }
    $date = format_time($message->created_at);
    $text = formatEntities($message->entities, isset($message->extended_entities) ? $message->extended_entities : null, $message->text);
    $output = "\n\t\t\t<li>\n\t\t\t\t<span class=\"status_author\">\n\t\t\t\t\t<a href=\"user.php?id={$name}\" target=\"_blank\"><img id=\"avatar\" src=\"{$imgurl}\" title=\"Hello, I am {$name}. Click for more...\" /></a>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"status_body\">\n\t\t\t\t\t<span class=\"status_id\">{$message->id} </span>\n\t\t\t\t\t<span class=\"status_word\"><a class=\"user_name\" href=\"user.php?id={$name}\" id=\"{$name}\">" . ($_COOKIE["shownick"] == 'true' ? $nick : $name) . "</a> " . $text['text'] . " </span>" . '<span class="extended_entities">' . $text['extended'] . '</span>' . "<span class=\"actions\">\n\t\t";
    if ($isSentPage) {
        $output .= "<a class=\"msg_delete_btn fa fa-trash-o\" href=\"#\" title=\"Delete\"></a>";
    } else {
        $output .= "<a class=\"msg_replie_btn fa fa-reply\" href=\"#\" title=\"Reply\"></a><a class=\"msg_delete_btn fa fa-trash-o\" href=\"#\" title=\"Delete\"></a>";
    }
    $output .= "</span><span class=\"status_info\"><span class=\"date\" id=\"{$date}\">" . date('Y-m-d H:i:s', $date) . "</span></span></span></li>";
    return $output;
}
Exemplo n.º 3
0
}
include 'lib/twitese.php';
if (!loginStatus()) {
    header('location: login.php');
}
$t = getTwitter();
if (isset($_GET['id'])) {
    $statusid = $_GET['id'];
    $status = $t->showStatus($statusid);
    if (!$status) {
        header('location: error.php?code=' . $t->http_code);
        exit;
    }
    $user = $status->user;
    $date = format_time($status->created_at);
    $text = formatEntities($status->entities, isset($status->extended_entities) ? $status->extended_entities : null, $status->text);
} else {
    header('location: error.php?code=' . $t->http_code);
    exit;
}
?>

<?php 
ob_start();
?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="embr, open source, php, twitter, oauth" />
<meta name="description" content="Vivid Interface for Twitter" />