質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.49%
WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

Q&A

解決済

1回答

1677閲覧

wordpress,buddypressプラグイン使用での会員制SNS作成について

sai_to

総合スコア20

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

0グッド

0クリップ

投稿2016/10/19 08:14

###前提・実現したいこと
会員制SNSをbuddypressで作り、Facebookでのみ会員登録できるようにしたいんです。
新規登録の場合buddypressでの登録フォームを表示せずに、FBのバナーだけ表示しFBアカウントでログインします。

また、登録していないユーザーからはデモページとFBログインのバナーのみ見られるようにして、
登録済みのユーザーにはマイページが表示される切り替えをしたいです。

###エラー
ウィジェットにて「Social login」をページに載せましたが、「Insert text/html to add before the widget:」と
「Insert text/html to add after the widget:」の項目にのせるものがわからず空白にしています。
そのためか、エラーが出ます。
facebook.comのページに移動してから
「URLを読み込めません:このURLのドメインはアプリのドメインに含まれていません。このURLを読み込むには、アプリ設定のアプリドメインにすべてのドメインとサブドメインを追加してください。」
と表示されています。

###該当のソースコード

//テーマデフォルトここから <?php function meso_load_child_style() { global $theme_version; wp_enqueue_style( 'meso-child-css', get_stylesheet_directory_uri() . '/style.css', array(), $theme_version ); } add_action( 'wp_enqueue_scripts', 'meso_load_child_style',99 ); ?> //テーマデフォルトここまで //Handle data retrieved from a social network profile<font></font>   function oa_social_login_store_extended_data ($user_data, $identity)<font></font>   {<font></font>     // $user_data is an object that represents the newly added user<font></font>     // The format is similar to the data returned by $user_data = get_userdata ($user_id);<font></font> <font></font>     // $identity is an object that contains the full social network profile<font></font>     <font></font>     //Example to store the gender<font></font>     update_user_meta ($user_data->ID, 'gender', $identity->gender);<font></font>   }<font></font> <font></font>   //This action is called whenever Social Login adds a new user<font></font>   add_action ('oa_social_login_action_after_user_insert', 'oa_social_login_store_extended_data', 10, 2); //Store data retrieved from a social network profile in BuddyPress Xprofile fields<font></font> function oa_social_login_store_xprofile ($user_data, $identity)<font></font> {<font></font>   // $user_data is an object that represents the newly added user<font></font>   // The format is similar to the data returned by $user_data = get_userdata ($user_id);<font></font>  <font></font>   // $identity is an object that contains the full social network profile<font></font>    <font></font>   //The following line is required to initialise the BuddyPress table names<font></font>   do_action('bp_setup_globals');<font></font>   <font></font>   //Example to store the firstname/lastname<font></font>   xprofile_set_field_data ('First Name', $user_data->ID, $identity->name->givenName);<font></font>   xprofile_set_field_data ('Last Name', $user_data->ID, $identity->name->familyName);<font></font> }<font></font> add_action( 'oa_social_login_action_after_user_insert', 'oa_social_login_store_xprofile', 10, 2); //Use the email address for user_login<font></font>   function oa_social_login_set_email_as_user_login ($user_fields)<font></font>   {<font></font>     if ( ! empty ($user_fields['user_email']))<font></font>     {<font></font>       if ( ! username_exists ($user_fields['user_email']))<font></font>       {<font></font>         $user_fields['user_login'] = $user_fields['user_email'];<font></font>       }<font></font>     }<font></font> <font></font>     return $user_fields;<font></font>   }<font></font> <font></font>   // This filter is applied to new users<font></font>   add_filter('oa_social_login_filter_new_user_fields', 'oa_social_login_set_email_as_user_login'); //Set custom roles for new users<font></font>   function oa_social_login_set_new_user_role ($user_role)<font></font>   {<font></font>     //This is an example for a custom setting with one role<font></font>     $user_role = 'author';<font></font>     <font></font>     //This is an example for a custom setting with two roles<font></font>     $user_role = 'author editor';<font></font> <font></font>     //The new user will be created with this role<font></font>     return $user_role;<font></font>   }<font></font> <font></font>   //This filter is applied to the roles of new users<font></font>   add_filter('oa_social_login_filter_new_user_role', 'oa_social_login_set_new_user_role');

###試したこと
http://docs.oneall.com/plugins/guide/social-login-wordpress/
このページにあるように、テーマのfunctions.phpにA.B.D.Eのソースを追加しました。
見よう見まねで追加したのでよく理解できていません。
facebook for developersで作ったアプリ名に変更する箇所があるのかと思うのですが、どこを変えたらいいのかわからず参考URLのソースをそのままペーストしました。

###補足情報(言語/FW/ツール等のバージョンなど)
mac,iPhonで作成と確認をしています。

使用テーマ:MesoColumn【https://ja.wordpress.org/themes/mesocolumn/】
sociallogin:oneall取得済み
facebook for developers:登録済み、アプリ作成済み

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

完璧に解決したわけではないのですが、一旦保留にしました。

投稿2016/10/26 02:53

sai_to

総合スコア20

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.49%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問