New: history logs high quality access via action.php. A new column

#history.is_high was added. Filter was added on administration history
detail view.

Modification: function get_sql_condition_FandF was slightly refactored for
presentation improvement.


git-svn-id: http://piwigo.org/svn/trunk@1817 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2007-02-14 22:53:02 +00:00
parent 58a359e3c1
commit aabdb3e929
8 changed files with 340 additions and 37 deletions
+97 -4
View File
@@ -606,7 +606,7 @@ function mass_updates($tablename, $dbfields, $datas)
UPDATE '.$tablename.'
SET ';
$is_first = true;
foreach ($dbfields['update'] as $num => $key)
foreach ($dbfields['update'] as $key)
{
if (!$is_first)
{
@@ -625,13 +625,16 @@ function mass_updates($tablename, $dbfields, $datas)
}
$query.= '
WHERE ';
foreach ($dbfields['primary'] as $num => $key)
$is_first = true;
foreach ($dbfields['primary'] as $key)
{
if ($num > 1)
if (!$is_first)
{
$query.= ' AND ';
}
$query.= $key.' = \''.$data[$key].'\'';
$is_first = false;
}
$query.= '
;';
@@ -1901,6 +1904,97 @@ SELECT image_id
associate_images_to_categories($images, $destinations);
}
/**
* Create an XML file with PhpWebGallery informations about a list of
* pictures.
*
* The goal of the export feature is to make easier the reading of
* informations related to pictures outside of PhpWebGallery.
*
* @param array image_ids
*/
function export_pwg_data($image_ids)
{
global $conf;
if (count($image_ids) == 0)
{
return;
}
$fp = fopen($conf['export_file'], 'w');
$xml_string = '<export>'."\n";
$query = '
SELECT tag_id,
image_id
FROM '.IMAGE_TAG_TABLE.'
WHERE image_id IN ('.implode(',', $image_ids).')
;';
$result = pwg_query($query);
$tags_of = array();
$all_tag_ids = array();
$tag_name_of = array();
if (mysql_num_rows($result))
{
while ($row = mysql_fetch_array($result))
{
array_push($all_tag_ids, $row['tag_id']);
if (!isset($tags_of[ $row['image_id'] ])) {
$tags_of[ $row['image_id'] ] = array();
}
array_push(
$tags_of[ $row['image_id'] ],
$row['tag_id']
);
}
$all_tag_ids = array_unique($all_tag_ids);
$query = '
SELECT id,
name
FROM '.TAGS_TABLE.'
WHERE id IN ('.implode(',', $all_tag_ids).')
;';
$result = pwg_query($query);
while ($row = mysql_fetch_array($result))
{
$tag_name_of[ $row['id'] ] = $row['name'];
}
}
$query = '
SELECT id,
path
FROM '.IMAGES_TABLE.'
WHERE id IN ('.implode(',', $image_ids).')
;';
$result = pwg_query($query);
while ($row = mysql_fetch_array($result))
{
$xml_string.= " <photo>\n";
$xml_string.= " <id>".$row['id']."</id>\n";
$xml_string.= " <path>".$row['path']."</path>\n";
foreach ($tags_of[ $row['id'] ] as $tag_id)
{
$xml_string.= " <tag>".$tag_name_of[$tag_id]."</tag>\n";
}
$xml_string.= " </photo>\n";
}
$xml_string.= '</export>';
fwrite($fp, $xml_string);
fclose($fp);
}
/**
* Check configuration and add notes on problem
*
@@ -1937,7 +2031,6 @@ function check_conf()
);
}
}
/**
* Refer main PhpWebGallery URLs (currently PHPWG_DOMAIN domain)
*