upstream fixes and a lot of taxonomy stuff

This commit is contained in:
friendica
2012-07-10 06:28:02 -07:00
parent 1215de575d
commit 94fabe3a29
10 changed files with 32 additions and 16 deletions

View File

@@ -1328,10 +1328,14 @@ function file_tag_decode($s) {
function file_tag_file_query($table,$s,$type = 'file') {
if($type == 'file')
$str = preg_quote( '[' . str_replace('%','%%',file_tag_encode($s)) . ']' );
$termtype = TERM_FILE;
else
$str = preg_quote( '<' . str_replace('%','%%',file_tag_encode($s)) . '>' );
return " AND " . (($table) ? dbesc($table) . '.' : '') . "file regexp '" . dbesc($str) . "' ";
$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 ) ",
intval($termtype),
protect_sprintf(dbesc($s))
);
}
// ex. given music,video return <music><video> or [music][video]