Selasa, 11 September 2012

0 Fitur Retweet Style untuk Dabr (Twitter Client)

Pertama masuk ke file /common/twitter.com
cari code
function theme_retweet($status)
{
$text = “RT @{$status->user->screen_name}: {$status->text}”;

ganti code diatas dengan
function theme_retweet($status)
{
if (setting_fetch(‘RT’, ‘on’) == ‘on’) {
$text = “RT @{$status->user->screen_name}: {$status->text}”;
}
if (setting_fetch(‘RT’, ‘off’) == ‘off’) {
$text = ” [Quote]@{$status->user->screen_name}: {$status->text}[/Quote]“;
}
masih di dalam file yang sama, cari code
if ($retweeted_by) // Show a diffrent retweet icon to indicate to the user this is an RT
{
$actions[] = theme(‘action_icon’, “retweet/{$status->id}”, ‘images/retweeted.png’, ‘RT’);
}
else
{
$actions[] = theme(‘action_icon’, “retweet/{$status->id}”, ‘images/retweet.png’, ‘RT’);
}
modif code di atas menjadi
if (setting_fetch(‘RT’, ‘on’) == ‘on’) {
if ($retweeted_by) // Show a diffrent retweet icon to indicate to the user this is an RT
{
$actions[] = theme(‘action_icon’, “retweet/{$status->id}”, ‘images/retweeted.png’, ‘RT’);
}
else
{
$actions[] = theme(‘action_icon’, “retweet/{$status->id}”, ‘images/retweet.png’, ‘RT’);
}
} else
if (setting_fetch(‘RT’, ‘off’) == ‘off’) {
if ($retweeted_by) // Show a diffrent retweet icon to indicate to the user this is an RT
{
$actions[] = theme(‘action_icon’, “retweet/{$status->id}”, ‘images/retweeted.png’, ‘Quote’);
}
else
{
$actions[] = theme(‘action_icon’, “retweet/{$status->id}”, ‘images/retweet.png’, ‘Quote’);
}
}
selanjutnya, masuk file /common/settings.php dan cari fungsi
function settings_page($args) {
dan tambahkan code di baha ini
$settings['RT'] = $_POST['RT'];
mash di dalam file yang sama, tambahkan fungsi
$RT = array(
‘on’ => ‘RT’,
‘off’ => ‘Quote’,
);
setelah fungsi :
$gwt = array(
‘off’ => ‘direct’,
‘on’ => ‘via GWT’,
);
terakhir, pasang code
$content .= ‘<p>Retweet Style:<br /><select name="RT">’;
$content .= theme(‘options’, $RT, setting_fetch(‘RT’));
$content .= ‘</select><small><br />Choose retweet style you like</small></p>’;
setelah code
$content .= ‘<p>External links go:<br /><select name="gwt">’;
$content .= theme(‘options’, $gwt, setting_fetch(‘gwt’, $GLOBALS['current_theme'] == ‘text’ ? ‘on’ : ‘off’));
$content .= ‘</select><small><br />Google Web Transcoder (GWT) converts third-party sites into small, speedy pages suitable for older phones and people with less bandwidth.</small></p>’;

0 Comments

Bagaimana Pendapat Anda ?