Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My code:
- <?php
- $facebook = Yii::app()->facebook;
- $facebook->getAccessToken();
- $login = CHtml::link('Login Url', $facebook->getLoginStatusUrl(array('no_user'))).'<br/>';
- $this->widget('LoginButton', array('registration_url'=>$login));
- echo "<Br>";
- $this->widget('LoginButton', array('registration_url'=> $facebook->getLogoutUrl(array('next'=>$login)), 'text'=>'Logout'));
- var_dump($facebook);
- echo $facebook->getSignedRequest(); echo "<Br>";
- var_dump($facebook->getLoginUrl()); echo "<Br>";
- var_dump($facebook->getLogoutUrl()); echo "<Br>";
- var_dump($facebook->getLoginStatusUrl()); echo "<Br>";
- try {
- //$facebook->api('/me'); echo "<Br>";
- //$facebook->getAccessToken();
- $ret = $facebook->api('me?scope=email?fields=id,name' /*array(
- 'method' => 'fql.query',
- 'query' => 'SELECT name FROM user WHERE uid = me()',
- )*/);
- var_dump($ret);
- } catch (FacebookApiException $e) {
- var_dump($e->getMessage());
- }
- var_dump($facebook->getProfilePicture('large')); echo "<Br>";
- echo '<img src="'.$facebook->getProfilePicture('large').'" />'; echo "<Br>";
- //var_dump($facebook->getProfilePictureById('me?type=large')); echo "<Br>";
- //echo '<img src="'.$facebook->getProfilePictureById('/me','large').'" />'; echo "<Br>";
- var_dump($facebook->getInfo()); echo "<Br>";
- var_dump($facebook->getInfoById('me')); echo "<Br>";
- ?>
- <?php $this->widget('Registration', array(
- 'width'=>'900px',
- 'registration_url'=>array('/site/facebookregister'),
- 'fields'=>"[
- {'name':'name'},
- {'name':'first_name'},
- {'name':'last_name'},
- {'name':'email'},
- {'name':'password'},
- {'name':'location'},
- {'name':'captcha'}
- ]",
- )); ?>
- My output:
- object(SFacebook)[49]
- private '_facebook' =>
- object(SBaseFacebook)[50]
- protected 'sharedSessionID' => null
- protected 'appId' => string '792113527488047' (length=15)
- protected 'appSecret' => string '1f5cf0c17a2b94e744c80e321d4f8013' (length=32)
- protected 'user' => null
- protected 'signedRequest' => null
- protected 'state' => string '389a502405646973548ae37c30e5a8d5' (length=32)
- protected 'accessToken' => string '792113527488047|1f5cf0c17a2b94e744c80e321d4f8013' (length=48)
- protected 'fileUploadSupport' => boolean false
- protected 'trustForwarded' => boolean false
- protected 'allowSignedRequest' => boolean true
- public 'appId' => string '792113527488047' (length=15)
- public 'secret' => string '1f5cf0c17a2b94e744c80e321d4f8013' (length=32)
- public 'fileUpload' => boolean false
- public 'trustForwarded' => boolean false
- public 'allowSignedRequest' => boolean true
- public 'status' => boolean true
- public 'cookie' => boolean true
- public 'oauth' => boolean true
- public 'xfbml' => boolean true
- public 'jsCallback' => boolean false
- private 'callbackScripts' => string '' (length=0)
- public 'frictionlessRequests' => boolean false
- public 'jsSdk' => boolean true
- public 'html5' => boolean true
- public 'async' => boolean true
- public 'locale' => null
- private '_locale' => null
- public 'ogTags' =>
- array (size=0)
- empty
- protected 'locales' =>
- array (size=108)
- 0 => string 'az_AZ' (length=5)
- 1 => string 'be_BY' (length=5)
- 2 => string 'bg_BG' (length=5)
- 3 => string 'bn_IN' (length=5)
- 4 => string 'bs_BA' (length=5)
- 5 => string 'ca_ES' (length=5)
- 6 => string 'ck_US' (length=5)
- 7 => string 'cs_CZ' (length=5)
- 8 => string 'cy_GB' (length=5)
- 9 => string 'da_DK' (length=5)
- 10 => string 'de_DE' (length=5)
- 11 => string 'eu_ES' (length=5)
- 12 => string 'en_GB' (length=5)
- 13 => string 'en_PI' (length=5)
- 14 => string 'en_UD' (length=5)
- 15 => string 'en_US' (length=5)
- 16 => string 'es_LA' (length=5)
- 17 => string 'es_CL' (length=5)
- 18 => string 'es_CO' (length=5)
- 19 => string 'es_ES' (length=5)
- 20 => string 'es_MX' (length=5)
- 21 => string 'es_VE' (length=5)
- 22 => string 'fb_FI' (length=5)
- 23 => string 'fi_FI' (length=5)
- 24 => string 'fr_FR' (length=5)
- 25 => string 'gl_ES' (length=5)
- 26 => string 'hu_HU' (length=5)
- 27 => string 'it_IT' (length=5)
- 28 => string 'ja_JP' (length=5)
- 29 => string 'ko_KR' (length=5)
- 30 => string 'nb_NO' (length=5)
- 31 => string 'nn_NO' (length=5)
- 32 => string 'nl_NL' (length=5)
- 33 => string 'pl_PL' (length=5)
- 34 => string 'pt_BR' (length=5)
- 35 => string 'pt_PT' (length=5)
- 36 => string 'ro_RO' (length=5)
- 37 => string 'ru_RU' (length=5)
- 38 => string 'sk_SK' (length=5)
- 39 => string 'sl_SI' (length=5)
- 40 => string 'sv_SE' (length=5)
- 41 => string 'th_TH' (length=5)
- 42 => string 'tr_TR' (length=5)
- 43 => string 'ku_TR' (length=5)
- 44 => string 'zh_CN' (length=5)
- 45 => string 'zh_HK' (length=5)
- 46 => string 'zh_TW' (length=5)
- 47 => string 'fb_LT' (length=5)
- 48 => string 'af_ZA' (length=5)
- 49 => string 'sq_AL' (length=5)
- 50 => string 'hy_AM' (length=5)
- 51 => string 'hr_HR' (length=5)
- 52 => string 'nl_BE' (length=5)
- 53 => string 'eo_EO' (length=5)
- 54 => string 'et_EE' (length=5)
- 55 => string 'fo_FO' (length=5)
- 56 => string 'fr_CA' (length=5)
- 57 => string 'ka_GE' (length=5)
- 58 => string 'el_GR' (length=5)
- 59 => string 'gu_IN' (length=5)
- 60 => string 'hi_IN' (length=5)
- 61 => string 'is_IS' (length=5)
- 62 => string 'id_ID' (length=5)
- 63 => string 'ga_IE' (length=5)
- 64 => string 'jv_ID' (length=5)
- 65 => string 'kn_IN' (length=5)
- 66 => string 'kk_KZ' (length=5)
- 67 => string 'la_VA' (length=5)
- 68 => string 'lv_LV' (length=5)
- 69 => string 'li_NL' (length=5)
- 70 => string 'lt_LT' (length=5)
- 71 => string 'mk_MK' (length=5)
- 72 => string 'mg_MG' (length=5)
- 73 => string 'ms_MY' (length=5)
- 74 => string 'mt_MT' (length=5)
- 75 => string 'mr_IN' (length=5)
- 76 => string 'mn_MN' (length=5)
- 77 => string 'ne_NP' (length=5)
- 78 => string 'pa_IN' (length=5)
- 79 => string 'rm_CH' (length=5)
- 80 => string 'sa_IN' (length=5)
- 81 => string 'sr_RS' (length=5)
- 82 => string 'so_SO' (length=5)
- 83 => string 'sw_KE' (length=5)
- 84 => string 'tl_PH' (length=5)
- 85 => string 'ta_IN' (length=5)
- 86 => string 'tt_RU' (length=5)
- 87 => string 'te_IN' (length=5)
- 88 => string 'ml_IN' (length=5)
- 89 => string 'uk_UA' (length=5)
- 90 => string 'uz_UZ' (length=5)
- 91 => string 'vi_VN' (length=5)
- 92 => string 'xh_ZA' (length=5)
- 93 => string 'zu_ZA' (length=5)
- 94 => string 'km_KH' (length=5)
- 95 => string 'tg_TJ' (length=5)
- 96 => string 'ar_AR' (length=5)
- 97 => string 'he_IL' (length=5)
- 98 => string 'ur_PK' (length=5)
- 99 => string 'fa_IR' (length=5)
- 100 => string 'sy_SY' (length=5)
- 101 => string 'yi_DE' (length=5)
- 102 => string 'gn_PY' (length=5)
- 103 => string 'qu_PE' (length=5)
- 104 => string 'ay_BO' (length=5)
- 105 => string 'se_NO' (length=5)
- 106 => string 'ps_AF' (length=5)
- 107 => string 'tl_ST' (length=5)
- public 'behaviors' =>
- array (size=0)
- empty
- private '_initialized' (CApplicationComponent) => boolean true
- private '_e' (CComponent) => null
- private '_m' (CComponent) => null
- string 'https://www.facebook.com/dialog/oauth?client_id=792113527488047&redirect_uri=http%3A%2F%2Flocalhost%2FYiiMain%2Fapp%2Fsventessvesk%2Findex.php%3Fr%3Dsite%252Ffacebookregister%26https%3D1&state=389a502405646973548ae37c30e5a8d5&sdk=php-sdk-3.2.3' (length=243)
- string 'https://www.facebook.com/logout.php?next=http%3A%2F%2Flocalhost%2FYiiMain%2Fapp%2Fsventessvesk%2Findex.php%3Fr%3Dsite%252Ffacebookregister%26https%3D1&access_token=0' (length=165)
- string 'https://www.facebook.com/dialog/oauth?client_id=792113527488047&redirect_uri=http%3A%2F%2Flocalhost%2FYiiMain%2Fapp%2Fsventessvesk%2Findex.php%3Fr%3Dsite%252Ffacebookregister%26https%3D1&state=389a502405646973548ae37c30e5a8d5&sdk=php-sdk-3.2.3&response_type=code&display=none' (length=275)
- string 'An active access token must be used to query information about the current user.' (length=80)
- string 'http://graph.facebook.com/0/picture?type=large' (length=46)
- boolean false
- boolean false
Advertisement
Add Comment
Please, Sign In to add comment