use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
+use Friendica\Database\DBA;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Group;
if (local_user() && $a->data['user']['uid'] == local_user()) {
$can_post = true;
+ } else {
+ $can_post = false;
}
if ($ret['success']) {
// Update the photo albums cache
Photo::clearAlbumCache($page_owner_uid);
- $newurl = str_replace(bin2hex($album), bin2hex($newalbum), $_SESSION['photo_return']);
+ $newurl = System::baseUrl() . '/photos/' . $a->user['nickname'] . '/album/' . bin2hex($newalbum);
goaway($newurl);
return; // NOTREACHED
}
$uri = Item::newURI($page_owner_uid);
$arr = [];
- $arr['guid'] = get_guid(32);
+ $arr['guid'] = System::createGUID(32);
$arr['uid'] = $page_owner_uid;
$arr['uri'] = $uri;
$arr['parent-uri'] = $uri;
- $arr['type'] = 'photo';
+ $arr['post-type'] = Item::PT_IMAGE;
$arr['wall'] = 1;
$arr['resource-id'] = $p[0]['resource-id'];
$arr['contact-id'] = $owner_record['id'];
$uri = Item::newURI($page_owner_uid);
$arr = [];
- $arr['guid'] = get_guid(32);
+ $arr['guid'] = System::createGUID(32);
$arr['uid'] = $page_owner_uid;
$arr['uri'] = $uri;
$arr['parent-uri'] = $uri;
- $arr['type'] = 'activity';
$arr['wall'] = 1;
$arr['contact-id'] = $owner_record['id'];
$arr['owner-name'] = $owner_record['name'];
$arr['deny_gid'] = $p[0]['deny_gid'];
$arr['visible'] = 1;
$arr['verb'] = ACTIVITY_TAG;
+ $arr['gravity'] = GRAVITY_PARENT;
$arr['object-type'] = ACTIVITY_OBJ_PERSON;
$arr['target-type'] = ACTIVITY_OBJ_IMAGE;
$arr['tag'] = $tagged[4];
$arr['coord'] = $lat . ' ' . $lon;
}
- $arr['guid'] = get_guid(32);
+ $arr['guid'] = System::createGUID(32);
$arr['uid'] = $page_owner_uid;
$arr['uri'] = $uri;
$arr['parent-uri'] = $uri;
$contact = null;
$remote_contact = false;
$contact_id = 0;
+ $edit = false;
$owner_uid = $a->data['user']['uid'];
$albumselect = '';
- $albumselect .= '<option value="" ' . (!$selname ? ' selected="selected" ' : '') . '> </option>';
+ $albumselect .= '<option value="" ' . (!$selname ? ' selected="selected" ' : '') . '><current year></option>';
if (count($a->data['albums'])) {
foreach ($a->data['albums'] as $album) {
if (($album['album'] === '') || ($album['album'] === 'Contact Photos') || ($album['album'] === L10n::t('Contact Photos'))) {
'$usage' => $usage_message,
'$nickname' => $a->data['user']['nickname'],
'$newalbum' => L10n::t('New album name: '),
- '$existalbumtext' => L10n::t('or existing album name: '),
+ '$existalbumtext' => L10n::t('or select existing album:'),
'$nosharetext' => L10n::t('Do not show a status post for this upload'),
'$albumselect' => $albumselect,
'$permissions' => L10n::t('Permissions'),
}
if ($order_field === 'posted') {
- $order = [L10n::t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album)];
+ $order = [L10n::t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album), 'oldest'];
} else {
- $order = [L10n::t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?f=&order=posted'];
+ $order = [L10n::t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?f=&order=posted', 'newest'];
}
$photos = [];
$link_item = Item::selectFirst([], ['id' => $linked_items[0]['id']]);
$condition = ["`parent` = ? AND `parent` != `id`", $link_item['parent']];
- $a->set_pager_total(dba::count('item', $condition));
+ $a->set_pager_total(DBA::count('item', $condition));
$params = ['order' => ['id'], 'limit' => [$a->pager['start'], $a->pager['itemspage']]];
$result = Item::selectForUser($link_item['uid'], [], $condition, $params);
$comments .= replace_macros($cmnt_tpl, [
'$return_path' => '',
'$jsreload' => $return_url,
- '$type' => 'wall-comment',
'$id' => $link_item['id'],
'$parent' => $link_item['id'],
'$profile_uid' => $owner_uid,
$comments .= replace_macros($cmnt_tpl,[
'$return_path' => '',
'$jsreload' => $return_url,
- '$type' => 'wall-comment',
'$id' => $link_item['id'],
'$parent' => $link_item['id'],
'$profile_uid' => $owner_uid,
$comments .= replace_macros($cmnt_tpl, [
'$return_path' => '',
'$jsreload' => $return_url,
- '$type' => 'wall-comment',
'$id' => $item['item_id'],
'$parent' => $item['parent'],
'$profile_uid' => $owner_uid,