return; // NOTREACHED
}
- $r = q("SELECT `album` FROM `photo` WHERE `album` = '%s' AND `uid` = %d",
- DBA::escape($album),
- intval($page_owner_uid)
- );
-
- if (!DBA::isResult($r)) {
+ if (!DBA::exists('photo', ['album' => $album, 'uid' => $page_owner_uid])) {
notice(DI::l10n()->t('Album not found.'));
DI::baseUrl()->redirect('photos/' . $user['nickname'] . '/album');
return; // NOTREACHED
}
if (!empty($_POST['rotate']) && (intval($_POST['rotate']) == 1 || intval($_POST['rotate']) == 2)) {
- Logger::log('rotate');
+ Logger::notice('rotate');
$photo = Photo::getPhotoForUser($page_owner_uid, $resource_id);
$type = Images::getMimeTypeBySource($src, $filename, $type);
- Logger::log('photos: upload: received file: ' . $filename . ' as ' . $src . ' ('. $type . ') ' . $filesize . ' bytes', Logger::DEBUG);
+ Logger::info('photos: upload: received file: ' . $filename . ' as ' . $src . ' ('. $type . ') ' . $filesize . ' bytes');
$maximagesize = DI::config()->get('system', 'maximagesize');
return;
}
- Logger::log('mod/photos.php: photos_post(): loading the contents of ' . $src , Logger::DEBUG);
+ Logger::info('loading the contents of ' . $src);
$imagedata = @file_get_contents($src);
$image = new Image($imagedata, $type);
if (!$image->isValid()) {
- Logger::log('mod/photos.php: photos_post(): unable to process image' , Logger::DEBUG);
+ Logger::info('unable to process image');
notice(DI::l10n()->t('Unable to process image.'));
@unlink($src);
$foo = 0;
$r = Photo::store($image, $page_owner_uid, $visitor, $resource_id, $filename, $album, 0 , 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
if (!$r) {
- Logger::log('mod/photos.php: photos_post(): image store failed', Logger::DEBUG);
+ Logger::info('image store failed');
notice(DI::l10n()->t('Image upload failed.'));
return;
}
$drop_url = DI::args()->getQueryString();
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
- '$method' => 'post',
- '$message' => DI::l10n()->t('Do you really want to delete this photo album and all its photos?'),
- '$confirm' => DI::l10n()->t('Delete Album'),
- '$confirm_url' => $drop_url,
- '$confirm_name' => 'dropalbum',
+ '$l10n' => [
+ 'message' => DI::l10n()->t('Do you really want to delete this photo album and all its photos?'),
+ 'confirm' => DI::l10n()->t('Delete Album'),
+ 'cancel' => DI::l10n()->t('Cancel'),
+ ],
+ '$method' => 'post',
+ '$confirm_url' => $drop_url,
+ '$confirm_name' => 'dropalbum',
'$confirm_value' => 'dropalbum',
- '$cancel' => DI::l10n()->t('Cancel'),
]);
}
$drop_url = DI::args()->getQueryString();
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
- '$method' => 'post',
- '$message' => DI::l10n()->t('Do you really want to delete this photo?'),
- '$confirm' => DI::l10n()->t('Delete Photo'),
- '$confirm_url' => $drop_url,
- '$confirm_name' => 'delete',
+ '$l10n' => [
+ 'message' => DI::l10n()->t('Do you really want to delete this photo?'),
+ 'confirm' => DI::l10n()->t('Delete Photo'),
+ 'cancel' => DI::l10n()->t('Cancel'),
+ ],
+ '$method' => 'post',
+ '$confirm_url' => $drop_url,
+ '$confirm_name' => 'delete',
'$confirm_value' => 'delete',
- '$cancel' => DI::l10n()->t('Cancel'),
]);
}