- 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
This commit is contained in:
plegall
2004-11-16 23:38:34 +00:00
parent 973e0f8806
commit 1bf3753f14
15 changed files with 103 additions and 170 deletions
+3 -5
View File
@@ -66,7 +66,7 @@ while ( $row = mysql_fetch_array( $result ) )
$name = get_cat_display_name($cat_infos['name'],'<br />','',false);
$query = '
SELECT id,file,tn_ext,storage_category_id
SELECT path,file,tn_ext
FROM '.IMAGES_TABLE.', '.IMAGE_CATEGORY_TABLE.'
WHERE category_id = '.$row['category_id'].'
AND date_available > SUBDATE(CURRENT_DATE
@@ -75,11 +75,9 @@ SELECT id,file,tn_ext,storage_category_id
ORDER BY RAND()
LIMIT 0,1
;';
$subrow = mysql_fetch_array( pwg_query( $query ) );
$subrow = mysql_fetch_array(pwg_query($query));
$thumbnail_src = get_thumbnail_src($subrow['file'],
$subrow['storage_category_id'],
@$subrow['tn_ext']);
$thumbnail_src = get_thumbnail_src($subrow['path'], @$subrow['tn_ext']);
$url_link = PHPWG_ROOT_PATH.'category.php?cat='.$row['category_id'];