Friday, April 27, 2012

Fitur Edit Profil

Edit file common/twitter.php nya gan..
PHP Code:
..........
.......... 
'trends' => array(
                
'hidden' => true,
                
'security' => true,
                
'callback' => 'twitter_trends_page',
        ), 
'profile' => array(
               
'security' => true,
               
'callback' => 'twitter_profile_page',
  ),
));

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

function 
long_url($shortURL)
{
        if (!
defined('LONGURL_KEY'))
..........
..........
..........  

0 comments:

Post a Comment

 

Copyright © Zaki's Blog.

Managed by FHMZK