function __construct()
 {
     parent::__construct();
     global $photonic_instagram_client_id, $photonic_instagram_client_secret, $photonic_instagram_disable_title_link;
     $this->client_id = $photonic_instagram_client_id;
     $this->client_secret = $photonic_instagram_client_secret;
     $this->provider = 'instagram';
     $this->oauth_version = '2.0';
     $this->response_type = 'code';
     $this->scope = 'comments relationships likes';
     $this->link_lightbox_title = empty($photonic_instagram_disable_title_link);
     $cookie = Photonic::parse_cookie();
     global $photonic_instagram_allow_oauth;
     $this->oauth_done = false;
     if ($photonic_instagram_allow_oauth && isset($cookie['instagram']) && isset($cookie['instagram']['oauth_token'])) {
         // OAuth2, so no Access token secret
         if ($this->is_token_expired($cookie['instagram'])) {
             // either access has been revoked or token has expired.
             $this->oauth_done = false;
         } else {
             $this->oauth_done = true;
         }
     } else {
         if (!isset($cookie['instagram']) || !isset($cookie['instagram']['oauth_token'])) {
             $this->oauth_done = false;
         }
     }
 }
 function __construct()
 {
     parent::__construct();
     global $photonic_picasa_client_id, $photonic_picasa_client_secret, $photonic_picasa_disable_title_link;
     $this->client_id = $photonic_picasa_client_id;
     $this->client_secret = $photonic_picasa_client_secret;
     $this->provider = 'picasa';
     $this->oauth_version = '2.0';
     $this->response_type = 'code';
     $this->scope = 'https://picasaweb.google.com/data/';
     $this->link_lightbox_title = empty($photonic_picasa_disable_title_link);
     $cookie = Photonic::parse_cookie();
     global $photonic_picasa_allow_oauth;
     $this->oauth_done = false;
     if ($photonic_picasa_allow_oauth && isset($cookie['picasa']) && isset($cookie['picasa']['oauth_token']) && isset($cookie['picasa']['oauth_refresh_token'])) {
         // OAuth2, so no Access token secret
         if ($this->is_token_expired($cookie['picasa'])) {
             $this->refresh_token($cookie['picasa']['oauth_refresh_token']);
             $cookie = Photonic::parse_cookie();
             // Refresh the cookie object based on the results of the refresh token
             if ($this->is_token_expired($cookie['picasa'])) {
                 // Tried refreshing, but didn't work
                 $this->oauth_done = false;
             } else {
                 $this->oauth_done = true;
             }
         } else {
             $this->oauth_done = true;
         }
     } else {
         if (!isset($cookie['picasa']) || !isset($cookie['picasa']['oauth_token']) || !isset($cookie['picasa']['oauth_refresh_token'])) {
             $this->oauth_done = false;
         }
     }
 }