mirror of
https://github.com/friendica/friendica
synced 2025-05-05 21:44:11 +02:00
New photo field "photo-type" as preparation for banners
This commit is contained in:
parent
86947b0997
commit
13827edd2c
15 changed files with 80 additions and 60 deletions
|
@ -59,7 +59,7 @@ class Expire
|
|||
|
||||
Logger::notice('start expiry');
|
||||
|
||||
$r = DBA::p("SELECT `uid`, `username` FROM `user` WHERE `expire` != 0");
|
||||
$r = DBA::select('user', ['uid', 'username'], ["`expire` != ?", 0]);
|
||||
while ($row = DBA::fetch($r)) {
|
||||
Logger::info('Calling expiry', ['user' => $row['uid'], 'username' => $row['username']]);
|
||||
Worker::add(['priority' => $a->getQueueValue('priority'), 'created' => $a->getQueueValue('created'), 'dont_fork' => true],
|
||||
|
|
|
@ -36,7 +36,7 @@ class ExpireConversations
|
|||
return;
|
||||
}
|
||||
|
||||
DBA::p("DELETE FROM `conversation` WHERE `received` < UTC_TIMESTAMP() - INTERVAL ? DAY", $days);
|
||||
DBA::e("DELETE FROM `conversation` WHERE `received` < UTC_TIMESTAMP() - INTERVAL ? DAY", $days);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ class RemoveUnusedAvatars
|
|||
$contacts = DBA::select('contact', ['id'], $condition);
|
||||
while ($contact = DBA::fetch($contacts)) {
|
||||
Contact::update(['photo' => '', 'thumb' => '', 'micro' => ''], ['id' => $contact['id']]);
|
||||
Photo::delete(['contact-id' => $contact['id'], 'album' => Photo::CONTACT_PHOTOS]);
|
||||
Photo::delete(['contact-id' => $contact['id'], 'photo-type' => [Photo::CONTACT_AVATAR, Photo::CONTACT_BANNER]]);
|
||||
if ((++$count % 1000) == 0) {
|
||||
if (!Worker::isInMaintenanceWindow()) {
|
||||
Logger::notice('We are outside of the maintenance window, quitting');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue