- fill #searches.last_seen column

- small correction on my previous commit (functions_tag.inc.php)
- web service tags.getImages correction

git-svn-id: http://piwigo.org/svn/trunk@1816 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices 2007-02-14 05:45:20 +00:00
parent df3b43d356
commit 58a359e3c1
4 changed files with 8 additions and 14 deletions

View file

@ -258,6 +258,7 @@ SELECT id, name, url_name, count(*) counter
if ($max_tags>0) if ($max_tags>0)
{ {
$query .= ' $query .= '
ORDER BY counter DESC
LIMIT 0,'.$max_tags; LIMIT 0,'.$max_tags;
} }

View file

@ -656,7 +656,6 @@ function ws_session_getStatus($params, &$service)
*/ */
function ws_tags_getList($params, &$service) function ws_tags_getList($params, &$service)
{ {
global $user;
$tags = get_available_tags(); $tags = get_available_tags();
if ($params['sort_by_counter']) if ($params['sort_by_counter'])
{ {
@ -687,7 +686,7 @@ function ws_tags_getList($params, &$service)
function ws_tags_getImages($params, &$service) function ws_tags_getImages($params, &$service)
{ {
@include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); @include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
global $user, $conf; global $conf;
// first build all the tag_ids we are interested in // first build all the tag_ids we are interested in
$tag_ids = array(); $tag_ids = array();
@ -704,6 +703,8 @@ function ws_tags_getImages($params, &$service)
in_array($tag['name'], $params['tag_name']) in_array($tag['name'], $params['tag_name'])
or or
in_array($tag['url_name'], $params['tag_url_name']) in_array($tag['url_name'], $params['tag_url_name'])
or
in_array($tag['id'], $params['tag_id'])
) )
{ {
$tag_ids[] = $tag['id']; $tag_ids[] = $tag['id'];
@ -711,14 +712,6 @@ function ws_tags_getImages($params, &$service)
} }
unset($tags); unset($tags);
foreach( $params['tag_id'] as $tag_id )
{
if ( (int)$tag_id > 0 )
{
$tag_ids[] = $tag_id;
}
}
$tag_ids = array_unique( $tag_ids ); $tag_ids = array_unique( $tag_ids );
$image_ids = array(); $image_ids = array();

View file

@ -37,9 +37,9 @@ $search['q']=$_GET['q'];
$query =' $query ='
INSERT INTO '.SEARCH_TABLE.' INSERT INTO '.SEARCH_TABLE.'
(rules) (rules, last_seen)
VALUES VALUES
(\''.serialize($search).'\') (\''.serialize($search).'\', NOW() )
;'; ;';
pwg_query($query); pwg_query($query);

View file

@ -134,9 +134,9 @@ if (isset($_POST['submit']))
// thumbnails page and picture page. // thumbnails page and picture page.
$query =' $query ='
INSERT INTO '.SEARCH_TABLE.' INSERT INTO '.SEARCH_TABLE.'
(rules) (rules, last_seen)
VALUES VALUES
(\''.serialize($search).'\') (\''.serialize($search).'\', NOW())
;'; ;';
pwg_query($query); pwg_query($query);