mirror of
https://github.com/friendica/friendica
synced 2025-04-26 19:50:10 +00:00
Some easy to replace "q" calls have been replaced by "DBA" calls (#5632)
* Some easy to replace "q" calls have been replaced by "DBA" calls * Simplified the GUID creation * And one in the API ... * And OStatus has got some DBA calls more * Just some more replaced database calls * The event query is now simplified * Events are now shown again * subthread is now using the DBA calls as well * Some more replaced database calls * And some more replaced database calls and prevented notices * Better use gravity * Some more replaced database stuff * Some more replaced database calls in DFRN.php * The gcontact class now has got the new DBA functions as well * The Contact class is now changed to new database functions as well * Small correction * We can now delete without cascade * One more functionality is safe for future changes
This commit is contained in:
parent
dfe4413463
commit
7f3fb34c24
21 changed files with 275 additions and 501 deletions
|
@ -550,10 +550,13 @@ class Event extends BaseObject
|
|||
$fmt = L10n::t('l, F j');
|
||||
foreach ($event_result as $event) {
|
||||
$item = Item::selectFirst(['plink', 'author-name', 'author-avatar', 'author-link'], ['id' => $event['itemid']]);
|
||||
if (DBA::isResult($item)) {
|
||||
$event = array_merge($event, $item);
|
||||
if (!DBA::isResult($item)) {
|
||||
// Using default values when no item had been found
|
||||
$item = ['plink' => '', 'author-name' => '', 'author-avatar' => '', 'author-link' => ''];
|
||||
}
|
||||
|
||||
$event = array_merge($event, $item);
|
||||
|
||||
$start = $event['adjust'] ? DateTimeFormat::local($event['start'], 'c') : DateTimeFormat::utc($event['start'], 'c');
|
||||
$j = $event['adjust'] ? DateTimeFormat::local($event['start'], 'j') : DateTimeFormat::utc($event['start'], 'j');
|
||||
$day = $event['adjust'] ? DateTimeFormat::local($event['start'], $fmt) : DateTimeFormat::utc($event['start'], $fmt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue