/**
* @file mod/photos.php
*/
+
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\Nav;
use Friendica\Core\Addon;
+use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
-use Friendica\Core\Config;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Group;
+use Friendica\Model\Item;
use Friendica\Model\Photo;
use Friendica\Model\Profile;
use Friendica\Network\Probe;
use Friendica\Object\Image;
use Friendica\Protocol\DFRN;
+use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Map;
require_once 'include/items.php';
require_once 'include/acl_selectors.php';
if (DBM::is_result($r)) {
foreach ($r as $rr) {
q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
- dbesc(datetime_convert()),
+ dbesc(DateTimeFormat::utcNow()),
dbesc($rr['parent-uri']),
intval($page_owner_uid)
);
);
if (DBM::is_result($i)) {
q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
+ dbesc(DateTimeFormat::utcNow()),
+ dbesc(DateTimeFormat::utcNow()),
dbesc($i[0]['uri']),
intval($page_owner_uid)
);
$resource_id = $a->argv[2];
if (!strlen($albname)) {
- $albname = datetime_convert('UTC',date_default_timezone_get(),'now', 'Y');
+ $albname = DateTimeFormat::localNow('Y');
}
if (x($_POST,'rotate') !== false &&
. '[img]' . System::baseUrl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.'. $ext . '[/img]'
. '[/url]';
- $item_id = item_store($arr);
+ $item_id = Item::insert($arr);
}
if ($item_id) {
$r = q("UPDATE `item` SET `tag` = '%s', `inform` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d",
dbesc($newtag),
dbesc($newinform),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
+ dbesc(DateTimeFormat::utcNow()),
+ dbesc(DateTimeFormat::utcNow()),
intval($item_id),
intval($page_owner_uid)
);
. System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '</id>';
$arr['target'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '" />' . "\n" . '<link rel="preview" type="'.$p[0]['type'].'" href="' . System::baseUrl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
- $item_id = item_store($arr);
+ $item_id = Item::insert($arr);
if ($item_id) {
Worker::add(PRIORITY_HIGH, "Notifier", "tag", $item_id);
}
if (strlen($newalbum)) {
$album = $newalbum;
} else {
- $album = datetime_convert('UTC',date_default_timezone_get(),'now', 'Y');
+ $album = DateTimeFormat::localNow('Y');
}
}
. '[img]' . System::baseUrl() . "/photo/{$photo_hash}-{$smallest}.".$Image->getExt() . '[/img]'
. '[/url]';
- $item_id = item_store($arr);
+ $item_id = Item::insert($arr);
// Update the photo albums cache
Photo::clearAlbumCache($page_owner_uid);
$photo = [
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
'title'=> L10n::t('View Full Size'),
- 'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis'),
+ 'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . DateTimeFormat::utcNow('ymdhis'),
'height' => $hires['height'],
'width' => $hires['width'],
'album' => $hires['album'],
'$caption' => ['desc', L10n::t('Caption'), $caption_e, ''],
'$tags' => ['newtag', L10n::t('Add a Tag'), "", L10n::t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping')],
'$rotate_none' => ['rotate', L10n::t('Do not rotate'),0,'', true],
- '$rotate_cw' => ['rotate', L10n::t('Rotate CW (right)'),1,''],
- '$rotate_ccw' => ['rotate', L10n::t('Rotate CCW (left)'),2,''],
+ '$rotate_cw' => ['rotate', L10n::t("Rotate CW \x28right\x29"),1,''],
+ '$rotate_ccw' => ['rotate', L10n::t("Rotate CCW \x28left\x29"),2,''],
'$nickname' => $a->data['user']['nickname'],
'$resource_id' => $ph[0]['resource-id'],