本文整理汇总了PHP中Facebook::Post方法的典型用法代码示例。如果您正苦于以下问题:PHP Facebook::Post方法的具体用法?PHP Facebook::Post怎么用?PHP Facebook::Post使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facebook
的用法示例。
在下文中一共展示了Facebook::Post方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: urlencode
}
if (Input::Get("name")) {
$params[] = "name=" . urlencode($spintax->get(Input::Get("name")));
}
if (Input::Get("caption")) {
$params[] = "caption=" . urlencode($spintax->get(Input::Get("caption")));
}
if (Input::Get("description")) {
$params[] = "description=" . urlencode($spintax->get(Input::Get("description")));
}
} else {
if (Input::Get("postType") == "image") {
$params[] = "url=" . $spintax->get(Input::Get("image"));
} else {
if (Input::Get("postType") == "video") {
$params[] = "file_url=" . $spintax->get(Input::Get("file_url"));
if (Input::Get("message")) {
$params[] = "title=" . urlencode($spintax->get(Input::Get("message")));
}
if (Input::Get("description")) {
$params[] = "description=" . urlencode($spintax->get(Input::Get("description")));
}
}
}
}
if ($result = $fb->Post(Input::get("groupID"), $params, Input::Get("postType"))) {
echo json_encode($result, 128);
}
} else {
echo json_encode(array('error' => lang('EMPTY_REQUEST')), 128);
}
示例2: urlencode
$params[] = "url=" . urlencode($spintax->get($postParam->image));
}
if ($postType == "video") {
$params[] = "file_url=" . urlencode($spintax->get($postParam->video));
if ($postParam->description != "") {
$params[] = "description=" . urlencode($spintax->get($postParam->description));
}
}
// Get app accessToken
$accessToken = $fb->getAccessToken($scheduled->post_app, $scheduled->fb_account, $scheduled->userid);
// Test access token
if (!$fb->IsATValid($accessToken)) {
logs::Save($scheduled->id, lang('INVALID_ACCESS_TOKEN'));
} else {
// Send post and get the result
$result = (object) $fb->Post($groups[$scheduled->next_target], $params, $postType, $accessToken);
// Save log
if (isset($result->status)) {
if (isset($result->id)) {
logs::Save($scheduled->id, "<a href='https://www.facebook.com/" . $result->id . "' target='_blank'><span class='glyphicon glyphicon-ok'></span> " . lang('VIEW_POST') . " </a>");
} else {
if ($groups[$scheduled->next_target] == "me") {
logs::Save($scheduled->id, "Your timeline - " . $result->message);
} else {
logs::Save($scheduled->id, $result->message . " <a href='https://www.facebook.com/groups/" . $groups[$scheduled->next_target] . "' target='_blank'><span class='glyphicon glyphicon-eye-open'></span> " . lang('VISIT_GROUP') . " </a>");
}
}
} else {
logs::Save($scheduled->id, lang('UNKNOWN_ERROR'));
}
}