Changeset 1089546
- Timestamp:
- 02/14/2015 01:03:29 AM (11 years ago)
- Location:
- fp/trunk
- Files:
-
- 43 added
- 7 deleted
- 2 edited
- 1 moved
-
fp-admin.php (deleted)
-
fp-comment.php (deleted)
-
fp-like.php (deleted)
-
fp-login.php (deleted)
-
fp-oauth.php (deleted)
-
fp-social.php (added)
-
fp.php (modified) (3 diffs)
-
images/fb.png (deleted)
-
images/login-with-fb.gif (deleted)
-
la-social (added)
-
la-social/la-social-comments.php (added)
-
la-social/la-social-module.php (added)
-
la-social/la-social.php (added)
-
la-social/wp-oauth.php (moved) (moved from fp/trunk/wp-oauth.php) (2 diffs)
-
lib (added)
-
lib/Facebook (added)
-
lib/Facebook/Entities (added)
-
lib/Facebook/Entities/AccessToken.php (added)
-
lib/Facebook/Entities/SignedRequest.php (added)
-
lib/Facebook/FacebookAuthorizationException.php (added)
-
lib/Facebook/FacebookCanvasLoginHelper.php (added)
-
lib/Facebook/FacebookClientException.php (added)
-
lib/Facebook/FacebookJavaScriptLoginHelper.php (added)
-
lib/Facebook/FacebookOtherException.php (added)
-
lib/Facebook/FacebookPageTabHelper.php (added)
-
lib/Facebook/FacebookPermissionException.php (added)
-
lib/Facebook/FacebookRedirectLoginHelper.php (added)
-
lib/Facebook/FacebookRequest.php (added)
-
lib/Facebook/FacebookRequestException.php (added)
-
lib/Facebook/FacebookResponse.php (added)
-
lib/Facebook/FacebookSDKException.php (added)
-
lib/Facebook/FacebookServerException.php (added)
-
lib/Facebook/FacebookSession.php (added)
-
lib/Facebook/FacebookSignedRequestFromInputHelper.php (added)
-
lib/Facebook/FacebookThrottleException.php (added)
-
lib/Facebook/GraphAlbum.php (added)
-
lib/Facebook/GraphLocation.php (added)
-
lib/Facebook/GraphObject.php (added)
-
lib/Facebook/GraphPage.php (added)
-
lib/Facebook/GraphSessionInfo.php (added)
-
lib/Facebook/GraphUser.php (added)
-
lib/Facebook/GraphUserPage.php (added)
-
lib/Facebook/HttpClients (added)
-
lib/Facebook/HttpClients/FacebookCurl.php (added)
-
lib/Facebook/HttpClients/FacebookCurlHttpClient.php (added)
-
lib/Facebook/HttpClients/FacebookGuzzleHttpClient.php (added)
-
lib/Facebook/HttpClients/FacebookHttpable.php (added)
-
lib/Facebook/HttpClients/FacebookStream.php (added)
-
lib/Facebook/HttpClients/FacebookStreamHttpClient.php (added)
-
lib/Facebook/HttpClients/certs (added)
-
lib/Facebook/HttpClients/certs/DigiCertHighAssuranceEVRootCA.pem (added)
-
lib/autoload.php (added)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fp/trunk/fp.php
r482880 r1089546 4 4 Description: All the tools you need to integrate your wordpress and facebook. 5 5 Author: Louy 6 Version: 1.46 Version: 2.0 7 7 Author URI: http://l0uy.com/ 8 8 Text Domain: fp … … 13 13 add your info and uncomment the following three lines: 14 14 */ 15 15 16 //define('FACEBOOK_APP_ID', 'EnterYourAppIDHere'); 16 17 //define('FACEBOOK_APP_SECRET', 'EtnterYourSecretHere'); 17 18 //define('FACEBOOK_FANPAGE', 'EnterYourPageIDHere'); 18 19 19 //define('FACEBOOK_DISABLE_LOGIN', true); 20 20 … … 22 22 load_plugin_textdomain( 'fp', false, dirname( plugin_basename( __FILE__ ) ) . '/po/' ); 23 23 24 define('FP_VERSION', '1.4'); 24 define( 'FP_VERSION', '2.0' ); 25 define( 'FP_PHP_VERSION_REQUIRED', '5.4.0' ); 25 26 26 require_once dirname(__FILE__).'/wp-oauth.php';27 28 /**29 * FacePress Core:30 */31 27 function fp_activate(){ 32 oauth_activate();33 34 28 // require PHP 5 35 if (version_compare(PHP_VERSION, '5.0.0', '<')) {29 if( version_compare(PHP_VERSION, FP_PHP_VERSION_REQUIRED, '<')) { 36 30 deactivate_plugins(basename(__FILE__)); // Deactivate ourself 37 wp_die( __("Sorry, FacePress requires PHP 5 or higher. Ask your host how to enable PHP 5 as the default on your servers.", 'fp'));31 wp_die( sprintf( __("Sorry, FacePress requires PHP %1$s or higher. Ask your host how to enable PHP %1$s as the default on your servers.", 'tp'), FP_PHP_VERSION_REQUIRED ) ); 38 32 } 39 33 } 40 34 register_activation_hook(__FILE__, 'fp_activate'); 41 35 42 if( !isset( $_SERVER['HTTPS'] ) ) 43 $_SERVER['HTTPS'] = false; 44 45 add_action('init','fp_init'); 46 function fp_init() { 47 48 wp_enqueue_script('jquery'); 49 50 if (session_id() == '') { 51 session_start(); 52 } 53 54 isset($_SESSION['fb-connected']) or 55 $_SESSION['fb-connected'] = false; 56 36 if( version_compare(PHP_VERSION, FP_PHP_VERSION_REQUIRED, '>=') ) { 37 require_once dirname(__FILE__) . '/fp-social.php'; 38 global $fp; 39 $fp = FP_Social::get_instance(__FILE__); 57 40 } 58 59 function fp_app_options_defined() {60 return defined('FACEBOOK_APP_ID') && defined('FACEBOOK_APP_SECRET');61 }62 63 function fp_options($k=false) {64 $options = get_option('fp_options');65 66 if( !is_array($options) ) {67 add_option('fp_options', $options = array(68 'allow_comment' => false,69 'comm_text' => '',70 'like_position' => '',71 'like_layout' => '',72 'like_send' => 'true',73 'like_action' => '',74 'like_css' => '',75 ));76 }77 78 $options = array_merge($options, fp_app_options());79 if( $k ) {80 $options = $options[$k];81 }82 return $options;83 }84 85 function fp_app_options() {86 $options = get_site_option('fp_app_options');87 88 if( !is_array($options) ) {89 add_site_option('fp_app_options', $options = array(90 'appId' => '',91 'secret' => '',92 'fanpage' => '',93 'disable_login' => false94 ));95 }96 97 if( fp_app_options_defined() ) {98 defined('FACEBOOK_FANPAGE') or99 define('FACEBOOK_FANPAGE', '');100 101 defined('FACEBOOK_DISABLE_LOGIN') or102 define('FACEBOOK_DISABLE_LOGIN', fales);103 104 $options['appId'] = FACEBOOK_APP_ID ;105 $options['secret'] = FACEBOOK_APP_SECRET ;106 $options['fanpage'] = FACEBOOK_FANPAGE ;107 $options['disable_login'] = FACEBOOK_DISABLE_LOGIN;108 }109 110 return $options;111 }112 113 function fp_ready() {114 $o = fp_app_options();115 return isset($o['appId']) && !empty($o['appId']) &&116 isset($o['secret']) && !empty($o['secret']);117 }118 119 function fb_access_token() {120 if( $_SESSION['fb-connected'] ) {121 return $_SESSION['fp_access_token'];122 }123 return false;124 }125 126 function fb_app_access_token() {127 if( fp_ready() ) {128 return fp_options('appId') . '|' . fp_options('secret');129 }130 return false;131 }132 133 function fb_me() {134 if( $_SESSION['fb-connected'] ) {135 return $_SESSION['fb-me'];136 }137 return false;138 }139 140 function fb_all_js() {141 /* translators: Facebook Locale */142 $locale = _x('en_US', 'FB Locale', 'fp');143 ?>144 <div id="fb-root"></div>145 <script>(function(d, s, id) {146 var js, fjs = d.getElementsByTagName(s)[0];147 if (d.getElementById(id)) {return;}148 js = d.createElement(s); js.id = id;149 js.src = "//connect.facebook.net/<?php echo $locale; ?>/all.js#xfbml=1&appId=<?php echo fp_options('appId'); ?>";150 fjs.parentNode.insertBefore(js, fjs);151 }(document, 'script', 'facebook-jssdk'));</script>152 <?php153 }154 155 // basic XFBML load into footer156 add_action('wp_footer','fb_all_js',20);157 158 // fix up the html tag to have the FBML extensions159 //add_filter('language_attributes','fp_lang_atts');160 function fp_lang_atts($lang) {161 return ' xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" '.$lang;162 }163 164 function fp_get_connect_button($action='', $perms = '', $data = array(), $image ='login-with-fb.gif') {165 $image = apply_filters('fp_connect_button_image', $image, $action);166 $imgsrc = apply_filters('fp_connect_button_image_src', plugins_url() . '/fp/images/'.$image, $image, $action);167 $return = '<a href="' . oauth_link('facebook', array(168 'action' => $action,169 'location' => fp_get_current_url(),170 'perms' => $perms171 ) ) . '" title="'.__('Login with Facebook', 'fp').'"';172 173 foreach( $data as $k => $v ) {174 $return .= " $k=\"$v\"";175 }176 177 $return .= '>'.178 '<img src="'.$imgsrc.'" alt="'.__('Login with Facebook', 'fp').'" style="border:none;" />'.179 '</a>';180 return apply_filters('fp_get_connect_button', $return, $action, $perms, $image, $data);181 }182 183 function fp_get_current_url() {184 // build the URL in the address bar185 $requested_url = ( !empty($_SERVER['HTTPS'] ) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';186 $requested_url .= $_SERVER['HTTP_HOST'];187 $requested_url .= $_SERVER['REQUEST_URI'];188 return $requested_url;189 }190 191 // this adds the app id to allow you to use Facebook Insights on your domain, linked to your application.192 add_action('wp_head','fp_meta_head');193 function fp_meta_head() {194 $options = fp_options();195 196 if ($options['appId']) {197 ?>198 <meta property='fb:app_id' content='<?php echo $options['appId']; ?>' />199 <?php200 }201 ?>202 <meta property="og:site_name" content="<?php bloginfo('name'); ?>" />203 <?php204 if ( is_singular() ) {205 global $wp_the_query;206 if ( $id = $wp_the_query->get_queried_object_id() ) {207 $link = get_permalink( $id );208 echo "<meta property='og:url' content='{$link}' />\n";209 }210 } else if (is_home()) {211 $link = get_bloginfo('url');212 echo "<meta property='og:url' content='{$link}' />\n";213 }214 do_action('og_meta');215 }216 217 require_once 'fp-oauth.php';218 219 require_once 'fp-login.php';220 221 require_once 'fp-admin.php';222 223 require_once 'fp-comment.php';224 225 require_once 'fp-like.php';226 -
fp/trunk/la-social/wp-oauth.php
r880404 r1089546 17 17 function oauth_init() { 18 18 global $wp, $oauth_activate; 19 19 20 20 add_rewrite_rule('oauth/(.+)/?$', 'index.php?oauth=$matches[1]',1); 21 21 add_rewrite_rule('oauth/?', 'index.php?oauth=null',1); 22 22 23 23 $wp->add_query_var('oauth'); 24 25 24 } 26 25 … … 34 33 // Nothing happened!? 35 34 do_action('wp_oauth_unknown_site'); 36 die( __('OAuth site not recognized!') );35 wp_die( __('OAuth site not recognized!') ); 37 36 } 38 37 } 39 38 40 39 function oauth_link($site,$args=array()){ 40 global $wp_rewrite; 41 41 42 $link = get_bloginfo('url'); 42 $link .= '/oauth/' . $site; 43 if( $wp_rewrite->using_permalinks() ) { 44 $link .= '/oauth/' . $site; 45 } else { 46 $link = add_query_arg(array( 47 'oauth' => $site 48 ), $link);; 49 } 43 50 $link = add_query_arg($args, $link); 51 44 52 return $link; 45 53 } -
fp/trunk/readme.txt
r880404 r1089546 1 1 === Plugin Name === 2 2 Contributors: louyx 3 Author URL: http://l ouyblog.wordpress.com/4 Tags: facebook, oauth, login, share, likebutton, comment, connect5 Requires at least: 3. 06 Tested up to: 3.73 Author URL: http://l0uy.com/ 4 Tags: Facebook, oauth, login, share, likebutton, comment, connect 5 Requires at least: 3.3 6 Tested up to: 4.1 7 7 Stable tag: 1.4 8 8 9 All the tools you need to integrate your wordpress and facebook.9 All the tools you need to integrate WordPress and Facebook. 10 10 11 11 == Description == 12 12 13 FacePress, is a plugin that allows you to integrate facebook and your blog very easily, you just need to configure a few stuff and voila! you're done! Happy FaceBook-ing.13 FacePress, is a plugin that allows you to integrate Facebook and your blog very easily, you just need to configure a few stuff and voila! you're done! Happy FaceBook-ing. 14 14 15 15 = Key Features = 16 16 17 * Allow your visitors to comment using their facebook ids17 * Allow your visitors to comment using their Facebook ids 18 18 * Adds a like button to your posts, so your visitors can share your content. 19 * Allow your blog users to sign in with their facebook ids. one click signin!19 * Allow your blog users to sign in with their Facebook ids. one click signin! 20 20 21 21 == Changelog == 22 23 == Changelog == 24 25 = 2.0 = 26 * Rewritten from ground up. Cleaner code and more extensibility. 27 * Now using Facebook PHP SDK v4. 22 28 23 29 = 1.4 = … … 25 31 26 32 = 1.3 = 27 * Fixing an issue with facebook and SSL on some servers33 * Fixing an issue with Facebook and SSL on some servers 28 34 * Using Facebook HTML5 support and graph API 29 35 30 36 = 1.2 = 31 * Adding an option to disable login with facebook in the app settings page37 * Adding an option to disable login with Facebook in the app settings page 32 38 33 39 = 1.1 =
Note: See TracChangeset
for help on using the changeset viewer.