aboutsummaryrefslogtreecommitdiffstats
path: root/admin/remote_site.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2004-11-16 23:38:34 +0000
committerplegall <plg@piwigo.org>2004-11-16 23:38:34 +0000
commit1bf3753f1449eedc4bd39c79b6ca17dc4f396e76 (patch)
tree7d7443b94356cd18a038b3f104f6e21a35d01279 /admin/remote_site.php
parent973e0f8806cd6d569c01977ad5112e16cc7a7f6f (diff)
- images.path column added to reduce database access
- function mass_inserts moved from admin/remote_sites.php to admin/include/function.php - function mass_inserts used in admin/update.php git-svn-id: http://piwigo.org/svn/trunk@606 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/remote_site.php52
1 files changed, 3 insertions, 49 deletions
diff --git a/admin/remote_site.php b/admin/remote_site.php
index 5aaf1a08f..082658ab0 100644
--- a/admin/remote_site.php
+++ b/admin/remote_site.php
@@ -112,53 +112,6 @@ SELECT id,dir
}
/**
- * inserts multiple lines in a table
- *
- * @param string table_name
- * @param array dbields
- * @param array inserts
- * @return void
- */
-function mass_inserts($table_name, $dbfields, $inserts)
-{
- // inserts all found categories
- $query = '
-INSERT INTO '.$table_name.'
- ('.implode(',', $dbfields).')
- VALUES';
- foreach ($inserts as $insert_id => $insert)
- {
- $query.= '
- ';
- if ($insert_id > 0)
- {
- $query.= ',';
- }
- $query.= '(';
- foreach ($dbfields as $field_id => $dbfield)
- {
- if ($field_id > 0)
- {
- $query.= ',';
- }
-
- if (!isset($insert[$dbfield]) or $insert[$dbfield] == '')
- {
- $query.= 'NULL';
- }
- else
- {
- $query.= "'".$insert[$dbfield]."'";
- }
- }
- $query.=')';
- }
- $query.= '
-;';
- pwg_query($query);
-}
-
-/**
* read $listing_file and update a remote site according to its id
*
* @param string listing_file
@@ -418,7 +371,8 @@ SELECT file
'author',
'keywords',
'name',
- 'comment');
+ 'comment',
+ 'path');
foreach ($optional_atts as $att)
{
if (getAttribute($xml_element, $att) != '')
@@ -434,7 +388,7 @@ SELECT file
{
$dbfields = array('file','storage_category_id','date_available','tn_ext',
'filesize','width','height','date_creation','author',
- 'keywords','name','comment');
+ 'keywords','name','comment','path');
mass_inserts(IMAGES_TABLE, $dbfields, $inserts);
$counts{'new_elements'}+= count($inserts);