function photos_admin_update in Album Photos 6.2
1 string reference to 'photos_admin_update'
- photos_menu in ./
photos.module
File
- inc/
photos.admin.inc, line 545
Code
function photos_admin_update() {
if ($_GET['count'] == true) {
_photos_res_count();
drupal_set_message(t('Update is complete.'));
return drupal_goto('admin/settings/photos');
}
$v = l(t('Thumbnail-size bulk update'), 'admin/settings/photos/update', array(
'query' => array(
'update' => 'true',
'limit' => 0,
),
)) . '<p>' . t('Normally, you do not need to update it.') . '</p>';
if ($_GET['update'] == 'true') {
if (!ini_get('safe_mode') && function_exists('set_time_limit')) {
set_time_limit(0);
$limit = 100;
}
else {
$limit = 50;
}
$result = db_query_range('SELECT f.filepath, f.fid FROM {files} f INNER JOIN {x_image} i ON f.fid = i.fid ORDER BY f.fid ASC', $_GET['limit'], $limit);
$i = 0;
while ($file = db_fetch_object($result)) {
photos_image_crop(array(
'path' => $file->filepath,
'fid' => $file->fid,
));
$i++;
}
if ($i) {
drupal_set_message(t('Update the %num images. Please wait, the next group is being updated ...', array(
'%num' => $i,
)));
$url = url('admin/settings/photos/update', array(
'query' => array(
'update' => 'true',
'limit' => $_GET['limit'] + $limit,
),
));
drupal_add_js(<<<EOT
\$(function(){
location = "{<span class="php-variable">$url</span>}";
});
EOT
, 'inline');
}
else {
drupal_set_message(t('Update is complete.'));
drupal_goto('admin/settings/photos/update');
}
}
return $v;
}