X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fphotos.php;h=d4b2a3b19f9169c7af633540aa4e86f07ecf1bc2;hb=c99247ddabe7e8383aa86f94d4ffae73e382a710;hp=1ef43f423ab3f6105eb63094a114b9af8a8977b8;hpb=d4c3dcf2fccefcb2c79881be09fd3b1c73dc611a;p=friendica.git diff --git a/mod/photos.php b/mod/photos.php index 1ef43f423a..d4b2a3b19f 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -10,7 +10,7 @@ require_once('include/tags.php'); require_once('include/threads.php'); require_once('include/Probe.php'); -function photos_init(&$a) { +function photos_init(App &$a) { if ($a->argc > 1) auto_redir($a, $a->argv[1]); @@ -112,7 +112,7 @@ function photos_init(&$a) { -function photos_post(&$a) { +function photos_post(App &$a) { logger('mod-photos: photos_post: begin' , LOGGER_DEBUG); @@ -255,7 +255,7 @@ function photos_post(&$a) { ); } if (dbm::is_result($r)) { - foreach($r as $rr) { + foreach ($r as $rr) { $res[] = "'" . dbesc($rr['rid']) . "'" ; } } else { @@ -277,7 +277,7 @@ function photos_post(&$a) { intval($page_owner_uid) ); if (dbm::is_result($r)) { - foreach($r as $rr) { + foreach ($r as $rr) { q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d", dbesc(datetime_convert()), dbesc($rr['parent-uri']), @@ -346,7 +346,7 @@ function photos_post(&$a) { dbesc($r[0]['resource-id']), intval($page_owner_uid) ); - if (count($i)) { + 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()), @@ -356,7 +356,7 @@ function photos_post(&$a) { create_tags_from_itemuri($i[0]['uri'], $page_owner_uid); delete_thread_uri($i[0]['uri'], $page_owner_uid); - $url = $a->get_baseurl(); + $url = App::get_baseurl(); $drop_id = intval($i[0]['id']); if ($i[0]['visible']) @@ -496,8 +496,8 @@ function photos_post(&$a) { $arr['visible'] = $visibility; $arr['origin'] = 1; - $arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $p[0]['resource-id'] . ']' - . '[img]' . $a->get_baseurl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.'. $ext . '[/img]' + $arr['body'] = '[url=' . App::get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $p[0]['resource-id'] . ']' + . '[img]' . App::get_baseurl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.'. $ext . '[/img]' . '[/url]'; $item_id = item_store($arr); @@ -615,7 +615,7 @@ function photos_post(&$a) { } } elseif (strpos($tag,'#') === 0) { $tagname = substr($tag, 1); - $str_tags .= '#[url='.$a->get_baseurl()."/search?tag=".$tagname.']'.$tagname.'[/url]'; + $str_tags .= '#[url='.App::get_baseurl()."/search?tag=".$tagname.']'.$tagname.'[/url]'; } } } @@ -685,8 +685,8 @@ function photos_post(&$a) { $arr['tag'] = $tagged[4]; $arr['inform'] = $tagged[2]; $arr['origin'] = 1; - $arr['body'] = sprintf( t('%1$s was tagged in %2$s by %3$s'), '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ; - $arr['body'] .= "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . '[img]' . $a->get_baseurl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ; + $arr['body'] = sprintf( t('%1$s was tagged in %2$s by %3$s'), '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . App::get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ; + $arr['body'] .= "\n\n" . '[url=' . App::get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . '[img]' . App::get_baseurl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ; $arr['object'] = '' . ACTIVITY_OBJ_PERSON . '' . $tagged[0] . '' . $tagged[1] . '/' . $tagged[0] . ''; $arr['object'] .= '' . xmlify('' . "\n"); @@ -695,8 +695,8 @@ function photos_post(&$a) { $arr['object'] .= '' . "\n"; $arr['target'] = '' . ACTIVITY_OBJ_IMAGE . '' . $p[0]['desc'] . '' - . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ''; - $arr['target'] .= '' . xmlify('' . "\n" . '') . ''; + . App::get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ''; + $arr['target'] .= '' . xmlify('' . "\n" . '') . ''; $item_id = item_store($arr); if ($item_id) { @@ -908,8 +908,8 @@ function photos_post(&$a) { $arr['visible'] = $visible; $arr['origin'] = 1; - $arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo_hash . ']' - . '[img]' . $a->get_baseurl() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/img]' + $arr['body'] = '[url=' . App::get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo_hash . ']' + . '[img]' . App::get_baseurl() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/img]' . '[/url]'; $item_id = item_store($arr); @@ -928,7 +928,7 @@ function photos_post(&$a) { -function photos_content(&$a) { +function photos_content(App &$a) { // URLs: // photos/name