1
0
Fork 0

add $no_photos parameter to add_page_info_data()

This commit is contained in:
rabuzarus 2018-02-12 03:56:20 +01:00
parent 26fd6b1c33
commit 5fe7a21482
2 changed files with 8 additions and 8 deletions

View file

@ -24,7 +24,7 @@ require_once 'include/text.php';
require_once 'mod/share.php';
require_once 'include/enotify.php';
function add_page_info_data($data) {
function add_page_info_data($data, $no_photos = false) {
Addon::callHooks('page_info_data', $data);
// It maybe is a rich content, but if it does have everything that a link has,
@ -92,7 +92,7 @@ function add_page_info_data($data) {
return "\n".$text.$hashtags;
}
function query_page_info($url, $no_photos = false, $photo = "", $keywords = false, $keyword_blacklist = "") {
function query_page_info($url, $photo = "", $keywords = false, $keyword_blacklist = "") {
$data = ParseUrl::getSiteinfoCached($url, true);
@ -120,8 +120,8 @@ function query_page_info($url, $no_photos = false, $photo = "", $keywords = fals
return $data;
}
function add_page_keywords($url, $no_photos = false, $photo = "", $keywords = false, $keyword_blacklist = "") {
$data = query_page_info($url, $no_photos, $photo, $keywords, $keyword_blacklist);
function add_page_keywords($url, $photo = "", $keywords = false, $keyword_blacklist = "") {
$data = query_page_info($url, $photo, $keywords, $keyword_blacklist);
$tags = "";
if (isset($data["keywords"]) && count($data["keywords"])) {
@ -141,9 +141,9 @@ function add_page_keywords($url, $no_photos = false, $photo = "", $keywords = fa
}
function add_page_info($url, $no_photos = false, $photo = "", $keywords = false, $keyword_blacklist = "") {
$data = query_page_info($url, $no_photos, $photo, $keywords, $keyword_blacklist);
$data = query_page_info($url, $photo, $keywords, $keyword_blacklist);
$text = add_page_info_data($data);
$text = add_page_info_data($data, $no_photos);
return $text;
}

View file

@ -402,7 +402,7 @@ class Feed {
// We always strip the title since it will be added in the page information
$item["title"] = "";
$item["body"] = $item["body"].add_page_info($item["plink"], false, $preview, ($contact["fetch_further_information"] == 2), $contact["ffi_keyword_blacklist"]);
$item["tag"] = add_page_keywords($item["plink"], false, $preview, ($contact["fetch_further_information"] == 2), $contact["ffi_keyword_blacklist"]);
$item["tag"] = add_page_keywords($item["plink"], $preview, ($contact["fetch_further_information"] == 2), $contact["ffi_keyword_blacklist"]);
$item["object-type"] = ACTIVITY_OBJ_BOOKMARK;
unset($item["attach"]);
} else {
@ -410,7 +410,7 @@ class Feed {
if (!empty($tags)) {
$item["tag"] = $tags;
} else {
$item["tag"] = add_page_keywords($item["plink"], false, $preview, true, $contact["ffi_keyword_blacklist"]);
$item["tag"] = add_page_keywords($item["plink"], $preview, true, $contact["ffi_keyword_blacklist"]);
}
$item["body"] .= "\n".$item['tag'];
}