Hello everyone make sure to stop by and introduce yourself and do check out our design and programming sections.
Visit the Den and get some free stuff!

You are not connected. Please login or register

Programming Tools offered on G-Forum

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Programming Tools offered on G-Forum on Mon Feb 16, 2015 11:20 pm

george

avatar

Admin
Admin
In our forums we have a customizable syntax highlighter which you can change the theme of when viewing code. When you want to share with us a code and are using the code tags it will automatically make it look beautiful!

Just a little preview below Wink

Code:

$client_id    = "[your client id]"; 
$client_secret = "[your client secret]"; 
$oauth_base    = "https://secure.viadeo.com/oauth-provider"; 
$api_base      = "https://api.viadeo.com"; 
$authorize_url = $oauth_base . "/authorize2"; 
$token_url    = $oauth_base . "/access_token2"; 
$access_token  = null; 
 
$opts = Array( 
    CURLOPT_CONNECTTIMEOUT => 10, 
    CURLOPT_RETURNTRANSFER => TRUE, 
    CURLOPT_HEADER        => TRUE, 
    CURLOPT_TIMEOUT        => 60, 
    CURLOPT_USERAGENT      => 'viadeo-api-sample-php-agent', 
    CURLOPT_HTTPHEADER    => array("Accept: application/json; charset=UTF-8") 
); 
if (isset($_REQUEST["error"])) { 
    echo "Authentication failed : " . $_REQUEST['error_description']; 
} else if (isset($_REQUEST["code"])) {
   
    # Request for an access_token
    $params = Array(
        'grant_type'    => 'authorization_code',
        'client_id'      => $client_id,
        'client_secret'  => $client_secret,
        'redirect_uri'  => curPageURL(),
        'code'          => $_REQUEST["code"]
    ); 
    $result = _http('POST', '', $params, $token_url);
 
    # Record access token and make requests
    if ($result) {
        $access_token = $result->access_token;
        make_requests(); # See below for a sample make_requests()
    }   
} else { 
    $params['response_type'] = 'code'; 
    $params['client_id'] = $client_id; 
    $params['redirect_uri'] = curPageURL(); 
    $url = $authorize_url . "?" . http_build_query($params, NULL, '&'); 
    header("Location: $url"); 

View user profile http://gareygraphics.com

View previous topic View next topic Back to top  Message [Page 1 of 1]

Share this topic!

URL Direct
BBcode
HTML
Programming Tools offered on G-Forum

Permissions in this forum:
You cannot reply to topics in this forum