diff --git a/superblock.tgz b/superblock.tgz new file mode 100644 index 00000000..7f5f026c Binary files /dev/null and b/superblock.tgz differ diff --git a/superblock/lang/C/messages.po b/superblock/lang/C/messages.po new file mode 100644 index 00000000..8089438b --- /dev/null +++ b/superblock/lang/C/messages.po @@ -0,0 +1,51 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-02-27 05:01-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: blockem.php:51 +msgid "\"Blockem\" Settings" +msgstr "" + +#: blockem.php:53 +msgid "Comma separated profile URLS to block" +msgstr "" + +#: blockem.php:57 +msgid "Submit" +msgstr "" + +#: blockem.php:70 +msgid "BLOCKEM Settings saved." +msgstr "" + +#: blockem.php:105 +#, php-format +msgid "Blocked %s - Click to open/close" +msgstr "" + +#: blockem.php:160 +msgid "Unblock Author" +msgstr "" + +#: blockem.php:162 +msgid "Block Author" +msgstr "" + +#: blockem.php:194 +msgid "blockem settings updated" +msgstr "" diff --git a/superblock/lang/ca/strings.php b/superblock/lang/ca/strings.php new file mode 100644 index 00000000..5587acd2 --- /dev/null +++ b/superblock/lang/ca/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "Configuració de \"Bloqueig\""; +$a->strings["Comma separated profile URLS to block"] = "URLS dels perfils a bloquejar, separats per comes"; +$a->strings["Submit"] = "Enviar"; +$a->strings["BLOCKEM Settings saved."] = "Guardada la configuració de BLOQUEIG."; +$a->strings["Blocked %s - Click to open/close"] = "Bloquejar %s - Clica per obrir/tancar"; +$a->strings["Unblock Author"] = "Desbloquejar Autor"; +$a->strings["Block Author"] = "Bloquejar Autor"; +$a->strings["blockem settings updated"] = "Actualitzar la Configuració de bloqueig"; diff --git a/superblock/lang/cs/strings.php b/superblock/lang/cs/strings.php new file mode 100644 index 00000000..174abc63 --- /dev/null +++ b/superblock/lang/cs/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "\"Blockem\" Nastavení"; +$a->strings["Comma separated profile URLS to block"] = "Čárkou oddělené URL adresy profilů určených k ignorování"; +$a->strings["Submit"] = "Odeslat"; +$a->strings["BLOCKEM Settings saved."] = "BLOCKEM nastavení uloženo."; +$a->strings["Blocked %s - Click to open/close"] = "Blokován %s - Klikněte pro otevření/zavření"; +$a->strings["Unblock Author"] = "Odblokovat autora"; +$a->strings["Block Author"] = "Zablokovat autora"; +$a->strings["blockem settings updated"] = "blockem nastavení aktualizováno"; diff --git a/superblock/lang/de/strings.php b/superblock/lang/de/strings.php new file mode 100644 index 00000000..132b68a2 --- /dev/null +++ b/superblock/lang/de/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "\"Blockem\"-Einstellungen"; +$a->strings["Comma separated profile URLS to block"] = "Profil-URLs, die blockiert werden sollen (durch Kommas getrennt)"; +$a->strings["Submit"] = "Senden"; +$a->strings["BLOCKEM Settings saved."] = "BLOCKEM-Einstellungen gesichert."; +$a->strings["Blocked %s - Click to open/close"] = "%s blockiert - Zum Öffnen/Schließen klicken"; +$a->strings["Unblock Author"] = "Autor freischalten"; +$a->strings["Block Author"] = "Autor blockieren"; +$a->strings["blockem settings updated"] = "blockem Einstellungen aktualisiert"; diff --git a/superblock/lang/eo/strings.php b/superblock/lang/eo/strings.php new file mode 100644 index 00000000..b6116507 --- /dev/null +++ b/superblock/lang/eo/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "\"Blockem\" Agordoj"; +$a->strings["Comma separated profile URLS to block"] = "Blokotaj URL adresoj, disigita per komo"; +$a->strings["Submit"] = "Sendi"; +$a->strings["BLOCKEM Settings saved."] = "Konservis Agordojn de BLOCKEM."; +$a->strings["Blocked %s - Click to open/close"] = "%s blokita - Klaku por malfermi/fermi"; +$a->strings["Unblock Author"] = "Malbloki Aŭtoron"; +$a->strings["Block Author"] = "Bloki Aŭtoron"; +$a->strings["blockem settings updated"] = "Ĝisdatigis la blockem agordojn"; diff --git a/superblock/lang/es/strings.php b/superblock/lang/es/strings.php new file mode 100644 index 00000000..874d6d7f --- /dev/null +++ b/superblock/lang/es/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "Configuración de \"Blockem\""; +$a->strings["Comma separated profile URLS to block"] = "Direcciones separadas por coma de los perfiles a bloquear"; +$a->strings["Submit"] = "Envíar"; +$a->strings["BLOCKEM Settings saved."] = "Configuracion Blockem guardada."; +$a->strings["Blocked %s - Click to open/close"] = "%s bloqueado. Pulsa aquí para mostrar/ocultar"; +$a->strings["Unblock Author"] = "Desbloquear Autor"; +$a->strings["Block Author"] = "Bloquear Autor"; +$a->strings["blockem settings updated"] = "Configuración de Blockem actualizada"; diff --git a/superblock/lang/fr/strings.php b/superblock/lang/fr/strings.php new file mode 100644 index 00000000..b9f31180 --- /dev/null +++ b/superblock/lang/fr/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "Réglages de Blockem"; +$a->strings["Comma separated profile URLS to block"] = "Liste d'URLS de profils à bloquer, séparés par des virgules"; +$a->strings["Submit"] = "Envoyer"; +$a->strings["BLOCKEM Settings saved."] = "Réglages Blockem sauvés."; +$a->strings["Blocked %s - Click to open/close"] = "Bloqué %s - Cliquez pour ouvrir/fermer"; +$a->strings["Unblock Author"] = "Débloquer l'auteur"; +$a->strings["Block Author"] = "Bloquer l'auteur"; +$a->strings["blockem settings updated"] = "Réglages blockem sauvés"; diff --git a/superblock/lang/is/strings.php b/superblock/lang/is/strings.php new file mode 100644 index 00000000..3075c457 --- /dev/null +++ b/superblock/lang/is/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "\"Blockem\" stillingar"; +$a->strings["Comma separated profile URLS to block"] = "Banna lista af forsíðum (komma á milli)"; +$a->strings["Submit"] = "Senda inn"; +$a->strings["BLOCKEM Settings saved."] = "BLOCKEM stillingar vistaðar."; +$a->strings["Blocked %s - Click to open/close"] = "%s sett í straff - Smella til að taka úr/setja á"; +$a->strings["Unblock Author"] = "Leyfa notanda"; +$a->strings["Block Author"] = "Banna notanda"; +$a->strings["blockem settings updated"] = ""; diff --git a/superblock/lang/it/strings.php b/superblock/lang/it/strings.php new file mode 100644 index 00000000..bcee9d0a --- /dev/null +++ b/superblock/lang/it/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "Impostazioni \"Blockem\""; +$a->strings["Comma separated profile URLS to block"] = "Lista, separata da virgola, di indirizzi da bloccare"; +$a->strings["Submit"] = "Invia"; +$a->strings["BLOCKEM Settings saved."] = "Impostazioni salvate."; +$a->strings["Blocked %s - Click to open/close"] = "%s bloccato - Clicca per aprire/chiudere"; +$a->strings["Unblock Author"] = "Sblocca autore"; +$a->strings["Block Author"] = "Blocca autore"; +$a->strings["blockem settings updated"] = "Impostazioni 'blockem' aggiornate."; diff --git a/superblock/lang/nb-no/strings.php b/superblock/lang/nb-no/strings.php new file mode 100644 index 00000000..0dd6660d --- /dev/null +++ b/superblock/lang/nb-no/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = ""; +$a->strings["Comma separated profile URLS to block"] = ""; +$a->strings["Submit"] = "Lagre"; +$a->strings["BLOCKEM Settings saved."] = ""; +$a->strings["Blocked %s - Click to open/close"] = ""; +$a->strings["Unblock Author"] = ""; +$a->strings["Block Author"] = ""; +$a->strings["blockem settings updated"] = ""; diff --git a/superblock/lang/pl/strings.php b/superblock/lang/pl/strings.php new file mode 100644 index 00000000..6d7bcf19 --- /dev/null +++ b/superblock/lang/pl/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = ""; +$a->strings["Comma separated profile URLS to block"] = ""; +$a->strings["Submit"] = "Potwierdź"; +$a->strings["BLOCKEM Settings saved."] = ""; +$a->strings["Blocked %s - Click to open/close"] = ""; +$a->strings["Unblock Author"] = "Odblokuj autora"; +$a->strings["Block Author"] = "Zablokuj autora"; +$a->strings["blockem settings updated"] = ""; diff --git a/superblock/lang/pt-br/strings.php b/superblock/lang/pt-br/strings.php new file mode 100644 index 00000000..49f69cc3 --- /dev/null +++ b/superblock/lang/pt-br/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "Configurações \"Blockem\""; +$a->strings["Comma separated profile URLS to block"] = "URLS de perfis separados por vírgulas a serem bloqueados"; +$a->strings["Submit"] = "Enviar"; +$a->strings["BLOCKEM Settings saved."] = "Configurações BLOCKEM armazenadas."; +$a->strings["Blocked %s - Click to open/close"] = "Bloqueado %s - Clique para abrir/fechar"; +$a->strings["Unblock Author"] = "Desbloqueie Autor"; +$a->strings["Block Author"] = "Bloqueie Autor"; +$a->strings["blockem settings updated"] = "configurações blockem atualizadas"; diff --git a/superblock/lang/ru/strings.php b/superblock/lang/ru/strings.php new file mode 100644 index 00000000..7617b865 --- /dev/null +++ b/superblock/lang/ru/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "\"Blockem\" настройки"; +$a->strings["Comma separated profile URLS to block"] = "URLS, которые заблокировать (список через запятую)"; +$a->strings["Submit"] = "Подтвердить"; +$a->strings["BLOCKEM Settings saved."] = "BLOCKEM-Настройки сохранены."; +$a->strings["Blocked %s - Click to open/close"] = "Заблокированные %s - Нажмите, чтобы открыть/закрыть"; +$a->strings["Unblock Author"] = ""; +$a->strings["Block Author"] = "Блокировать Автора"; +$a->strings["blockem settings updated"] = "\"Blockem\" настройки обновлены"; diff --git a/superblock/lang/sv/strings.php b/superblock/lang/sv/strings.php new file mode 100644 index 00000000..3ec569a7 --- /dev/null +++ b/superblock/lang/sv/strings.php @@ -0,0 +1,3 @@ +strings["Submit"] = "Spara"; diff --git a/superblock/lang/zh-cn/strings.php b/superblock/lang/zh-cn/strings.php new file mode 100644 index 00000000..3a3dfaeb --- /dev/null +++ b/superblock/lang/zh-cn/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "「Blockem」配置"; +$a->strings["Comma separated profile URLS to block"] = "逗号分简介URL为栏"; +$a->strings["Submit"] = "提交"; +$a->strings["BLOCKEM Settings saved."] = "「Blockem」配置保存了。"; +$a->strings["Blocked %s - Click to open/close"] = "%s拦了-点击为开关"; +$a->strings["Unblock Author"] = "不拦作家"; +$a->strings["Block Author"] = "拦作家"; +$a->strings["blockem settings updated"] = "blockem设置更新了"; diff --git a/superblock/superblock.css b/superblock/superblock.css new file mode 100755 index 00000000..368355bd --- /dev/null +++ b/superblock/superblock.css @@ -0,0 +1,18 @@ + +#superblock-label { + float: left; + width: 300px; + margin-top: 10px; +} + +#superblock-words { + float: left; + margin-top: 10px; + width: 400px; + height: 150px; +} + +#superblock-submit { + margin-top: 15px; +} + diff --git a/superblock/superblock.php b/superblock/superblock.php new file mode 100755 index 00000000..41abb471 --- /dev/null +++ b/superblock/superblock.php @@ -0,0 +1,133 @@ + + * + */ + +function superblock_install() { + + register_hook('plugin_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings'); + register_hook('plugin_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post'); + register_hook('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start'); + register_hook('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu'); +} + + +function superblock_uninstall() { + + unregister_hook('plugin_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings'); + unregister_hook('plugin_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post'); + unregister_hook('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start'); + unregister_hook('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu'); + +} + + + + + +function superblock_addon_settings(&$a,&$s) { + + if(! local_user()) + return; + + /* Add our stylesheet to the page so we can make our settings look nice */ + + $a->page['htmlhead'] .= '' . "\r\n"; + + + $words = get_pconfig(local_user(),'system','blocked'); + if(! $words) + $words = ''; + + $s .= '
'; + $s .= '

' . t('"Superblock" Settings') . '

'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + + return; + +} + +function superblock_addon_settings_post(&$a,&$b) { + + if(! local_user()) + return; + + if($_POST['superblock-submit']) { + set_pconfig(local_user(),'system','blocked',trim($_POST['superblock-words'])); + info( t('SUPERBLOCK Settings saved.') . EOL); + } +} + +function superblock_conversation_start(&$a,&$b) { + + if(! local_user()) + return; + + $words = get_pconfig(local_user(),'system','blocked'); + if($words) { + $a->data['superblock'] = explode(',',$words); + } + $a->page['htmlhead'] .= <<< EOT + + + +EOT; + +} + +function superblock_item_photo_menu(&$a,&$b) { + + if((! local_user()) || ($b['item']['self'])) + return; + + $blocked = false; + $author = $b['item']['author-link']; + if(is_array($a->data['superblock'])) { + foreach($a->data['superblock'] as $bloke) { + if(link_compare($bloke,$author)) { + $blocked = true; + break; + } + } + } + + $b['menu'][ t('Block Completely')] = 'javascript:superblockBlock(\'' . $author . '\');'; +} + +function superblock_module() {} + + +function superblock_init(&$a) { + + if(! local_user()) + return; + + $words = get_pconfig(local_user(),'system','blocked'); + + if(array_key_exists('block',$_GET) && $_GET['block']) { + if(strlen($words)) + $words .= ','; + $words .= trim($_GET['block']); + } + + set_pconfig(local_user(),'system','blocked',$words); + info( t('superblock settings updated') . EOL ); + killme(); +}