forked from friendica/friendica-addons
maybe this way works better
This commit is contained in:
parent
5638807da3
commit
c71f6266aa
2 changed files with 6 additions and 6 deletions
|
@ -103,7 +103,7 @@ function phototrack_photo_use($photo, $table, $field, $id) {
|
||||||
|
|
||||||
function phototrack_check_field_url($a, $table, $field, $id, $url) {
|
function phototrack_check_field_url($a, $table, $field, $id, $url) {
|
||||||
Logger::info('@@@ phototrack_check_field_url table ' . $table . ' field ' . $field . ' id ' . $id . ' url ' . $url);
|
Logger::info('@@@ phototrack_check_field_url table ' . $table . ' field ' . $field . ' id ' . $id . ' url ' . $url);
|
||||||
$baseurl = DI::baseUrl();
|
$baseurl = DI::baseUrl()->get(true);
|
||||||
if (strpos($url, $baseurl) === FALSE) {
|
if (strpos($url, $baseurl) === FALSE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ function phototrack_check_field_url($a, $table, $field, $id, $url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function phototrack_check_field_bbcode($a, $table, $field, $id, $value) {
|
function phototrack_check_field_bbcode($a, $table, $field, $id, $value) {
|
||||||
$baseurl = DI::baseUrl();
|
$baseurl = DI::baseUrl()->get(true);
|
||||||
$matches = array();
|
$matches = array();
|
||||||
preg_match_all("/\[img(\=([0-9]*)x([0-9]*))?\](.*?)\[\/img\]/ism", $value, $matches);
|
preg_match_all("/\[img(\=([0-9]*)x([0-9]*))?\](.*?)\[\/img\]/ism", $value, $matches);
|
||||||
foreach ($matches[4] as $url) {
|
foreach ($matches[4] as $url) {
|
||||||
|
|
|
@ -715,7 +715,7 @@ function retrieve_images(&$item) {
|
||||||
if (!$url) {
|
if (!$url) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strpos($url, DI::baseUrl()) === FALSE) {
|
if (strpos($url, DI::baseUrl()->get(true)) === FALSE) {
|
||||||
$resource = add_retriever_resource($url, $item['uid'], $item['contact-id'], true);
|
$resource = add_retriever_resource($url, $item['uid'], $item['contact-id'], true);
|
||||||
if (!$resource['completed']) {
|
if (!$resource['completed']) {
|
||||||
add_retriever_item($item, $resource);
|
add_retriever_item($item, $resource);
|
||||||
|
@ -801,7 +801,7 @@ function retriever_transform_images(&$item, $resource) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$photo = Photo::store($image, $uid, $cid, $rid, $filename, $album, 0, 0, "", "", "", "", $desc);
|
$photo = Photo::store($image, $uid, $cid, $rid, $filename, $album, 0, 0, "", "", "", "", $desc);
|
||||||
$new_url = DI::baseUrl() . '/photo/' . $rid . '-0.' . $image->getExt();
|
$new_url = DI::baseUrl()->get(true) . '/photo/' . $rid . '-0.' . $image->getExt();
|
||||||
if (!strlen($new_url)) {
|
if (!strlen($new_url)) {
|
||||||
Logger::warning('retriever_transform_images: no replacement URL for image ' . $resource['url']);
|
Logger::warning('retriever_transform_images: no replacement URL for image ' . $resource['url']);
|
||||||
return;
|
return;
|
||||||
|
@ -827,7 +827,7 @@ function retriever_content($a) {
|
||||||
if ($a->argv[1] === 'help') {
|
if ($a->argv[1] === 'help') {
|
||||||
$feeds = DBA::selectToArray('contact', ['id', 'name', 'thumb'], ['uid' => local_user(), 'network' => 'feed']);
|
$feeds = DBA::selectToArray('contact', ['id', 'name', 'thumb'], ['uid' => local_user(), 'network' => 'feed']);
|
||||||
for ($i = 0; $i < count($feeds); ++$i) {
|
for ($i = 0; $i < count($feeds); ++$i) {
|
||||||
$feeds[$i]['url'] = DI::baseUrl() . '/retriever/' . $feeds[$i]['id'];
|
$feeds[$i]['url'] = DI::baseUrl()->get(true) . '/retriever/' . $feeds[$i]['id'];
|
||||||
}
|
}
|
||||||
$template = Renderer::getMarkupTemplate('/help.tpl', 'addon/retriever/');
|
$template = Renderer::getMarkupTemplate('/help.tpl', 'addon/retriever/');
|
||||||
$a->page['content'] .= Renderer::replaceMacros($template, array(
|
$a->page['content'] .= Renderer::replaceMacros($template, array(
|
||||||
|
@ -951,7 +951,7 @@ function retriever_contact_photo_menu($a, &$args) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($args["contact"]["network"] == "feed") {
|
if ($args["contact"]["network"] == "feed") {
|
||||||
$args["menu"]['retriever'] = array(L10n::t('Retriever'), DI::baseUrl() . '/retriever/' . $args["contact"]['id']);
|
$args["menu"]['retriever'] = array(L10n::t('Retriever'), DI::baseUrl()->get(true) . '/retriever/' . $args["contact"]['id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue