- display author and and author url (if present) on plugin admin page
 - uniformized versions/authors... for all plugins in svn
 - security fix (html escape name, version, uri, author... to avoid javascript injection which could automatically simulate click on Install)
 - added confirmation for install/uninstall plugins

Web services:
 - web service explorer now caches method details in order to avoid unnecessary web calls
 - web service explorer can now send parameters as arrays
 - web service explorer uses now prototype.js version 1.5
 - small improvements

- added and use function bad_request (sends http status code 400)

git-svn-id: http://piwigo.org/svn/trunk@1852 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2007-02-23 13:18:34 +00:00
parent 6f03e29735
commit cb2408a82c
15 changed files with 1394 additions and 547 deletions
+61
View File
@@ -271,4 +271,65 @@ SELECT id, name, url_name, count(*) counter
usort($tags, 'name_compare');
return $tags;
}
/**
* return a list of tags corresponding to any of ids, url_names, names
*
* @param array ids
* @param array url_names
* @param array names
* @return array
*/
function find_tags($ids, $url_names=array(), $names=array() )
{
$where_clauses = array();
if ( !empty($ids) )
{
$where_clauses[] = 'id IN ('.implode(',', $ids).')';
}
if ( !empty($url_names) )
{
$where_clauses[] =
'url_name IN ('.
implode(
',',
array_map(
create_function('$s', 'return "\'".$s."\'";'),
$url_names
)
)
.')';
}
if ( !empty($names) )
{
$where_clauses[] =
'name IN ('.
implode(
',',
array_map(
create_function('$s', 'return "\'".$s."\'";'),
$names
)
)
.')';
}
if (empty($where_clauses))
{
return array();
}
$query = '
SELECT id, url_name, name
FROM '.TAGS_TABLE.'
WHERE '. implode( '
OR ', $where_clauses);
$result = pwg_query($query);
$tags = array();
while ($row = mysql_fetch_assoc($result))
{
array_push($tags, $row);
}
return $tags;
}
?>