function flickr_tags_cloud in Flickr 7
Same name and namespace in other branches
- 5 tags/flickr_tags.module \flickr_tags_cloud()
- 6 tags/flickr_tags.module \flickr_tags_cloud()
Returns a given user's tags cloud.
1 string reference to 'flickr_tags_cloud'
- flickr_tags_menu in tags/
flickr_tags.module - Implements hook_menu().
File
- tags/
flickr_tags.module, line 61 - The Flickr tags module.
Code
function flickr_tags_cloud($account, $nsid = NULL) {
if (variable_get('flickr_css', 1)) {
drupal_add_css(drupal_get_path('module', 'flickr_tags') . '/flickr_tags.css');
}
drupal_set_title(t('Flickr tags cloud - @name', array(
'@name' => $account->name,
)));
$nsid = $account->flickr['nsid'];
// Get tag info.
$poptag_response = flickr_tags_getlistuserpopular($nsid, variable_get('flickr_tags_in_cloud', 150));
if ($poptag_response === FALSE) {
drupal_set_message(t("Error retrieving %user's tags from Flickr", array(
'%user' => $account->name,
)));
return '';
}
elseif (empty($poptag_response)) {
drupal_set_message(t('%user has no tags', array(
'%user' => $account->name,
)));
return '';
}
$tags = array();
foreach ($poptag_response as $tag) {
$tags[$tag['_content']] = $tag['count'];
}
return theme('flickr_tags_cloud', array(
'uid' => $account->uid,
'nsid' => $nsid,
'tags' => $tags,
));
}