define ( 'FRIENDICA_CODENAME', 'Ginger');
define ( 'FRIENDICA_VERSION', '3.3' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
-define ( 'DB_UPDATE_VERSION', 1173 );
+define ( 'DB_UPDATE_VERSION', 1174 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
"bd" => array("type" => "date", "not null" => "1"),
"notify_new_posts" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"fetch_further_information" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
+ "ffi_keyword_blacklist" => array("type" => "mediumtext", "not null" => "1"),
),
"indexes" => array(
"PRIMARY" => array("id"),
}
if (isset($contact["network"]) AND ($contact["network"] == NETWORK_FEED) AND $contact['fetch_further_information']) {
- $res["body"] = $res["title"].add_page_info($res['plink'], false, "", ($contact['fetch_further_information'] == 2));
+ $res["body"] = $res["title"].add_page_info($res['plink'], false, "", ($contact['fetch_further_information'] == 2), $contact['ffi_keyword_blacklist']);
$res["title"] = "";
$res["object-type"] = ACTIVITY_OBJ_BOOKMARK;
} elseif (isset($contact["network"]) AND ($contact["network"] == NETWORK_OSTATUS))
return("\n[class=type-".$data["type"]."]".$text."[/class]".$hashtags);
}
-function add_page_info($url, $no_photos = false, $photo = "", $keywords = false) {
+function add_page_info($url, $no_photos = false, $photo = "", $keywords = false, $keyword_blacklist = "") {
require_once("mod/parse_url.php");
$data = parseurl_getsiteinfo($url, true);
if (!$keywords AND isset($data["keywords"]))
unset($data["keywords"]);
+ if (($keyword_blacklist != "") AND isset($data["keywords"])) {
+ $list = explode(",", $keyword_blacklist);
+ foreach ($list AS $keyword) {
+ $keyword = trim($keyword);
+ $index = array_search($keyword, $data["keywords"]);
+ if ($index !== false)
+ unset($data["keywords"][$index]);
+ }
+ }
+
$text = add_page_info_data($data);
return($text);
$fetch_further_information = intval($_POST['fetch_further_information']);
+ $ffi_keyword_blacklist = fix_mce_lf(escape_tags(trim($_POST['ffi_keyword_blacklist'])));
+
$priority = intval($_POST['poll']);
if($priority > 5 || $priority < 0)
$priority = 0;
$info = fix_mce_lf(escape_tags(trim($_POST['info'])));
$r = q("UPDATE `contact` SET `profile-id` = %d, `priority` = %d , `info` = '%s',
- `hidden` = %d, `notify_new_posts` = %d, `fetch_further_information` = %d WHERE `id` = %d AND `uid` = %d",
+ `hidden` = %d, `notify_new_posts` = %d, `fetch_further_information` = %d,
+ `ffi_keyword_blacklist` = '%s' WHERE `id` = %d AND `uid` = %d",
intval($profile_id),
intval($priority),
dbesc($info),
intval($hidden),
intval($notify),
intval($fetch_further_information),
+ dbesc($ffi_keyword_blacklist),
intval($contact_id),
intval(local_user())
);
$dir_icon = 'images/larrow.gif';
$relation_text = t('You are sharing with %s');
break;
-
+
case CONTACT_IS_SHARING;
$dir_icon = 'images/rarrow.gif';
$relation_text = t('%s is sharing with you');
'$notify' => array('notify', t('Notification for new posts'), ($contact['notify_new_posts'] == 1), t('Send a notification of every new post of this contact')),
'$fetch_further_information' => array('fetch_further_information', t('Fetch further information for feeds'), $contact['fetch_further_information'], t('Fetch further information for feeds'),
array('0'=>t('Disabled'), '1'=>t('Fetch information'), '2'=>t('Fetch information and keywords'))),
+ '$ffi_keyword_blacklist' => $contact['ffi_keyword_blacklist'],
+ '$ffi_keyword_blacklist' => array('ffi_keyword_blacklist', t('Blacklisted keywords'), $contact['ffi_keyword_blacklist'], t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')),
'$photo' => $contact['photo'],
'$name' => $contact['name'],
'$dir_icon' => $dir_icon,
<?php
-define( 'UPDATE_VERSION' , 1173 );
+define( 'UPDATE_VERSION' , 1174 );
/**
*
<div id="contact-edit-end" ></div>
{{include file="field_checkbox.tpl" field=$notify}}
{{include file="field_select.tpl" field=$fetch_further_information}}
+ {{if $fetch_further_information.2 == 2 }} {{include file="field_textarea.tpl" field=$ffi_keyword_blacklist}} {{/if}}
{{include file="field_checkbox.tpl" field=$hidden}}
<div id="contact-edit-info-wrapper">