예제 #1
0
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;
}
예제 #2
0
파일: items.php 프로젝트: bashrc/hubzilla
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;
}