X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=blockem%2Fblockem.php;h=223a1990c336d17a20635017e16d6d222695fad8;hb=29d58005dc8b8e99a686d009d22368d14da2cba9;hp=85c7fec68a32b0d631c538e1d9b0f9ebde33088d;hpb=7b71fec6222988a89423ee4584c87927f1a6e149;p=friendica-addons.git diff --git a/blockem/blockem.php b/blockem/blockem.php index 85c7fec6..223a1990 100755 --- a/blockem/blockem.php +++ b/blockem/blockem.php @@ -16,6 +16,7 @@ function blockem_install() { register_hook('plugin_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post'); register_hook('conversation_start', 'addon/blockem/blockem.php', 'blockem_conversation_start'); register_hook('item_photo_menu', 'addon/blockem/blockem.php', 'blockem_item_photo_menu'); + register_hook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store' ); } @@ -26,6 +27,7 @@ function blockem_uninstall() { unregister_hook('plugin_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post'); unregister_hook('conversation_start', 'addon/blockem/blockem.php', 'blockem_conversation_start'); unregister_hook('item_photo_menu', 'addon/blockem/blockem.php', 'blockem_item_photo_menu'); + unregister_hook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store' ); } @@ -47,14 +49,20 @@ function blockem_addon_settings(&$a,&$s) { if(! $words) $words = ''; - $s .= '
'; - $s .= '

' . t('"Blockem" Settings') . '

'; + $s .= ''; + $s .= '

' . t('"Blockem"') . '

'; + $s .= '
'; + $s .= ''; + $s .= '
'; return; @@ -71,6 +79,35 @@ function blockem_addon_settings_post(&$a,&$b) { } } + +function blockem_enotify_store(&$a,&$b) { + + $words = get_pconfig($b['uid'],'blockem','words'); + if($words) { + $arr = explode(',',$words); + } + else { + return; + } + + $found = false; + if(count($arr)) { + foreach($arr as $word) { + if(! strlen(trim($word))) { + continue; + } + + if(link_compare($b['url'],$word)) { + $found = true; + break; + } + } + } + if($found) { + $b['abort'] = true; + } +} + function blockem_prepare_body(&$a,&$b) { if(! local_user())