function encode_item_terms($terms) { $ret = array(); $allowed_export_terms = array(TERM_UNKNOWN, TERM_HASHTAG, TERM_MENTION, TERM_CATEGORY, TERM_BOOKMARK); if ($terms) { foreach ($terms as $term) { if (in_array($term['type'], $allowed_export_terms)) { $ret[] = array('tag' => $term['term'], 'url' => $term['url'], 'type' => termtype($term['type'])); } } } return $ret; }
function encode_item_terms($terms, $mirror = false) { $ret = array(); $allowed_export_terms = array(TERM_UNKNOWN, TERM_HASHTAG, TERM_MENTION, TERM_CATEGORY, TERM_BOOKMARK, TERM_COMMUNITYTAG); if ($mirror) { $allowed_export_terms[] = TERM_PCATEGORY; $allowed_export_terms[] = TERM_FILE; } if ($terms) { foreach ($terms as $term) { if (in_array($term['type'], $allowed_export_terms)) { $ret[] = array('tag' => $term['term'], 'url' => $term['url'], 'type' => termtype($term['type'])); } } } return $ret; }