forked from Public/pics
Allow all users to create and link people tags.
This commit is contained in:
@@ -226,6 +226,9 @@ class Tag
|
||||
if (!isset($data['id_parent']))
|
||||
$data['id_parent'] = 0;
|
||||
|
||||
if (!isset($data['description']))
|
||||
$data['description'] = 0;
|
||||
|
||||
if (!isset($data['count']))
|
||||
$data['count'] = 0;
|
||||
|
||||
@@ -297,6 +300,23 @@ class Tag
|
||||
['tokens' => '%' . strtolower(implode('%', $tokens)) . '%']);
|
||||
}
|
||||
|
||||
public static function matchPeople($tokens)
|
||||
{
|
||||
if (!is_array($tokens))
|
||||
$tokens = explode(' ', $tokens);
|
||||
|
||||
return Registry::get('db')->queryPair('
|
||||
SELECT id_tag, tag
|
||||
FROM tags
|
||||
WHERE LOWER(tag) LIKE {string:tokens} AND
|
||||
kind = {string:person}
|
||||
ORDER BY tag ASC',
|
||||
[
|
||||
'tokens' => '%' . strtolower(implode('%', $tokens)) . '%',
|
||||
'person' => 'Person',
|
||||
]);
|
||||
}
|
||||
|
||||
public static function exactMatch($tag)
|
||||
{
|
||||
if (!is_string($tag))
|
||||
|
||||
Reference in New Issue
Block a user