0) # Don't show the option if the collection is empty. { $lang_string=$lang["publish_to_flickr"]; $unpublished = ps_value("select count(*) value from resource join collection_resource on resource.ref = collection_resource.resource where collection_resource.collection = ? and flickr_photo_id is null", array("i",$collection_data["ref"]), 0); if ($unpublished>0) { $lang_string.=" (" . ($unpublished==1 ? $lang["unpublished-1"] : str_replace("%number", $unpublished, $lang["unpublished-2"])) . ")"; } $data_attribute['url'] = sprintf('%splugins/flickr_theme_publish/pages/sync.php?theme=%s', $baseurl_short, urlencode($collection_data["ref"]) ); // Add new option $c=count($options); $options[$c]['value']='flickr_publish'; $options[$c]['label']=$lang_string; $options[$c]['data_attr']=$data_attribute; $options[$c]['category']=ACTIONGROUP_ADVANCED; return $options; } }