本文整理匯總了PHP中LinkedIn::suggestedGroups方法的典型用法代碼示例。如果您正苦於以下問題:PHP LinkedIn::suggestedGroups方法的具體用法?PHP LinkedIn::suggestedGroups怎麽用?PHP LinkedIn::suggestedGroups使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類LinkedIn
的用法示例。
在下文中一共展示了LinkedIn::suggestedGroups方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: SimpleXMLElement
}
} else {
// request failed
echo "Error retrieving groups memberships: <br /><br />RESPONSE:<br /><br /><pre>" . print_r($response, TRUE) . "</pre>";
}
?>
<hr />
<h3 id="groupsSuggested">Suggested Groups:</h3>
<p>Groups that LinkedIn thinks you might be interested in:</p>
<?php
$OBJ_linkedin->setResponseFormat(LINKEDIN::_RESPONSE_XML);
$response = $OBJ_linkedin->suggestedGroups();
if ($response['success'] === TRUE) {
$suggested = new SimpleXMLElement($response['linkedin']);
$count = 1;
foreach ($suggested as $group) {
$gid = (string) $group->id;
$group_name = $group->name;
$group_open = $group->{'is-open-to-non-members'} == 'true' ? TRUE : FALSE;
?>
<div><span style="font-weight: bold;"><?php
echo $group_name . ' (' . ($group_open ? '' : 'not') . ' open to non-members)';
?>
</span></div>
<?php
if ($count == 1) {
$response = $OBJ_linkedin->group($gid, ':(id,name,short-description,relation-to-viewer:(membership-state,available-actions),is-open-to-non-members,category,contact-email)');