Exemplo n.º 1
0
function getSearch($query, $sinceid, $maxid)
{
    $t = getTwitter();
    $answer = $t->search($query, $sinceid, $maxid);
    $resultCount = count($answer->statuses);
    if ($resultCount <= 0) {
        echo "<div id=\"empty\">No tweet to display.</div>";
    } else {
        include_once 'lib/timeline_format.php';
        $output = '<ol class="timeline" id="allTimeline">';
        foreach ($answer->statuses as $status) {
            if (isset($status->retweeted_status)) {
                $output .= format_retweet($status);
            } else {
                $output .= format_timeline($status, $t->username);
            }
        }
        $output .= "</ol><div id=\"pagination\">";
        $next_results = isset($answer->search_metadata->next_results) ? $answer->search_metadata->next_results : false;
        if ($next_results) {
            $output .= "<a id=\"more\" class=\"btn btn-white\" style=\"float: right;\" href=\"search.php" . $next_results . "\">Next</a>";
        }
        $output .= "</div>";
        echo $output;
    }
}
Exemplo n.º 2
0
function actRelation()
{
    if (isset($_GET['id'])) {
        $t = getTwitter();
        if (getEncryptCookie('twitterID') == $_GET['id']) {
            echo '<br /><span style="color:#CC0033"><b>同志,你不认得你自己了?</b></span>';
        } else {
            $reD = $reU = false;
            if ($t->isFriend(getEncryptCookie('twitterID'), $_GET['id'])) {
                $reD = true;
            }
            //已关注
            if ($t->isFriend($_GET['id'], getEncryptCookie('twitterID'))) {
                $reU = true;
            }
            //被关注
            if ($reD && $reU) {
                echo '<br /><span class="relSame"><b>和你同一级别</b>
								 [<a href="javascript:void(0)" class="unfoll_btn">使其成为下级</a>]</span>';
            }
            if ($reD && !$reU) {
                echo '<br /><span class="relUp"><b>是你的上级</b>
								 [<a href="javascript:void(0)" class="unfoll_btn">与其脱离关系</a>]</span>';
            }
            if (!$reD && $reU) {
                echo '<br /><span class="relDown"><b>是你的下级</b>
								 [<a href="javascript:void(0)" class="follow_btn">使其成为同级</a>]</span>';
            }
            if (!$reD && !$reU) {
                echo '<br /><span class="relNone"><b>与你无关</b>
								 [<a href="javascript:void(0)" class="follow_btn">使其成为上级</a>]</span>';
            }
        }
    }
}
Exemplo n.º 3
0
function format_timeline($status, $screen_name, $updateStatus = false)
{
    $user = $status->user;
    $date = format_time($status->created_at);
    $text = formatEntities($status->entities, isset($status->extended_entities) ? $status->extended_entities : null, $status->text);
    if (preg_match('/^\\@' . getTwitter()->username . '/i', $text['text']) == 1) {
        $output = "<li class=\"reply\">";
    } elseif ($updateStatus == true) {
        $output = "<li class=\"mine\">";
    } else {
        $output = "<li>";
    }
    $output .= '<span class="status_author">
		<a href="user.php?id=' . $user->screen_name . '" target="_blank"><img id="avatar" src="' . getAvatar($user->profile_image_url) . '" title="Hello, I am  ' . $user->screen_name . '. Click for more..." /></a>
		</span>
		<span class="status_body">
		<span class="status_id">' . $status->id_str . '</span>
		<span class="status_word"><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">&nbsp;' . $text['text'] . '</span></span>';
    $output .= '<span class="extended_entities">' . $text['extended'] . '</span>';
    $output .= "<span class=\"actions\">\n\t\t\t<a class=\"replie_btn fa fa-reply\" title=\"Reply\" href=\"#\"></a>\n\t\t\t<a class=\"rt_btn fa fa-share\" title=\"Quote\" href=\"#\"></a>\n\t\t\t";
    if ($user->screen_name != $screen_name) {
        $output .= "<a class=\"retw_btn fa fa-retweet\" title=\"New Retweet\" href=\"#\"></a>";
    }
    $output .= $status->favorited == true ? "<a class=\"unfav_btn fa fa-star-o\" title=\"UnFav\" href=\"#\"></a>" : "<a class=\"favor_btn fa fa-star-o\" title=\"Fav\" href=\"#\"></a>";
    if ($user->screen_name == $screen_name) {
        $output .= "<a class=\"delete_btn fa fa-trash-o\" title=\"Delete\" href=\"#\"></a>";
    }
    $output .= "</span><span class=\"status_info\">";
    if ($status->in_reply_to_status_id) {
        $output .= "<span class=\"in_reply_to\"> <a class=\"ajax_reply\" href=\"ajax/status.php?id={$status->in_reply_to_status_id_str}&uid={$user->id} \">to {$status->in_reply_to_screen_name}</a> </span>";
    }
    $output .= "<span class=\"source\">via {$status->source}</span>\n\t\t\t<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>\n\t\t\t</span>\n\t\t\t</span>";
    $output .= $status->favorited == true ? '<i class="faved fa fa-star"></i>' : '';
    $output .= "</li>";
    return $output;
}
Exemplo n.º 4
0
getName();
?>
" height="100" width="100">
						</div>
						<div id=showInfo> 
							<b><?php 
getName();
?>
</b>
							<ul> 
								<li><a href="<?php 
getFacebook();
?>
" target="_blank"><img src="images/facebook-logo-3.png" alt="Facebook link" height="35" width="35"></a> </li>
								<li><a href="<?php 
getTwitter();
?>
" target="_blank"><img src="images/Twitter-logo-2012.png" alt="Twitter link" height="25" width="30"></a> </li>
								<li><a href="<?php 
getMixcloud();
?>
" target="_blank" ><img src="images/mixcloud.png" alt="Mixcloud link" height="33" width="33"></a> </li>
							</ul>
							""<?php 
getTagline();
?>
""
						</div>
					</div>		
					
					<div id ="chatBox">
Exemplo n.º 5
0
<?php

// ver 0.2 by @Chris_Ys
if (!isset($_SESSION)) {
    session_start();
}
include_once "../lib/twitese.php";
if (isset($_GET['id']) && isset($_GET['uid'])) {
    $t = getTwitter();
    $user_id = $_GET['uid'];
    $reply_to_id = "";
    $html = '<div class="ajax_form round">';
    $html .= "<a class=\"close fa fa-times\" title=\"Close\" onclick=\"\$(this).parent().slideToggle(300);return false;\" href=\"#\"></a>";
    $html .= '<ol>';
    $html .= formatConversation($_GET['id']);
    $html .= '</ol></div>';
    echo $html;
} else {
    echo 'error';
}
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 == "") {
Exemplo n.º 6
0
function outpListFollower()
{
    $t = getTwitter();
    if (isset($_GET['max_id'])) {
        $twitterdata = $t->listFollowers(getCookie("nUser"), getCookie("nList"), getCookie("nCursor"));
        if ($twitterdata === false) {
            echo 'error';
        } else {
            if (count($twitterdata) == 0) {
                echo 'none';
            } else {
                echo builtPerson($twitterdata);
            }
        }
    } else {
        $uid = $_GET['id'];
        $lid = $_GET['listid'];
        $twitterdata = $t->listFollowers($uid, $lid);
        if ($twitterdata === false) {
            echo builtPlus('error');
        } else {
            echo '<div id="content">';
            echo '<h2>关注' . $uid . '的名单' . $lid . '的是这些人:</h2><br />';
            if (count($twitterdata) == 0) {
                echo 'none';
            } else {
                setCookie("nUser", $uid);
                setCookie("nList", $lid);
                echo builtPlus('headol') . builtPerson($twitterdata) . builtPlus('more');
            }
        }
    }
}
Exemplo n.º 7
0
function actEditProfile()
{
    $t = getTwitter();
    $result = $t->updateProfile($_POST['name'], $_POST['url'], $_POST['location'], $_POST['description']);
    if ($result) {
        echo 'ok';
    } else {
        echo 'error';
    }
}
Exemplo n.º 8
0
    case 'profile':
        ?>
			<span class="subnavLink"><a href="setting.php">Customize</a></span><span class="subnavNormal">Profile</span>
<?php 
        break;
    default:
        ?>
			<span class="subnavNormal">Customize</span><span class="subnavLink"><a href="setting.php?t=profile">Profile</a></span>
<?php 
}
?>
</div>
<?php 
switch ($settingType) {
    case 'profile':
        $user = getTwitter()->veverify(true);
        ?>
			<form id="setting_form" action="ajax/uploadImage.php?do=profile" method="post" enctype="multipart/form-data">
				<fieldset class="settings">
				<legend>Avatar</legend>
				<ol>
				<li style="display:inline-block"><img src="<?php 
        echo isset($_COOKIE['imgurl']) ? $_COOKIE['imgurl'] : getAvatar($user->profile_image_url);
        ?>
" id="avatarimg"></img></li>
				<ol style="margin-left:29px">
					<li><input type="file" name="image" id="profile_image"/></li>
					<li><input type="submit" id="AvatarUpload" class="btn" value="Upload"/><small style="margin-left:10px;vertical-align: middle;">BMP,JPG or PNG accepted, less than 800K.</small></li>
				</ol></ol>
				</fieldset>
			</form>
Exemplo n.º 9
0
			<h2><?php 
    echo strtoupper(get_sub_field('section_name'));
    ?>
</h2>
		<?php 
}
?>
		<div class="social-feed">
			<div class="feed-container">
			<?php 
$network = get_sub_field('social_network');
if ($network == 'facebook') {
    $social_post = getFacebook(ot_get_option('facebook'));
    $suffix = "fb";
} elseif ($network == 'twitter') {
    $social_post = getTwitter(ot_get_option('twitter'));
    $suffix = "twitter";
}
for ($i = 0; $i < 3; $i++) {
    ?>
				<?php 
    echo '<a href="' . $social_post[$i]['url'] . '">';
    ?>
				<div class="social-block">
					<div class="social-date">
						<p><span class='glyphicon glyphicon-<?php 
    echo $suffix;
    ?>
'></span><time><?php 
    echo date("M j", $social_post[$i]['time']);
    ?>
Exemplo n.º 10
0
    return basicBox('/newsletter', '#paper', 'Sign Up for our Newsletter');
}
function getTwitter()
{
    return basicBox('https://twitter.com/texansforrubio/', '#twitter', '@TexansForRubio', true);
}
function getMedia()
{
    return basicBox('/media', '#image', 'Media from TexansForRubio');
}
function getIssuesBox()
{
    return basicBox('/issues', '#image', 'More Issues');
}
function getVolunteerBox()
{
    return basicBox('https://docs.google.com/forms/d/1CVsxBpnqCFyoZpGImNmIqYSgDb6ItCT3upl274whsCA/viewform?c=0&w=1', '#hammer', 'Volunteer', true);
}
foreach ($data as $box) {
    if ($box === 'newsletter') {
        echo getNewsletter();
    } elseif ($box === 'twitter') {
        echo getTwitter();
    } elseif ($box === 'media') {
        echo getMedia();
    } elseif ($box === 'issues') {
        echo getIssuesBox();
    } elseif ($box === 'volunteer') {
        echo getVolunteerBox();
    }
}
Exemplo n.º 11
0
// Facebook example
echo "<h2>Facebook</h2>";
try {
    $fb = getFacebook('ncstate', 1);
} catch (Exception $e) {
    echo $e->getMessage();
}
foreach ($fb as $post) {
    echo "<strong>" . date('M d, y', $post['time']) . "</strong><br/>";
    echo $post['message'] . "<br/>";
    echo "<a href=" . $post['url'] . ">" . $post['url'] . "</a><br/><br/>";
}
// Twitter Example
echo "<br/><br/><br/><br/><h2>Twitter</h2>";
try {
    $twitter = getTwitter("ncstate", 2);
} catch (Exception $e) {
    echo $e->getMessage();
}
foreach ($twitter as $tweet) {
    $output = "<p><strong>" . date('M d, y', $tweet['time']) . "</strong><br/>" . $tweet['description'];
    if ($tweet['media'][0]->media_url) {
        $output .= "<br/><img src='" . $tweet['media'][0]->media_url . "' />";
    }
    $output .= "</p>";
    echo $output;
}
// Instagram Example
echo "<br/><br/><h2>Instagram</h2>";
try {
    $instagram = getInstagram("ncstate", 10, 'thinkanddo');
Exemplo n.º 12
0
        ?>
			<span class="subnavLink"><a href="setting.php?t=1">twitese设置</a></span><span class="subnavLink"><a href="setting.php?t=2">外观设置</a></span><span class="subnavNormal">个人设置</span>
		<?php 
    }
}
?>
	    </div>
    
	    <?php 
if ($type == 3) {
    ?>
	    <?php 
    if (!isLogin()) {
        header('location: login.php');
    }
    $t = isset($t) ? $t : getTwitter();
    $user = $t->showUser();
    ?>
	    <form id="setting_form" action="setting.php?t=3" method="post">
	        <table id="setting_table">
	        	<tr>
	        		<td class="setting_title">昵称:</td>
	        		<td><input class="setting_input" type="text" name="name" value="<?php 
    echo isset($user->name) ? $user->name : '';
    ?>
" /></td>
	        	</tr>
	        	<tr>
	        		<td class="setting_title">网站:</td>
	        		<td><input class="setting_input" type="text" name="url" value="<?php 
    echo isset($user->url) ? $user->url : '';
Exemplo n.º 13
0
function getRelationship($target, $source = false)
{
    $relationship = getTwitter()->relationship($target, $source)->relationship;
    $target = $relationship->target;
    $source = $relationship->source;
    $result = 0;
    if ($source->muting == true) {
        $result |= 8;
    }
    if ($source->blocking == true) {
        $result |= 4;
    }
    if ($target->following == true) {
        $result |= 2;
    }
    if ($source->following == true) {
        $result |= 1;
    }
    return $result;
}
Exemplo n.º 14
0
require_once root() . 'controleurs/objetsphp/twitter/controleur_twitterfeed.php';
$script = array("http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js", "javascript/scroll_to_back_to_top.js", "javascript/operations_posts.js");
head('Aaron - Profile', 'Page de profile', 'profile, compte, utilisateur', '', $script);
$fluxArray = array();
$rssurls = getRss($_SESSION['login']);
foreach ($rssurls as $url) {
    try {
        $feed = new RssFeed($url);
        $fluxArray[] = $feed;
    } catch (Exception $e) {
        echo $e->getMessage() . '<span class="button" id="deletebutton' . $url . '"></span><br/>' . "\n";
        continue;
    }
}
$fluxTwitArray = array();
$twitAccount = getTwitter($_SESSION['login']);
foreach ($twitAccount as $account) {
    try {
        $feed2 = new TwitterFeed($account);
        $fluxTwitArray[] = $feed2;
    } catch (Exception $e) {
        echo $e->getMessage() . '<span class="button" id="deletebutton' . $account . '"></span><br/>' . "\n";
    }
}
announcement($fluxArray);
$liens[] = '../index.php';
$noms[] = 'accueil';
$images[] = 'static/images/favicon.svg';
$liens[] = '../controleurs/controleur_deconnexion.php';
$noms[] = 'Deconnexion';
$images[] = 'static/images/disconnect.png';