Fitur Edit Profile untuk Dabr (Twitter Client)


Buka file common/twitter.php

kemudian tambahkan kode di menu_register

‘profile’ => array(
‘security’ => true,
‘callback’ => ‘twitter_profile_page’,
),

masih di dalam file yang sama, tambahkan script di bawah ini pada bagian mana aja

function twitter_profile_page() {

// process form data
if ($_POST[‘name’]){
// post profile update
$post_data = array("name" => $_POST[‘name’],
"url" => $_POST[‘url’],
"location" => $_POST[‘location’],
"description" => $_POST[‘description’],
);
$url = "http://twitter.com/account/update_profile.json";
$user = twitter_process($url, $post_data);
} else {
// retrieve profile information
$user = twitter_user_info(user_current_username());
}

$content = theme(‘user_header’, $user);
$content .= theme(‘profile_form’, $user);

theme(‘page’, "Profile Edit", $content);
}

function theme_profile_form($user){
// Profile form
$out .= "<form name=’profile’ action=’profile’ method=’post’>
<hr />Name: <input name=’name’ maxlength=’20’ value='{$user->name}’ />
<br />Bio: <input name=’description’ size=40 maxlength=’160′ value='{$user->description}’ />
<br />Link: <input name=’url’ maxlength=’100′ size=40 value='{$user->url}’ />
<br />Location: <input name=’location’ maxlength=’30’ value='{$user->location}’ />";

// Javascript link to use Geo Coordinates
if(!empty($_COOKIE[‘lat’]) && !empty($_COOKIE[‘long’])){
$out .= " <a href=’javascript:document.forms[\"profile\"].location.value=\"dabr: {$_COOKIE[‘lat’]},{$_COOKIE[‘long’]}\";void(0);’>Use Geo</a>";
}

$out .= "<br /><input type=’submit’ value=’Update’ /></form>";

return $out;
}

Jangan lupa kunjungi & gunakan Twitter Client dari kami di alamat www.imorv.comūüôā

@fays_ozunu

4 Tanggapan

  1. ini dabr ane gan,,
    http://www.astwiter.tk

  2. ga bisa, malah eror parah. gmna ni?????/

  3. string ny ada yg error klo lgsg copas, mohon dbnrin

  4. Udah q coba, tp kog gak jalan ya…

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: