本文整理匯總了PHP中Twitter::HTMLifyTweet方法的典型用法代碼示例。如果您正苦於以下問題:PHP Twitter::HTMLifyTweet方法的具體用法?PHP Twitter::HTMLifyTweet怎麽用?PHP Twitter::HTMLifyTweet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Twitter
的用法示例。
在下文中一共展示了Twitter::HTMLifyTweet方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: OAuthRequester
<?php
return;
}
// Obtain a request object for the request we want to make
$req = new OAuthRequester($server['server_uri'] . '/direct_messages.json', 'GET', array());
// Sign the request, perform a curl request and return the results, throws OAuthException exception on an error
try {
$result = $req->doRequest($user_id);
} catch (OAuthException $e) {
header('Location: /follows/manage/register');
exit;
}
$page = 'follows';
$title = 'Follows';
require dirname(__FILE__) . '/../../header.tpl.php';
echo '<h1>Direct Messages</h1>';
echo '<p>Since this is currently just an OAuth test this just shows the results of a call to get your direct messages. This is an authenticated request so it serves to prove the point but has nothing to do with this application.</p>';
$result = json_decode($result['body']);
if (!$result) {
die('Invalid response');
}
foreach ($result as $msg) {
echo '<div style="clear:both; margin-bottom: 0.5em;">';
echo '<img style="float:left;margin-right:0.5em;margin-bottom:0.25em;" src="' . htmlentities($msg->sender->profile_image_url) . '" />';
echo Twitter::HTMLifyTweet($msg->text) . '<br />';
echo '<small>';
echo ucfirst(Twitter::FormatStamp(strtotime($msg->created_at)));
echo '</small>';
echo '<div style="clear:both;"></div></div>';
}
require dirname(__FILE__) . '/../../footer.tpl.php';
示例2: rawurlencode
$url = 'http://twitter.com/' . rawurlencode($from_user) . '/statuses/' . rawurlencode($id);
?>
<div style="margin-bottom: 1em;">
<div>
<a href="<?php
echo $url;
?>
"><img src="<?php
echo $profile_image_url;
?>
" width="48" height="48" align="left" border="0" style="margin-right: 0.25em;" /></a>
<strong><a href="http://twitter.com/<?php
echo rawurlencode($from_user);
?>
" style="text-decoration:none;"><?php
echo htmlentities($from_user);
?>
</a></strong> <?php
echo Twitter::HTMLifyTweet($text);
?>
<br />
<div style="font-size: small; font-style: italic;"><a href="<?php
echo $url;
?>
" style="text-decoration:none;"><?php
echo htmlentities(ucfirst(InDays(strtotime($created_at))));
?>
</a></div>
</div><div style="clear:both;"></div>
</div>