{"action":"created","comment":{"url":"https://api.github.com/repos/hashikuchi/freecycle/pulls/comments/34878678","id":34878678,"diff_hunk":"@@ -10,18 +10,38 @@\n \t\t<?php wp_head(); ?>\r\n \t\t<?php include_once \"js/freecycleJS.php\" ?>\r\n \t\t<?php\r\n+\t\t$user_ID = get_current_user_id();\r\n \t\t// if facebook dialog has not be shown before, show it\r\n-\t\tif(is_user_connected_with('facebook', get_current_user_id()) && !get_user_meta(get_current_user_id(), 'is_fb_share_popup_displayed')){\r\n+\t\tif(is_user_connected_with('facebook', $user_ID) && !get_user_meta($user_ID, 'is_fb_share_popup_displayed')){\r\n \t\t\t// change status\r\n-\t\t\tupdate_user_meta(get_current_user_id(), 'is_fb_share_popup_displayed', 1);\r\n+\t\t\tupdate_user_meta($user_ID, 'is_fb_share_popup_displayed', 1);\r\n \t\t\tinclude_once \"js/fcFbDialog.js.php\";\r\n \t\t}\r\n \t\t// if twitter dialog has not be shown before, show it\r\n-\t\tif(is_user_connected_with('twitter', get_current_user_id()) && !get_user_meta(get_current_user_id(), 'is_twitter_popup_displayed')){\r\n+\t\tif(is_user_connected_with('twitter', $user_ID) && !get_user_meta($user_ID, 'is_twitter_popup_displayed')){\r\n \t\t\t// change status\r\n-\t\t\tupdate_user_meta(get_current_user_id(), 'is_twitter_popup_displayed', 1);\r\n+\t\t\tupdate_user_meta($user_ID, 'is_twitter_popup_displayed', 1);\r\n \t\t\tinclude_once \"js/fcTwitterDialog.js.php\";\r\n \t\t}\r\n+\t\t// if first login \r\n+\t\tif(!get_user_meta($user_ID, \"first_login_page\")){\r\n+\t\t\tadd_todo_first_new_entry($user_ID);\r\n+\t\t\tadd_todo_first_giveme($user_ID);\r\n+\t\t\tif(!xprofile_get_field_data('大学名', $user_ID) || !xprofile_get_field_data('学部', $user_ID)){\r\n+\t\t\t\tadd_todo_first_category($user_ID);\r\n+\t\t\t}\r\n+\t\t\tupdate_user_meta($user_ID, \"first_login_page\", 1);\r\n+\t\t}\r\n+\t\t//if write category in profile\r\n+\t\tif(!get_user_meta($user_ID, 'first_write_category')){\r\n+\t\t\tif(xprofile_get_field_data('大学名', $user_ID) && xprofile_get_field_data('学部', $user_ID)){\r\n+\t\t\t\t$todo_row = get_todo_row($user_ID, -3);\r\n+\t\t\t\t$todoID = $todo_row->todo_id;\r\n+\t\t\t\tchange_todo_status_finished($todoID);\r\n+\r\n+\t\t\t\tupdate_user_meta($user_ID, \"first_write_category\", 1);\r","path":"themes/freecycle/header.php","position":37,"original_position":37,"commit_id":"9ae8371ff174a1771a25b3b5e9d79b9f57fc0d81","original_commit_id":"9ae8371ff174a1771a25b3b5e9d79b9f57fc0d81","user":{"login":"hashikuchi","id":4316388,"avatar_url":"https://avatars.githubusercontent.com/u/4316388?v=3","gravatar_id":"","url":"https://api.github.com/users/hashikuchi","html_url":"https://github.com/hashikuchi","followers_url":"https://api.github.com/users/hashikuchi/followers","following_url":"https://api.github.com/users/hashikuchi/following{/other_user}","gists_url":"https://api.github.com/users/hashikuchi/gists{/gist_id}","starred_url":"https://api.github.com/users/hashikuchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashikuchi/subscriptions","organizations_url":"https://api.github.com/users/hashikuchi/orgs","repos_url":"https://api.github.com/users/hashikuchi/repos","events_url":"https://api.github.com/users/hashikuchi/events{/privacy}","received_events_url":"https://api.github.com/users/hashikuchi/received_events","type":"User","site_admin":false},"body":"first_write_category は first_login_page (is_first_login_page_displayed) に統一できませんか？\r\n","created_at":"2015-07-17T10:29:34Z","updated_at":"2015-07-17T10:29:34Z","html_url":"https://github.com/hashikuchi/freecycle/pull/226#discussion_r34878678","pull_request_url":"https://api.github.com/repos/hashikuchi/freecycle/pulls/226","_links":{"self":{"href":"https://api.github.com/repos/hashikuchi/freecycle/pulls/comments/34878678"},"html":{"href":"https://github.com/hashikuchi/freecycle/pull/226#discussion_r34878678"},"pull_request":{"href":"https://api.github.com/repos/hashikuchi/freecycle/pulls/226"}}},"pull_request":{"url":"https://api.github.com/repos/hashikuchi/freecycle/pulls/226","id":39696534,"html_url":"https://github.com/hashikuchi/freecycle/pull/226","diff_url":"https://github.com/hashikuchi/freecycle/pull/226.diff","patch_url":"https://github.com/hashikuchi/freecycle/pull/226.patch","issue_url":"https://api.github.com/repos/hashikuchi/freecycle/issues/226","number":226,"state":"open","locked":false,"title":"TODO新規追加","user":{"login":"tagasouichiro","id":7579796,"avatar_url":"https://avatars.githubusercontent.com/u/7579796?v=3","gravatar_id":"","url":"https://api.github.com/users/tagasouichiro","html_url":"https://github.com/tagasouichiro","followers_url":"https://api.github.com/users/tagasouichiro/followers","following_url":"https://api.github.com/users/tagasouichiro/following{/other_user}","gists_url":"https://api.github.com/users/tagasouichiro/gists{/gist_id}","starred_url":"https://api.github.com/users/tagasouichiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tagasouichiro/subscriptions","organizations_url":"https://api.github.com/users/tagasouichiro/orgs","repos_url":"https://api.github.com/users/tagasouichiro/repos","events_url":"https://api.github.com/users/tagasouichiro/events{/privacy}","received_events_url":"https://api.github.com/users/tagasouichiro/received_events","type":"User","site_admin":false},"body":"以下の３点のTODOを追加しました。\r\naction:新規登録\r\n・大学、学部登録\r\n・新規出品\r\n・ください処理\r\n\r\n基本的に、user_metaを利用して初めてかどうかの判断をしています。\r\n(既存ユーザーをどうしようか悩みどころです。)\r\n大学・学部登録のTODOの消しどころがBuddyPress既存の動きをしているところ(プロフィール編集)でしたので、header.phpで常に監視して変化があった際にTODOを消すというような挙動にしました。","created_at":"2015-07-10T15:41:52Z","updated_at":"2015-07-17T10:29:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"92ec3929af5e9f3c3fbfd96860b4082291bed96b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hashikuchi/freecycle/pulls/226/commits","review_comments_url":"https://api.github.com/repos/hashikuchi/freecycle/pulls/226/comments","review_comment_url":"https://api.github.com/repos/hashikuchi/freecycle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashikuchi/freecycle/issues/226/comments","statuses_url":"https://api.github.com/repos/hashikuchi/freecycle/statuses/9ae8371ff174a1771a25b3b5e9d79b9f57fc0d81","head":{"label":"hashikuchi:enhance_todo_list","ref":"enhance_todo_list","sha":"9ae8371ff174a1771a25b3b5e9d79b9f57fc0d81","user":{"login":"hashikuchi","id":4316388,"avatar_url":"https://avatars.githubusercontent.com/u/4316388?v=3","gravatar_id":"","url":"https://api.github.com/users/hashikuchi","html_url":"https://github.com/hashikuchi","followers_url":"https://api.github.com/users/hashikuchi/followers","following_url":"https://api.github.com/users/hashikuchi/following{/other_user}","gists_url":"https://api.github.com/users/hashikuchi/gists{/gist_id}","starred_url":"https://api.github.com/users/hashikuchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashikuchi/subscriptions","organizations_url":"https://api.github.com/users/hashikuchi/orgs","repos_url":"https://api.github.com/users/hashikuchi/repos","events_url":"https://api.github.com/users/hashikuchi/events{/privacy}","received_events_url":"https://api.github.com/users/hashikuchi/received_events","type":"User","site_admin":false},"repo":{"id":15099935,"name":"freecycle","full_name":"hashikuchi/freecycle","owner":{"login":"hashikuchi","id":4316388,"avatar_url":"https://avatars.githubusercontent.com/u/4316388?v=3","gravatar_id":"","url":"https://api.github.com/users/hashikuchi","html_url":"https://github.com/hashikuchi","followers_url":"https://api.github.com/users/hashikuchi/followers","following_url":"https://api.github.com/users/hashikuchi/following{/other_user}","gists_url":"https://api.github.com/users/hashikuchi/gists{/gist_id}","starred_url":"https://api.github.com/users/hashikuchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashikuchi/subscriptions","organizations_url":"https://api.github.com/users/hashikuchi/orgs","repos_url":"https://api.github.com/users/hashikuchi/repos","events_url":"https://api.github.com/users/hashikuchi/events{/privacy}","received_events_url":"https://api.github.com/users/hashikuchi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hashikuchi/freecycle","description":"Project for TexChange (web service for students trading their textbooks)","fork":false,"url":"https://api.github.com/repos/hashikuchi/freecycle","forks_url":"https://api.github.com/repos/hashikuchi/freecycle/forks","keys_url":"https://api.github.com/repos/hashikuchi/freecycle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashikuchi/freecycle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashikuchi/freecycle/teams","hooks_url":"https://api.github.com/repos/hashikuchi/freecycle/hooks","issue_events_url":"https://api.github.com/repos/hashikuchi/freecycle/issues/events{/number}","events_url":"https://api.github.com/repos/hashikuchi/freecycle/events","assignees_url":"https://api.github.com/repos/hashikuchi/freecycle/assignees{/user}","branches_url":"https://api.github.com/repos/hashikuchi/freecycle/branches{/branch}","tags_url":"https://api.github.com/repos/hashikuchi/freecycle/tags","blobs_url":"https://api.github.com/repos/hashikuchi/freecycle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashikuchi/freecycle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashikuchi/freecycle/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashikuchi/freecycle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashikuchi/freecycle/statuses/{sha}","languages_url":"https://api.github.com/repos/hashikuchi/freecycle/languages","stargazers_url":"https://api.github.com/repos/hashikuchi/freecycle/stargazers","contributors_url":"https://api.github.com/repos/hashikuchi/freecycle/contributors","subscribers_url":"https://api.github.com/repos/hashikuchi/freecycle/subscribers","subscription_url":"https://api.github.com/repos/hashikuchi/freecycle/subscription","commits_url":"https://api.github.com/repos/hashikuchi/freecycle/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashikuchi/freecycle/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashikuchi/freecycle/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashikuchi/freecycle/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashikuchi/freecycle/contents/{+path}","compare_url":"https://api.github.com/repos/hashikuchi/freecycle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashikuchi/freecycle/merges","archive_url":"https://api.github.com/repos/hashikuchi/freecycle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashikuchi/freecycle/downloads","issues_url":"https://api.github.com/repos/hashikuchi/freecycle/issues{/number}","pulls_url":"https://api.github.com/repos/hashikuchi/freecycle/pulls{/number}","milestones_url":"https://api.github.com/repos/hashikuchi/freecycle/milestones{/number}","notifications_url":"https://api.github.com/repos/hashikuchi/freecycle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashikuchi/freecycle/labels{/name}","releases_url":"https://api.github.com/repos/hashikuchi/freecycle/releases{/id}","created_at":"2013-12-11T06:33:41Z","updated_at":"2015-05-07T11:56:29Z","pushed_at":"2015-07-15T04:47:32Z","git_url":"git://github.com/hashikuchi/freecycle.git","ssh_url":"git@github.com:hashikuchi/freecycle.git","clone_url":"https://github.com/hashikuchi/freecycle.git","svn_url":"https://github.com/hashikuchi/freecycle","homepage":null,"size":37044,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":57,"forks":0,"open_issues":57,"watchers":0,"default_branch":"master"}},"base":{"label":"hashikuchi:master","ref":"master","sha":"c4ccfcb0c6b038611b4efe0f351a101af706e78f","user":{"login":"hashikuchi","id":4316388,"avatar_url":"https://avatars.githubusercontent.com/u/4316388?v=3","gravatar_id":"","url":"https://api.github.com/users/hashikuchi","html_url":"https://github.com/hashikuchi","followers_url":"https://api.github.com/users/hashikuchi/followers","following_url":"https://api.github.com/users/hashikuchi/following{/other_user}","gists_url":"https://api.github.com/users/hashikuchi/gists{/gist_id}","starred_url":"https://api.github.com/users/hashikuchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashikuchi/subscriptions","organizations_url":"https://api.github.com/users/hashikuchi/orgs","repos_url":"https://api.github.com/users/hashikuchi/repos","events_url":"https://api.github.com/users/hashikuchi/events{/privacy}","received_events_url":"https://api.github.com/users/hashikuchi/received_events","type":"User","site_admin":false},"repo":{"id":15099935,"name":"freecycle","full_name":"hashikuchi/freecycle","owner":{"login":"hashikuchi","id":4316388,"avatar_url":"https://avatars.githubusercontent.com/u/4316388?v=3","gravatar_id":"","url":"https://api.github.com/users/hashikuchi","html_url":"https://github.com/hashikuchi","followers_url":"https://api.github.com/users/hashikuchi/followers","following_url":"https://api.github.com/users/hashikuchi/following{/other_user}","gists_url":"https://api.github.com/users/hashikuchi/gists{/gist_id}","starred_url":"https://api.github.com/users/hashikuchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashikuchi/subscriptions","organizations_url":"https://api.github.com/users/hashikuchi/orgs","repos_url":"https://api.github.com/users/hashikuchi/repos","events_url":"https://api.github.com/users/hashikuchi/events{/privacy}","received_events_url":"https://api.github.com/users/hashikuchi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hashikuchi/freecycle","description":"Project for TexChange (web service for students trading their textbooks)","fork":false,"url":"https://api.github.com/repos/hashikuchi/freecycle","forks_url":"https://api.github.com/repos/hashikuchi/freecycle/forks","keys_url":"https://api.github.com/repos/hashikuchi/freecycle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashikuchi/freecycle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashikuchi/freecycle/teams","hooks_url":"https://api.github.com/repos/hashikuchi/freecycle/hooks","issue_events_url":"https://api.github.com/repos/hashikuchi/freecycle/issues/events{/number}","events_url":"https://api.github.com/repos/hashikuchi/freecycle/events","assignees_url":"https://api.github.com/repos/hashikuchi/freecycle/assignees{/user}","branches_url":"https://api.github.com/repos/hashikuchi/freecycle/branches{/branch}","tags_url":"https://api.github.com/repos/hashikuchi/freecycle/tags","blobs_url":"https://api.github.com/repos/hashikuchi/freecycle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashikuchi/freecycle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashikuchi/freecycle/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashikuchi/freecycle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashikuchi/freecycle/statuses/{sha}","languages_url":"https://api.github.com/repos/hashikuchi/freecycle/languages","stargazers_url":"https://api.github.com/repos/hashikuchi/freecycle/stargazers","contributors_url":"https://api.github.com/repos/hashikuchi/freecycle/contributors","subscribers_url":"https://api.github.com/repos/hashikuchi/freecycle/subscribers","subscription_url":"https://api.github.com/repos/hashikuchi/freecycle/subscription","commits_url":"https://api.github.com/repos/hashikuchi/freecycle/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashikuchi/freecycle/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashikuchi/freecycle/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashikuchi/freecycle/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashikuchi/freecycle/contents/{+path}","compare_url":"https://api.github.com/repos/hashikuchi/freecycle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashikuchi/freecycle/merges","archive_url":"https://api.github.com/repos/hashikuchi/freecycle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashikuchi/freecycle/downloads","issues_url":"https://api.github.com/repos/hashikuchi/freecycle/issues{/number}","pulls_url":"https://api.github.com/repos/hashikuchi/freecycle/pulls{/number}","milestones_url":"https://api.github.com/repos/hashikuchi/freecycle/milestones{/number}","notifications_url":"https://api.github.com/repos/hashikuchi/freecycle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashikuchi/freecycle/labels{/name}","releases_url":"https://api.github.com/repos/hashikuchi/freecycle/releases{/id}","created_at":"2013-12-11T06:33:41Z","updated_at":"2015-05-07T11:56:29Z","pushed_at":"2015-07-15T04:47:32Z","git_url":"git://github.com/hashikuchi/freecycle.git","ssh_url":"git@github.com:hashikuchi/freecycle.git","clone_url":"https://github.com/hashikuchi/freecycle.git","svn_url":"https://github.com/hashikuchi/freecycle","homepage":null,"size":37044,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":57,"forks":0,"open_issues":57,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashikuchi/freecycle/pulls/226"},"html":{"href":"https://github.com/hashikuchi/freecycle/pull/226"},"issue":{"href":"https://api.github.com/repos/hashikuchi/freecycle/issues/226"},"comments":{"href":"https://api.github.com/repos/hashikuchi/freecycle/issues/226/comments"},"review_comments":{"href":"https://api.github.com/repos/hashikuchi/freecycle/pulls/226/comments"},"review_comment":{"href":"https://api.github.com/repos/hashikuchi/freecycle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashikuchi/freecycle/pulls/226/commits"},"statuses":{"href":"https://api.github.com/repos/hashikuchi/freecycle/statuses/9ae8371ff174a1771a25b3b5e9d79b9f57fc0d81"}}}}