Selasa, 11 September 2012

0 Memasang Fitur Upload Avatar pada Dabr


kemudian masuk ke file common/twitter.php
tambahkan code di bawah ini di menu register
‘avatar’ => array(
‘hidden’ => true,
‘security’ => true,
‘callback’ => ‘twitter_avatar_page’,
),

masih di dalam file yang sama tambahkan fungsi di bawah ini
function twitter_avatar_page($query) {
if ( ! empty($_FILES)) {
require ‘tmhOAuth.php’;
list($oauth_token, $oauth_token_secret) = explode(‘|’, $GLOBALS['user']['password']);
$tmhOAuth = new tmhOAuth(array(
‘consumer_key’ => OAUTH_CONSUMER_KEY,
‘consumer_secret’ => OAUTH_CONSUMER_SECRET,
‘user_token’ => $oauth_token,
‘user_secret’ => $oauth_token_secret,
));
// note the type and filename are set here as well
$params = array(
‘image’ => "@{$_FILES['image']['tmp_name']};type={$_FILES['image']['type']};filename={$_FILES['image']['name']}",
);
// if we are setting the background we want it to be displayed
$code = $tmhOAuth->request(‘POST’, $tmhOAuth->url("1/account/update_profile_image"),
$params,
true, // use auth
true // multipart
);
if ($code == 200) {
$json = json_decode($tmhOAuth->response['response']);
$text = $json->text;
$content = "<span class=’status shift’><font color=’green’>You’ve success to upload a photo profile.</font></span>";
} else {
$content = "<span class=’status shift’><font color=’red’>Damn! Something went wrong. Sorry :-( </font></span>";
}
}
if($_POST) {
if (!$_FILES['image']['tmp_name']) {
$content .= "<span class=’status shift’><font color=’red’>Please select an image to upload.</font></span>";
}
}
$user = twitter_user_info(user_current_username());
$content .= theme(‘user_header’, $user);
$content .= "<form method=’post’ action=’avatar’ enctype=’multipart/form-data’><div>
Upload your avatar<br/>
<input type=’file’ name=’image’ /><br/>
<button type=’submit’ class=’button’>Upload</button></div></form>";
return theme(‘page’, ‘Upload Avatar’, $content);
}
selesai, semoga berhasil :)

0 Menambahkan Fitur Tweet Longer dari twtmore.com pada Dabr


Pada file common/twitter.php, cari
function twitter_update() {
menambahkan coding dibawah ini SEBELUM if ($status) {
$callback_key = false;
if (mb_strlen($status, ‘utf-8′) > 140) {
$reply_to_id = null;
if (is_numeric((string) $_POST['in_reply_to_id'])) {
$reply_to_id = (string) $_POST['in_reply_to_id'];
}
$response = post_twtmore_tweet(user_current_username(), $status, $reply_to_id);
if (!$response) {
theme(‘error’, "<h2>Long tweet error</h2><p>An unexpected error occured while posting to twtmore. Please try again.</p><hr>");
twitter_refresh($_POST['from'] ? $_POST['from'] : ”);
return;
}

$tatus = $response->tweet->short_content;
$callback_key = $response->callback_key;
}
masih di dalam funtion yg sama, tambahkan coding di bawah ini SESUDAH $b = twitter_process($request, $post_data);
if ($callback_key) {
post_twtmore_callback($callback_key, $b->id_str);
}
kemudian tambahkan junga coding functions di dalam file common/twitter.php tersebut, terserah di taro di bagian mana, asal tidak di dalam function yg lain, taruh saja di bagian paling bawah sebelum tanda ?>
// twtmore api key
define(‘TWTMORE_API_KEY’, ‘ISI_DENGAN_API_TWTMORE_KAMU’);
function post_twtmore_tweet($username, $tweet, $reply_to_tweet_id = null)
{
// Formulate the request
$request = array(
‘apikey’ => TWTMORE_API_KEY,
‘user’ => $username,
‘tweet’ => $tweet
);
// If reply
if ($reply_to_tweet_id)
{
$request['reply_to_tweet'] = $reply_to_tweet_id;
}
// Create CURL
$url = ‘http://api.twtmore.com/v3/shorten’;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
// Execute CURL
$response = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// Close CURL
curl_close($ch);
// Check we have a % 200 HTTP status code, and the JSON decodes ok
if ($code == 200 && ($resp = json_decode($response)))
{
return $resp;
}
// There was an error
return false;
}
function post_twtmore_callback($callback_key, $twitter_id)
{
$request = array(
‘apikey’ => TWTMORE_API_KEY,
‘key’ => $callback_key,
‘status_id’ => $twitter_id
);
$url = ‘http://api.twtmore.com/v3/callback’;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

0 Feature Mute for Dabr (Twitter Client)


First, you create a file mute.php and place in a /common/ folder, the file contents mute.php with the code below code:
<?php
function muted_page($query) {
/*
mute landing page to show the mutedlist account
thanks for your respect to not change any information here :)
*/
$content = "<p>Muted Feature is help you to mute an annoying tweets from your timeline <img src=’/smile/mv/sip.gif’><br/>";
$content .= "<br/>Just go to user profile page and click <b>`mute`</b> button to mute him/her tweet <img src=’/smile/mv/ketawa.gif’>";
$content .= "</p>";
$act = $_REQUEST['act'];
$screen_name = $_REQUEST['user'];
if ($act != "" && $act != NULL) {
mute_save($screen_name,$act);
header(‘Location: ‘. BASE_URL . "mute");exit();
} else {
$muted_list = mute_read();
$content .= "<ul>";
foreach ($muted_list as $item) {
$content .= "<li>@$item&nbsp;";
$content .= "<a href=’mute/?act=unmute&user={$item}’>Unmute</a></li>";
}
$content .= "</ul>";
theme(‘page’, ‘Muted List’, $content);
}
}
function sensor($tl) {
/*
lembaga sensor tweets
here we censored any tweeps from mutedlist account
*/
$muted_list = mute_read();
$new_tl = array();
foreach ($tl as $item) {
$user = strtolower($item->from->screen_name);
if (!in_array($user,$muted_list)) $new_tl[strval($item->id)] = $item;
}
$hsl = json_decode(json_encode($new_tl));
return $hsl;
}
function mute_read() {
/* mutelist reader */
$muted_list = unserialize(base64_decode($_COOKIE['muted']));
if (!$muted_list) { return array();}
else { return json_decode($muted_list); }
}
function mute_save($new,$act) {
/* mutelist writer */
$new = strtolower($new);
$muted_list = mute_read();
if ($act == "mute") {
if (!in_array($new,$muted_list)) array_push($muted_list,$new);
} elseif ($act == "unmute") {
$tmp = array();
foreach ($muted_list as $item) {
if ($item != $new) array_push($tmp,$item);
}
$muted_list = $tmp;
}
$muted_list = json_encode($muted_list);
$duration = time() + (3600 * 24 * 365);
setcookie(‘muted’, base64_encode(serialize($muted_list)), $duration, ‘/’);
}
/* Remove mutedlist cookies when user logout */
if (!isset($GLOBALS['user'])) {
if(!array_key_exists(‘USER_AUTH’, $_COOKIE)) {
$duration = time() – 3600;
setcookie("muted", NULL, $duration, ‘/’);
setcookie("muted", NULL, $duration);
}
}
?>
The next step, go to file /common/twitter.php, then add:
Calling code mute.php file by adding require ‘mute.php’; at the beginning of the file after code <?php
add the code in menu_register(array(
code:
‘mute’ => array(
‘callback’ => ‘muted_page’,
‘security’ => true,
),
still in the same file, find the function twitter_home_page ()
replace the code:
code:
$tl = twitter_standard_timeline($tl, ‘friends’);
to
code:
$tl = sensor(twitter_standard_timeline($tl, ‘friends’));
still in the same file, find the function theme_user_header($user) , add the code below:
code:
if ($user->following !== false) {
$muted_list = mute_read();
if (in_array(strtolower($user->screen_name),$muted_list)) {
$out .= " | <a href=’/mute/?act=unmute&user={$user->screen_name}’>Unmute</a>";
} else {
$out .= " | <a href=’/mute/?act=mute&user={$user->screen_name}’>Mute</a>";
}
}
before
code:
$out .= " | <a href=’confirm/spam/{$user->screen_name}/{$user->id}’>Report Spam</a>";
$out .= " | <a href=’search?query=%40{$user->screen_name}’>Search @{$user->screen_name}</a>";
$out .= "</div></div>";
return $out;
}
Do not forget to visit & use Twitter Client from us at the address www.imorv.com :)
@fays_ozunu
hp with the code below
code:
<?php
function muted_page($query) {
/*
mute landing page to show the mutedlist account
thanks for your respect to not change any information here :)
*/
$content = "<p>Muted Feature is help you to mute an annoying tweets from your timeline <img src=’/smile/mv/sip.gif’><br/>";
$content .= "<br/>Just go to user profile page and click <b>`mute`</b> button to mute him/her tweet <img src=’/smile/mv/ketawa.gif’>";
$content .= "</p>";
$act = $_REQUEST['act'];
$screen_name = $_REQUEST['user'];
if ($act != "" && $act != NULL) {
mute_save($screen_name,$act);
header(‘Location: ‘. BASE_URL . "mute");exit();
} else {
$muted_list = mute_read();
$content .= "<ul>";
foreach ($muted_list as $item) {
$content .= "<li>@$item&nbsp;";
$content .= "<a href=’mute/?act=unmute&user={$item}’>Unmute</a></li>";
}
$content .= "</ul>";
theme(‘page’, ‘Muted List’, $content);
}
}
function sensor($tl) {
/*
lembaga sensor tweets
here we censored any tweeps from mutedlist account
*/
$muted_list = mute_read();
$new_tl = array();
foreach ($tl as $item) {
$user = strtolower($item->from->screen_name);
if (!in_array($user,$muted_list)) $new_tl[strval($item->id)] = $item;
}
$hsl = json_decode(json_encode($new_tl));
return $hsl;
}
function mute_read() {
/* mutelist reader */
$muted_list = unserialize(base64_decode($_COOKIE['muted']));
if (!$muted_list) { return array();}
else { return json_decode($muted_list); }
}
function mute_save($new,$act) {
/* mutelist writer */
$new = strtolower($new);
$muted_list = mute_read();
if ($act == "mute") {
if (!in_array($new,$muted_list)) array_push($muted_list,$new);
} elseif ($act == "unmute") {
$tmp = array();
foreach ($muted_list as $item) {
if ($item != $new) array_push($tmp,$item);
}
$muted_list = $tmp;
}
$muted_list = json_encode($muted_list);
$duration = time() + (3600 * 24 * 365);
setcookie(‘muted’, base64_encode(serialize($muted_list)), $duration, ‘/’);
}
/* Remove mutedlist cookies when user logout */
if (!isset($GLOBALS['user'])) {
if(!array_key_exists(‘USER_AUTH’, $_COOKIE)) {
$duration = time() – 3600;
setcookie("muted", NULL, $duration, ‘/’);
setcookie("muted", NULL, $duration);
}
}
?>
The next step, go to file /common/twitter.php, then add:
Calling code mute.php file by adding require ‘mute.php’; at the beginning of the file after code <?php
add the code in menu_register(array(
code:
‘mute’ => array(
‘callback’ => ‘muted_page’,
‘security’ => true,
),
still in the same file, find the function twitter_home_page ()
replace the code:
code:
$tl = twitter_standard_timeline($tl, ‘friends’);
to
code:
$tl = sensor(twitter_standard_timeline($tl, ‘friends’));
still in the same file, find the function theme_user_header($user) , add the code below:
code:
if ($user->following !== false) {
$muted_list = mute_read();
if (in_array(strtolower($user->screen_name),$muted_list)) {
$out .= " | <a href=’/mute/?act=unmute&user={$user->screen_name}’>Unmute</a>";
} else {
$out .= " | <a href=’/mute/?act=mute&user={$user->screen_name}’>Mute</a>";
}
}
before
code:
$out .= " | <a href=’confirm/spam/{$user->screen_name}/{$user->id}’>Report Spam</a>";
$out .= " | <a href=’search?query=%40{$user->screen_name}’>Search @{$user->screen_name}</a>";
$out .= "</div></div>";
return $out;
}

0 Fitur TweetLonger Kanvaso untuk Dabr (Twitter Client)


Pertama, download dan install dabr package dari sini
Kedua, Register dan dapatkan Kanvaso API dari http://api.kanvaso.com/1/register.php
Ketiga, tambahkan kode d bawah ini pada bagian config.php pada file dabr mu

define('KANVASO_API_KEY', 'Kanvaso_API_Kamu');


Keempat, masuk ke file /common/twitter.php pada file dabr mu
cari code if ($status) {
kemudian tambahkan kode d bawah ini
// shrink the status if it exceeds Twitter’s limit 140
if(mb_strlen($status, ‘utf-8′) > 140)
$status = handle_long_tweet($status);
Terakhir masih d file yang sama tambahkan fungsi :
function handle_long_tweet($status) {
require_once(‘OAuth.php’);
$header = array(
‘X-Auth-Service-Provider: https://api.twitter.com/1/account/verify_credentials.json’,
‘X-Verify-Credentials-Authorization: OAuth realm="http://api.twitter.com/"’
);
$consumer = new OAuthConsumer(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET);
$sha1_method = new OAuthSignatureMethod_HMAC_SHA1();
// user’s token
list($oauth_token, $oauth_token_secret) = explode(‘|’, $GLOBALS['user']['password']);
$token = new OAuthConsumer($oauth_token, $oauth_token_secret);
// Generate all the OAuth parameters needed
$signingURL = ‘https://api.twitter.com/1/account/verify_credentials.json’;
$request = OAuthRequest::from_consumer_and_token($consumer, $token, ‘GET’, $signingURL, array());
$request->sign_request($sha1_method, $consumer, $token);
$header[1] .= ", oauth_consumer_key=\"" . $request->get_parameter(‘oauth_consumer_key’) . "\"";
$header[1] .= ", oauth_signature_method=\"" . $request->get_parameter(‘oauth_signature_method’) ."\"";
$header[1] .= ", oauth_token=\"" . $request->get_parameter(‘oauth_token’) ."\"";
$header[1] .= ", oauth_timestamp=\"" . $request->get_parameter(‘oauth_timestamp’) ."\"";
$header[1] .= ", oauth_nonce=\"" . $request->get_parameter(‘oauth_nonce’) ."\"";
$header[1] .= ", oauth_version=\"" . $request->get_parameter(‘oauth_version’) ."\"";
$header[1] .= ", oauth_signature=\"" . urlencode($request->get_parameter(‘oauth_signature’)) ."\"";
$url = ‘http://api.kanvaso.com/1/update.php’;
$ch = curl_init();
$contents = array(‘text’=>urlencode($status),
‘api_key’=>KANVASO_API_KEY,
‘format’=>’json’);
foreach($contents as $key=>$value) {
$fields .= $key . ‘=’ . $value . ‘&’;
}
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
$respond = curl_exec($ch);
$response_info = curl_getinfo($ch);
curl_close($ch);
$result = json_decode($respond);
if($result->status == ‘success’)
return $result->text;
else
return $result->text;
}

0 Fitur TweetLonger WriteLonger untuk Dabr (Twitter Client)

Pertama, cari fungsi twitter_update() di file /common/twitter.php
kemudian cari baian: if ($status) {
dan sebelem: $request = API_URL.’statuses/update.json’;
tambahkan code di bawah ini

if (mb_strlen($status, ‘utf-8′) > 140) {
$header = array(
‘X-Auth-Service-Provider: https://api.twitter.com/1/account/verify_credentials.json’,
‘X-Verify-Credentials-Authorization: OAuth realm="http://api.twitter.com/"’
);
require_once(‘OAuth.php’);
$consumer = new OAuthConsumer(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET);
$sha1_method = new OAuthSignatureMethod_HMAC_SHA1();
list($oauth_token, $oauth_token_secret) = explode(‘|’, $GLOBALS['user']['password']);
$token = new OAuthConsumer($oauth_token, $oauth_token_secret);
$signingURL = ‘https://api.twitter.com/1/account/verify_credentials.json’;
$request = OAuthRequest::from_consumer_and_token($consumer, $token, ‘GET’, $signingURL, array());
$request->sign_request($sha1_method, $consumer, $token);
$header[1] .= ", oauth_consumer_key=\"" . $request->get_parameter(‘oauth_consumer_key’) ."\"";
$header[1] .= ", oauth_signature_method=\"" . $request->get_parameter(‘oauth_signature_method’) ."\"";
$header[1] .= ", oauth_token=\"" . $request->get_parameter(‘oauth_token’) ."\"";
$header[1] .= ", oauth_timestamp=\"" . $request->get_parameter(‘oauth_timestamp’) ."\"";
$header[1] .= ", oauth_nonce=\"" . $request->get_parameter(‘oauth_nonce’) ."\"";
$header[1] .= ", oauth_version=\"" . $request->get_parameter(‘oauth_version’) ."\"";
$header[1] .= ", oauth_signature=\"" . urlencode($request->get_parameter(‘oauth_signature’)) ."\"";
$longtweetlink = ‘http://api.writelonger.com/create.php’;
$contents = array(‘text’=>urlencode($status),
‘api_key’=>’WL_H52m239dvsd’,
‘format’=>’json’);
foreach($contents as $key=>$value) {
$fields .= $key . ‘=’ . $value . ‘&’;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_URL, $longtweetlink);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
$respond = curl_exec($ch);
$response_info = curl_getinfo($ch);
curl_close($ch);
$result = json_decode($respond);
$status = $result->text;
}
Jangan lupa kunjungi & gunakan Twitter Client dari kami di alamat www.imorv.com :)
@fays_ozunugt; 140) {
$header = array(
‘X-Auth-Service-Provider: https://api.twitter.com/1/account/verify_credentials.json’,
‘X-Verify-Credentials-Authorization: OAuth realm="http://api.twitter.com/"’
);
require_once(‘OAuth.php’);
$consumer = new OAuthConsumer(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET);
$sha1_method = new OAuthSignatureMethod_HMAC_SHA1();
list($oauth_token, $oauth_token_secret) = explode(‘|’, $GLOBALS['user']['password']);
$token = new OAuthConsumer($oauth_token, $oauth_token_secret);
$signingURL = ‘https://api.twitter.com/1/account/verify_credentials.json’;
$request = OAuthRequest::from_consumer_and_token($consumer, $token, ‘GET’, $signingURL, array());
$request->sign_request($sha1_method, $consumer, $token);
$header[1] .= ", oauth_consumer_key=\"" . $request->get_parameter(‘oauth_consumer_key’) ."\"";
$header[1] .= ", oauth_signature_method=\"" . $request->get_parameter(‘oauth_signature_method’) ."\"";
$header[1] .= ", oauth_token=\"" . $request->get_parameter(‘oauth_token’) ."\"";
$header[1] .= ", oauth_timestamp=\"" . $request->get_parameter(‘oauth_timestamp’) ."\"";
$header[1] .= ", oauth_nonce=\"" . $request->get_parameter(‘oauth_nonce’) ."\"";
$header[1] .= ", oauth_version=\"" . $request->get_parameter(‘oauth_version’) ."\"";
$header[1] .= ", oauth_signature=\"" . urlencode($request->get_parameter(‘oauth_signature’)) ."\"";
$longtweetlink = ‘http://api.writelonger.com/create.php’;
$contents = array(‘text’=>urlencode($status),
‘api_key’=>’WL_H52m239dvsd’,
‘format’=>’json’);
foreach($contents as $key=>$value) {
$fields .= $key . ‘=’ . $value . ‘&’;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_URL, $longtweetlink);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
$respond = curl_exec($ch);
$response_info = curl_getinfo($ch);
curl_close($ch);
$result = json_decode($respond);
$status = $result->text;
}

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