Merge pull request #7448 from friendica/Photo-select-patch

Replace remaining Photo::select by new Photo::selectToArray
This commit is contained in:
Hypolite Petovan 2019-07-29 13:43:29 -04:00 committed by GitHub
commit 7f08f5be71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 9 deletions

View file

@ -635,7 +635,7 @@ function photos_post(App $a)
* they acquire comments, likes, dislikes, and/or tags * they acquire comments, likes, dislikes, and/or tags
*/ */
$r = Photo::select([], ['`album` = ? AND `uid` = ? AND `created` > UTC_TIMESTAMP() - INTERVAL 3 HOUR', $album, $page_owner_uid]); $r = Photo::selectToArray([], ['`album` = ? AND `uid` = ? AND `created` > UTC_TIMESTAMP() - INTERVAL 3 HOUR', $album, $page_owner_uid]);
if (!DBA::isResult($r) || ($album == L10n::t('Profile Photos'))) { if (!DBA::isResult($r) || ($album == L10n::t('Profile Photos'))) {
$visible = 1; $visible = 1;

View file

@ -192,14 +192,7 @@ function profile_photo_content(App $a)
$resource_id = $a->argv[2]; $resource_id = $a->argv[2];
//die(":".local_user()); //die(":".local_user());
$r = Photo::select([], ["resource-id" => $resource_id, "uid" => local_user()], ["order" => ["scale"=>false]]); $r = Photo::selectToArray([], ["resource-id" => $resource_id, "uid" => local_user()], ["order" => ["scale" => false]]);
/*
$r = q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' ORDER BY `scale` ASC", intval(local_user()),
DBA::escape($resource_id)
);
*/
if (!DBA::isResult($r)) { if (!DBA::isResult($r)) {
notice(L10n::t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;