mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-19 06:47:03 +00:00
[blockem]:
- changed checking condition (CR request) - added/removed more spaces
This commit is contained in:
parent
e54c99b313
commit
9b5ab3b373
1 changed files with 8 additions and 5 deletions
|
@ -107,7 +107,8 @@ function blockem_enotify_store(App $a, array &$b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($found) {
|
|
||||||
|
if ($found) {
|
||||||
$b['abort'] = true;
|
$b['abort'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,6 +120,7 @@ function blockem_prepare_body_content_filter(App $a, array &$hook_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
$profiles_string = null;
|
$profiles_string = null;
|
||||||
|
|
||||||
if (local_user()) {
|
if (local_user()) {
|
||||||
$profiles_string = PConfig::get(local_user(), 'blockem', 'words');
|
$profiles_string = PConfig::get(local_user(), 'blockem', 'words');
|
||||||
}
|
}
|
||||||
|
@ -130,6 +132,7 @@ function blockem_prepare_body_content_filter(App $a, array &$hook_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
$found = false;
|
$found = false;
|
||||||
|
|
||||||
foreach ($profiles_array as $word) {
|
foreach ($profiles_array as $word) {
|
||||||
if (link_compare($hook_data['item']['author-link'], trim($word))) {
|
if (link_compare($hook_data['item']['author-link'], trim($word))) {
|
||||||
$found = true;
|
$found = true;
|
||||||
|
@ -144,7 +147,7 @@ function blockem_prepare_body_content_filter(App $a, array &$hook_data)
|
||||||
|
|
||||||
function blockem_display_item(App $a, array &$b = null)
|
function blockem_display_item(App $a, array &$b = null)
|
||||||
{
|
{
|
||||||
if (isset($b['output']) && strstr($b['output']['body'], 'id="blockem-wrap-')) {
|
if (!empty($b['output']['body']) && strstr($b['output']['body'], 'id="blockem-wrap-')) {
|
||||||
$b['output']['thumb'] = $a->get_baseurl() . "/images/person-80.jpg";
|
$b['output']['thumb'] = $a->get_baseurl() . "/images/person-80.jpg";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,7 +216,7 @@ function blockem_init(App $a)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$words = PConfig::get(local_user(),'blockem','words');
|
$words = PConfig::get(local_user(), 'blockem', 'words');
|
||||||
|
|
||||||
if (array_key_exists('block', $_GET) && $_GET['block']) {
|
if (array_key_exists('block', $_GET) && $_GET['block']) {
|
||||||
if (strlen($words)) {
|
if (strlen($words)) {
|
||||||
|
@ -229,13 +232,13 @@ function blockem_init(App $a)
|
||||||
|
|
||||||
if (count($arr)) {
|
if (count($arr)) {
|
||||||
foreach ($arr as $x) {
|
foreach ($arr as $x) {
|
||||||
if (! link_compare(trim($x),trim($_GET['unblock']))) {
|
if (!link_compare(trim($x), trim($_GET['unblock']))) {
|
||||||
$newarr[] = $x;
|
$newarr[] = $x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$words = implode(',',$newarr);
|
$words = implode(',', $newarr);
|
||||||
}
|
}
|
||||||
|
|
||||||
PConfig::set(local_user(), 'blockem', 'words', $words);
|
PConfig::set(local_user(), 'blockem', 'words', $words);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue