Membuat Fitur Retweet Style di Dabr - Faiz Mubarak

Latest

Iseng - iseng ngeBlog [Tempat berbagi tempat bercerita]

Wednesday, 7 September 2011

Membuat Fitur Retweet Style di Dabr

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>';



Jangan lupa kunjungi & gunakan Twitter Client dari kami di alamat www.imorv.com :)

@fays_lee

1 comment:

  1. sekedar info gan

    kode ini

    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]";
    }

    ngga work. dan diganti aja dengan kode

    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 =""@{$status->user->screen_name}: {$status->text}"";
    }

    liat punya ane ya http://ngancengs.p.ht/

    ReplyDelete