diff options
author | redmatrix <git@macgirvin.com> | 2016-06-19 19:12:33 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-06-19 19:12:33 -0700 |
commit | fb61c4fb3497d3751bb43f12cadee9e9c7776be9 (patch) | |
tree | 604989e10424456783fccff1fccc5b14da26db7f /include/taxonomy.php | |
parent | bfaabfb7b5ff639992a01b0e1fc374cd43d536e9 (diff) | |
parent | 4578649f758e65f1d87ebb98da7cd891d0b90d0d (diff) | |
download | volse-hubzilla-fb61c4fb3497d3751bb43f12cadee9e9c7776be9.tar.gz volse-hubzilla-fb61c4fb3497d3751bb43f12cadee9e9c7776be9.tar.bz2 volse-hubzilla-fb61c4fb3497d3751bb43f12cadee9e9c7776be9.zip |
Merge branch '1.8RC'
Diffstat (limited to 'include/taxonomy.php')
-rw-r--r-- | include/taxonomy.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/include/taxonomy.php b/include/taxonomy.php index e43f5e5d0..177215fe8 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -20,7 +20,7 @@ function file_tag_file_query($table,$s,$type = 'file') { else $termtype = TERM_CATEGORY; - return sprintf(" AND " . (($table) ? dbesc($table) . '.' : '') . "id in (select term.oid from term where term.type = %d and term.term = '%s' and term.uid = " . (($table) ? dbesc($table) . '.' : '') . "uid ) ", + return sprintf(" AND " . (($table) ? dbesc($table) . '.' : '') . "id in (select term.oid from term where term.ttype = %d and term.term = '%s' and term.uid = " . (($table) ? dbesc($table) . '.' : '') . "uid ) ", intval($termtype), protect_sprintf(dbesc($s)) ); @@ -29,14 +29,14 @@ function file_tag_file_query($table,$s,$type = 'file') { function term_query($table,$s,$type = TERM_UNKNOWN, $type2 = '') { if($type2) { - return sprintf(" AND " . (($table) ? dbesc($table) . '.' : '') . "id in (select term.oid from term where term.type in (%d, %d) and term.term = '%s' and term.uid = " . (($table) ? dbesc($table) . '.' : '') . "uid ) ", + return sprintf(" AND " . (($table) ? dbesc($table) . '.' : '') . "id in (select term.oid from term where term.ttype in (%d, %d) and term.term = '%s' and term.uid = " . (($table) ? dbesc($table) . '.' : '') . "uid ) ", intval($type), intval($type2), protect_sprintf(dbesc($s)) ); } else { - return sprintf(" AND " . (($table) ? dbesc($table) . '.' : '') . "id in (select term.oid from term where term.type = %d and term.term = '%s' and term.uid = " . (($table) ? dbesc($table) . '.' : '') . "uid ) ", + return sprintf(" AND " . (($table) ? dbesc($table) . '.' : '') . "id in (select term.oid from term where term.ttype = %d and term.term = '%s' and term.uid = " . (($table) ? dbesc($table) . '.' : '') . "uid ) ", intval($type), protect_sprintf(dbesc($s)) ); @@ -49,7 +49,7 @@ function store_item_tag($uid,$iid,$otype,$type,$term,$url = '') { return false; $r = q("select * from term - where uid = %d and oid = %d and otype = %d and type = %d + where uid = %d and oid = %d and otype = %d and ttype = %d and term = '%s' and url = '%s' ", intval($uid), intval($iid), @@ -61,7 +61,7 @@ function store_item_tag($uid,$iid,$otype,$type,$term,$url = '') { if($r) return false; - $r = q("insert into term (uid, oid, otype, type, term, url) + $r = q("insert into term (uid, oid, otype, ttype, term, url) values( %d, %d, %d, %d, '%s', '%s') ", intval($uid), intval($iid), @@ -85,7 +85,7 @@ function get_terms_oftype($arr,$type) { foreach($type as $t) foreach($arr as $x) - if($x['type'] == $t) + if($x['ttype'] == $t) $ret[] = $x; return $ret; @@ -93,9 +93,9 @@ function get_terms_oftype($arr,$type) { function format_term_for_display($term) { $s = ''; - if(($term['type'] == TERM_HASHTAG) || ($term['type'] == TERM_COMMUNITYTAG)) + if(($term['ttype'] == TERM_HASHTAG) || ($term['ttype'] == TERM_COMMUNITYTAG)) $s .= '#'; - elseif($term['type'] == TERM_MENTION) + elseif($term['ttype'] == TERM_MENTION) $s .= '@'; else return $s; @@ -142,7 +142,7 @@ function tagadelic($uid, $count = 0, $authors = '', $owner = '', $flags = 0, $re // Fetch tags $r = q("select term, count(term) as total from term left join item on term.oid = item.id - where term.uid = %d and term.type = %d + where term.uid = %d and term.ttype = %d and otype = %d and item_type = %d and item_private = 0 $sql_options $item_normal group by term order by total desc %s", |