質問編集履歴

1

ソースのタグを使いました。

2015/07/09 08:49

投稿

venturer_level1
venturer_level1

スコア15

test CHANGED
File without changes
test CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
 
22
22
 
23
- ==以下ソース==
23
+ ```lang-php
24
24
 
25
25
  require_once('facebook.php');
26
26
 
@@ -28,47 +28,51 @@
28
28
 
29
29
  $app = array(
30
30
 
31
- 'appId' => 'appId',
31
+ 'appId' => 'appId',
32
32
 
33
- 'secret' => 'secret',
33
+ 'secret' => 'secret',
34
34
 
35
35
  );
36
+
37
+
36
38
 
37
39
  $facebook = new Facebook($app);
38
40
 
39
41
  $fb_user = $facebook->getUser();
40
42
 
43
+
44
+
41
45
  if ($fb_user) {
42
46
 
43
- $text = str_replace('##replace_str##', $replace_str, $default_message);
47
+ $text = str_replace('##replace_str##', $replace_str, $default_message);
44
48
 
45
- $data = array(
49
+ $data = array(
46
50
 
47
- 'access_token' => $facebook->getAccessToken(),
51
+ 'access_token' => $facebook->getAccessToken(),
48
52
 
49
- 'message' => $text
53
+ 'message' => $text
50
54
 
51
55
  );
52
56
 
53
- $response = $facebook->api('/me/feed', 'post', $data);
57
+ $response = $facebook->api('/me/feed', 'post', $data);
54
58
 
55
- header("Location: https://www.facebook.com/");
59
+ header("Location: https://www.facebook.com/");
56
60
 
57
61
  } else {
58
62
 
59
- $loginUrl = $facebook->getLoginUrl(array(
63
+ $loginUrl = $facebook->getLoginUrl(array(
60
64
 
61
- 'scope' => 'publish_actions',
65
+ 'scope' => 'publish_actions',
62
66
 
63
- 'redirect_uri' => "http://". $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"]
67
+ 'redirect_uri' => "http://". $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"]
64
68
 
65
- ));
69
+ ));
66
70
 
67
- header("Location: " . $loginUrl);
71
+ header("Location: " . $loginUrl);
68
72
 
69
73
  }
70
74
 
71
- ==以上ソース==
75
+ ```
72
76
 
73
77
 
74
78