From 1ea73a55e8276006b4c0f0307dfbe2a35acdff33 Mon Sep 17 00:00:00 2001 From: Olivier van Helden Date: Wed, 3 Dec 2014 18:26:17 -0400 Subject: [PATCH 01/29] update fr typoes --- view/fr/messages.po | 26 +++++++++++++------------- view/fr/strings.php | 40 ++++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/view/fr/messages.po b/view/fr/messages.po index d818c67ec..f747baac3 100644 --- a/view/fr/messages.po +++ b/view/fr/messages.po @@ -23,7 +23,7 @@ msgstr "" #: ../../include/dba/dba_driver.php:50 #, php-format msgid "Cannot locate DNS info for database server '%s'" -msgstr "Impossible de trouver les infos DNS du serveur de BD '%s'" +msgstr "Impossible de trouver les infos DNS du serveur de base de données '%s'" #: ../../include/photo/photo_driver.php:653 ../../include/photos.php:51 #: ../../mod/profile_photo.php:142 ../../mod/profile_photo.php:301 @@ -183,7 +183,7 @@ msgstr "Suggérer" #: ../../include/apps.php:145 msgid "Random Channel" -msgstr "Un Canal au Hasard" +msgstr "Un canal au hasard" #: ../../include/apps.php:146 msgid "Invite" @@ -203,12 +203,12 @@ msgstr "Envoyer" #: ../../include/apps.php:150 msgid "Profile Photo" -msgstr "Photo du Profil" +msgstr "Photo du profil" #: ../../include/apps.php:239 ../../mod/settings.php:79 #: ../../mod/settings.php:543 msgid "Update" -msgstr "Mise-à-jour" +msgstr "Mise à jour" #: ../../include/apps.php:239 msgid "Install" @@ -293,7 +293,7 @@ msgstr "cogne" #: ../../include/text.php:897 ../../include/conversation.php:243 msgid "poked" -msgstr "C'est fait cogner" +msgstr "s'est fait cogner" #: ../../include/text.php:898 msgid "ping" @@ -301,7 +301,7 @@ msgstr "solliciter" #: ../../include/text.php:898 msgid "pinged" -msgstr "sollicité" +msgstr "a sollicité" #: ../../include/text.php:899 msgid "prod" @@ -317,7 +317,7 @@ msgstr "giffle" #: ../../include/text.php:900 msgid "slapped" -msgstr "gifflé" +msgstr "a gifflé" #: ../../include/text.php:901 msgid "finger" @@ -325,7 +325,7 @@ msgstr "pointer" #: ../../include/text.php:901 msgid "fingered" -msgstr "pointé" +msgstr "a pointé" #: ../../include/text.php:902 msgid "rebuff" @@ -333,7 +333,7 @@ msgstr "rejetter" #: ../../include/text.php:902 msgid "rebuffed" -msgstr "rejetté" +msgstr "a rejetté" #: ../../include/text.php:911 msgid "happy" @@ -2408,7 +2408,7 @@ msgstr "Visible sur toute la Matrice." #: ../../include/items.php:965 msgid "Visible to anybody authenticated." -msgstr "Visible aux usagers authentifiés." +msgstr "Visible aux utilisateurs authentifiés." #: ../../include/items.php:967 #, php-format @@ -3872,7 +3872,7 @@ msgstr "Thème mobile :" #: ../../mod/settings.php:760 msgid "Enable user zoom on mobile devices" -msgstr "Permettre à l'usager d'un mobile d'agrandir le contenu" +msgstr "Permettre à l'tilisateur d'un mobile d'agrandir le contenu" #: ../../mod/settings.php:761 msgid "Update browser every xx seconds" @@ -4776,7 +4776,7 @@ msgstr "Merci de vous connecter." #: ../../mod/cloud.php:126 msgid "Red Matrix - Guests: Username: {your email address}, Password: +++" -msgstr "Matrice Rouge - Pour les invités: Usager = {votre courriel}, Mot de passe = +++" +msgstr "Matrice Rouge - Pour les invités: Nom d'utilisateur = {votre courriel}, Mot de passe = +++" #: ../../mod/removeme.php:29 msgid "" @@ -7675,7 +7675,7 @@ msgstr "URL vers le serveur Friendica" #: ../../mod/frphotos.php:82 msgid "Friendica Login Username" -msgstr "Nom d'usager Friendica" +msgstr "Nom d'utilisateur Friendica" #: ../../mod/frphotos.php:83 msgid "Friendica Login Password" diff --git a/view/fr/strings.php b/view/fr/strings.php index 24efb1744..a3d5ced01 100644 --- a/view/fr/strings.php +++ b/view/fr/strings.php @@ -5,7 +5,7 @@ function string_plural_select_fr($n){ return ($n > 1);; }} ; -$a->strings["Cannot locate DNS info for database server '%s'"] = "Impossible de trouver les infos DNS du serveur de BD '%s'"; +$a->strings["Cannot locate DNS info for database server '%s'"] = "Impossible de trouver les infos DNS du serveur de base de données '%s'"; $a->strings["Profile Photos"] = "Photos du profil"; $a->strings["%1\$s is now friends with %2\$s"] = "%1\$s et %2\$s sont maintenant amis."; $a->strings["Sharing notification from Diaspora network"] = "Partage de vos notifications du réseau Diaspora"; @@ -39,13 +39,13 @@ $a->strings["Chat"] = "Clavardage"; $a->strings["Search"] = "Recherche"; $a->strings["Probe"] = "Sonder"; $a->strings["Suggest"] = "Suggérer"; -$a->strings["Random Channel"] = "Un Canal au Hasard"; +$a->strings["Random Channel"] = "Un canal au hasard"; $a->strings["Invite"] = "Invitation"; $a->strings["Features"] = "Fonctionalités"; $a->strings["Language"] = "Langue"; $a->strings["Post"] = "Envoyer"; -$a->strings["Profile Photo"] = "Photo du Profil"; -$a->strings["Update"] = "Mise-à-jour"; +$a->strings["Profile Photo"] = "Photo du profil"; +$a->strings["Update"] = "Mise à jour"; $a->strings["Install"] = "Installer"; $a->strings["Purchase"] = "Acheter"; $a->strings["Edit"] = "Éditer"; @@ -65,17 +65,17 @@ $a->strings["%d Connection"] = array( $a->strings["View Connections"] = "Voir les relations"; $a->strings["Save"] = "Sauver"; $a->strings["poke"] = "cogne"; -$a->strings["poked"] = "C'est fait cogner"; +$a->strings["poked"] = "s'est fait cogner par"; $a->strings["ping"] = "solliciter"; -$a->strings["pinged"] = "sollicité"; +$a->strings["pinged"] = "a sollicité"; $a->strings["prod"] = "aiguillonner"; -$a->strings["prodded"] = "aiguillonné"; +$a->strings["prodded"] = "a aiguillonné"; $a->strings["slap"] = "giffle"; -$a->strings["slapped"] = "gifflé"; +$a->strings["slapped"] = "a gifflé"; $a->strings["finger"] = "pointer"; -$a->strings["fingered"] = "pointé"; +$a->strings["fingered"] = "a pointé"; $a->strings["rebuff"] = "rejetter"; -$a->strings["rebuffed"] = "rejetté"; +$a->strings["rebuffed"] = "a rejetté"; $a->strings["happy"] = "heureux"; $a->strings["sad"] = "triste"; $a->strings["mellow"] = "mélancolique"; @@ -88,7 +88,7 @@ $a->strings["interested"] = "intéressé"; $a->strings["bitter"] = "amer"; $a->strings["cheerful"] = "entrain"; $a->strings["alive"] = "énergique"; -$a->strings["annoyed"] = "agaçé"; +$a->strings["annoyed"] = "agacé"; $a->strings["anxious"] = "anxieux"; $a->strings["cranky"] = "énervé"; $a->strings["disturbed"] = "perturbé"; @@ -565,7 +565,7 @@ $a->strings["(Unknown)"] = "(Inconnu)"; $a->strings["Visible to anybody on the internet."] = "Visible à tout le monde sur internet."; $a->strings["Visible to you only."] = "Visible pour vous seulement."; $a->strings["Visible to anybody in this network."] = "Visible sur toute la Matrice."; -$a->strings["Visible to anybody authenticated."] = "Visible aux usagers authentifiés."; +$a->strings["Visible to anybody authenticated."] = "Visible aux utilisateurs authentifiés."; $a->strings["Visible to anybody on %s."] = "Visible pour tous sur %s."; $a->strings["Visible to all connections."] = "Visible pour tous les contacts."; $a->strings["Visible to approved connections."] = "Visible aux contacts approuvés."; @@ -915,7 +915,7 @@ $a->strings["%s - (Experimental)"] = "%s - (Expérimental)"; $a->strings["Display Settings"] = "Affichage"; $a->strings["Display Theme:"] = "Thème :"; $a->strings["Mobile Theme:"] = "Thème mobile :"; -$a->strings["Enable user zoom on mobile devices"] = "Permettre à l'usager d'un mobile d'agrandir le contenu"; +$a->strings["Enable user zoom on mobile devices"] = "Permettre à l'utilisateur d'un mobile d'agrandir le contenu"; $a->strings["Update browser every xx seconds"] = "Rafraîchir le navigateur toutes les xx secondes"; $a->strings["Minimum of 10 seconds, no maximum"] = "Minimum 10 secondes, pas de maximum"; $a->strings["Maximum number of conversations to load at any time:"] = "Nombre maximal de conversations pouvant être chargées en même temps :"; @@ -938,13 +938,13 @@ $a->strings["or"] = "ou"; $a->strings["Your channel address is"] = "Voici l'adresse de votre canal"; $a->strings["Channel Settings"] = "Canal"; $a->strings["Basic Settings"] = "Basique"; -$a->strings["Your Timezone:"] = "Fureau Horaire :"; +$a->strings["Your Timezone:"] = "Fuseau horaire :"; $a->strings["Default Post Location:"] = "Emplacement géographique par défaut :"; $a->strings["Geographical location to display on your posts"] = "Emplacement géographique à afficher sur vos publications"; $a->strings["Use Browser Location:"] = "Utiliser la géolocalisation fournie par le navigateur :"; $a->strings["Adult Content"] = "Contenu \"adulte\""; $a->strings["This channel frequently or regularly publishes adult content. (Please tag any adult material and/or nudity with #NSFW)"] = "Ce canal publie plus ou moins fréquemment du contenu pour adultes. (Merci d'indiquer tout contenu pour adulte ou potentiellement choquant avec l'étiquette #NSFW - Not Safe For Work)"; -$a->strings["Security and Privacy Settings"] = "Réglages de Sécurité et vie privée"; +$a->strings["Security and Privacy Settings"] = "Réglages de sécurité et vie privée"; $a->strings["Hide my online presence"] = "Cacher ma présence en ligne"; $a->strings["Prevents displaying in your profile that you are online"] = "Cacher votre statut (en ligne/hors ligne) sur votre profil"; $a->strings["Simple Privacy Settings:"] = "Réglages simples :"; @@ -952,7 +952,7 @@ $a->strings["Very Public - extremely permissive (should be used with caution $a->strings["Typical - default public, privacy when desired (similar to social network permissions but with improved privacy)"] = "Classique - public par défaut, privé en cas de besoin (comparable dans le principe aux réseaux sociaux centralisés, avec un mode privé plus efficace)"; $a->strings["Private - default private, never open or public"] = "Privé - privé par défaut, jamais ouvert ni public"; $a->strings["Blocked - default blocked to/from everybody"] = "Bloqué - par défaut, bloqué de/vers tout le monde"; -$a->strings["Allow others to tag your posts"] = "Autoriser les autres à \"étiqueté\" vos publications"; +$a->strings["Allow others to tag your posts"] = "Autoriser les autres à \"étiqueter\" vos publications"; $a->strings["Often used by the community to retro-actively flag inappropriate content"] = "Souvent utilisé par la communauté pour distinguer le contenu innaproprié"; $a->strings["Advanced Privacy Settings"] = "Réglages avancés"; $a->strings["Expire other channel content after this many days"] = "Faire expirer le contenu des autres canaux après n jours"; @@ -1116,7 +1116,7 @@ $a->strings["Passwords do not match."] = "Les mots de passe ne concordent pas."; $a->strings["Registration successful. Please check your email for validation instructions."] = "Inscription réussie. Merci de vérifier vos courriels pour valider votre compte."; $a->strings["Your registration is pending approval by the site owner."] = "Votre inscription est en attente de l'approbation d'un administrateur."; $a->strings["Your registration can not be processed."] = "Votre inscription ne peut être traîtée."; -$a->strings["Registration on this site/hub is by approval only."] = "L'inscription sur cette instance/ce site est soumis à une modération."; +$a->strings["Registration on this site/hub is by approval only."] = "L'inscription sur cette instance/ce site est soumise à une modération."; $a->strings["Register at another affiliated site/hub"] = "S'inscrire sur un site/hub affilié"; $a->strings["This site has exceeded the number of allowed daily account registrations. Please try again tomorrow."] = "Ce site a dépassé le nombre de création de compte autorisé par jour. Merci de recommencer demain."; $a->strings["Terms of Service"] = "Règles du Service"; @@ -1131,7 +1131,7 @@ $a->strings["Please re-enter your password"] = "Confirmez-le"; $a->strings["Away"] = "Absent"; $a->strings["Online"] = "En ligne"; $a->strings["Please login."] = "Merci de vous connecter."; -$a->strings["Red Matrix - Guests: Username: {your email address}, Password: +++"] = "Matrice Rouge - Pour les invités: Usager = {votre courriel}, Mot de passe = +++"; +$a->strings["Red Matrix - Guests: Username: {your email address}, Password: +++"] = "Matrice Rouge - Pour les invités: Nom d'utilisateur = {votre courriel}, Mot de passe = +++"; $a->strings["Channel removals are not allowed within 48 hours of changing the account password."] = "Il est impossible de supprimer un canal à l'intérieur de 48 heures après avoir changé le mot de passe d'un compte."; $a->strings["Remove This Channel"] = "Supprimer ce Canal"; $a->strings["This will completely remove this channel from the network. Once this has been done it is not recoverable."] = "Ceci effacera complètement le canal du réseau. Une fois effacé, un canal ne PEUT PAS être récupéré."; @@ -1511,7 +1511,7 @@ $a->strings["Active plugins"] = "Extensions actives"; $a->strings["Site settings updated."] = "Réglages du site sauvegardés."; $a->strings["No special theme for accessibility"] = "Pas de thème spécifique pour l'accessibilité"; $a->strings["Yes - with approval"] = "Oui - avec approbation"; -$a->strings["My site is not a public server"] = "Mon site n'est pas un serveur publique"; +$a->strings["My site is not a public server"] = "Mon site n'est pas un serveur public"; $a->strings["My site has paid access only"] = "Mon site est payant"; $a->strings["My site has free access only"] = "Mon site est gratuit"; $a->strings["My site offers free accounts with optional paid upgrades"] = "Mon site offre des comptes gratuits avec des ajouts payants"; @@ -1811,7 +1811,7 @@ $a->strings["View Results"] = "Voir les Résultats"; $a->strings["Friendica Photo Album Import"] = "Importer votre Album Photo Friendica"; $a->strings["This will import all your Friendica photo albums to this Red channel."] = "Cette fonction va importer tous vos albums photos Friendica dans ce canal de la Matrice Rouge."; $a->strings["Friendica Server base URL"] = "URL vers le serveur Friendica"; -$a->strings["Friendica Login Username"] = "Nom d'usager Friendica"; +$a->strings["Friendica Login Username"] = "Nom d'utilisateur Friendica"; $a->strings["Friendica Login Password"] = "Mot de passe Friendica"; $a->strings["Account removals are not allowed within 48 hours of changing the account password."] = "Il est impossible de supprimer un compte à l'intérieur de 48 heures après avoir changé le mot de passe d'un compte."; $a->strings["Remove This Account"] = "Supprimer ce Compte"; From bbd5cb736787157c0c7f78c7b103ff746d7caf5c Mon Sep 17 00:00:00 2001 From: Olivier van Helden Date: Wed, 3 Dec 2014 18:37:51 -0400 Subject: [PATCH 02/29] update fr: fix typo and ambiguous changes in 1ea73a55e8276006b4c0f0307dfbe2a35acdff33 --- view/fr/messages.po | 12 ++++++------ view/fr/strings.php | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/view/fr/messages.po b/view/fr/messages.po index f747baac3..ca4b138cc 100644 --- a/view/fr/messages.po +++ b/view/fr/messages.po @@ -293,7 +293,7 @@ msgstr "cogne" #: ../../include/text.php:897 ../../include/conversation.php:243 msgid "poked" -msgstr "s'est fait cogner" +msgstr "s'est fait cogner par" #: ../../include/text.php:898 msgid "ping" @@ -301,7 +301,7 @@ msgstr "solliciter" #: ../../include/text.php:898 msgid "pinged" -msgstr "a sollicité" +msgstr "sollicité" #: ../../include/text.php:899 msgid "prod" @@ -317,7 +317,7 @@ msgstr "giffle" #: ../../include/text.php:900 msgid "slapped" -msgstr "a gifflé" +msgstr "gifflé" #: ../../include/text.php:901 msgid "finger" @@ -325,7 +325,7 @@ msgstr "pointer" #: ../../include/text.php:901 msgid "fingered" -msgstr "a pointé" +msgstr "pointé" #: ../../include/text.php:902 msgid "rebuff" @@ -333,7 +333,7 @@ msgstr "rejetter" #: ../../include/text.php:902 msgid "rebuffed" -msgstr "a rejetté" +msgstr "rejetté" #: ../../include/text.php:911 msgid "happy" @@ -3872,7 +3872,7 @@ msgstr "Thème mobile :" #: ../../mod/settings.php:760 msgid "Enable user zoom on mobile devices" -msgstr "Permettre à l'tilisateur d'un mobile d'agrandir le contenu" +msgstr "Permettre à l'utilisateur d'un mobile d'agrandir le contenu" #: ../../mod/settings.php:761 msgid "Update browser every xx seconds" diff --git a/view/fr/strings.php b/view/fr/strings.php index a3d5ced01..a6f020c58 100644 --- a/view/fr/strings.php +++ b/view/fr/strings.php @@ -67,15 +67,15 @@ $a->strings["Save"] = "Sauver"; $a->strings["poke"] = "cogne"; $a->strings["poked"] = "s'est fait cogner par"; $a->strings["ping"] = "solliciter"; -$a->strings["pinged"] = "a sollicité"; +$a->strings["pinged"] = "sollicité"; $a->strings["prod"] = "aiguillonner"; -$a->strings["prodded"] = "a aiguillonné"; +$a->strings["prodded"] = "aiguillonné"; $a->strings["slap"] = "giffle"; -$a->strings["slapped"] = "a gifflé"; +$a->strings["slapped"] = "gifflé"; $a->strings["finger"] = "pointer"; -$a->strings["fingered"] = "a pointé"; +$a->strings["fingered"] = "pointé"; $a->strings["rebuff"] = "rejetter"; -$a->strings["rebuffed"] = "a rejetté"; +$a->strings["rebuffed"] = "rejetté"; $a->strings["happy"] = "heureux"; $a->strings["sad"] = "triste"; $a->strings["mellow"] = "mélancolique"; From 78c37bc325dcfea0b2328768b3dd42931c70f0a1 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 4 Dec 2014 01:34:58 +0000 Subject: [PATCH 03/29] Put dir back - the fat lady didn't sing afterall. --- boot.php | 3 ++- mod/connedit.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/boot.php b/boot.php index b2c8fa9ea..3fdaa55f0 100755 --- a/boot.php +++ b/boot.php @@ -75,7 +75,8 @@ $DIRECTORY_FALLBACK_SERVERS = array( 'https://zotid.net', 'https://redmatrix.nl', 'https://red.zottel.red', - 'https://red.pixelbits.de' + 'https://red.pixelbits.de', + 'https://whogotzot.com' ); diff --git a/mod/connedit.php b/mod/connedit.php index fbc2c8c33..5bf9c130b 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -504,7 +504,7 @@ function connedit_content(&$a) { $slider_tpl = get_markup_template('contact_slider.tpl'); $slide = replace_macros($slider_tpl,array( '$me' => t('Me'), - '$min' => 1, + '$min' => 1, '$val' => (($contact['abook_closeness']) ? $contact['abook_closeness'] : 99), '$intimate' => t('Best Friends'), '$friends' => t('Friends'), From 384833317224c5c16cf66a101912bcc738e90415 Mon Sep 17 00:00:00 2001 From: Olivier van Helden Date: Thu, 4 Dec 2014 00:08:20 -0400 Subject: [PATCH 04/29] update fr - resubmitted, after online tests, correct translations for poked, pinged, etc - fix wrong sense for poked - there were two different translations for [red:notify], changed to the most used (Red:Notification) everywhere. --- view/fr/messages.po | 28 ++++++++++++++-------------- view/fr/strings.php | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/view/fr/messages.po b/view/fr/messages.po index ca4b138cc..a15cf225b 100644 --- a/view/fr/messages.po +++ b/view/fr/messages.po @@ -293,7 +293,7 @@ msgstr "cogne" #: ../../include/text.php:897 ../../include/conversation.php:243 msgid "poked" -msgstr "s'est fait cogner par" +msgstr "a cogné" #: ../../include/text.php:898 msgid "ping" @@ -301,7 +301,7 @@ msgstr "solliciter" #: ../../include/text.php:898 msgid "pinged" -msgstr "sollicité" +msgstr "a sollicité" #: ../../include/text.php:899 msgid "prod" @@ -309,15 +309,15 @@ msgstr "aiguillonner" #: ../../include/text.php:899 msgid "prodded" -msgstr "aiguillonné" +msgstr "a aiguillonné" #: ../../include/text.php:900 msgid "slap" -msgstr "giffle" +msgstr "gifler" #: ../../include/text.php:900 msgid "slapped" -msgstr "gifflé" +msgstr "a giflé" #: ../../include/text.php:901 msgid "finger" @@ -325,15 +325,15 @@ msgstr "pointer" #: ../../include/text.php:901 msgid "fingered" -msgstr "pointé" +msgstr "a pointé" #: ../../include/text.php:902 msgid "rebuff" -msgstr "rejetter" +msgstr "rejeter" #: ../../include/text.php:902 msgid "rebuffed" -msgstr "rejetté" +msgstr "a rejeté" #: ../../include/text.php:911 msgid "happy" @@ -357,7 +357,7 @@ msgstr "impertinent" #: ../../include/text.php:916 msgid "angry" -msgstr "colèrique" +msgstr "colérique" #: ../../include/text.php:917 msgid "stupified" @@ -1490,7 +1490,7 @@ msgstr "Merci de visiter %s pour voir et/ou répondre sur cette conversation." #: ../../include/enotify.php:182 #, php-format msgid "[Red:Notify] %s posted to your profile wall" -msgstr "[Matrice Rouge:Notification] %s a publié sur votre profil" +msgstr "[Red:Notification] %s a publié sur votre profil" #: ../../include/enotify.php:184 #, php-format @@ -1525,7 +1525,7 @@ msgstr "[Red:Notification] %1$s vous a cogné" #: ../../include/enotify.php:226 #, php-format msgid "%1$s, %2$s poked you at %3$s" -msgstr "%1$s, vous avez été cogné/pointé/sollicité par %2$s sur %3$s" +msgstr "%1$s, %2$s vous a cogné sur %3$s #: ../../include/enotify.php:227 #, php-format @@ -1535,7 +1535,7 @@ msgstr "%1$s, %2$s [zrl=%2$s]vous a cogné[/zrl]." #: ../../include/enotify.php:243 #, php-format msgid "[Red:Notify] %s tagged your post" -msgstr "[Matrice Rouge:Notification] %s a étiqueté votre publication" +msgstr "[Red:Notification] %s a étiqueté votre publication" #: ../../include/enotify.php:244 #, php-format @@ -1574,7 +1574,7 @@ msgstr "Merci de visiter %s avant d'approuver (ou non) cette demande de relation #: ../../include/enotify.php:272 msgid "[Red:Notify] Friend suggestion received" -msgstr "[Matrice Rouge:Notification] Nouvelle suggestion d'amitié" +msgstr "[Red:Notification] Nouvelle suggestion d'amitié" #: ../../include/enotify.php:273 #, php-format @@ -3126,7 +3126,7 @@ msgstr "Indice pour la phrase de passe" #: ../../include/js_strings.php:16 msgid "Notice: Permissions have changed but have not yet been submitted." -msgstr "Note : Les permissions ont changées, mais n'ont pas encore été sauvées." +msgstr "Note : Les permissions ont changé, mais n'ont pas encore été soumises." #: ../../include/js_strings.php:17 msgid "close all" diff --git a/view/fr/strings.php b/view/fr/strings.php index a6f020c58..9b50ecebe 100644 --- a/view/fr/strings.php +++ b/view/fr/strings.php @@ -65,23 +65,23 @@ $a->strings["%d Connection"] = array( $a->strings["View Connections"] = "Voir les relations"; $a->strings["Save"] = "Sauver"; $a->strings["poke"] = "cogne"; -$a->strings["poked"] = "s'est fait cogner par"; +$a->strings["poked"] = "a cogné"; $a->strings["ping"] = "solliciter"; -$a->strings["pinged"] = "sollicité"; +$a->strings["pinged"] = "a sollicité"; $a->strings["prod"] = "aiguillonner"; -$a->strings["prodded"] = "aiguillonné"; -$a->strings["slap"] = "giffle"; -$a->strings["slapped"] = "gifflé"; +$a->strings["prodded"] = "a aiguillonné"; +$a->strings["slap"] = "gifler"; +$a->strings["slapped"] = "a giflé"; $a->strings["finger"] = "pointer"; -$a->strings["fingered"] = "pointé"; -$a->strings["rebuff"] = "rejetter"; -$a->strings["rebuffed"] = "rejetté"; +$a->strings["fingered"] = "a pointé"; +$a->strings["rebuff"] = "rejeter"; +$a->strings["rebuffed"] = "a rejeté"; $a->strings["happy"] = "heureux"; $a->strings["sad"] = "triste"; $a->strings["mellow"] = "mélancolique"; $a->strings["tired"] = "fatigué"; $a->strings["perky"] = "impertinent"; -$a->strings["angry"] = "colèrique"; +$a->strings["angry"] = "colérique"; $a->strings["stupified"] = "stupéfié"; $a->strings["puzzled"] = "perplexe"; $a->strings["interested"] = "intéressé"; @@ -349,16 +349,16 @@ $a->strings["%1\$s, %2\$s commented on [zrl=%3\$s]your %4\$s[/zrl]"] = "%1\$s, % $a->strings["[Red:Notify] Comment to conversation #%1\$d by %2\$s"] = "[Red:Notification] Commentaire de %2\$s sur conversation #%1\$d"; $a->strings["%1\$s, %2\$s commented on an item/conversation you have been following."] = "%1\$s, %2\$s a commenté un élément de conversation que vous suivez."; $a->strings["Please visit %s to view and/or reply to the conversation."] = "Merci de visiter %s pour voir et/ou répondre sur cette conversation."; -$a->strings["[Red:Notify] %s posted to your profile wall"] = "[Matrice Rouge:Notification] %s a publié sur votre profil"; +$a->strings["[Red:Notify] %s posted to your profile wall"] = "[Red:Notification] %s a publié sur votre profil"; $a->strings["%1\$s, %2\$s posted to your profile wall at %3\$s"] = "%1\$s, %2\$s a publié sur votre profil à %3\$s"; $a->strings["%1\$s, %2\$s posted to [zrl=%3\$s]your wall[/zrl]"] = "%1\$s, %2\$s a publié sur [zrl=%3\$s]votre profil[/zrl]"; $a->strings["[Red:Notify] %s tagged you"] = "[Red:Notification] %s vous a étiqueté"; $a->strings["%1\$s, %2\$s tagged you at %3\$s"] = "%1\$s, vous avez été étiqueté sur %3\$s par %2\$s"; $a->strings["%1\$s, %2\$s [zrl=%3\$s]tagged you[/zrl]."] = "%1\$s, %2\$s [zrl=%3\$s]vous a étiqueté[/zrl]."; $a->strings["[Red:Notify] %1\$s poked you"] = "[Red:Notification] %1\$s vous a cogné"; -$a->strings["%1\$s, %2\$s poked you at %3\$s"] = "%1\$s, vous avez été cogné/pointé/sollicité par %2\$s sur %3\$s"; +$a->strings["%1\$s, %2\$s poked you at %3\$s"] = "%1\$s, %2\$s vous a cogné sur %3\$s"; $a->strings["%1\$s, %2\$s [zrl=%2\$s]poked you[/zrl]."] = "%1\$s, %2\$s [zrl=%2\$s]vous a cogné[/zrl]."; -$a->strings["[Red:Notify] %s tagged your post"] = "[Matrice Rouge:Notification] %s a étiqueté votre publication"; +$a->strings["[Red:Notify] %s tagged your post"] = "[Red:Notification] %s a étiqueté votre publication"; $a->strings["%1\$s, %2\$s tagged your post at %3\$s"] = "%1\$s, %2\$s a étiqueté votre publication sur %3\$s"; $a->strings["%1\$s, %2\$s tagged [zrl=%3\$s]your post[/zrl]"] = "%1\$s, %2\$s a étiqueté [zrl=%3\$s]votre publication[/zrl]"; $a->strings["[Red:Notify] Introduction received"] = "[Red:Notification] Nouvelle introduction"; @@ -366,7 +366,7 @@ $a->strings["%1\$s, you've received an new connection request from '%2\$s' at %3 $a->strings["%1\$s, you've received [zrl=%2\$s]a new connection request[/zrl] from %3\$s."] = "%1\$s, vous avez reçu [zrl=%2\$s]une demande de mise en relation[/zrl] de %3\$s."; $a->strings["You may visit their profile at %s"] = "Vous pouvez visiter leur profil sur %s"; $a->strings["Please visit %s to approve or reject the connection request."] = "Merci de visiter %s avant d'approuver (ou non) cette demande de relation."; -$a->strings["[Red:Notify] Friend suggestion received"] = "[Matrice Rouge:Notification] Nouvelle suggestion d'amitié"; +$a->strings["[Red:Notify] Friend suggestion received"] = "[Red:Notification] Nouvelle suggestion d'amitié"; $a->strings["%1\$s, you've received a friend suggestion from '%2\$s' at %3\$s"] = "%1\$s, vous avez reçu une suggestion de relation de '%2\$s' à %3\$s"; $a->strings["%1\$s, you've received [zrl=%2\$s]a friend suggestion[/zrl] for %3\$s from %4\$s."] = "%1\$s, avez reçu %3\$s comme [zrl=%2\$s]une suggestion de relation[/zrl] de %4\$s."; $a->strings["Name:"] = "Nom :"; @@ -735,7 +735,7 @@ $a->strings["Passwords do not match"] = "Les mots de passe ne correspondent pas" $a->strings["everybody"] = "tout le monde"; $a->strings["Secret Passphrase"] = "Phrase de passe secrète"; $a->strings["Passphrase hint"] = "Indice pour la phrase de passe"; -$a->strings["Notice: Permissions have changed but have not yet been submitted."] = "Note : Les permissions ont changées, mais n'ont pas encore été sauvées."; +$a->strings["Notice: Permissions have changed but have not yet been submitted."] = "Note : Les permissions ont changé, mais n'ont pas encore été soumises."; $a->strings["close all"] = "fermer tout"; $a->strings["timeago.prefixAgo"] = "timeago.prefixAgo"; $a->strings["timeago.prefixFromNow"] = "timeago.prefixFromNow"; From 1391fdfa7c62699b9e9679db1f5c191f986bfb70 Mon Sep 17 00:00:00 2001 From: Olivier van Helden Date: Thu, 4 Dec 2014 00:31:58 -0400 Subject: [PATCH 05/29] update fr - sorry for multiple posts, I will try to find time to check the whole french translation and submit once. --- view/fr/messages.po | 38 +++++++++++++++++++------------------- view/fr/strings.php | 34 +++++++++++++++++----------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/view/fr/messages.po b/view/fr/messages.po index a15cf225b..1ef71294f 100644 --- a/view/fr/messages.po +++ b/view/fr/messages.po @@ -91,7 +91,7 @@ msgstr "Favoris" #: ../../include/apps.php:125 msgid "Address Book" -msgstr "Carnet d'adresse" +msgstr "Carnet d'adresses" #: ../../include/apps.php:126 ../../include/nav.php:106 ../../boot.php:1498 msgid "Login" @@ -289,7 +289,7 @@ msgstr "Sauver" #: ../../include/text.php:897 msgid "poke" -msgstr "cogne" +msgstr "cogner" #: ../../include/text.php:897 ../../include/conversation.php:243 msgid "poked" @@ -377,7 +377,7 @@ msgstr "amer" #: ../../include/text.php:921 msgid "cheerful" -msgstr "entrain" +msgstr "joyeux" #: ../../include/text.php:922 msgid "alive" @@ -385,7 +385,7 @@ msgstr "énergique" #: ../../include/text.php:923 msgid "annoyed" -msgstr "agaçé" +msgstr "agacé" #: ../../include/text.php:924 msgid "anxious" @@ -517,7 +517,7 @@ msgstr "Cliquer pour ouvrir/fermer" #: ../../include/text.php:1512 ../../mod/events.php:374 msgid "Link to Source" -msgstr "Lien vers la Source" +msgstr "Lien vers la source" #: ../../include/text.php:1531 msgid "Select a page layout: " @@ -563,7 +563,7 @@ msgstr "Menus" #: ../../include/text.php:2008 msgid "Layouts" -msgstr "Mises-en-page" +msgstr "Mises en page" #: ../../include/text.php:2009 msgid "Pages" @@ -766,7 +766,7 @@ msgstr "Fermer" #: ../../include/activities.php:39 msgid " and " -msgstr "et" +msgstr " et " #: ../../include/activities.php:47 msgid "public profile" @@ -780,12 +780,12 @@ msgstr "%1$s a changé %2$s en “%3$s”" #: ../../include/activities.php:53 #, php-format msgid "Visit %1$s's %2$s" -msgstr "Visiter %1$s de %2$s" +msgstr "Visiter %1$s sur %2$s" #: ../../include/activities.php:56 #, php-format msgid "%1$s has an updated %2$s, changing %3$s." -msgstr "%1$s a mis-à-jour %2$s, modifiant %3$s." +msgstr "%1$s a mis à jour %2$s, modifiant %3$s." #: ../../include/api.php:1036 msgid "Public Timeline" @@ -805,7 +805,7 @@ msgstr "Impossible de trouver le fichier à remplacer." #: ../../include/attach.php:370 msgid "Cannot locate file to revise/update" -msgstr "Impossible de trouver le fichier à corriger/mettre-à-jour" +msgstr "Impossible de trouver le fichier à corriger/mettre à jour" #: ../../include/attach.php:381 #, php-format @@ -3567,7 +3567,7 @@ msgstr "Menu introuvable." #: ../../mod/mitem.php:47 msgid "Menu element updated." -msgstr "Entrée de menu mis-à-jour." +msgstr "Entrée de menu mis à jour." #: ../../mod/mitem.php:51 msgid "Unable to update menu element." @@ -3716,7 +3716,7 @@ msgstr "Le mot de passe a été changé." #: ../../mod/settings.php:216 msgid "Password update failed. Please try again." -msgstr "La mise-à-jour du mot de passe a échoué. Merci de recommencer." +msgstr "La mise à jour du mot de passe a échoué. Merci de recommencer." #: ../../mod/settings.php:230 msgid "Not valid email." @@ -5292,7 +5292,7 @@ msgstr "Supprimer le contact" #: ../../mod/connedit.php:549 msgid "Last update:" -msgstr "Dernière mise-à-jour :" +msgstr "Dernière mise à jour :" #: ../../mod/connedit.php:551 msgid "Update public posts" @@ -5549,7 +5549,7 @@ msgstr "Impossible de trouver une version CLI de PHP dans le PATH du serveur web msgid "" "If you don't have a command line version of PHP installed on server, you " "will not be able to run background polling via cron." -msgstr "En l'absence de version CLI de PHP sur votre serveur, vous ne pourrez pas utiliser la mise-à-jour en arrière-plan via cron." +msgstr "En l'absence de version CLI de PHP sur votre serveur, vous ne pourrez pas utiliser la mise à jour en arrière-plan via cron." #: ../../mod/setup.php:392 msgid "PHP executable path" @@ -5802,7 +5802,7 @@ msgstr "

Et maintenant

" msgid "" "IMPORTANT: You will need to [manually] setup a scheduled task for the " "poller." -msgstr "IMPORTANT : Vous devez créer [manuellement] une tâche planifiée pour les mises-à-jour." +msgstr "IMPORTANT : Vous devez créer [manuellement] une tâche planifiée pour les mises à jour." #: ../../mod/editblock.php:8 ../../mod/editblock.php:27 #: ../../mod/editblock.php:53 ../../mod/editlayout.php:36 @@ -6279,7 +6279,7 @@ msgstr "Impossible de créer la collection." #: ../../mod/group.php:54 msgid "Collection updated." -msgstr "Collection mise-à-jour." +msgstr "Collection mise à jour." #: ../../mod/group.php:86 msgid "Create a collection of channels." @@ -6936,7 +6936,7 @@ msgstr "Niveau de journalisation" #: ../../mod/thing.php:98 msgid "Thing updated" -msgstr "Chose mise-à-jour" +msgstr "Chose mise à jour" #: ../../mod/thing.php:158 msgid "Object store: failed" @@ -7997,12 +7997,12 @@ msgstr "Vous êtes plutôt \"bureau bien rangé\" ou \"gros foutoir\"?" #: ../../boot.php:1296 #, php-format msgid "Update %s failed. See error logs." -msgstr "La mise-à-jour %s a échoué. Merci de consulter les journaux d'erreur." +msgstr "La mise à jour %s a échoué. Merci de consulter les journaux d'erreur." #: ../../boot.php:1299 #, php-format msgid "Update Error at %s" -msgstr "Erreur de mise-à-jour sur %s" +msgstr "Erreur de mise à jour sur %s" #: ../../boot.php:1473 msgid "" diff --git a/view/fr/strings.php b/view/fr/strings.php index 9b50ecebe..93f2b163d 100644 --- a/view/fr/strings.php +++ b/view/fr/strings.php @@ -19,7 +19,7 @@ $a->strings["created a new post"] = "a publié"; $a->strings["commented on %s's post"] = "a commenté la publication de %s"; $a->strings["Site Admin"] = "Administrateur"; $a->strings["Bookmarks"] = "Favoris"; -$a->strings["Address Book"] = "Carnet d'adresse"; +$a->strings["Address Book"] = "Carnet d'adresses"; $a->strings["Login"] = "Connexion"; $a->strings["Channel Select"] = "Changer de canal"; $a->strings["Matrix"] = "Matrice"; @@ -64,7 +64,7 @@ $a->strings["%d Connection"] = array( ); $a->strings["View Connections"] = "Voir les relations"; $a->strings["Save"] = "Sauver"; -$a->strings["poke"] = "cogne"; +$a->strings["poke"] = "cogner"; $a->strings["poked"] = "a cogné"; $a->strings["ping"] = "solliciter"; $a->strings["pinged"] = "a sollicité"; @@ -86,7 +86,7 @@ $a->strings["stupified"] = "stupéfié"; $a->strings["puzzled"] = "perplexe"; $a->strings["interested"] = "intéressé"; $a->strings["bitter"] = "amer"; -$a->strings["cheerful"] = "entrain"; +$a->strings["cheerful"] = "joyeux"; $a->strings["alive"] = "énergique"; $a->strings["annoyed"] = "agacé"; $a->strings["anxious"] = "anxieux"; @@ -121,7 +121,7 @@ $a->strings["bytes"] = "octets"; $a->strings["remove category"] = "supprimer la catégorie"; $a->strings["remove from file"] = "retirer du fichier"; $a->strings["Click to open/close"] = "Cliquer pour ouvrir/fermer"; -$a->strings["Link to Source"] = "Lien vers la Source"; +$a->strings["Link to Source"] = "Lien vers la source"; $a->strings["Select a page layout: "] = "Choisir une mise en page :"; $a->strings["default"] = "défaut"; $a->strings["Page content type: "] = "Type de contenu :"; @@ -170,16 +170,16 @@ $a->strings["Show"] = "Voir plus"; $a->strings["Don't show"] = "Cacher"; $a->strings["Permissions"] = "Permissions"; $a->strings["Close"] = "Fermer"; -$a->strings[" and "] = "et"; +$a->strings[" and "] = " et "; $a->strings["public profile"] = "profil public"; $a->strings["%1\$s changed %2\$s to “%3\$s”"] = "%1\$s a changé %2\$s en “%3\$s”"; -$a->strings["Visit %1\$s's %2\$s"] = "Visiter %1\$s de %2\$s"; -$a->strings["%1\$s has an updated %2\$s, changing %3\$s."] = "%1\$s a mis-à-jour %2\$s, modifiant %3\$s."; +$a->strings["Visit %1\$s's %2\$s"] = "Visiter %1\$s sur %2\$s"; +$a->strings["%1\$s has an updated %2\$s, changing %3\$s."] = "%1\$s a mis à jour %2\$s, modifiant %3\$s."; $a->strings["Public Timeline"] = "Fil public"; $a->strings["Item was not found."] = "Élément introuvable."; $a->strings["No source file."] = "Pas de fichier source."; $a->strings["Cannot locate file to replace"] = "Impossible de trouver le fichier à remplacer."; -$a->strings["Cannot locate file to revise/update"] = "Impossible de trouver le fichier à corriger/mettre-à-jour"; +$a->strings["Cannot locate file to revise/update"] = "Impossible de trouver le fichier à corriger/mettre à jour"; $a->strings["File exceeds size limit of %d"] = "Le fichier dépasse la taille limite de %d"; $a->strings["You have reached your limit of %1$.0f Mbytes attachment storage."] = "Vous avez atteint votre limite de %1$.0f méga-octets autorisés pour le stockage des pièces-jointes"; $a->strings["File upload failed. Possible system limit or action terminated."] = "Envoi du fichier impossible. Limite système ou action avortée."; @@ -840,7 +840,7 @@ $a->strings["Can administer my channel resources"] = "Peut administrer les resso $a->strings["Extremely advanced. Leave this alone unless you know what you are doing"] = "Très avancé. Ne pas toucher, sauf si vous savez VRAIMENT ce que vous faites"; $a->strings["Set your current mood and tell your friends"] = "Indiquez votre humeur du moment à vos amis"; $a->strings["Menu not found."] = "Menu introuvable."; -$a->strings["Menu element updated."] = "Entrée de menu mis-à-jour."; +$a->strings["Menu element updated."] = "Entrée de menu mis à jour."; $a->strings["Unable to update menu element."] = "Impossible de mettre l'entrée de menu à jour."; $a->strings["Menu element added."] = "Entrée de menu ajouté."; $a->strings["Unable to add menu element."] = "Impossible d'ajouter l'entrée de menu."; @@ -877,7 +877,7 @@ $a->strings["Key and Secret are required"] = "Clef et secret sont requis"; $a->strings["Passwords do not match. Password unchanged."] = "Les deux saisies du mot de passe ne correspondent pas. Il n'a donc pas été changé."; $a->strings["Empty passwords are not allowed. Password unchanged."] = "Le mot de passe ne peut pas être vide. Il n'a donc pas été changé."; $a->strings["Password changed."] = "Le mot de passe a été changé."; -$a->strings["Password update failed. Please try again."] = "La mise-à-jour du mot de passe a échoué. Merci de recommencer."; +$a->strings["Password update failed. Please try again."] = "La mise à jour du mot de passe a échoué. Merci de recommencer."; $a->strings["Not valid email."] = "Adresse de courriel non-valide."; $a->strings["Protected email address. Cannot change to that email."] = "Adresse de courriel protégée. Impossible de l'utiliser."; $a->strings["System failure storing new email. Please try again."] = "Défaillance système lors du stockage de la nouvelle adresse de courriel. Merci de ré-essayer."; @@ -1251,7 +1251,7 @@ $a->strings["Ignore contact"] = "Ignorer le contact"; $a->strings["Repair URL settings"] = "Réparer les réglages d'URL"; $a->strings["View conversations"] = "Voir les conversations"; $a->strings["Delete contact"] = "Supprimer le contact"; -$a->strings["Last update:"] = "Dernière mise-à-jour :"; +$a->strings["Last update:"] = "Dernière mise à jour :"; $a->strings["Update public posts"] = "Mettre à jour les publications"; $a->strings["Update now"] = "Mettre à jour maintenant"; $a->strings["Currently blocked"] = "Actuellement bloqué"; @@ -1310,7 +1310,7 @@ $a->strings["Please use SSL (https) URL if available."] = "Merci d'utiliser SSL/ $a->strings["Please select a default timezone for your website"] = "Merci de choisir une zone de temps (fuseau horaire) pour votre site"; $a->strings["Site settings"] = "Réglages du site"; $a->strings["Could not find a command line version of PHP in the web server PATH."] = "Impossible de trouver une version CLI de PHP dans le PATH du serveur web."; -$a->strings["If you don't have a command line version of PHP installed on server, you will not be able to run background polling via cron."] = "En l'absence de version CLI de PHP sur votre serveur, vous ne pourrez pas utiliser la mise-à-jour en arrière-plan via cron."; +$a->strings["If you don't have a command line version of PHP installed on server, you will not be able to run background polling via cron."] = "En l'absence de version CLI de PHP sur votre serveur, vous ne pourrez pas utiliser la mise à jour en arrière-plan via cron."; $a->strings["PHP executable path"] = "Chemin vers l'éxecutable PHP"; $a->strings["Enter full path to php executable. You can leave this blank to continue the installation."] = "Entrez le chemin complet vers l'exécutable php. Vous pouvez continuer l'installation sans."; $a->strings["Command line PHP"] = "PHP en ligne de commande (CLI)"; @@ -1360,7 +1360,7 @@ $a->strings["Url rewrite is working"] = "La réécriture d'URL fonctionne"; $a->strings["The database configuration file \".htconfig.php\" could not be written. Please use the enclosed text to create a configuration file in your web server root."] = "Le fichier de configuration de la base de données - \".htconfig.php\" - ne peut être écrit. Merci de copier le texte généré dans un fichier à ce nom, à la racine de votre serveur web."; $a->strings["Errors encountered creating database tables."] = "Erreurs rencontrées pendant la création de tables de BD."; $a->strings["

What next

"] = "

Et maintenant

"; -$a->strings["IMPORTANT: You will need to [manually] setup a scheduled task for the poller."] = "IMPORTANT : Vous devez créer [manuellement] une tâche planifiée pour les mises-à-jour."; +$a->strings["IMPORTANT: You will need to [manually] setup a scheduled task for the poller."] = "IMPORTANT : Vous devez créer [manuellement] une tâche planifiée pour les mises à jour."; $a->strings["Item not found"] = "Élément introuvable"; $a->strings["Edit Block"] = "Éditer bloc"; $a->strings["Delete block?"] = "Supprimer le bloc?"; @@ -1473,7 +1473,7 @@ $a->strings["Suggest a friend for %s"] = "Suggérer une relation à %s"; $a->strings["No suggestions available. If this is a new site, please try again in 24 hours."] = "Pas de suggestions pour l'instant. Si le site est récent, merci de re-tenter dans 24 heures."; $a->strings["Collection created."] = "Collection créée."; $a->strings["Could not create collection."] = "Impossible de créer la collection."; -$a->strings["Collection updated."] = "Collection mise-à-jour."; +$a->strings["Collection updated."] = "Collection mise à jour."; $a->strings["Create a collection of channels."] = "Créez une collection de canaux."; $a->strings["Collection Name: "] = "Nom de la collection :"; $a->strings["Members are visible to other channels"] = "Les membres sont visibles par les autres canaux"; @@ -1633,7 +1633,7 @@ $a->strings["Debugging"] = "Débogage"; $a->strings["Log file"] = "Fichier du journal"; $a->strings["Must be writable by web server. Relative to your Red top-level directory."] = "Doit être accessible en écriture par le serveur web. Chemin relatif à la racine de votre installation de la Matrice Rouge."; $a->strings["Log level"] = "Niveau de journalisation"; -$a->strings["Thing updated"] = "Chose mise-à-jour"; +$a->strings["Thing updated"] = "Chose mise à jour"; $a->strings["Object store: failed"] = "Stockage de l'objet : échec"; $a->strings["Thing added"] = "Chose ajoutée"; $a->strings["OBJ: %1\$s %2\$s %3\$s"] = "OBJ: %1\$s %2\$s %3\$s"; @@ -1887,8 +1887,8 @@ $a->strings["Set size of conversation author photo"] = "Définir la taille de la $a->strings["Set size of followup author photos"] = "Définir la taille de la photo de l'auteur d'une réponse"; $a->strings["Sloppy photo albums"] = "Albums photo \"en biais\""; $a->strings["Are you a clean desk or a messy desk person?"] = "Vous êtes plutôt \"bureau bien rangé\" ou \"gros foutoir\"?"; -$a->strings["Update %s failed. See error logs."] = "La mise-à-jour %s a échoué. Merci de consulter les journaux d'erreur."; -$a->strings["Update Error at %s"] = "Erreur de mise-à-jour sur %s"; +$a->strings["Update %s failed. See error logs."] = "La mise à jour %s a échoué. Merci de consulter les journaux d'erreur."; +$a->strings["Update Error at %s"] = "Erreur de mise à jour sur %s"; $a->strings["Create an account to access services and applications within the Red Matrix"] = "Créez un compte pour pouvoir accéder aux services et applications de la Matrice Red"; $a->strings["Password"] = "Mot de passe"; $a->strings["Remember me"] = "Se souvenir de moi"; From f362d407853832d213ae0a2bd8b8c794e7ca12b1 Mon Sep 17 00:00:00 2001 From: Olivier van Helden Date: Thu, 4 Dec 2014 00:46:22 -0400 Subject: [PATCH 06/29] update fr: use prefixFromNow to display time delta in the most used, natural form ("Il y a 2 jours" and not "2 jours auparavant") --- view/fr/messages.po | 4 ++-- view/fr/strings.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/view/fr/messages.po b/view/fr/messages.po index 1ef71294f..9bc64f2b3 100644 --- a/view/fr/messages.po +++ b/view/fr/messages.po @@ -3134,7 +3134,7 @@ msgstr "fermer tout" #: ../../include/js_strings.php:19 msgid "timeago.prefixAgo" -msgstr "timeago.prefixAgo" +msgstr "Il y a" #: ../../include/js_strings.php:20 msgid "timeago.prefixFromNow" @@ -3142,7 +3142,7 @@ msgstr "timeago.prefixFromNow" #: ../../include/js_strings.php:21 msgid "ago" -msgstr "auparavant" +msgstr " " #: ../../include/js_strings.php:22 msgid "from now" diff --git a/view/fr/strings.php b/view/fr/strings.php index 93f2b163d..095788338 100644 --- a/view/fr/strings.php +++ b/view/fr/strings.php @@ -737,9 +737,9 @@ $a->strings["Secret Passphrase"] = "Phrase de passe secrète"; $a->strings["Passphrase hint"] = "Indice pour la phrase de passe"; $a->strings["Notice: Permissions have changed but have not yet been submitted."] = "Note : Les permissions ont changé, mais n'ont pas encore été soumises."; $a->strings["close all"] = "fermer tout"; -$a->strings["timeago.prefixAgo"] = "timeago.prefixAgo"; +$a->strings["timeago.prefixAgo"] = "Il y a"; $a->strings["timeago.prefixFromNow"] = "timeago.prefixFromNow"; -$a->strings["ago"] = "auparavant"; +$a->strings["ago"] = " "; $a->strings["from now"] = "de maintenant"; $a->strings["less than a minute"] = "moins d'une minute"; $a->strings["about a minute"] = "environ une minute"; From d393f11dcb4f00d327c9ebd1a18292268b21d0ca Mon Sep 17 00:00:00 2001 From: Olivier van Helden Date: Thu, 4 Dec 2014 01:09:55 -0400 Subject: [PATCH 07/29] update fr: checked mail templates and another bunch of typoes in strings --- view/fr/lostpass_eml.tpl | 16 ++++++++-------- view/fr/messages.po | 4 ++-- view/fr/passchanged_eml.tpl | 8 ++++---- view/fr/register_open_eml.tpl | 15 +++++++-------- view/fr/register_verify_eml.tpl | 8 ++++---- view/fr/register_verify_member.tpl | 8 ++++---- view/fr/strings.php | 4 ++-- view/fr/update_fail_eml.tpl | 8 ++++---- 8 files changed, 35 insertions(+), 36 deletions(-) diff --git a/view/fr/lostpass_eml.tpl b/view/fr/lostpass_eml.tpl index 04292dca8..0421d41a8 100644 --- a/view/fr/lostpass_eml.tpl +++ b/view/fr/lostpass_eml.tpl @@ -1,30 +1,30 @@ Cher {{$username}}, - Une demande pour réinitialiser votre mot de passe a récemment été reçu de {{$sitename}} + Une demande pour réinitialiser votre mot de passe a récemment été reçue par {{$sitename}} Pour confirmer cette requête, veuillez suivre le lien de vérification -suivant ou copier-coller le dans la barre d'adresse de votre navigateur. +ci-dessous ou en faire un copier-coller dans la barre d'adresse de votre navigateur. -Si vous N'AVEZ PAS demander ce changement, NE SUIVEZ PAS ce lien, ignorez simplement et/ou supprimer ce courriel. +Si vous N'AVEZ PAS demandé ce changement, NE SUIVEZ PAS ce lien, ignorez-le simplement et/ou supprimez ce courriel. Votre mot de passe ne sera pas changé à moins que nous puissions vérifier vos intentions. -Suivez ce lien pour vérifier votre identité: +Suivez ce lien pour confirmer votre identité: {{$reset_link}} Vous recevrez ensuite un second courriel avec votre nouveau mot de passe. -Vous pouvez changez ce mot de passe à partir de la page des configurations de votre profil. +Vous pouvez changer ce mot de passe à partir des réglages du profil après vous être connecté. -Voici les détails de connections: +Voici les détails de connexion: Emplacement du site:⇥{{$siteurl}} -Usager:⇥{{$email}} +Utilisateur:⇥{{$email}} Sincèrement, - Administrateur {{$sitename}} + L'administrateur {{$sitename}} \ No newline at end of file diff --git a/view/fr/messages.po b/view/fr/messages.po index 9bc64f2b3..ada772d85 100644 --- a/view/fr/messages.po +++ b/view/fr/messages.po @@ -4822,7 +4822,7 @@ msgstr "Relations communes" #: ../../mod/common.php:44 msgid "No connections in common." -msgstr "Pas de relations en commun." +msgstr "Pas de relation en commun." #: ../../mod/rmagic.php:38 msgid "" @@ -7224,7 +7224,7 @@ msgstr "Visible par :" #: ../../mod/viewconnections.php:58 msgid "No connections." -msgstr "Pas de relations." +msgstr "Pas de relation." #: ../../mod/viewconnections.php:71 #, php-format diff --git a/view/fr/passchanged_eml.tpl b/view/fr/passchanged_eml.tpl index bfbd7c5ef..7c4e3d7bb 100644 --- a/view/fr/passchanged_eml.tpl +++ b/view/fr/passchanged_eml.tpl @@ -4,16 +4,16 @@ Cher {{$username}}, Veuillez conserver cette information (ou changer immédiatement ce mot de passe temporaire). -Voici les détails de connections: +Voici les détails de connexion: Emplacement du site:⇥{{$siteurl}} -Usager:⇥{{$email}} +Utilisateur:⇥{{$email}} Mot de passe:⇥{{$new_password}} -Vous pouvez changez ce mot de passe à partir des réglages du profil après vous être connecté. +Vous pouvez changer ce mot de passe à partir des réglages du profil après vous être connecté. Sincèrement, - Administrateur {{$sitename}} + L'administrateur {{$sitename}} \ No newline at end of file diff --git a/view/fr/register_open_eml.tpl b/view/fr/register_open_eml.tpl index 7bf52a261..46390bc9d 100644 --- a/view/fr/register_open_eml.tpl +++ b/view/fr/register_open_eml.tpl @@ -1,19 +1,18 @@ Un compte a été créé sur {{$sitename}} avec cette adresse de courriel. -Voici les détails de connections: +Voici les détails de connexion: Emplacement du site:⇥{{$siteurl}} -Usager:⇥{{$email}} -Mot de passe: (le mot de passe tel qu'il a été spécifier lors de l'enregistrement) +Utilisateur:⇥{{$email}} +Mot de passe: (le mot de passe qui a été spécifié lors de l'enregistrement) -Si ce compte a été créé sans votre accord, vous pouvez -visiter ce site et réinitialiser le mot de passe. +Si ce compte a été créé sans votre accord, vous pouvez visiter ce site et réinitialiser le mot de passe. Ceci vous permettra de supprimer le compte à partir de la page des réglages du profil. -Veuillez accepter nos excuses pour tous les inconvénients que cela a pu engendrer. +Veuillez accepter nos excuses pour tous les désagréments engendrés. -Merci et Bienvenu sur {{$sitename}}. +Merci et bienvenue sur {{$sitename}}. Sincèrement, - Administrateur {{$sitename}} + L'administrateur {{$sitename}} \ No newline at end of file diff --git a/view/fr/register_verify_eml.tpl b/view/fr/register_verify_eml.tpl index 09170079c..9d2be027c 100644 --- a/view/fr/register_verify_eml.tpl +++ b/view/fr/register_verify_eml.tpl @@ -1,15 +1,15 @@ -Une demande d'enregistrement pour un nouvel usager a été reçue de {{$sitename}} laquelle requiert +Une demande d'enregistrement pour un nouvel utilisateur a été reçue par {{$sitename}} qui requiert votre accord. -Voici les détails de connections: +Voici les détails de connexion: Emplacement du site:⇥{{$siteurl}} -Usager:⇥{{$email}} +Utilisateur:⇥{{$email}} Adresse IP: {{$details}} -Pour confirmer votre accord, veuillez visiter le lien suivant: +Pour confirmer votre accord, veuillez suivre le lien suivant: {{$siteurl}}/regmod/allow/{{$hash}} diff --git a/view/fr/register_verify_member.tpl b/view/fr/register_verify_member.tpl index c7641d4f7..3461c56a0 100644 --- a/view/fr/register_verify_member.tpl +++ b/view/fr/register_verify_member.tpl @@ -1,16 +1,16 @@ Merci de vous être enregistré sur {{$sitename}}. -Voici les détails de connections: +Voici les détails de connexion: Emplacement du site:⇥{{$siteurl}} -Usager:⇥{{$email}} +Utilisateur:⇥{{$email}} Connectez-vous avec le mot de passe que vous avez choisi au moment de l'enregistrement. -Nous avons besoin de vérifier votre adresse de courriel avant d’autoriser votre accès sur le réseau. +Nous avons besoin de vérifier votre adresse de courriel avant d’autoriser votre accès au réseau. -Si vous avez enregistré ce compte, veuillez visiter ce lien: +Si vous avez enregistré ce compte, suivre ce lien: {{$siteurl}}/regver/allow/{{$hash}} diff --git a/view/fr/strings.php b/view/fr/strings.php index 095788338..c056fa930 100644 --- a/view/fr/strings.php +++ b/view/fr/strings.php @@ -1141,7 +1141,7 @@ $a->strings["By default only the instance of the channel located on this hub wil $a->strings["Remove Channel"] = "Enlever le canal"; $a->strings["No channel."] = "Pas de canal."; $a->strings["Common connections"] = "Relations communes"; -$a->strings["No connections in common."] = "Pas de relations en commun."; +$a->strings["No connections in common."] = "Pas de relation en commun."; $a->strings["We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID."] = "Nous avons rencontré un problème avec l'OpenID que vous nous avez fourni. Merci de vérifier que l'ID est bien saisi."; $a->strings["The error message was:"] = "Le message d'erreur était :"; $a->strings["Authentication failed."] = "Échec de l'authentification."; @@ -1703,7 +1703,7 @@ $a->strings["Action completed."] = "Action complétée."; $a->strings["Thank you."] = "Merci."; $a->strings["Remote privacy information not available."] = "Les informations de vie privée à distance ne sont pas disponibles."; $a->strings["Visible to:"] = "Visible par :"; -$a->strings["No connections."] = "Pas de relations."; +$a->strings["No connections."] = "Pas de relation."; $a->strings["Visit %s's profile [%s]"] = "Visiter le profil de %s [%s]"; $a->strings["View Connnections"] = "Voir les relations"; $a->strings["No valid account found."] = "Aucun compte valide trouvé."; diff --git a/view/fr/update_fail_eml.tpl b/view/fr/update_fail_eml.tpl index 39dc6fa03..5fbad2c8a 100644 --- a/view/fr/update_fail_eml.tpl +++ b/view/fr/update_fail_eml.tpl @@ -1,16 +1,16 @@ Bonjour, Je suis le serveur web de {{$sitename}}; -Les développeurs de la Matrice Rouge viennent de lancer une mise-à-jour {{$update}} récemment, +Les développeurs de la Matrice Rouge ont lancé une mise à jour {{$update}} récemment, toutefois, lorsque j'ai essayé de l'installer, quelques choses d'inattendu s'est produit. - + Nous devons corriger la situation et cela requiert votre intervention. -Veuillez contacter un développeur de la Matrice Rouge si vous avez de la difficulté à déterminer +Veuillez contacter un développeur de la Matrice Rouge si vous avez des difficultés à déterminer la meilleure approche pour résoudre le problème. Ma base de donnée est peut-être corrompue. Le message d'erreur est '{{$error}}'. -Veuillez accepter mes plus humbles excuses pour les inconvénients, +Veuillez accepter mes plus humbles excuses pour les désagréments, votre serveur web a {{$siteurl}} \ No newline at end of file From 82a4416dc7cb6bb98347416c6be3ebcade0cfd3e Mon Sep 17 00:00:00 2001 From: Olivier van Helden Date: Thu, 4 Dec 2014 01:20:38 -0400 Subject: [PATCH 08/29] update fr: 'to prod', better translated by 'encourager' --- view/fr/messages.po | 10 +++++----- view/fr/strings.php | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/view/fr/messages.po b/view/fr/messages.po index ada772d85..dfff156a2 100644 --- a/view/fr/messages.po +++ b/view/fr/messages.po @@ -305,11 +305,11 @@ msgstr "a sollicité" #: ../../include/text.php:899 msgid "prod" -msgstr "aiguillonner" +msgstr "encourager" #: ../../include/text.php:899 msgid "prodded" -msgstr "a aiguillonné" +msgstr "a encouragé" #: ../../include/text.php:900 msgid "slap" @@ -4122,7 +4122,7 @@ msgstr "Vous êtes étiqueté dans une publication" #: ../../mod/settings.php:994 msgid "You are poked/prodded/etc. in a post" -msgstr "Vous êtes cogné/pointé/etc. dans une publication" +msgstr "Vous êtes cogné/encouragé/etc. dans une publication" #: ../../mod/settings.php:997 msgid "Advanced Account/Page Type Settings" @@ -4152,11 +4152,11 @@ msgstr "Supprimer ce canal" #: ../../mod/poke.php:159 msgid "Poke/Prod" -msgstr "Cogner/Solliciter" +msgstr "Cogner/Encourager" #: ../../mod/poke.php:160 msgid "poke, prod or do other things to somebody" -msgstr "Cogner, pointer, et autres choses à faire à quelqu'un" +msgstr "Cogner, encourager, et autres choses à faire à quelqu'un" #: ../../mod/poke.php:161 msgid "Recipient" diff --git a/view/fr/strings.php b/view/fr/strings.php index c056fa930..03a6a0fee 100644 --- a/view/fr/strings.php +++ b/view/fr/strings.php @@ -68,8 +68,8 @@ $a->strings["poke"] = "cogner"; $a->strings["poked"] = "a cogné"; $a->strings["ping"] = "solliciter"; $a->strings["pinged"] = "a sollicité"; -$a->strings["prod"] = "aiguillonner"; -$a->strings["prodded"] = "a aiguillonné"; +$a->strings["prod"] = "encourager"; +$a->strings["prodded"] = "a encouragé"; $a->strings["slap"] = "gifler"; $a->strings["slapped"] = "a giflé"; $a->strings["finger"] = "pointer"; @@ -975,15 +975,15 @@ $a->strings["Someone writes a followup comment"] = "Quelqu'un a commenté sur vo $a->strings["You receive a private message"] = "Vous recevez un message privé"; $a->strings["You receive a friend suggestion"] = "Vous recevez une suggestion d'amitié/relation"; $a->strings["You are tagged in a post"] = "Vous êtes étiqueté dans une publication"; -$a->strings["You are poked/prodded/etc. in a post"] = "Vous êtes cogné/pointé/etc. dans une publication"; +$a->strings["You are poked/prodded/etc. in a post"] = "Vous êtes cogné/encouragé/etc. dans une publication"; $a->strings["Advanced Account/Page Type Settings"] = "Type de page/Compte (avancé)"; $a->strings["Change the behaviour of this account for special situations"] = "Modifie le comportement de ce compte pour certains cas particuliers"; $a->strings["Please enable expert mode (in Settings > Additional features) to adjust!"] = "Mode expert requis (Réglages > Fonctions supplémentaires) svp ajuster!"; $a->strings["Miscellaneous Settings"] = "Divers"; $a->strings["Personal menu to display in your channel pages"] = "Menu personnel tel qu'il apparaîtra sur les pages de votre canal"; $a->strings["Remove this channel"] = "Supprimer ce canal"; -$a->strings["Poke/Prod"] = "Cogner/Solliciter"; -$a->strings["poke, prod or do other things to somebody"] = "Cogner, pointer, et autres choses à faire à quelqu'un"; +$a->strings["Poke/Prod"] = "Cogner/Encourager"; +$a->strings["poke, prod or do other things to somebody"] = "Cogner, encourager, et autres choses à faire à quelqu'un"; $a->strings["Recipient"] = "Destinataire"; $a->strings["Choose what you wish to do to recipient"] = "Choisir quoi lui faire"; $a->strings["Make this post private"] = "Rendre cette contribution privée"; From f1367cb9f9b86379fe5a80c69691414483e58bad Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 4 Dec 2014 21:52:22 +0000 Subject: [PATCH 09/29] Missing include if photo album widget called from not-the-photos page. --- include/widgets.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/widgets.php b/include/widgets.php index f7b8a20bd..e686fd5bd 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -606,6 +606,7 @@ function widget_photo_albums($arr) { $channelx = channelx_by_n($a->profile['profile_uid']); if((! $channelx) || (! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_photos'))) return ''; + require_once('include/photos.php'); return photos_album_widget($channelx,$a->get_observer()); } @@ -918,4 +919,4 @@ function widget_random_block($arr) { } return $o; -} \ No newline at end of file +} From 647311db3eab87cfe15747765485df782abfa657 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Sat, 6 Dec 2014 14:55:23 +0100 Subject: [PATCH 10/29] Directory sorting as a dropdown, forum filter as checkbox, option to sort oldest first --- include/dir_fns.php | 17 +++++++++++++++++ mod/directory.php | 2 -- mod/dirsearch.php | 6 ++++-- view/tpl/dir_sort_links.tpl | 13 +++++++------ 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/include/dir_fns.php b/include/dir_fns.php index 909005bbb..8bec974fb 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -51,13 +51,30 @@ function check_upstream_directory() { } function dir_sort_links() { + // Build urls without order and pubforums so it's easy to tack on the changed value + // Probably there's an easier way to do this + $url = 'directory?'; + $tmp = $_REQUEST; + unset($tmp['order']); + $sorturl = $url . http_build_query($tmp); + $tmp = $_REQUEST; + + unset($tmp['pubforums']); + $forumsurl = $url . http_build_query($tmp); $o = replace_macros(get_markup_template('dir_sort_links.tpl'), array( '$header' => t('Directory Options'), '$normal' => t('Alphabetic'), '$reverse' => t('Reverse Alphabetic'), '$date' => t('Newest to Oldest'), + '$reversedate' => t('Oldest to Newest'), '$pubforums' => t('Public Forums Only'), + '$pubforumsonly' => x($_REQUEST,'pubforums') ? $_REQUEST['pubforums'] : '', + '$sort' => t('Sort'), + '$selected_sort' => x($_REQUEST,'order') ? $_REQUEST['order'] : 'normal', + '$sorturl' => $sorturl, + '$forumsurl' => $forumsurl, + )); return $o; } diff --git a/mod/directory.php b/mod/directory.php index c06a14d9e..47849e6ba 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -100,8 +100,6 @@ function directory_content(&$a) { $query .= '&pubforums=' . intval($pubforums); $sort_order = ((x($_REQUEST,'order')) ? $_REQUEST['order'] : ''); - if($pubforums) - $sort_order = 'normal'; if($sort_order) $query .= '&order=' . urlencode($sort_order); diff --git a/mod/dirsearch.php b/mod/dirsearch.php index 1ecf33393..a88db0a2c 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -64,7 +64,7 @@ function dirsearch_content(&$a) { $agege = ((x($_REQUEST,'agege')) ? intval($_REQUEST['agege']) : 0 ); $agele = ((x($_REQUEST,'agele')) ? intval($_REQUEST['agele']) : 0 ); $kw = ((x($_REQUEST,'kw')) ? intval($_REQUEST['kw']) : 0 ); - $forums = ((array_key_exists('pubforums',$_REQUEST)) ? intval($_REQUEST['pubforums']) : null); + $forums = ((array_key_exists('pubforums',$_REQUEST)) ? intval($_REQUEST['pubforums']) : 0); @@ -111,7 +111,7 @@ function dirsearch_content(&$a) { if($keywords) $sql_extra .= dir_query_build($joiner,'xprof_keywords',$keywords); - if(! is_null($forums)) + if($forums) $sql_extra .= dir_flag_build($joiner,'xprof_flags',XCHAN_FLAGS_PUBFORUM, $forums); @@ -183,6 +183,8 @@ function dirsearch_content(&$a) { $order = " order by xchan_name asc "; elseif($sort_order == 'reverse') $order = " order by xchan_name desc "; + elseif($sort_order == 'reversedate') + $order = " order by xchan_name_date asc "; else $order = " order by xchan_name_date desc "; diff --git a/view/tpl/dir_sort_links.tpl b/view/tpl/dir_sort_links.tpl index 2fcf0c13a..d9ecd22c6 100644 --- a/view/tpl/dir_sort_links.tpl +++ b/view/tpl/dir_sort_links.tpl @@ -1,9 +1,10 @@ From 83ea120ac96c1f565a227a670023aa3128534e45 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Sun, 7 Dec 2014 12:39:50 +0100 Subject: [PATCH 11/29] Revert "Revert "Directory shows channel suggestions by default"" This reverts commit bfde28f28eae1f4b00aac03b2714254d14ab7464. --- include/contact_widgets.php | 1 - mod/directory.php | 42 +++++++++++++++++++++++++++++++++++-- view/tpl/direntry.tpl | 3 +++ view/tpl/peoplefind.tpl | 1 - 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/include/contact_widgets.php b/include/contact_widgets.php index ee9394e95..4e8adab62 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -24,7 +24,6 @@ function findpeople_widget() { '$label' => t('Connect/Follow'), '$hint' => t('Examples: Robert Morgenstein, Fishing'), '$findthem' => t('Find'), - '$suggest' => t('Channel Suggestions'), '$similar' => '', // FIXME and uncomment when mod/match working // t('Similar Interests'), '$random' => t('Random Profile'), '$inv' => t('Invite Friends'), diff --git a/mod/directory.php b/mod/directory.php index c06a14d9e..c64c3386c 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -1,5 +1,6 @@ set_pager_itemspage(60); + if(x($_GET,'ignore')) { + q("insert into xign ( uid, xchan ) values ( %d, '%s' ) ", + intval(local_user()), + dbesc($_GET['ignore']) + ); + } } function directory_content(&$a) { @@ -43,11 +50,33 @@ function directory_content(&$a) { else $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : ''); + if(strpos($search,'=') && local_user() && get_pconfig(local_user(),'feature','expert')) $advanced = $search; + $keywords = (($_GET['keywords']) ? $_GET['keywords'] : ''); + // Suggest channels if no search terms or keywords are given + $suggest = ($search == '' && $keywords == '' && local_user()); + + if($suggest) { + $r = suggestion_query(local_user(),get_observer_hash()); + + // Remember in which order the suggestions were + $addresses = array(); + foreach($r as $rr) { + $addresses[$rr['xchan_addr']] = $index++; + } + + // Build query to get info about suggested people + $advanced = ''; + foreach(array_keys($addresses) as $address) { + $advanced .= "address=\"$address\" "; + } + + } + $tpl = get_markup_template('directory_header.tpl'); @@ -238,19 +267,28 @@ function directory_content(&$a) { 'online' => $online, 'kw' => (($out) ? t('Keywords: ') : ''), 'keywords' => $out, + 'ignlink' => $suggest ? $a->get_baseurl() . '/directory?ignore=' . $rr['hash'] : '', + 'ignore_label' => "Don't suggest", ); $arr = array('contact' => $rr, 'entry' => $entry); call_hooks('directory_item', $arr); - $entries[] = $arr['entry']; + if($sort_order == '' && $suggest) { + $entries[$addresses[$rr['address']]] = $arr['entry']; // Use the same indexes as originally to get the best suggestion first + } + else { + $entries[] = $arr['entry']; + } unset($profile); unset($location); } + ksort($entries); // Sort array by key so that foreach-constructs work as expected + if($j['keywords']) { $a->data['directory_keywords'] = $j['keywords']; } @@ -279,7 +317,7 @@ function directory_content(&$a) { '$finddsc' => t('Finding:'), '$safetxt' => htmlspecialchars($search,ENT_QUOTES,'UTF-8'), '$entries' => $entries, - '$dirlbl' => t('Directory'), + '$dirlbl' => $suggest ? t('Channel Suggestions') : t('Directory'), '$submit' => t('Find'), '$next' => alt_pager($a,$j['records'], t('next page'), t('previous page')) diff --git a/view/tpl/direntry.tpl b/view/tpl/direntry.tpl index 2da920ab1..cdc6f1f97 100755 --- a/view/tpl/direntry.tpl +++ b/view/tpl/direntry.tpl @@ -6,6 +6,9 @@ {{if $entry.connect}} {{/if}} +{{if $entry.ignlink}} + +{{/if}} diff --git a/view/tpl/peoplefind.tpl b/view/tpl/peoplefind.tpl index 2f23948c8..16af5d8ed 100755 --- a/view/tpl/peoplefind.tpl +++ b/view/tpl/peoplefind.tpl @@ -12,7 +12,6 @@ From c8818d83498d19262ba90f7f2954828c24cf03cb Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Sun, 7 Dec 2014 13:38:38 +0100 Subject: [PATCH 12/29] Suggestions in dir redux. Suggestions are now showed in directory if suggest=1 parameter is given to directory. --- include/contact_widgets.php | 1 + mod/directory.php | 6 ++++-- view/tpl/peoplefind.tpl | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 4e8adab62..ee9394e95 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -24,6 +24,7 @@ function findpeople_widget() { '$label' => t('Connect/Follow'), '$hint' => t('Examples: Robert Morgenstein, Fishing'), '$findthem' => t('Find'), + '$suggest' => t('Channel Suggestions'), '$similar' => '', // FIXME and uncomment when mod/match working // t('Similar Interests'), '$random' => t('Random Profile'), '$inv' => t('Invite Friends'), diff --git a/mod/directory.php b/mod/directory.php index c64c3386c..79c1e99c9 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -58,13 +58,14 @@ function directory_content(&$a) { $keywords = (($_GET['keywords']) ? $_GET['keywords'] : ''); // Suggest channels if no search terms or keywords are given - $suggest = ($search == '' && $keywords == '' && local_user()); + $suggest = (local_user() && x($_REQUEST,'suggest')) ? $_REQUEST['suggest'] : ''; if($suggest) { $r = suggestion_query(local_user(),get_observer_hash()); // Remember in which order the suggestions were $addresses = array(); + $index = 0; foreach($r as $rr) { $addresses[$rr['xchan_addr']] = $index++; } @@ -74,12 +75,13 @@ function directory_content(&$a) { foreach(array_keys($addresses) as $address) { $advanced .= "address=\"$address\" "; } + // Remove last space in the advanced query + $advanced = rtrim($advanced); } $tpl = get_markup_template('directory_header.tpl'); - $dirmode = intval(get_config('system','directory_mode')); if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) { diff --git a/view/tpl/peoplefind.tpl b/view/tpl/peoplefind.tpl index 16af5d8ed..ba71c1e80 100755 --- a/view/tpl/peoplefind.tpl +++ b/view/tpl/peoplefind.tpl @@ -12,6 +12,7 @@ From 098eb66ba0dac65629190764bece1f8b860384b2 Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Sun, 7 Dec 2014 16:07:34 +0100 Subject: [PATCH 13/29] merge --- doc/html/namespaceRedMatrix.js | 4 +- doc/html/namespaceRedmatrix.html | 120 ------------------------------- doc/html/namespaceRedmatrix.js | 4 -- 3 files changed, 2 insertions(+), 126 deletions(-) delete mode 100644 doc/html/namespaceRedmatrix.html delete mode 100644 doc/html/namespaceRedmatrix.js diff --git a/doc/html/namespaceRedMatrix.js b/doc/html/namespaceRedMatrix.js index 930158787..161035822 100644 --- a/doc/html/namespaceRedMatrix.js +++ b/doc/html/namespaceRedMatrix.js @@ -1,4 +1,4 @@ -var namespaceRedMatrix = +var namespaceRedmatrix = [ - [ "RedDAV", "namespaceRedMatrix_1_1RedDAV.html", "namespaceRedMatrix_1_1RedDAV" ] + [ "Import", "namespaceRedmatrix_1_1Import.html", "namespaceRedmatrix_1_1Import" ] ]; \ No newline at end of file diff --git a/doc/html/namespaceRedmatrix.html b/doc/html/namespaceRedmatrix.html deleted file mode 100644 index 2861c646a..000000000 --- a/doc/html/namespaceRedmatrix.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - -The Red Matrix: Redmatrix Namespace Reference - - - - - - - - - - - - - -
-
- - - - - - - -
-
The Red Matrix -
-
-
- - - - - -
-
- -
-
-
- -
- - - - -
- -
- -
- -
-
Redmatrix Namespace Reference
-
-
- - - - -

-Namespaces

namespace  Import
 
-
-
- diff --git a/doc/html/namespaceRedmatrix.js b/doc/html/namespaceRedmatrix.js deleted file mode 100644 index 161035822..000000000 --- a/doc/html/namespaceRedmatrix.js +++ /dev/null @@ -1,4 +0,0 @@ -var namespaceRedmatrix = -[ - [ "Import", "namespaceRedmatrix_1_1Import.html", "namespaceRedmatrix_1_1Import" ] -]; \ No newline at end of file From f3789b1aeb35d41b4766df26806aed4544cc6006 Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Sun, 7 Dec 2014 16:09:03 +0100 Subject: [PATCH 14/29] merge --- doc/html/namespaceRedMatrix.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/html/namespaceRedMatrix.html b/doc/html/namespaceRedMatrix.html index b28ba8dc6..2861c646a 100644 --- a/doc/html/namespaceRedMatrix.html +++ b/doc/html/namespaceRedMatrix.html @@ -4,7 +4,7 @@ -The Red Matrix: RedMatrix Namespace Reference +The Red Matrix: Redmatrix Namespace Reference @@ -85,7 +85,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
@@ -106,13 +106,13 @@ $(document).ready(function(){initNavTree('namespaceRedMatrix.html','');});
-
RedMatrix Namespace Reference
+
Redmatrix Namespace Reference
- +

Namespaces

namespace  RedDAV
namespace  Import
 
From 62dabecf97611925d4d47f62c9968eafb56ae64b Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Sun, 7 Dec 2014 16:17:45 +0100 Subject: [PATCH 15/29] Show tags in other channels profile field to make it easier to navigate to the channels --- include/identity.php | 17 ++- include/text.php | 256 ++++++++++++++++++++++++++++++++++++++++++ mod/item.php | 262 +------------------------------------------ 3 files changed, 273 insertions(+), 262 deletions(-) diff --git a/include/identity.php b/include/identity.php index 11da745da..7ae8e48f6 100644 --- a/include/identity.php +++ b/include/identity.php @@ -1113,7 +1113,7 @@ logger('online: ' . $profile['online']); function advanced_profile(&$a) { - + require_once('include/text.php'); if(! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_profile')) return ''; @@ -1205,7 +1205,18 @@ function advanced_profile(&$a) { if($txt = prepare_text($a->profile['contact'])) $profile['contact'] = array( t('Contact information and Social Networks:'), $txt); - if($txt = prepare_text($a->profile['channels'])) $profile['channels'] = array( t('My other channels:'), $txt); + // Support tags in the other channels field (probably want to restrict it to channels only?) + $txt = $a->profile['channels']; + $matches = get_tags($txt); + $access_tag = ''; + $str_tags = ''; + foreach($matches as $m) { + $success = handle_tag($a, $txt, $access_tag, $str_tags, $a->profile_uid, $m); // Use uid of the profile maker + } + + if($txt = prepare_text($txt)) { + $profile['channels'] = array( t('My other channels:'), $txt); + } if($txt = prepare_text($a->profile['music'])) $profile['music'] = array( t('Musical interests:'), $txt); @@ -1580,4 +1591,4 @@ function get_channel_default_perms($uid) { if($r) return $r[0]['abook_my_perms']; return 0; -} \ No newline at end of file +} diff --git a/include/text.php b/include/text.php index ce729ac1b..70a8f1179 100644 --- a/include/text.php +++ b/include/text.php @@ -2087,3 +2087,259 @@ function extra_query_args() { } return $s; } + +/** + * This function removes the tag $tag from the text $body and replaces it with + * the appropiate link. + * + * @param unknown_type $body the text to replace the tag in + * @param unknown_type $access_tag - used to return tag ACL exclusions e.g. @!foo + * @param unknown_type $str_tags string to add the tag to + * @param unknown_type $profile_uid + * @param unknown_type $tag the tag to replace + * + * @return boolean true if replaced, false if not replaced + */ +function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) { + + $replaced = false; + $r = null; + + + $termtype = ((strpos($tag,'#') === 0) ? TERM_HASHTAG : TERM_UNKNOWN); + $termtype = ((strpos($tag,'@') === 0) ? TERM_MENTION : $termtype); + $termtype = ((strpos($tag,'#^[') === 0) ? TERM_BOOKMARK : $termtype); + + + //is it a hash tag? + if(strpos($tag,'#') === 0) { + if(strpos($tag,'#^[') === 0) { + if(preg_match('/#\^\[(url|zrl)(.*?)\](.*?)\[\/(url|zrl)\]/',$tag,$match)) { + $basetag = $match[3]; + $url = ((substr($match[2],0,1) === '=') ? substr($match[2],1) : $match[3]); + $replaced = true; + + } + } + // if the tag is already replaced... + elseif((strpos($tag,'[zrl=')) || (strpos($tag,'[url='))) { + //...do nothing + return $replaced; + } + if($tag == '#getzot') { + $basetag = 'getzot'; + $url = 'https://redmatrix.me'; + $newtag = '#[zrl=' . $url . ']' . $basetag . '[/zrl]'; + $body = str_replace($tag,$newtag,$body); + $replaced = true; + } + if(! $replaced) { + + //base tag has the tags name only + + if((substr($tag,0,7) === '#"') && (substr($tag,-6,6) === '"')) { + $basetag = substr($tag,7); + $basetag = substr($basetag,0,-6); + } + else + $basetag = str_replace('_',' ',substr($tag,1)); + + //create text for link + $url = $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag); + $newtag = '#[zrl=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/zrl]'; + //replace tag by the link + $body = str_replace($tag, $newtag, $body); + $replaced = true; + } + //is the link already in str_tags? + if(! stristr($str_tags,$newtag)) { + //append or set str_tags + if(strlen($str_tags)) + $str_tags .= ','; + $str_tags .= $newtag; + } + return array('replaced' => $replaced, 'termtype' => $termtype, 'term' => $basetag, 'url' => $url, 'contact' => $r[0]); + } + + //is it a person tag? + + if(strpos($tag,'@') === 0) { + + // The @! tag will alter permissions + $exclusive = ((strpos($tag,'!') === 1) ? true : false); + + //is it already replaced? + if(strpos($tag,'[zrl=')) + return $replaced; + + //get the person's name + + $name = substr($tag,(($exclusive) ? 2 : 1)); // The name or name fragment we are going to replace + $newname = $name; // a copy that we can mess with + $tagcid = 0; + + $r = null; + + // is it some generated name? + + $forum = false; + $trailing_plus_name = false; + + // @channel+ is a forum or network delivery tag + + if(substr($newname,-1,1) === '+') { + $forum = true; + $newname = substr($newname,0,-1); + } + + // Here we're looking for an address book entry as provided by the auto-completer + // of the form something+nnn where nnn is an abook_id or the first chars of xchan_hash + + if(strrpos($newname,'+')) { + //get the id + + if(strrpos($tagcid,' ')) + $tagcid = substr($tagcid,0,strrpos($tagcid,' ')); + + $tagcid = substr($newname,strrpos($newname,'+') + 1); + + if(strlen($tagcid) < 16) + $abook_id = intval($tagcid); + //remove the next word from tag's name + if(strpos($name,' ')) { + $name = substr($name,0,strpos($name,' ')); + } + + if($abook_id) { // if there was an id + // select channel with that id from the logged in user's address book + $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash + WHERE abook_id = %d AND abook_channel = %d LIMIT 1", + intval($abook_id), + intval($profile_uid) + ); + } + else { + $r = q("SELECT * FROM xchan + WHERE xchan_hash like '%s%%' LIMIT 1", + dbesc($tagcid) + ); + } + } + + if(! $r) { + + // look for matching names in the address book + + // Two ways to deal with spaces - double quote the name or use underscores + // we see this after input filtering so quotes have been html entity encoded + + if((substr($name,0,6) === '"') && (substr($name,-6,6) === '"')) { + $newname = substr($name,6); + $newname = substr($newname,0,-6); + } + else + $newname = str_replace('_',' ',$name); + + // do this bit over since we started over with $name + + if(substr($newname,-1,1) === '+') { + $forum = true; + $newname = substr($newname,0,-1); + } + + //select someone from this user's contacts by name + $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash + WHERE xchan_name = '%s' AND abook_channel = %d LIMIT 1", + dbesc($newname), + intval($profile_uid) + ); + + if(! $r) { + //select someone by attag or nick and the name passed in + $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash + WHERE xchan_addr like ('%s') AND abook_channel = %d LIMIT 1", + dbesc(((strpos($newname,'@')) ? $newname : $newname . '@%')), + intval($profile_uid) + ); + } + + if(! $r) { + + // it's possible somebody has a name ending with '+', which we stripped off as a forum indicator + // This is very rare but we want to get it right. + + $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash + WHERE xchan_name = '%s' AND abook_channel = %d LIMIT 1", + dbesc($newname . '+'), + intval($profile_uid) + ); + if($r) + $trailing_plus_name = true; + } + } + + // $r is set if we found something + + $channel = get_app()->get_channel(); + + if($r) { + $profile = $r[0]['xchan_url']; + $newname = $r[0]['xchan_name']; + // add the channel's xchan_hash to $access_tag if exclusive + if($exclusive) { + $access_tag .= 'cid:' . $r[0]['xchan_hash']; + } + } + else { + // check for a group/collection exclusion tag + + // note that we aren't setting $replaced even though we're replacing text. + // This tag isn't going to get a term attached to it. It's only used for + // access control. The link points to out own channel just so it doesn't look + // weird - as all the other tags are linked to something. + + if(local_user() && local_user() == $profile_uid) { + require_once('include/group.php'); + $grp = group_byname($profile_uid,$name); + + if($grp) { + $g = q("select hash from groups where id = %d and visible = 1 limit 1", + intval($grp) + ); + if($g && $exclusive) { + $access_tag .= 'gid:' . $g[0]['hash']; + } + $channel = get_app()->get_channel(); + if($channel) { + $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . z_root() . '/channel/' . $channel['channel_address'] . ']' . $newname . '[/zrl]'; + $body = str_replace('@' . (($exclusive) ? '!' : '') . $name, $newtag, $body); + } + } + } + } + + if(($exclusive) && (! $access_tag)) { + $access_tag .= 'cid:' . $channel['channel_hash']; + } + + // if there is an url for this channel + + if(isset($profile)) { + $replaced = true; + //create profile link + $profile = str_replace(',','%2c',$profile); + $url = $profile; + $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . (($forum && ! $trailing_plus_name) ? '+' : '') . '[/zrl]'; + $body = str_replace('@' . (($exclusive) ? '!' : '') . $name, $newtag, $body); + //append tag to str_tags + if(! stristr($str_tags,$newtag)) { + if(strlen($str_tags)) + $str_tags .= ','; + $str_tags .= $newtag; + } + } + } + + + return array('replaced' => $replaced, 'termtype' => $termtype, 'term' => $newname, 'url' => $url, 'contact' => $r[0]); +} diff --git a/mod/item.php b/mod/item.php index 94ff32750..9ffcc7de2 100644 --- a/mod/item.php +++ b/mod/item.php @@ -85,7 +85,7 @@ function item_post(&$a) { $preview = ((x($_REQUEST,'preview')) ? intval($_REQUEST['preview']) : 0); $categories = ((x($_REQUEST,'category')) ? escape_tags($_REQUEST['category']) : ''); $webpage = ((x($_REQUEST,'webpage')) ? intval($_REQUEST['webpage']) : 0); - $pagetitle = ((x($_REQUEST,'pagetitle')) ? escape_tags(urlencode($_REQUEST['pagetitle'])) : ''); + $pagetitle = ((x($_REQUEST,'pagetitle')) ? escape_tags(urlencode($_REQUEST['pagetitle'])) : ''); $layout_mid = ((x($_REQUEST,'layout_mid')) ? escape_tags($_REQUEST['layout_mid']): ''); $plink = ((x($_REQUEST,'permalink')) ? escape_tags($_REQUEST['permalink']) : ''); @@ -468,6 +468,7 @@ function item_post(&$a) { if($mimetype === 'text/bbcode') { + require_once('include/text.php'); if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) { require_once('include/bb2diaspora.php'); $body = diaspora2bb(escape_tags($body),true); @@ -602,7 +603,7 @@ function item_post(&$a) { continue; $success = handle_tag($a, $body, $access_tag, $str_tags, ($uid) ? $uid : $profile_uid , $tag); - logger('handle_tag: ' . print_r($success,tue), LOGGER_DATA); + logger('handle_tag: ' . print_r($success,true), LOGGER_DATA); if(($access_tag) && (! $parent_item)) { logger('access_tag: ' . $tag . ' ' . print_r($access_tag,true), LOGGER_DATA); if ($first_access_tag && (! get_pconfig($profile_uid,'system','no_private_mention_acl_override'))) { @@ -987,263 +988,6 @@ function item_content(&$a) { } } -/** - * This function removes the tag $tag from the text $body and replaces it with - * the appropiate link. - * - * @param unknown_type $body the text to replace the tag in - * @param unknown_type $access_tag - used to return tag ACL exclusions e.g. @!foo - * @param unknown_type $str_tags string to add the tag to - * @param unknown_type $profile_uid - * @param unknown_type $tag the tag to replace - * - * @return boolean true if replaced, false if not replaced - */ -function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) { - - $replaced = false; - $r = null; - - - $termtype = ((strpos($tag,'#') === 0) ? TERM_HASHTAG : TERM_UNKNOWN); - $termtype = ((strpos($tag,'@') === 0) ? TERM_MENTION : $termtype); - $termtype = ((strpos($tag,'#^[') === 0) ? TERM_BOOKMARK : $termtype); - - - //is it a hash tag? - if(strpos($tag,'#') === 0) { - if(strpos($tag,'#^[') === 0) { - if(preg_match('/#\^\[(url|zrl)(.*?)\](.*?)\[\/(url|zrl)\]/',$tag,$match)) { - $basetag = $match[3]; - $url = ((substr($match[2],0,1) === '=') ? substr($match[2],1) : $match[3]); - $replaced = true; - - } - } - // if the tag is already replaced... - elseif((strpos($tag,'[zrl=')) || (strpos($tag,'[url='))) { - //...do nothing - return $replaced; - } - if($tag == '#getzot') { - $basetag = 'getzot'; - $url = 'https://redmatrix.me'; - $newtag = '#[zrl=' . $url . ']' . $basetag . '[/zrl]'; - $body = str_replace($tag,$newtag,$body); - $replaced = true; - } - if(! $replaced) { - - //base tag has the tags name only - - if((substr($tag,0,7) === '#"') && (substr($tag,-6,6) === '"')) { - $basetag = substr($tag,7); - $basetag = substr($basetag,0,-6); - } - else - $basetag = str_replace('_',' ',substr($tag,1)); - - //create text for link - $url = $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag); - $newtag = '#[zrl=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/zrl]'; - //replace tag by the link - $body = str_replace($tag, $newtag, $body); - $replaced = true; - } - //is the link already in str_tags? - if(! stristr($str_tags,$newtag)) { - //append or set str_tags - if(strlen($str_tags)) - $str_tags .= ','; - $str_tags .= $newtag; - } - return array('replaced' => $replaced, 'termtype' => $termtype, 'term' => $basetag, 'url' => $url, 'contact' => $r[0]); - } - - //is it a person tag? - - if(strpos($tag,'@') === 0) { - - // The @! tag will alter permissions - $exclusive = ((strpos($tag,'!') === 1) ? true : false); - - //is it already replaced? - if(strpos($tag,'[zrl=')) - return $replaced; - - //get the person's name - - $name = substr($tag,(($exclusive) ? 2 : 1)); // The name or name fragment we are going to replace - $newname = $name; // a copy that we can mess with - $tagcid = 0; - - $r = null; - - // is it some generated name? - - $forum = false; - $trailing_plus_name = false; - - // @channel+ is a forum or network delivery tag - - if(substr($newname,-1,1) === '+') { - $forum = true; - $newname = substr($newname,0,-1); - } - - // Here we're looking for an address book entry as provided by the auto-completer - // of the form something+nnn where nnn is an abook_id or the first chars of xchan_hash - - if(strrpos($newname,'+')) { - //get the id - - if(strrpos($tagcid,' ')) - $tagcid = substr($tagcid,0,strrpos($tagcid,' ')); - - $tagcid = substr($newname,strrpos($newname,'+') + 1); - - if(strlen($tagcid) < 16) - $abook_id = intval($tagcid); - //remove the next word from tag's name - if(strpos($name,' ')) { - $name = substr($name,0,strpos($name,' ')); - } - - if($abook_id) { // if there was an id - // select channel with that id from the logged in user's address book - $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash - WHERE abook_id = %d AND abook_channel = %d LIMIT 1", - intval($abook_id), - intval($profile_uid) - ); - } - else { - $r = q("SELECT * FROM xchan - WHERE xchan_hash like '%s%%' LIMIT 1", - dbesc($tagcid) - ); - } - } - - if(! $r) { - - // look for matching names in the address book - - // Two ways to deal with spaces - doube quote the name or use underscores - // we see this after input filtering so quotes have been html entity encoded - - if((substr($name,0,6) === '"') && (substr($name,-6,6) === '"')) { - $newname = substr($name,6); - $newname = substr($newname,0,-6); - } - else - $newname = str_replace('_',' ',$name); - - // do this bit over since we started over with $name - - if(substr($newname,-1,1) === '+') { - $forum = true; - $newname = substr($newname,0,-1); - } - - //select someone from this user's contacts by name - $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash - WHERE xchan_name = '%s' AND abook_channel = %d LIMIT 1", - dbesc($newname), - intval($profile_uid) - ); - - if(! $r) { - //select someone by attag or nick and the name passed in - $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash - WHERE xchan_addr like ('%s') AND abook_channel = %d LIMIT 1", - dbesc(((strpos($newname,'@')) ? $newname : $newname . '@%')), - intval($profile_uid) - ); - } - - if(! $r) { - - // it's possible somebody has a name ending with '+', which we stripped off as a forum indicator - // This is very rare but we want to get it right. - - $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash - WHERE xchan_name = '%s' AND abook_channel = %d LIMIT 1", - dbesc($newname . '+'), - intval($profile_uid) - ); - if($r) - $trailing_plus_name = true; - } - } - - // $r is set if we found something - - $channel = get_app()->get_channel(); - - if($r) { - $profile = $r[0]['xchan_url']; - $newname = $r[0]['xchan_name']; - // add the channel's xchan_hash to $access_tag if exclusive - if($exclusive) { - $access_tag .= 'cid:' . $r[0]['xchan_hash']; - } - } - else { - // check for a group/collection exclusion tag - - // note that we aren't setting $replaced even though we're replacing text. - // This tag isn't going to get a term attached to it. It's only used for - // access control. The link points to out own channel just so it doesn't look - // weird - as all the other tags are linked to something. - - if(local_user() && local_user() == $profile_uid) { - require_once('include/group.php'); - $grp = group_byname($profile_uid,$name); - - if($grp) { - $g = q("select hash from groups where id = %d and visible = 1 limit 1", - intval($grp) - ); - if($g && $exclusive) { - $access_tag .= 'gid:' . $g[0]['hash']; - } - $channel = get_app()->get_channel(); - if($channel) { - $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . z_root() . '/channel/' . $channel['channel_address'] . ']' . $newname . '[/zrl]'; - $body = str_replace('@' . (($exclusive) ? '!' : '') . $name, $newtag, $body); - } - } - } - } - - if(($exclusive) && (! $access_tag)) { - $access_tag .= 'cid:' . $channel['channel_hash']; - } - - // if there is an url for this channel - - if(isset($profile)) { - $replaced = true; - //create profile link - $profile = str_replace(',','%2c',$profile); - $url = $profile; - $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . (($forum && ! $trailing_plus_name) ? '+' : '') . '[/zrl]'; - $body = str_replace('@' . (($exclusive) ? '!' : '') . $name, $newtag, $body); - //append tag to str_tags - if(! stristr($str_tags,$newtag)) { - if(strlen($str_tags)) - $str_tags .= ','; - $str_tags .= $newtag; - } - } - } - - - return array('replaced' => $replaced, 'termtype' => $termtype, 'term' => $newname, 'url' => $url, 'contact' => $r[0]); -} - - function fix_attached_photo_permissions($uid,$xchan_hash,$body, $str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny) { From 63646a144015d788634db974f144a1993b0465cc Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Sun, 7 Dec 2014 19:27:14 +0100 Subject: [PATCH 16/29] Some Doxygen comments and small cleanups. --- boot.php | 188 +++++++++++++++++++++++++---------- include/Import/Importer.php | 38 +++---- include/Import/refimport.php | 2 - include/permissions.php | 166 ++++++++++++++++++------------- include/security.php | 115 +++++++++++++-------- include/widgets.php | 158 +++++++++++++---------------- 6 files changed, 396 insertions(+), 271 deletions(-) diff --git a/boot.php b/boot.php index 3fdaa55f0..8a212a11d 100755 --- a/boot.php +++ b/boot.php @@ -27,7 +27,6 @@ * documented. */ - require_once('include/config.php'); require_once('include/network.php'); require_once('include/plugin.php'); @@ -570,7 +569,7 @@ define ( 'ITEM_RSS', 0x8000); // Item comes from a feed. Use this t define ( 'DBTYPE_MYSQL', 0 ); define ( 'DBTYPE_POSTGRES', 1 ); - + /** * * Reverse the effect of magic_quotes_gpc if it is enabled. @@ -614,10 +613,10 @@ function startup() { } /** - * * class: App * - * Our main application structure for the life of this page + * @brief Our main application structure for the life of this page. + * * Primarily deals with the URL that got us here * and tries to make some sense of it, and * stores our page contents and config storage @@ -683,11 +682,15 @@ class App { public $force_max_items = 0; public $theme_thread_allow = true; - // An array for all theme-controllable parameters - // Mostly unimplemented yet. Only options 'template_engine' and - // beyond are used. - - private $theme = array( + /** + * @brief An array for all theme-controllable parameters + * + * Mostly unimplemented yet. Only options 'template_engine' and + * beyond are used. + * + * @var array + */ + private $theme = array( 'sourcename' => '', 'videowidth' => 425, 'videoheight' => 350, @@ -697,9 +700,17 @@ class App { 'template_engine' => 'smarty3', ); - // array of registered template engines ('name'=>'class name') + /** + * array of registered template engines ('name'=>'class name') + * + * @var array + */ public $template_engines = array(); - // array of instanced template engines ('name'=>'instance') + /** + * array of instanced template engines ('name'=>'instance') + * + * @var array + */ public $template_engine_instance = array(); private $ldelim = array( @@ -716,7 +727,9 @@ class App { private $baseurl; private $path; - + /** + * App constructor. + */ function __construct() { // we'll reset this after we read our config file date_default_timezone_set('UTC'); @@ -759,8 +772,8 @@ class App { set_include_path("include/$this->hostname" . PATH_SEPARATOR . get_include_path()); - if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") { - $this->query_string = substr($_SERVER['QUERY_STRING'],2); + if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'], 0, 2) === "q=") { + $this->query_string = substr($_SERVER['QUERY_STRING'], 2); // removing trailing / - maybe a nginx problem if (substr($this->query_string, 0, 1) == "/") $this->query_string = substr($this->query_string, 1); @@ -770,8 +783,8 @@ class App { // unix style "homedir" - if(substr($this->cmd,0,1) === '~') - $this->cmd = 'channel/' . substr($this->cmd,1); + if(substr($this->cmd, 0, 1) === '~') + $this->cmd = 'channel/' . substr($this->cmd, 1); /** @@ -855,7 +868,6 @@ class App { } function set_baseurl($url) { - if(is_array($this->config) && array_key_exists('system',$this->config) && is_array($this->config['system']) @@ -888,7 +900,7 @@ class App { } function set_path($p) { - $this->path = trim(trim($p),'/'); + $this->path = trim(trim($p), '/'); } function get_path() { @@ -1030,6 +1042,7 @@ class App { * return engine defined by theme, or default * * @param string $name Template engine name + * * @return object Template Engine instance */ function template_engine($name = ''){ @@ -1056,6 +1069,11 @@ class App { echo "template engine $template_engine is not registered!\n"; killme(); } + /** + * @brief Returns the active template engine. + * + * @return string + */ function get_template_engine() { return $this->theme['template_engine']; } @@ -1097,9 +1115,13 @@ class App { } // End App class -// retrieve the App structure -// useful in functions which require it but don't get it passed to them - +/** + * @brief Retrieve the App structure. + * + * Useful in functions which require it but don't get it passed to them + * + * @return App + */ function get_app() { global $a; return $a; @@ -1117,7 +1139,8 @@ function get_app() { * * @param string|array $s variable to check * @param string $k key inside the array to check - * @return bool + * + * @return bool|int */ function x($s, $k = null) { if($k != null) { @@ -1167,24 +1190,43 @@ function z_path() { return $base; } +/** + * @brief Returns the baseurl. + * + * @see App::get_baseurl() + * + * @return string + */ function z_root() { global $a; return $a->get_baseurl(); } +/** + * @brief Return absolut URL for given $path. + * + * @param string $path + * + * @return string + */ function absurl($path) { - if(strpos($path,'/') === 0) + if(strpos($path, '/') === 0) return z_path() . $path; return $path; } -function os_mkdir($path,$mode = 0777,$recursive = false) { +function os_mkdir($path, $mode = 0777, $recursive = false) { $oldumask = @umask(0); @mkdir($path, $mode, $recursive); @umask($oldumask); } +/** + * @brief Function to check if request was an AJAX (xmlhttprequest) request. + * + * @return boolean + */ function is_ajax() { return (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'); } @@ -1332,11 +1374,11 @@ function check_config(&$a) { else $installed = array(); - $plugins = get_config('system','addon'); + $plugins = get_config('system', 'addon'); $plugins_arr = array(); if($plugins) - $plugins_arr = explode(',',str_replace(' ', '',$plugins)); + $plugins_arr = explode(',', str_replace(' ', '', $plugins)); $a->plugins = $plugins_arr; @@ -1344,7 +1386,7 @@ function check_config(&$a) { if(count($installed)) { foreach($installed as $i) { - if(! in_array($i['name'],$plugins_arr)) { + if(! in_array($i['name'], $plugins_arr)) { unload_plugin($i['name']); } else { @@ -1355,7 +1397,7 @@ function check_config(&$a) { if(count($plugins_arr)) { foreach($plugins_arr as $p) { - if(! in_array($p,$installed_arr)) { + if(! in_array($p, $installed_arr)) { load_plugin($p); } } @@ -1365,7 +1407,7 @@ function check_config(&$a) { } -function fix_system_urls($oldurl,$newurl) { +function fix_system_urls($oldurl, $newurl) { require_once('include/crypto.php'); @@ -1456,7 +1498,7 @@ function login($register = false, $form_id = 'main-login', $hiddens=false) { $a = get_app(); $o = ''; $reg = false; - $reglink = get_config('system','register_link'); + $reglink = get_config('system', 'register_link'); if(! strlen($reglink)) $reglink = 'register'; @@ -1472,7 +1514,7 @@ function login($register = false, $form_id = 'main-login', $hiddens=false) { $tpl = get_markup_template("logout.tpl"); } else { - $a->page['htmlhead'] .= replace_macros(get_markup_template("login_head.tpl"),array( + $a->page['htmlhead'] .= replace_macros(get_markup_template("login_head.tpl"), array( '$baseurl' => $a->get_baseurl(true) )); @@ -1501,16 +1543,17 @@ function login($register = false, $form_id = 'main-login', $hiddens=false) { } -// Used to end the current process, after saving session state. - +/** + * @brief Used to end the current process, after saving session state. + */ function killme() { session_write_close(); exit; } - -// redirect to another URL and terminate this process. - +/** + * @brief Redirect to another URL and terminate this process. + */ function goaway($s) { header("Location: $s"); killme(); @@ -1532,7 +1575,7 @@ function get_account_id() { } /** - * @brief Returns the entity id of locally logged in user or false. + * @brief Returns the entity id (channel_id) of locally logged in user or false. * * Returns authenticated numeric channel_id if authenticated and connected to * a channel or 0. Sometimes referred to as $uid in the code. @@ -1546,22 +1589,28 @@ function local_user() { return false; } - -// Returns contact id of authenticated site visitor or false - +/** + * @brief Returns contact id (visitor_id) of authenticated site visitor or false. + * + * @return int|bool visitor_id or false + */ function remote_user() { - if((x($_SESSION,'authenticated')) && (x($_SESSION,'visitor_id'))) + if((x($_SESSION, 'authenticated')) && (x($_SESSION, 'visitor_id'))) return $_SESSION['visitor_id']; + return false; } - -// contents of $s are displayed prominently on the page the next time -// a page is loaded. Usually used for errors or alerts. - +/** + * Contents of $s are displayed prominently on the page the next time + * a page is loaded. Usually used for errors or alerts. + * + * @param string $s Text to display + */ function notice($s) { $a = get_app(); if(! x($_SESSION, 'sysmsg')) $_SESSION['sysmsg'] = array(); + if($a->interactive) { // shameless plug, permission is denied and they have no identity. // There's a fairly good chance that they've not got zot. @@ -1572,7 +1621,13 @@ function notice($s) { } } - +/** + * Contents of $s are displayed prominently on the page the next time a page is + * loaded. Usually used for information. + * For error and alerts use notice(). + * + * @param string $s Text to display + */ function info($s) { $a = get_app(); if(! x($_SESSION, 'sysmsg_info')) $_SESSION['sysmsg_info'] = array(); @@ -1736,13 +1791,19 @@ function current_theme(){ /** - * Return full URL to theme which is currently in effect. + * @brief Return full URL to theme which is currently in effect. + * * Provide a sane default if nothing is chosen or the specified theme does not exist. + * + * @param bool $installing default false + * + * @return string */ - function current_theme_url($installing = false) { global $a; + $t = current_theme(); + $opts = ''; $opts = (($a->profile_uid) ? '?f=&puid=' . $a->profile_uid : ''); $opts .= ((x($a->layout,'schema')) ? '&schema=' . $a->layout['schema'] : ''); @@ -1761,10 +1822,12 @@ function current_theme_url($installing = false) { */ function is_site_admin() { $a = get_app(); + if((intval($_SESSION['authenticated'])) && (is_array($a->account)) && ($a->account['account_roles'] & ACCOUNT_ROLE_ADMIN)) return true; + return false; } @@ -1816,6 +1879,7 @@ function load_contact_links($uid) { * * @param array $params mapped array with query parameters * @param string $name of parameter, default null + * * @return string */ function build_querystring($params, $name = null) { @@ -1857,6 +1921,11 @@ function dba_timer() { return microtime(true); } +/** + * @brief Returns xchan_hash from the observer. + * + * @return string Empty if no observer, otherwise xchan_hash from observer + */ function get_observer_hash() { $observer = get_app()->get_observer(); if(is_array($observer)) @@ -1892,6 +1961,7 @@ function curPageURL() { * * @param App $a global application object * @param string $navname + * * @return mixed */ function get_custom_nav(&$a, $navname) { @@ -2043,12 +2113,20 @@ function construct_page(&$a) { ); } - +/** + * @brief Returns RedMatrix's root directory. + * + * @return string + */ function appdirpath() { return dirname(__FILE__); } - +/** + * @brief Set a pageicon. + * + * @param string $icon + */ function head_set_icon($icon) { global $a; @@ -2056,6 +2134,11 @@ function head_set_icon($icon) { // logger('head_set_icon: ' . $icon); } +/** + * @brief Get the pageicon. + * + * @return string absolut path to pageicon + */ function head_get_icon() { global $a; @@ -2066,6 +2149,11 @@ function head_get_icon() { return $icon; } +/** + * @brief Return the Realm of the directory. + * + * @return string + */ function get_directory_realm() { if($x = get_config('system', 'directory_realm')) return $x; diff --git a/include/Import/Importer.php b/include/Import/Importer.php index c42344236..5e684cd8e 100644 --- a/include/Import/Importer.php +++ b/include/Import/Importer.php @@ -1,26 +1,28 @@ credentials; } function get_itemlist() { - - + return $this->itemlist; } - function get_item_ident($item) { } @@ -43,19 +45,17 @@ class Import { function convert_taxonomy($item_ident) { - } function convert_child($child) { } - function store($item,$update = false) { + function store($item, $update = false) { } function run() { - $this->credentials = $this->get_credentials(); $this->itemlist = $this->get_itemlist(); if($this->itemlist) { @@ -77,18 +77,6 @@ class Import { } $cnt ++; } - - - - } - - - - - - } - - } \ No newline at end of file diff --git a/include/Import/refimport.php b/include/Import/refimport.php index 4f2572660..181b2b398 100644 --- a/include/Import/refimport.php +++ b/include/Import/refimport.php @@ -13,8 +13,6 @@ require_once('include/hubloc.php'); // with a browser until all the posts had been imported. - - define('REDMATRIX_IMPORTCHANNEL','mike'); define('REFLECT_EXPORTUSERNAME','mike'); define('REFLECT_BLOGNAME','Diary and Other Rantings'); diff --git a/include/permissions.php b/include/permissions.php index b078de4d5..563d574db 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -1,6 +1,19 @@ -hook + * global_permissions. + * + * @return array associative array containing all permissions + */ function get_perms() { // thinking about making element[2] a bitmask instead of boolean so that we can provide a list of applicable selections @@ -14,8 +27,8 @@ function get_perms() { 'view_profile' => array('channel_r_profile', intval(PERMS_R_PROFILE), true, t('Can view my default channel profile'), ''), 'view_photos' => array('channel_r_photos', intval(PERMS_R_PHOTOS), true, t('Can view my photo albums'), ''), 'view_contacts' => array('channel_r_abook', intval(PERMS_R_ABOOK), true, t('Can view my connections'), ''), - 'view_storage' => array('channel_r_storage', intval(PERMS_R_STORAGE), true, t('Can view my file storage'), ''), - 'view_pages' => array('channel_r_pages', intval(PERMS_R_PAGES), true, t('Can view my webpages'), ''), + 'view_storage' => array('channel_r_storage', intval(PERMS_R_STORAGE), true, t('Can view my file storage'), ''), + 'view_pages' => array('channel_r_pages', intval(PERMS_R_PAGES), true, t('Can view my webpages'), ''), // Write permissions 'send_stream' => array('channel_w_stream', intval(PERMS_W_STREAM), false, t('Can send me their channel stream and posts'), ''), @@ -23,19 +36,20 @@ function get_perms() { 'post_comments' => array('channel_w_comment', intval(PERMS_W_COMMENT), false, t('Can comment on or like my posts'), ''), 'post_mail' => array('channel_w_mail', intval(PERMS_W_MAIL), false, t('Can send me private mail messages'), ''), 'post_photos' => array('channel_w_photos', intval(PERMS_W_PHOTOS), false, t('Can post photos to my photo albums'), ''), - 'post_like' => array('channel_w_like', intval(PERMS_W_LIKE), false, t('Can like/dislike stuff'), t('Profiles and things other than posts/comments')), + 'post_like' => array('channel_w_like', intval(PERMS_W_LIKE), false, t('Can like/dislike stuff'), t('Profiles and things other than posts/comments')), 'tag_deliver' => array('channel_w_tagwall', intval(PERMS_W_TAGWALL), false, t('Can forward to all my channel contacts via post @mentions'), t('Advanced - useful for creating group forum channels')), 'chat' => array('channel_w_chat', intval(PERMS_W_CHAT), false, t('Can chat with me (when available)'), t('')), - 'write_storage' => array('channel_w_storage', intval(PERMS_W_STORAGE), false, t('Can write to my file storage'), ''), - 'write_pages' => array('channel_w_pages', intval(PERMS_W_PAGES), false, t('Can edit my webpages'), ''), + 'write_storage' => array('channel_w_storage', intval(PERMS_W_STORAGE), false, t('Can write to my file storage'), ''), + 'write_pages' => array('channel_w_pages', intval(PERMS_W_PAGES), false, t('Can edit my webpages'), ''), - 'republish' => array('channel_a_republish', intval(PERMS_A_REPUBLISH), false, t('Can source my public posts in derived channels'), t('Somewhat advanced - very useful in open communities')), + 'republish' => array('channel_a_republish', intval(PERMS_A_REPUBLISH), false, t('Can source my public posts in derived channels'), t('Somewhat advanced - very useful in open communities')), - 'delegate' => array('channel_a_delegate', intval(PERMS_A_DELEGATE), false, t('Can administer my channel resources'), t('Extremely advanced. Leave this alone unless you know what you are doing')), + 'delegate' => array('channel_a_delegate', intval(PERMS_A_DELEGATE), false, t('Can administer my channel resources'), t('Extremely advanced. Leave this alone unless you know what you are doing')), ); $ret = array('global_permissions' => $global_perms); - call_hooks('global_permissions',$ret); + call_hooks('global_permissions', $ret); + return $ret['global_permissions']; } @@ -43,13 +57,13 @@ function get_perms() { /** * get_all_perms($uid,$observer_xchan) * - * @param $uid : The channel_id associated with the resource owner - * @param $observer_xchan: The xchan_hash representing the observer + * @param int $uid The channel_id associated with the resource owner + * @param string $observer_xchan The xchan_hash representing the observer + * @param bool $internal_use (default true) * - * @returns: array of all permissions, key is permission name, value is true or false + * @returns array of all permissions, key is permission name, value is true or false */ - -function get_all_perms($uid,$observer_xchan,$internal_use = true) { +function get_all_perms($uid, $observer_xchan, $internal_use = true) { $global_perms = get_perms(); @@ -85,7 +99,6 @@ function get_all_perms($uid,$observer_xchan,$internal_use = true) { continue; } - // Next we're going to check for blocked or ignored contacts. // These take priority over all other settings. @@ -94,7 +107,7 @@ function get_all_perms($uid,$observer_xchan,$internal_use = true) { $ret[$perm_name] = true; continue; } - + if(! $abook_checked) { $x = q("select abook_my_perms, abook_flags, xchan_network from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_xchan = '%s' and not ( abook_flags & %d )>0 limit 1", @@ -105,7 +118,7 @@ function get_all_perms($uid,$observer_xchan,$internal_use = true) { if(! $x) { // not in address book, see if they've got an xchan $y = q("select xchan_network from xchan where xchan_hash = '%s' limit 1", - dbesc($observer_xchan) + dbesc($observer_xchan) ); } @@ -113,7 +126,7 @@ function get_all_perms($uid,$observer_xchan,$internal_use = true) { } // If they're blocked - they can't read or write - + if(($x) && ($x[0]['abook_flags'] & ABOOK_FLAG_BLOCKED)) { $ret[$perm_name] = false; continue; @@ -130,7 +143,7 @@ function get_all_perms($uid,$observer_xchan,$internal_use = true) { // system is blocked to anybody who is not authenticated - if((! $observer_xchan) && intval(get_config('system','block_public'))) { + if((! $observer_xchan) && intval(get_config('system', 'block_public'))) { $ret[$perm_name] = false; continue; } @@ -177,14 +190,14 @@ function get_all_perms($uid,$observer_xchan,$internal_use = true) { $onsite_checked = true; } - + if($c) $ret[$perm_name] = true; else $ret[$perm_name] = false; continue; - } + } // From here on we require that the observer be a connection and // handle whether we're allowing any, approved or specific ones @@ -226,7 +239,6 @@ function get_all_perms($uid,$observer_xchan,$internal_use = true) { $ret[$perm_name] = false; continue; - } $arr = array( @@ -235,11 +247,23 @@ function get_all_perms($uid,$observer_xchan,$internal_use = true) { 'permissions' => $ret); call_hooks('get_all_perms',$arr); + return $arr['permissions']; } - -function perm_is_allowed($uid,$observer_xchan,$permission) { +/** + * @brief Checks if given permission is allowed for given observer on a channel. + * + * Checks if the given observer with the hash $observer_xchan has permission + * $permission on channel_id $uid. + * $permission is one defined in get_perms(); + * + * @param int $uid The channel_id associated with the resource owner + * @param string $observer_xchan The xchan_hash representing the observer + * @param string $permission + * @return bool true if permission is allowed for observer on channel + */ +function perm_is_allowed($uid, $observer_xchan, $permission) { $arr = array( 'channel_id' => $uid, @@ -247,7 +271,7 @@ function perm_is_allowed($uid,$observer_xchan,$permission) { 'permission' => $permission, 'result' => false); - call_hooks('perm_is_allowed',$arr); + call_hooks('perm_is_allowed', $arr); if($arr['result']) return true; @@ -279,21 +303,21 @@ function perm_is_allowed($uid,$observer_xchan,$permission) { if(($x) && ($x[0]['abook_flags'] & ABOOK_FLAG_BLOCKED)) return false; - + if(($x) && (! $global_perms[$permission][2]) && ($x[0]['abook_flags'] & ABOOK_FLAG_IGNORED)) return false; if(! $x) { // not in address book, see if they've got an xchan $y = q("select xchan_network from xchan where xchan_hash = '%s' limit 1", - dbesc($observer_xchan) + dbesc($observer_xchan) ); } } // system is blocked to anybody who is not authenticated - if((! $observer_xchan) && intval(get_config('system','block_public'))) + if((! $observer_xchan) && intval(get_config('system', 'block_public'))) return false; // Check if this $uid is actually the $observer_xchan @@ -301,7 +325,6 @@ function perm_is_allowed($uid,$observer_xchan,$permission) { if($r[0]['channel_hash'] === $observer_xchan) return true; - if($r[0][$channel_perm] & PERMS_PUBLIC) return true; @@ -326,6 +349,7 @@ function perm_is_allowed($uid,$observer_xchan,$permission) { ); if($c) return true; + return false; } @@ -361,25 +385,32 @@ function perm_is_allowed($uid,$observer_xchan,$permission) { // No permissions allowed. - return false; + return false; } // Check a simple array of observers against a permissions // return a simple array of those with permission -function check_list_permissions($uid,$arr,$perm) { +function check_list_permissions($uid, $arr, $perm) { $result = array(); if($arr) foreach($arr as $x) - if(perm_is_allowed($uid,$x,$perm)) + if(perm_is_allowed($uid, $x, $perm)) $result[] = $x; + return($result); } - +/** + * @brief Sets site wide default permissions. + * + * @return array + */ function site_default_perms() { + $ret = array(); + $typical = array( 'view_stream' => PERMS_PUBLIC, 'view_profile' => PERMS_PUBLIC, @@ -401,14 +432,14 @@ function site_default_perms() { ); $global_perms = get_perms(); - $ret = array(); foreach($global_perms as $perm => $v) { - $x = get_config('default_perms',$perm); + $x = get_config('default_perms', $perm); if($x === false) $x = $typical[$perm]; $ret[$perm] = $x; } + return $ret; } @@ -449,7 +480,7 @@ function get_role_perms($role) { |PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE; $ret['channel_r_stream'] = PERMS_PUBLIC; $ret['channel_r_profile'] = PERMS_PUBLIC; - $ret['channel_r_photos'] = PERMS_PUBLIC; + $ret['channel_r_photos'] = PERMS_PUBLIC; $ret['channel_r_abook'] = PERMS_PUBLIC; $ret['channel_w_stream'] = PERMS_CONTACTS; $ret['channel_w_wall'] = PERMS_CONTACTS; @@ -465,9 +496,8 @@ function get_role_perms($role) { $ret['channel_w_pages'] = 0; $ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_w_like'] = PERMS_NETWORK; - - break; + break; case 'social_restricted': $ret['perms_auto'] = false; @@ -482,7 +512,7 @@ function get_role_perms($role) { |PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE; $ret['channel_r_stream'] = PERMS_PUBLIC; $ret['channel_r_profile'] = PERMS_PUBLIC; - $ret['channel_r_photos'] = PERMS_PUBLIC; + $ret['channel_r_photos'] = PERMS_PUBLIC; $ret['channel_r_abook'] = PERMS_PUBLIC; $ret['channel_w_stream'] = PERMS_CONTACTS; $ret['channel_w_wall'] = PERMS_CONTACTS; @@ -498,9 +528,8 @@ function get_role_perms($role) { $ret['channel_w_pages'] = 0; $ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_w_like'] = PERMS_CONTACTS; - - break; + break; case 'social_private': $ret['perms_auto'] = false; @@ -515,7 +544,7 @@ function get_role_perms($role) { |PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE; $ret['channel_r_stream'] = PERMS_PUBLIC; $ret['channel_r_profile'] = PERMS_PUBLIC; - $ret['channel_r_photos'] = PERMS_PUBLIC; + $ret['channel_r_photos'] = PERMS_PUBLIC; $ret['channel_r_abook'] = PERMS_CONTACTS; $ret['channel_w_stream'] = PERMS_CONTACTS; $ret['channel_w_wall'] = PERMS_CONTACTS; @@ -531,7 +560,7 @@ function get_role_perms($role) { $ret['channel_w_pages'] = 0; $ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_w_like'] = PERMS_CONTACTS; - + break; case 'forum': @@ -547,7 +576,7 @@ function get_role_perms($role) { |PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE|PERMS_W_TAGWALL; $ret['channel_r_stream'] = PERMS_PUBLIC; $ret['channel_r_profile'] = PERMS_PUBLIC; - $ret['channel_r_photos'] = PERMS_PUBLIC; + $ret['channel_r_photos'] = PERMS_PUBLIC; $ret['channel_r_abook'] = PERMS_PUBLIC; $ret['channel_w_stream'] = 0; $ret['channel_w_wall'] = PERMS_CONTACTS; @@ -563,7 +592,7 @@ function get_role_perms($role) { $ret['channel_w_pages'] = 0; $ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_w_like'] = PERMS_NETWORK; - + break; case 'forum_restricted': @@ -579,7 +608,7 @@ function get_role_perms($role) { |PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE|PERMS_W_TAGWALL; $ret['channel_r_stream'] = PERMS_PUBLIC; $ret['channel_r_profile'] = PERMS_PUBLIC; - $ret['channel_r_photos'] = PERMS_PUBLIC; + $ret['channel_r_photos'] = PERMS_PUBLIC; $ret['channel_r_abook'] = PERMS_PUBLIC; $ret['channel_w_stream'] = 0; $ret['channel_w_wall'] = PERMS_CONTACTS; @@ -595,9 +624,8 @@ function get_role_perms($role) { $ret['channel_w_pages'] = 0; $ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_w_like'] = PERMS_CONTACTS; - - break; + break; case 'forum_private': $ret['perms_auto'] = false; @@ -612,7 +640,7 @@ function get_role_perms($role) { |PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE; $ret['channel_r_stream'] = PERMS_PUBLIC; $ret['channel_r_profile'] = PERMS_CONTACTS; - $ret['channel_r_photos'] = PERMS_CONTACTS; + $ret['channel_r_photos'] = PERMS_CONTACTS; $ret['channel_r_abook'] = PERMS_CONTACTS; $ret['channel_w_stream'] = 0; $ret['channel_w_wall'] = PERMS_CONTACTS; @@ -628,7 +656,7 @@ function get_role_perms($role) { $ret['channel_w_pages'] = 0; $ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_w_like'] = PERMS_CONTACTS; - + break; case 'feed': @@ -644,7 +672,7 @@ function get_role_perms($role) { |PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE; $ret['channel_r_stream'] = PERMS_PUBLIC; $ret['channel_r_profile'] = PERMS_PUBLIC; - $ret['channel_r_photos'] = PERMS_PUBLIC; + $ret['channel_r_photos'] = PERMS_PUBLIC; $ret['channel_r_abook'] = PERMS_PUBLIC; $ret['channel_w_stream'] = PERMS_CONTACTS; $ret['channel_w_wall'] = PERMS_CONTACTS; @@ -660,11 +688,10 @@ function get_role_perms($role) { $ret['channel_w_pages'] = 0; $ret['channel_a_republish'] = PERMS_NETWORK; $ret['channel_w_like'] = PERMS_NETWORK; - + break; case 'feed_restricted': - $ret['perms_auto'] = false; $ret['default_collection'] = true; $ret['directory_publish'] = false; @@ -677,7 +704,7 @@ function get_role_perms($role) { |PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE; $ret['channel_r_stream'] = PERMS_PUBLIC; $ret['channel_r_profile'] = PERMS_PUBLIC; - $ret['channel_r_photos'] = PERMS_PUBLIC; + $ret['channel_r_photos'] = PERMS_PUBLIC; $ret['channel_r_abook'] = PERMS_PUBLIC; $ret['channel_w_stream'] = PERMS_CONTACTS; $ret['channel_w_wall'] = PERMS_CONTACTS; @@ -693,7 +720,7 @@ function get_role_perms($role) { $ret['channel_w_pages'] = 0; $ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_w_like'] = PERMS_NETWORK; - + break; case 'soapbox': @@ -707,7 +734,7 @@ function get_role_perms($role) { |PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE; $ret['channel_r_stream'] = PERMS_PUBLIC; $ret['channel_r_profile'] = PERMS_PUBLIC; - $ret['channel_r_photos'] = PERMS_PUBLIC; + $ret['channel_r_photos'] = PERMS_PUBLIC; $ret['channel_r_abook'] = PERMS_PUBLIC; $ret['channel_w_stream'] = 0; $ret['channel_w_wall'] = 0; @@ -723,7 +750,7 @@ function get_role_perms($role) { $ret['channel_w_pages'] = 0; $ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_w_like'] = PERMS_NETWORK; - + break; case 'repository': @@ -755,14 +782,11 @@ function get_role_perms($role) { $ret['channel_w_pages'] = PERMS_CONTACTS; $ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_w_like'] = PERMS_NETWORK; - + break; - - default: break; - } $x = get_config('system','role_perms'); @@ -775,7 +799,12 @@ function get_role_perms($role) { return $ret; } - +/** + * @brief Creates a HTML select field with all available roles. + * + * @param string $current The current role + * @return string Returns the complete HTML code for this privacy-role-select field. + */ function role_selector($current) { if(! $current) @@ -792,16 +821,17 @@ function role_selector($current) { array('soapbox' => t('Celebrity/Soapbox'), 'repository' => t('Group Repository'))), 'other' => array( t('Other'), array('custom' => t('Custom/Expert Mode')))); + $o = ''; - return $o; -} + return $o; +} diff --git a/include/security.php b/include/security.php index 8066a76f6..ca5411bde 100644 --- a/include/security.php +++ b/include/security.php @@ -1,12 +1,24 @@ -account = $user_record; $_SESSION['account_id'] = $user_record['account_id']; $_SESSION['authenticated'] = 1; @@ -39,7 +51,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive // might want to log success here } - if($return || x($_SESSION,'workflow')) { + if($return || x($_SESSION, 'workflow')) { unset($_SESSION['workflow']); return; } @@ -70,7 +82,13 @@ function authenticate_success($user_record, $login_initial = false, $interactive /* else just return */ } - +/** + * @brief Change to another channel with current logged-in account. + * + * @param int $change_channel The channel_id of the channel you want to change to + * + * @return bool|array false or channel record of the new channel + */ function change_channel($change_channel) { $ret = false; @@ -83,17 +101,17 @@ function change_channel($change_channel) { ); // It's not there. Is this an administrator, and is this the sys channel? - if (is_developer()) { - if (! $r) { - if (is_site_admin()) { - $r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel_id = %d and ( channel_pageflags & %d) and not (channel_pageflags & %d )>0 limit 1", - intval($change_channel), - intval(PAGE_SYSTEM), - intval(PAGE_REMOVED) - ); + if (is_developer()) { + if (! $r) { + if (is_site_admin()) { + $r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel_id = %d and ( channel_pageflags & %d) and not (channel_pageflags & %d )>0 limit 1", + intval($change_channel), + intval(PAGE_SYSTEM), + intval(PAGE_REMOVED) + ); + } } } - } if($r) { $hash = $r[0]['channel_hash']; @@ -109,23 +127,28 @@ function change_channel($change_channel) { ); if($x) { $_SESSION['my_url'] = $x[0]['xchan_url']; - $_SESSION['my_address'] = $r[0]['channel_address'] . '@' . substr(get_app()->get_baseurl(),strpos(get_app()->get_baseurl(),'://')+3); + $_SESSION['my_address'] = $r[0]['channel_address'] . '@' . substr(get_app()->get_baseurl(), strpos(get_app()->get_baseurl(), '://') + 3); get_app()->set_observer($x[0]); - get_app()->set_perms(get_all_perms(local_user(),$hash)); + get_app()->set_perms(get_all_perms(local_user(), $hash)); } if(! is_dir('store/' . $r[0]['channel_address'])) @os_mkdir('store/' . $r[0]['channel_address'], STORAGE_DEFAULT_PERMISSIONS,true); - } return $ret; - } - - -function permissions_sql($owner_id,$remote_verified = false,$groups = null) { +/** + * @brief Creates an addiontal SQL where statement to check permissions. + * + * @param int $owner_id + * @param bool $remote_verified default false, not used at all + * @param string $groups this param is not used at all + * + * @return string additional SQL where statement + */ +function permissions_sql($owner_id, $remote_verified = false, $groups = null) { if(defined('STATUSNET_PRIVACY_COMPATIBILITY')) return ''; @@ -142,8 +165,7 @@ function permissions_sql($owner_id,$remote_verified = false,$groups = null) { $sql = " AND allow_cid = '' AND allow_gid = '' AND deny_cid = '' - AND deny_gid = '' - + AND deny_gid = '' "; /** @@ -162,7 +184,6 @@ function permissions_sql($owner_id,$remote_verified = false,$groups = null) { * done this and passed the groups into this function. */ - else { $observer = get_observer_hash(); if($observer) { @@ -191,7 +212,16 @@ function permissions_sql($owner_id,$remote_verified = false,$groups = null) { return $sql; } -function item_permissions_sql($owner_id,$remote_verified = false,$groups = null) { +/** + * @brief Creates an addiontal SQL where statement to check permissions for an item. + * + * @param int $owner_id + * @param bool $remote_verified default false, not used at all + * @param string $groups this param is not used at all + * + * @return string additional SQL where statement + */ +function item_permissions_sql($owner_id, $remote_verified = false, $groups = null) { if(defined('STATUSNET_PRIVACY_COMPATIBILITY')) return ''; @@ -206,7 +236,6 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null) */ $sql = " AND item_private=0 "; - /** * Profile owner - everything is visible @@ -224,7 +253,6 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null) * done this and passed the groups into this function. */ - else { $observer = get_observer_hash(); @@ -250,12 +278,18 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null) ); } } + return $sql; } +/** + * @param string $observer_hash + * + * @return string additional SQL where statement + */ function public_permissions_sql($observer_hash) { - $observer = get_app()->get_observer(); + //$observer = get_app()->get_observer(); $groups = init_groups_visitor($observer_hash); $gs = '<<>>'; // should be impossible to match @@ -263,7 +297,7 @@ function public_permissions_sql($observer_hash) { if(is_array($groups) && count($groups)) { foreach($groups as $g) $gs .= '|<' . $g . '>'; - } + } $sql = ''; if($observer_hash) { $regexop = db_getfunc('REGEXP'); @@ -341,11 +375,11 @@ function check_form_security_token_ForbiddenOnErr($typename = '', $formname = 'f } } + // Returns an array of group id's this contact is a member of. // This array will only contain group id's related to the uid of this // DFRN contact. They are *not* neccessarily unique across the entire site. - if(! function_exists('init_groups_visitor')) { function init_groups_visitor($contact_id) { $groups = array(); @@ -361,8 +395,6 @@ function init_groups_visitor($contact_id) { - - // This is used to determine which uid have posts which are visible to the logged in user (from the API) for the // public_timeline, and we can use this in a community page by making // $perms = (PERMS_NETWORK|PERMS_PUBLIC) unless logged in. @@ -382,19 +414,22 @@ function stream_perms_api_uids($perms = NULL ) { intval($perms), intval(PAGE_CENSORED|PAGE_SYSTEM|PAGE_REMOVED) ); - if($r) + if($r) { foreach($r as $rr) - if(! in_array($rr['channel_id'],$ret)) + if(! in_array($rr['channel_id'], $ret)) $ret[] = $rr['channel_id']; + } $str = ''; - if($ret) + if($ret) { foreach($ret as $rr) { if($str) $str .= ','; $str .= intval($rr); } + } logger('stream_perms_api_uids: ' . $str, LOGGER_DEBUG); + return $str; } @@ -409,19 +444,21 @@ function stream_perms_xchans($perms = NULL ) { intval($perms), intval(PAGE_CENSORED|PAGE_SYETEM|PAGE_REMOVED) ); - if($r) + if($r) { foreach($r as $rr) - if(! in_array($rr['channel_hash'],$ret)) + if(! in_array($rr['channel_hash'], $ret)) $ret[] = $rr['channel_hash']; + } $str = ''; - if($ret) + if($ret) { foreach($ret as $rr) { if($str) $str .= ','; $str .= "'" . dbesc($rr) . "'"; } + } logger('stream_perms_xchans: ' . $str, LOGGER_DEBUG); + return $str; } - diff --git a/include/widgets.php b/include/widgets.php index e686fd5bd..b13be4922 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -1,4 +1,9 @@ -profile, $block, true); } @@ -16,14 +21,15 @@ function widget_profile($args) { function widget_tagcloud($args) { $o = ''; - $tab = 0; + //$tab = 0; $a = get_app(); $uid = $a->profile_uid; $count = ((x($args,'count')) ? intval($args['count']) : 24); $flags = 0; $type = TERM_CATEGORY; - $r = tagadelic($uid,$count,$authors,$flags,ITEM_WEBPAGE,$type); + // FIXME there exists no $authors variable + $r = tagadelic($uid, $count, $authors, $flags, ITEM_WEBPAGE, $type); if($r) { $o = '

' . t('Categories') . '

'; @@ -75,9 +81,8 @@ function widget_collections($args) { return ''; break; } - - return group_side($every, $each, $edit, $current, $abook_id, $wmode); + return group_side($every, $each, $edit, $current, $abook_id, $wmode); } @@ -93,7 +98,6 @@ function widget_appselect($arr) { } - function widget_suggestions($arr) { if((! local_user()) || (! feature_enabled(local_user(),'suggest'))) @@ -114,16 +118,13 @@ function widget_suggestions($arr) { // This will throw some entropy intot he situation so you won't // be looking at the same two mug shots every time the widget runs - $index = ((count($r) > 2) ? mt_rand(0,count($r) - 2) : 0); - for($x = $index; $x <= ($index+1); $x ++) { - $rr = $r[$x]; if(! $rr['xchan_url']) break; - + $connlnk = z_root() . '/follow/?url=' . $rr['xchan_addr']; $arr[] = array( @@ -138,7 +139,6 @@ function widget_suggestions($arr) { ); } - $o = replace_macros(get_markup_template('suggest_widget.tpl'),array( '$title' => t('Suggestions'), '$more' => t('See more...'), @@ -146,13 +146,13 @@ function widget_suggestions($arr) { )); return $o; - } function widget_follow($args) { if(! local_user()) return ''; + $a = get_app(); $uid =$a->channel['channel_id']; $r = q("select count(*) as total from abook where abook_channel = %d and not (abook_flags & %d)>0 ", @@ -163,10 +163,10 @@ function widget_follow($args) { $total_channels = $r[0]['total']; $limit = service_class_fetch($uid,'total_channels'); if($limit !== false) { - $abook_usage_message = sprintf( t("You have %1$.0f of %2$.0f allowed connections."), $total_channels, $limit); + $abook_usage_message = sprintf( t("You have %1$.0f of %2$.0f allowed connections."), $total_channels, $limit); } else { - $abook_usage_message = ''; + $abook_usage_message = ''; } return replace_macros(get_markup_template('follow.tpl'),array( '$connect' => t('Add New Connection'), @@ -175,7 +175,6 @@ function widget_follow($args) { '$follow' => t('Connect'), '$abook_usage_message' => $abook_usage_message )); - } @@ -192,6 +191,7 @@ function widget_notes($arr) { '$text' => $text, '$save' => t('Save'), )); + return $o; } @@ -228,8 +228,6 @@ function widget_savedsearch($arr) { $search = ''; } - - $srchurl = $a->query_string; $srchurl = rtrim(preg_replace('/searchsave\=[^\&].*?(\&|$)/is','',$srchurl),'&'); @@ -240,7 +238,7 @@ function widget_savedsearch($arr) { $srchurl = rtrim(preg_replace('/search\=[^\&].*?(\&|$)/is','',$srchurl),'&'); $srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl); $hasq = ((strpos($srchurl,'?') !== false) ? true : false); - + $o = ''; $r = q("select `tid`,`term` from `term` WHERE `uid` = %d and `type` = %d ", @@ -252,31 +250,28 @@ function widget_savedsearch($arr) { if(count($r)) { foreach($r as $rr) { - $saved[] = array( 'id' => $rr['tid'], - 'term' => $rr['term'], + 'term' => $rr['term'], 'dellink' => z_root() . '/' . $srchurl . (($hasq) ? '' : '?f=') . '&searchremove=1&search=' . urlencode($rr['term']), 'srchlink' => z_root() . '/' . $srchurl . (($hasq) ? '' : '?f=') . '&search=' . urlencode($rr['term']), 'displayterm' => htmlspecialchars($rr['term'], ENT_COMPAT,'UTF-8'), - 'encodedterm' => urlencode($rr['term']), - 'delete' => t('Remove term'), - 'selected' => ($search==$rr['term']), + 'encodedterm' => urlencode($rr['term']), + 'delete' => t('Remove term'), + 'selected' => ($search==$rr['term']), ); } - } + } - $tpl = get_markup_template("saved_searches.tpl"); $o = replace_macros($tpl, array( '$title' => t('Saved Searches'), '$add' => t('add'), - '$searchbox' => searchbox($search,'netsearch-box',$srchurl . (($hasq) ? '' : '?f='),true), + '$searchbox' => searchbox($search, 'netsearch-box', $srchurl . (($hasq) ? '' : '?f='), true), '$saved' => $saved, )); return $o; - } @@ -306,7 +301,6 @@ function widget_filer($arr) { '$all' => t('Everything'), '$terms' => $terms, '$base' => z_root() . '/' . $a->cmd - )); } @@ -327,7 +321,6 @@ function widget_archive($arr) { if(! perm_is_allowed($uid,get_observer_hash(),'view_stream')) return ''; - $wall = ((array_key_exists('wall', $arr)) ? intval($arr['wall']) : 0); $style = ((array_key_exists('style', $arr)) ? $arr['style'] : 'select'); $showend = ((get_pconfig($uid,'system','archive_show_end_date')) ? true : false); @@ -336,10 +329,8 @@ function widget_archive($arr) { if(! $visible_years) $visible_years = 5; - $url = z_root() . '/' . $a->cmd; - $ret = list_post_dates($uid,$wall,$mindate); if(! count($ret)) @@ -367,7 +358,7 @@ function widget_fullprofile($arr) { if(! $a->profile['profile_uid']) return; - $block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false); + $block = (((get_config('system', 'block_public')) && (! local_user()) && (! remote_user())) ? true : false); return profile_sidebar($a->profile, $block); } @@ -375,41 +366,43 @@ function widget_fullprofile($arr) { function widget_categories($arr) { $a = get_app(); - if($a->profile['profile_uid'] && (! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_stream'))) return ''; - $cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat'],ENT_COMPAT,'UTF-8') : ''); $srchurl = $a->query_string; $srchurl = rtrim(preg_replace('/cat\=[^\&].*?(\&|$)/is','',$srchurl),'&'); $srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl); - return categories_widget($srchurl,$cat); + return categories_widget($srchurl, $cat); } function widget_tagcloud_wall($arr) { $a = get_app(); + if((! $a->profile['profile_uid']) || (! $a->profile['channel_hash'])) return ''; - if(! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_stream')) + if(! perm_is_allowed($a->profile['profile_uid'], get_observer_hash(), 'view_stream')) return ''; - $limit = ((array_key_exists('limit',$arr)) ? intval($arr['limit']) : 50); - if(feature_enabled($a->profile['profile_uid'],'tagadelic')) - return tagblock('search',$a->profile['profile_uid'],$limit,$a->profile['channel_hash'],ITEM_WALL); + $limit = ((array_key_exists('limit', $arr)) ? intval($arr['limit']) : 50); + if(feature_enabled($a->profile['profile_uid'], 'tagadelic')) + return tagblock('search', $a->profile['profile_uid'], $limit, $a->profile['channel_hash'], ITEM_WALL); + return ''; } + function widget_catcloud_wall($arr) { $a = get_app(); + if((! $a->profile['profile_uid']) || (! $a->profile['channel_hash'])) return ''; - if(! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_stream')) + if(! perm_is_allowed($a->profile['profile_uid'], get_observer_hash(), 'view_stream')) return ''; $limit = ((array_key_exists('limit',$arr)) ? intval($arr['limit']) : 50); - return catblock($a->profile['profile_uid'],$limit,$a->profile['channel_hash'],ITEM_WALL); - return ''; + + return catblock($a->profile['profile_uid'], $limit, $a->profile['channel_hash'], ITEM_WALL); } @@ -438,6 +431,7 @@ function widget_affinity($arr) { call_hooks('main_slider',$arr); return $arr['html']; } + return ''; } @@ -463,20 +457,19 @@ function widget_settings_menu($arr) { if($abk) $abook_self_id = $abk[0]['abook_id']; - $tabs = array( array( 'label' => t('Account settings'), 'url' => $a->get_baseurl(true).'/settings/account', 'selected' => ((argv(1) === 'account') ? 'active' : ''), ), - + array( 'label' => t('Channel settings'), 'url' => $a->get_baseurl(true).'/settings/channel', 'selected' => ((argv(1) === 'channel') ? 'active' : ''), ), - + array( 'label' => t('Additional features'), 'url' => $a->get_baseurl(true).'/settings/features', @@ -494,7 +487,7 @@ function widget_settings_menu($arr) { 'url' => $a->get_baseurl(true).'/settings/display', 'selected' => ((argv(1) === 'display') ? 'active' : ''), ), - + array( 'label' => t('Connected apps'), 'url' => $a->get_baseurl(true) . '/settings/oauth', @@ -512,7 +505,6 @@ function widget_settings_menu($arr) { 'url' => $a->get_baseurl(true) . '/uexport/complete', 'selected' => '' ), - ); if($role === false || $role === 'custom') { @@ -529,7 +521,6 @@ function widget_settings_menu($arr) { 'url' => $a->get_baseurl(true) . '/connect/' . $channel['channel_address'], 'selected' => '' ); - } if(feature_enabled(local_user(),'channel_sources')) { @@ -538,18 +529,14 @@ function widget_settings_menu($arr) { 'url' => $a->get_baseurl(true) . '/sources', 'selected' => '' ); - } - - $tabtpl = get_markup_template("generic_links_widget.tpl"); return replace_macros($tabtpl, array( '$title' => t('Settings'), '$class' => 'settings-widget', '$items' => $tabs, )); - } @@ -560,9 +547,7 @@ function widget_mailmenu($arr) { $a = get_app(); return replace_macros(get_markup_template('message_side.tpl'), array( '$title' => t('Messages'), - '$tabs'=> array(), - '$check'=>array( 'label' => t('Check Mail'), 'url' => $a->get_baseurl(true) . '/message', @@ -573,9 +558,7 @@ function widget_mailmenu($arr) { 'url' => $a->get_baseurl(true) . '/mail/new', 'sel'=> (argv(1) == 'new'), ) - )); - } function widget_design_tools($arr) { @@ -586,7 +569,7 @@ function widget_design_tools($arr) { if($a->profile['profile_uid']) if(($a->profile['profile_uid'] != local_user()) && (! $a->is_sys)) - return ''; + return ''; if(! local_user()) return ''; @@ -601,24 +584,25 @@ function widget_findpeople($arr) { function widget_photo_albums($arr) { $a = get_app(); + if(! $a->profile['profile_uid']) return ''; $channelx = channelx_by_n($a->profile['profile_uid']); - if((! $channelx) || (! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_photos'))) + if((! $channelx) || (! perm_is_allowed($a->profile['profile_uid'], get_observer_hash(), 'view_photos'))) return ''; require_once('include/photos.php'); - return photos_album_widget($channelx,$a->get_observer()); + return photos_album_widget($channelx, $a->get_observer()); } function widget_vcard($arr) { require_once ('include/Contact.php'); - return vcard_from_xchan('',get_app()->get_observer()); + return vcard_from_xchan('', get_app()->get_observer()); } -/** +/* * The following directory widgets are only useful on the directory page */ @@ -631,21 +615,23 @@ function widget_dirsort($arr) { } function widget_dirtags($arr) { - return dir_tagblock(z_root() . '/directory',null); + return dir_tagblock(z_root() . '/directory', null); } function widget_menu_preview($arr) { if(! get_app()->data['menu_item']) return; require_once('include/menu.php'); + return menu_render(get_app()->data['menu_item']); } function widget_chatroom_list($arr) { $a = get_app(); + require_once("include/chat.php"); $r = chatroom_list($a->profile['profile_uid']); - return replace_macros(get_markup_template('chatroomlist.tpl'),array( + return replace_macros(get_markup_template('chatroomlist.tpl'), array( '$header' => t('Chat Rooms'), '$baseurl' => z_root(), '$nickname' => $a->profile['channel_address'], @@ -658,7 +644,7 @@ function widget_bookmarkedchats($arr) { if(! $h) return; $r = q("select * from xchat where xchat_xchan = '%s' group by xchat_url order by xchat_desc", - dbesc($h) + dbesc($h) ); if($r) { for($x = 0; $x < count($r); $x ++) { @@ -692,17 +678,17 @@ function widget_suggestedchats($arr) { } function widget_item($arr) { + // FIXME there is no $a here $uid = $a->profile['profile_uid']; if((! $uid) || (! $arr['mid'])) return ''; - if(! perm_is_allowed($uid,get_observer_hash(),'view_pages')) + if(! perm_is_allowed($uid, get_observer_hash(), 'view_pages')) return ''; require_once('include/security.php'); $sql_extra = item_permissions_sql($uid); - $r = q("select * from item where mid = '%s' and uid = %d and item_restrict = " . intval(ITEM_WEBPAGE) . " $sql_extra limit 1", dbesc($arr['mid']), intval($uid) @@ -712,11 +698,10 @@ function widget_item($arr) { return ''; xchan_query($r); - $r = fetch_post_tags($r,true); + $r = fetch_post_tags($r, true); - $o .= prepare_page($r[0]); + $o = prepare_page($r[0]); return $o; - } function widget_clock($arr) { @@ -786,18 +771,17 @@ return $o; * URL must be an http or https URL */ - function widget_photo($arr) { $style = $zrl = false; - $params = ''; - if(array_key_exists('src',$arr) && isset($arr['src'])) + + if(array_key_exists('src', $arr) && isset($arr['src'])) $url = $arr['src']; if(strpos($url,'http') !== 0) return ''; - if(array_key_exists('style',$arr) && isset($arr['style'])) + if(array_key_exists('style', $arr) && isset($arr['style'])) $style = $arr['style']; // ensure they can't sneak in an eval(js) function @@ -805,7 +789,7 @@ function widget_photo($arr) { if(strpos($style,'(') !== false) return ''; - if(array_key_exists('zrl',$arr) && isset($arr['zrl'])) + if(array_key_exists('zrl', $arr) && isset($arr['zrl'])) $zrl = (($arr['zrl']) ? true : false); if($zrl) @@ -815,7 +799,7 @@ function widget_photo($arr) { $o .= '' . t('photo/image') . ''; + . ' src="' . $url . '" alt="' . t('photo/image') . '">'; $o .= '
'; @@ -826,15 +810,15 @@ function widget_photo($arr) { function widget_photo_rand($arr) { require_once('include/photos.php'); - $style = $zrl = false; - $params = ''; - if(array_key_exists('album',$arr) && isset($arr['album'])) + $style = false; + + if(array_key_exists('album', $arr) && isset($arr['album'])) $album = $arr['album']; else $album = ''; $channel_id = 0; - if(array_key_exists('channel_id',$arr) && intval($arr['channel_id'])) + if(array_key_exists('channel_id', $arr) && intval($arr['channel_id'])) $channel_id = intval($arr['channel_id']); if(! $channel_id) $channel_id = get_app()->profile_uid; @@ -844,7 +828,7 @@ function widget_photo_rand($arr) { $scale = ((array_key_exists('scale',$arr)) ? intval($arr['scale']) : 0); $ret = photos_list_photos(array('channel_id' => $channel_id),get_app()->get_observer(),$album); - + $filtered = array(); if($ret['success'] && $ret['photos']) foreach($ret['photos'] as $p) @@ -852,14 +836,14 @@ function widget_photo_rand($arr) { $filtered[] = $p['src']; if($filtered) { - $e = mt_rand(0,count($filtered)-1); + $e = mt_rand(0, count($filtered) - 1); $url = $filtered[$e]; } - if(strpos($url,'http') !== 0) + if(strpos($url, 'http') !== 0) return ''; - if(array_key_exists('style',$arr) && isset($arr['style'])) + if(array_key_exists('style', $arr) && isset($arr['style'])) $style = $arr['style']; // ensure they can't sneak in an eval(js) function @@ -873,7 +857,7 @@ function widget_photo_rand($arr) { $o .= '' . t('photo/image') . ''; + . ' src="' . $url . '" alt="' . t('photo/image') . '">'; $o .= '
'; @@ -913,10 +897,10 @@ function widget_random_block($arr) { $o = '
'; if($r[0]['title']) $o .= '

' . $r[0]['title'] . '

'; + $o .= prepare_text($r[0]['body'],$r[0]['mimetype']); $o .= '
'; - } - return $o; + return $o; } From 406e97c9ad76975011f639a415b8139352cb23da Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Sun, 7 Dec 2014 21:20:52 +0100 Subject: [PATCH 17/29] Remove channel cloud files from file system when the channel is removed --- include/Contact.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/include/Contact.php b/include/Contact.php index 64779d45f..9a3b91dc4 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -207,6 +207,7 @@ function account_remove($account_id,$local = true,$unset_session=true) { intval($account_id) ); + if ($unset_session) { unset($_SESSION['authenticated']); unset($_SESSION['uid']); @@ -216,6 +217,28 @@ function account_remove($account_id,$local = true,$unset_session=true) { return $r; } +// recursively delete a directory +function rrmdir($path) +{ + if (is_dir($path) === true) + { + $files = array_diff(scandir($path), array('.', '..')); + + foreach ($files as $file) + { + rrmdir(realpath($path) . '/' . $file); + } + + return rmdir($path); + } + + else if (is_file($path) === true) + { + return unlink($path); + } + + return false; +} function channel_remove($channel_id, $local = true, $unset_session=true) { @@ -311,6 +334,19 @@ function channel_remove($channel_id, $local = true, $unset_session=true) { dbesc($channel['channel_hash']) ); } + + //remove from file system + $r = q("select channel_address from channel where channel_id = %d", + intval($channel_id) + ); + if($r) + $channel_address = $r[0]['channel_address'] ; + if ($channel_address !== '') { + $f = 'store/' . $channel_address.'/'; + logger ('delete '. $f); + if(is_dir($f)) + @rrmdir($f); + } proc_run('php','include/directory.php',$channel_id); From 10d5f0eed7d3708ca5a33f426baddfdfc138ba4f Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Sun, 7 Dec 2014 23:29:23 +0100 Subject: [PATCH 18/29] small change --- include/Contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Contact.php b/include/Contact.php index 9a3b91dc4..4fd43db44 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -336,7 +336,7 @@ function channel_remove($channel_id, $local = true, $unset_session=true) { } //remove from file system - $r = q("select channel_address from channel where channel_id = %d", + $r = q("select channel_address from channel where channel_id = %d limit 1", intval($channel_id) ); if($r) From 8ddf16f1eeb6e9a83b959028653aaa4ad494736d Mon Sep 17 00:00:00 2001 From: zottel Date: Mon, 8 Dec 2014 11:06:37 +0100 Subject: [PATCH 19/29] add main_footer include to all .md files except TOS and README --- doc/AdvancedSearch.md | 1 - doc/Comanche.md | 2 +- doc/Creating-Templates.md | 4 +++- doc/DerivedTheme1.md | 3 +-- doc/Developers.md | 2 +- doc/Features.md | 1 + doc/Hooks.md | 1 - doc/Plugins.md | 1 + doc/Remove-Account.md | 1 + doc/Schema-development.md | 2 ++ doc/Tags-and-Mentions.md | 4 +++- doc/Translations.md | 2 ++ doc/Webpages.md | 4 +++- doc/Widgets.md | 1 + doc/Zot---A-High-Level-Overview.md | 4 +++- doc/connecting_to_channels.md | 1 + doc/dev-function-overview.md | 1 - doc/diaspora_compat.md | 10 +--------- doc/history.md | 3 +-- doc/roles.md | 4 +--- doc/to_do_doco.md | 2 ++ doc/zot.md | 2 +- doc/zot_structures.md | 3 +-- 23 files changed, 31 insertions(+), 28 deletions(-) diff --git a/doc/AdvancedSearch.md b/doc/AdvancedSearch.md index df4a87482..a67c1fc1f 100644 --- a/doc/AdvancedSearch.md +++ b/doc/AdvancedSearch.md @@ -50,5 +50,4 @@ Example: name="charlie brown" and country=canada and not gender=female - #include doc/macros/main_footer.bb; diff --git a/doc/Comanche.md b/doc/Comanche.md index 7374e8406..56bf68457 100644 --- a/doc/Comanche.md +++ b/doc/Comanche.md @@ -166,4 +166,4 @@ Please note that pasting this example into a layout page is not likely to do any [/region] - +#include doc/macros/main_footer.bb; diff --git a/doc/Creating-Templates.md b/doc/Creating-Templates.md index 35003cb1a..6de627f39 100644 --- a/doc/Creating-Templates.md +++ b/doc/Creating-Templates.md @@ -88,4 +88,6 @@ and this would place a profile widget into the "foo" region you created. Use the CSS file to position the region on the page where desired and optionally control its size. -[To be continued] \ No newline at end of file +[To be continued] + +#include doc/macros/main_footer.bb; diff --git a/doc/DerivedTheme1.md b/doc/DerivedTheme1.md index d20a958f2..d4a7ee148 100644 --- a/doc/DerivedTheme1.md +++ b/doc/DerivedTheme1.md @@ -74,5 +74,4 @@ Now create the actual CSS file for your theme. Put it in view/theme/mytheme/css You've just successfully created a derived theme. This needs to be enabled in the admin "themes" panel, and then anybody on the site can use it by selecting it in Settings->Display Settings as their default theme. - - \ No newline at end of file +#include doc/macros/main_footer.bb; diff --git a/doc/Developers.md b/doc/Developers.md index baadd1a2e..8252fa91d 100644 --- a/doc/Developers.md +++ b/doc/Developers.md @@ -52,4 +52,4 @@ In the interests of consistency we adopt the following code styling. We may acce * Generally speaking, opening braces go on the same line as the thing which opens the brace. They are the last character on the line. Closing braces are on a line by themselves. - +#include doc/macros/main_footer.bb; diff --git a/doc/Features.md b/doc/Features.md index 184652742..78c77c9bd 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -105,3 +105,4 @@ Ability to mark special posts with a star indicator Provide a personal tag cloud on your channel page +#include doc/macros/main_footer.bb; diff --git a/doc/Hooks.md b/doc/Hooks.md index d7998a8e7..90edff623 100644 --- a/doc/Hooks.md +++ b/doc/Hooks.md @@ -134,4 +134,3 @@ Hooks - Complete List * $a->module . '_pre_' . $selname #include doc/macros/main_footer.bb; - diff --git a/doc/Plugins.md b/doc/Plugins.md index 0db7c9ebc..b657f5ceb 100644 --- a/doc/Plugins.md +++ b/doc/Plugins.md @@ -258,3 +258,4 @@ The Red Matrix has _install and _uninstall functions but these are used differen Changing these will often allow your plugin to function, but please double check all your permission and identity code because the concepts behind it are completely different in the Red Matrix. Many structured data names (especially DB schema columns) are also quite different. +#include doc/macros/main_footer.bb; diff --git a/doc/Remove-Account.md b/doc/Remove-Account.md index bc1301b16..322b95578 100644 --- a/doc/Remove-Account.md +++ b/doc/Remove-Account.md @@ -21,3 +21,4 @@ If you have identity clones on other sites this only removes the channel instanc on this site. +#include doc/macros/main_footer.bb; diff --git a/doc/Schema-development.md b/doc/Schema-development.md index 481792fcc..e800479f6 100644 --- a/doc/Schema-development.md +++ b/doc/Schema-development.md @@ -74,3 +74,5 @@ theme are as follows: * reply_photo * sloppy_photos Determins whether photos are "sloppy" or aligned. Set or unset (1 or '') + +#include doc/macros/main_footer.bb; diff --git a/doc/Tags-and-Mentions.md b/doc/Tags-and-Mentions.md index cdee73167..84442dd7a 100644 --- a/doc/Tags-and-Mentions.md +++ b/doc/Tags-and-Mentions.md @@ -21,4 +21,6 @@ You may also tag public collections. When you create or edit a collection, there Topical tags are indicated by preceding the tag name with the # character. This will create a link in the post to a generalised site search for the term provided. For example, #cars will provide a search link for all posts mentioning 'cars' on your site. Topical tags are generally a minimum of three characters in length. Shorter search terms are not likely to yield any search results, although this depends on the database configuration. The same rules apply as with names that spaces within tags are represented by the underscore character. It is therefore not possible to create a tag whose target contains an underscore. -Topical tags are also not linked if they are purely numeric, e.g. #1. If you wish to use a numerica hashtag, please add some descriptive text such as #2012-elections. \ No newline at end of file +Topical tags are also not linked if they are purely numeric, e.g. #1. If you wish to use a numerica hashtag, please add some descriptive text such as #2012-elections. + +#include doc/macros/main_footer.bb; diff --git a/doc/Translations.md b/doc/Translations.md index 724286052..7435a28bf 100644 --- a/doc/Translations.md +++ b/doc/Translations.md @@ -89,3 +89,5 @@ Links ------ [1]: http://www.transifex.com/projects/p/red-matrix/ + +#include doc/macros/main_footer.bb; diff --git a/doc/Webpages.md b/doc/Webpages.md index e9943fda8..dafd3661d 100644 --- a/doc/Webpages.md +++ b/doc/Webpages.md @@ -11,4 +11,6 @@ The "page link title" box allows a user to specify the "pagelinktitle" of this U Beneath the page creation box, a list of existing pages will appear with an "edit" link. Clicking this will take you to an editor, similar to that of the post editor, where you can make changes to your webpages. -If you are the admin of a site, you can specify a channel whose webpages we will use at key points around the site. Presently, the only place this is implemented is the home page. If you specify the channel "admin" and then the channel called "admin" creates a webpage called "home", we will display it's content on your websites home page. We expect this functionality to be extended to other areas in future. \ No newline at end of file +If you are the admin of a site, you can specify a channel whose webpages we will use at key points around the site. Presently, the only place this is implemented is the home page. If you specify the channel "admin" and then the channel called "admin" creates a webpage called "home", we will display it's content on your websites home page. We expect this functionality to be extended to other areas in future. + +#include doc/macros/main_footer.bb; diff --git a/doc/Widgets.md b/doc/Widgets.md index 68f9e4cea..d45f719d9 100644 --- a/doc/Widgets.md +++ b/doc/Widgets.md @@ -99,3 +99,4 @@ Some/many of these widgets have restrictions which may restrict the type of page * channel_id - if not your own
 
+#include doc/macros/main_footer.bb; diff --git a/doc/Zot---A-High-Level-Overview.md b/doc/Zot---A-High-Level-Overview.md index 07f353552..990ea037b 100644 --- a/doc/Zot---A-High-Level-Overview.md +++ b/doc/Zot---A-High-Level-Overview.md @@ -104,4 +104,6 @@ Good enough. Podunk.edu checks out the story and indeed, it is example.com, and -And that's the package (the original message). Example.com converts this into a form suitable for viewing by Nickordo and notifies Nickordo that there's a new message. Podunk.edu **might** discover that there are other packages waiting for example.com. If this happens it may also send any and all other waiting packages at this time. Each has the original tracking number attached. \ No newline at end of file +And that's the package (the original message). Example.com converts this into a form suitable for viewing by Nickordo and notifies Nickordo that there's a new message. Podunk.edu **might** discover that there are other packages waiting for example.com. If this happens it may also send any and all other waiting packages at this time. Each has the original tracking number attached. + +#include doc/macros/main_footer.bb; diff --git a/doc/connecting_to_channels.md b/doc/connecting_to_channels.md index 8a7b0bdde..1e0d4d3fc 100644 --- a/doc/connecting_to_channels.md +++ b/doc/connecting_to_channels.md @@ -31,3 +31,4 @@ Here's their meaning: Some channels are designated "Premium Channels" and **may** require some action on your part before a connection can be established. The Connect button will for these channels will take you to a page which lists in detail what terms the channel owner has set. If the terms are accepted, the connection will then proceed normally. In some cases, such as with celebrities and world-reknowned publishers, this **may** involve payment. If you do not agree to the terms, the connection will not proceed, or it may proceed but with reduced permissions allowed on your interactions with that channel. +#include doc/macros/main_footer.bb; diff --git a/doc/dev-function-overview.md b/doc/dev-function-overview.md index ecf9186ca..5e382201f 100644 --- a/doc/dev-function-overview.md +++ b/doc/dev-function-overview.md @@ -49,4 +49,3 @@ Shorthand test to see if variable $var is set and is not empty. Tests vary by ty If variable is set, returns 1 if has 'non-zero' value, otherwise returns 0. -- e.g. x('') or x(0) returns 0; #include doc/macros/main_footer.bb; - diff --git a/doc/diaspora_compat.md b/doc/diaspora_compat.md index 3be53c839..3829a9c64 100644 --- a/doc/diaspora_compat.md +++ b/doc/diaspora_compat.md @@ -54,12 +54,4 @@ Diaspora members will not appear in the directory. There are differences in oembed compatibility between the networks. Some embedded resources will turn into a link on one side or the other. - - - - - - - - - \ No newline at end of file +#include doc/macros/main_footer.bb; diff --git a/doc/history.md b/doc/history.md index b626d376e..12091d205 100644 --- a/doc/history.md +++ b/doc/history.md @@ -46,5 +46,4 @@ Over time a few federation components re-emerged. The ability to view RSS feeds That brings us up to the present. Where will RedMatrix go from here? I don't know. That's up to you. - - +#include doc/macros/main_footer.bb; diff --git a/doc/roles.md b/doc/roles.md index 0d906b5b5..5d8d07113 100644 --- a/doc/roles.md +++ b/doc/roles.md @@ -63,6 +63,4 @@ A public forum which allows members to post files/photos/webpages. Set all the privacy and permissions manually to suit your specific needs. - - - +#include doc/macros/main_footer.bb; diff --git a/doc/to_do_doco.md b/doc/to_do_doco.md index 6e4f17724..018b9efa2 100644 --- a/doc/to_do_doco.md +++ b/doc/to_do_doco.md @@ -27,3 +27,5 @@ For translating documentation, create a directory in */doc* named by the languag * Administration Guide (post-install) * Administration Guide (pre-install) + +#include doc/macros/main_footer.bb; diff --git a/doc/zot.md b/doc/zot.md index f514fb3f8..54af44161 100644 --- a/doc/zot.md +++ b/doc/zot.md @@ -397,4 +397,4 @@ auth_check messages MUST be encrypted with AES256CBC. This message is sent to th 'confirm' in this case is the base64url encoded RSA signature of the concatenation of 'secret' with the base64url encoded whirlpool hash of the source guid and guid_sig; signed with the source channel private key. This prevents a man-in-the-middle from inserting a rogue success packet. Upon receipt and successful verification of this packet, the destination site will redirect to the original destination URL and indicate a successful remote login. -Return to the [url=[baseurl]/help/main]Main documentation page[/url] +#include doc/macros/main_footer.bb; diff --git a/doc/zot_structures.md b/doc/zot_structures.md index 44fc63c41..e8a65ff1f 100644 --- a/doc/zot_structures.md +++ b/doc/zot_structures.md @@ -59,5 +59,4 @@ secret is a 64-char string which is randomly generated by the sending site. secret_sig is the RSA signature of the secret, signed with the sender's private key. - - +#include doc/macros/main_footer.bb; From 97d1072f9bc39b47769576e5885c04a5f1bacd9a Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Mon, 8 Dec 2014 16:49:48 +0100 Subject: [PATCH 20/29] Make it clear that title and categories are optional --- include/conversation.php | 4 ++-- mod/editblock.php | 4 ++-- mod/editlayout.php | 4 ++-- mod/editpost.php | 4 ++-- mod/editwebpage.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 6b3e278f0..c8336900f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1131,10 +1131,10 @@ function status_editor($a,$x,$popup=false) { '$noloc' => t('Clear browser location'), '$shortnoloc' => t('clear location'), '$title' => ((x($x,'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''), - '$placeholdertitle' => t('Set title'), + '$placeholdertitle' => t('Title (optional)'), '$catsenabled' => ((feature_enabled($x['profile_uid'],'categories') && (! $webpage)) ? 'categories' : ''), '$category' => "", - '$placeholdercategory' => t('Categories (comma-separated list)'), + '$placeholdercategory' => t('Categories (optional, comma-separated list)'), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), '$shortpermset' => t('permissions'), diff --git a/mod/editblock.php b/mod/editblock.php index c58a93410..33d4c8b1a 100644 --- a/mod/editblock.php +++ b/mod/editblock.php @@ -161,10 +161,10 @@ function editblock_content(&$a) { '$public' => t('Public post'), '$jotnets' => $jotnets, '$title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'), - '$placeholdertitle' => t('Set title'), + '$placeholdertitle' => t('Title (optional)'), '$pagetitle' => $block_title, '$category' => '', - '$placeholdercategory' => t('Categories (comma-separated list)'), + '$placeholdercategory' => t('Categories (optional, comma-separated list)'), '$emtitle' => t('Example: bob@example.com, mary@example.com'), '$lockstate' => $lockstate, '$acl' => '', diff --git a/mod/editlayout.php b/mod/editlayout.php index 94e2e628c..01f439cb2 100644 --- a/mod/editlayout.php +++ b/mod/editlayout.php @@ -156,10 +156,10 @@ function editlayout_content(&$a) { '$public' => t('Public post'), '$jotnets' => $jotnets, '$title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'), - '$placeholdertitle' => t('Set title'), + '$placeholdertitle' => t('Title (optional)'), '$pagetitle' => $layout_title, '$category' => '', - '$placeholdercategory' => t('Categories (comma-separated list)'), + '$placeholdercategory' => t('Categories (optional, comma-separated list)'), '$emtitle' => t('Example: bob@example.com, mary@example.com'), '$lockstate' => $lockstate, '$acl' => '', diff --git a/mod/editpost.php b/mod/editpost.php index ed7fcff8a..26e3c7139 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -129,9 +129,9 @@ function editpost_content(&$a) { '$public' => t('Public post'), '$jotnets' => $jotnets, '$title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'), - '$placeholdertitle' => t('Set title'), + '$placeholdertitle' => t('Title (optional)'), '$category' => $category, - '$placeholdercategory' => t('Categories (comma-separated list)'), + '$placeholdercategory' => t('Categories (optional, comma-separated list)'), '$emtitle' => t('Example: bob@example.com, mary@example.com'), '$lockstate' => $lockstate, '$acl' => '', diff --git a/mod/editwebpage.php b/mod/editwebpage.php index 2acb3bd84..1b1268914 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -195,9 +195,9 @@ function editwebpage_content(&$a) { '$mimeselect' => $mimeselect, '$layoutselect' => $layoutselect, '$title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'), - '$placeholdertitle' => t('Set title'), + '$placeholdertitle' => t('Title (optional)'), '$category' => '', - '$placeholdercategory' => t('Categories (comma-separated list)'), + '$placeholdercategory' => t('Categories (optional, comma-separated list)'), '$emtitle' => t('Example: bob@example.com, mary@example.com'), 'lockstate' => (((strlen($itm[0]['allow_cid'])) || (strlen($itm[0]['allow_gid'])) || (strlen($itm[0]['deny_cid'])) || (strlen($itm[0]['deny_gid']))) ? 'lock' : 'unlock'), '$bang' => '', From d65ad03aec49f91e308d951dae0b5c28f3549adb Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Mon, 8 Dec 2014 22:37:02 +0100 Subject: [PATCH 21/29] Put some spacing between share types and other buttons in jot --- view/tpl/jot.tpl | 62 ++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index f172a6dfa..826a3dd38 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -36,40 +36,46 @@
-
+
{{if $visitor}} - - - - - - - +
+ + + + + +
+
+ + + {{else}} +
{{/if}} {{if $feature_expire}} - + {{/if}} {{if $feature_encrypt}} - + {{/if}} +
From e233e386b84f8b43cfc8d757cad454403670e043 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Mon, 8 Dec 2014 22:46:30 +0100 Subject: [PATCH 22/29] Group comment editor icons --- view/tpl/comment_item.tpl | 62 +++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/view/tpl/comment_item.tpl b/view/tpl/comment_item.tpl index e68314797..ab67bc196 100755 --- a/view/tpl/comment_item.tpl +++ b/view/tpl/comment_item.tpl @@ -21,35 +21,41 @@ {{/if}}
-
- - - - - - - - +
+
+ + + + + +
+
+ + + +
{{if $feature_encrypt}} - +
+ +
{{/if}}
From 242713ebef71e0e2b6b1666f7c2400b26772ba2d Mon Sep 17 00:00:00 2001 From: marijus Date: Tue, 9 Dec 2014 15:09:19 +0100 Subject: [PATCH 23/29] show clear browser location button only if use browser location option is set and minor css fixes --- include/conversation.php | 2 +- view/css/bootstrap-red.css | 6 ------ view/css/default.css | 4 ---- view/css/widgets.css | 1 + view/tpl/jot-header.tpl | 2 +- view/tpl/jot.tpl | 8 +++++--- 6 files changed, 8 insertions(+), 15 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index c8336900f..d0cd81c4a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1128,7 +1128,7 @@ function status_editor($a,$x,$popup=false) { '$shortaudio' => t('audio link'), '$setloc' => t('Set your location'), '$shortsetloc' => t('set location'), - '$noloc' => t('Clear browser location'), + '$noloc' => ((get_pconfig($x['profile_uid'],'system','use_browser_location')) ? t('Clear browser location') : ''), '$shortnoloc' => t('clear location'), '$title' => ((x($x,'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''), '$placeholdertitle' => t('Title (optional)'), diff --git a/view/css/bootstrap-red.css b/view/css/bootstrap-red.css index 9f93395c9..587ea7b8f 100644 --- a/view/css/bootstrap-red.css +++ b/view/css/bootstrap-red.css @@ -1,11 +1,5 @@ /* override some bootstrap settings */ -/* this might be a bug in bootstrap */ -.input-group-addon, -.input-group-btn { - width: unset; -} - /* nav overrides */ nav .badge { diff --git a/view/css/default.css b/view/css/default.css index 40d5cfc59..56173f932 100644 --- a/view/css/default.css +++ b/view/css/default.css @@ -23,10 +23,6 @@ aside#region_1 { padding: 65px 7px 0px 7px; } -aside input[type='text'] { - width: 100%; -} - section { width: 100%; display: table-cell; diff --git a/view/css/widgets.css b/view/css/widgets.css index a24f5fb29..4db87e633 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -13,6 +13,7 @@ } .widget-input { + width: 100%; border-top-right-radius: 0px; border-bottom-right-radius: 0px; } diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index abf446ba9..bdbb7d09c 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -309,7 +309,7 @@ function enableOnUser(){ function jotClearLocation() { $('#jot-coord').val(''); - $('#profile-nolocation-wrapper').hide(); + $('#profile-nolocation-wrapper').attr('disabled', true); } diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 826a3dd38..8d6b5ff91 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -56,12 +56,14 @@
- + {{if $noloc}} + + {{/if}} {{else}}
{{/if}} From cc365513edc0ea7829e44a7854a47f3fcf8a17d1 Mon Sep 17 00:00:00 2001 From: marijus Date: Tue, 9 Dec 2014 15:22:53 +0100 Subject: [PATCH 24/29] adjustment to clear browser location button only if use browser location option is set --- view/tpl/jot.tpl | 2 +- view/tpl/jot_geotag.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 8d6b5ff91..34acce879 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -60,7 +60,7 @@ {{if $noloc}} - {{/if}} diff --git a/view/tpl/jot_geotag.tpl b/view/tpl/jot_geotag.tpl index 7a398b612..60f128850 100755 --- a/view/tpl/jot_geotag.tpl +++ b/view/tpl/jot_geotag.tpl @@ -1,7 +1,7 @@ if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { $('#jot-coord').val(position.coords.latitude + ' ' + position.coords.longitude); - $('#profile-nolocation-wrapper').show(); + $('#profile-nolocation-wrapper').attr('disabled', false); }); } From a23af1f5f7dc4b256b56f05ce27841eb13e1cb4f Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 9 Dec 2014 19:14:58 +0000 Subject: [PATCH 25/29] Issue #732 --- doc/doco.bb | 25 +++++++++++++++++++++++++ doc/main.bb | 5 +++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 doc/doco.bb diff --git a/doc/doco.bb b/doc/doco.bb new file mode 100644 index 000000000..3fd0ee94f --- /dev/null +++ b/doc/doco.bb @@ -0,0 +1,25 @@ +[b]Creating Documentation[/b] + +To contribute documentation, simply put some words in a cunning order, and make their existence known to a developer. You can do this literally anywhere as long as a developer can see it. Once made aware, somebody will check it in for you. You should try to avoid proprietary formats, or locations that require authentication with methods other than Zot in order to make it easy for a developer to access, but even this is not a strict requirement. + +If you wish to contribute directly, that's fine too. To contribute directly, documentation should be in one of the following formats: + +[li]Markdown[/li] +[li]BBCode[/li] +[li]HTML[/li] +[li]Plain Text[/li] + +Other formats are also allowed, but support for the format must be added to mod/help.php first. + +If editing a plain text file, please keep column width to 80. This is because plain text is used in instances where we may not have a working installation - the installation documentation, for example - and it should be easy to read these from a CLI text editor. + +The advantage of Markdown is that it is human readable. + +The advantage of BBCode is that it is identity aware. + +Therefore, if using BBCode, try to make the most of it: +[li]Use ZRL links where appropriate to ensure a link to another site retains authentication and keeps identity based documentation working[/li] +[li]Use baseurl or observer.baseurl tags where appropriate instead of example.com for authenticated viewers.[/li] +[li]Support non-authenticated users with observer=0 tags. We presently do not do this due to historical oversights. This needs adding everywhere[/li] + +#include doc/macros/main_footer.bb; diff --git a/doc/main.bb b/doc/main.bb index b4b74dcc1..4f1852642 100644 --- a/doc/main.bb +++ b/doc/main.bb @@ -53,6 +53,7 @@ Zot is the great new communicaton protocol invented especially for the RedMatrix [zrl=[baseurl]/help/Creating-Templates]Creating Comanche Templates[/zrl] [zrl=[baseurl]/help/Widgets]Core Widgets[/zrl] [zrl=[baseurl]/help/plugins]Plugins[/zrl] +[zrl=[baseurl]/help/doco]Contributing Documentation[/zrl] [zrl=[baseurl]/help/DerivedTheme1]Creating Derivative Themes[/zrl] [zrl=[baseurl]/help/schema_development]Schemas[/zrl] [zrl=[baseurl]/help/Translations]Translations[/zrl] @@ -77,7 +78,7 @@ Zot is the great new communicaton protocol invented especially for the RedMatrix [url=https://zothub.com/channel/one]Development Channel[/url] [url=[baseurl]/help/credits]RedMatrix Credits[/url] - + [size=large][b]About This RedMatrix Hub[/b][/size] -[zrl=[baseurl]/help/TermsOfService]Terms of Service For This Hub[/zrl] +[zrl=[baseurl]/help/TermsOfService]Terms of Service For This Hub[/zrl] [zrl=[baseurl]/siteinfo]Hub Information (/siteinfo)[/zrl] From ad2c8a4cb76d727cc6c22fb42f87ffa1fd32edb3 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Wed, 10 Dec 2014 15:34:18 +0000 Subject: [PATCH 26/29] Provide censorship. --- include/conversation.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index d0cd81c4a..b9419acde 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -431,13 +431,18 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $arr_blocked = null; - if(local_user()) { + if(local_user()) $str_blocked = get_pconfig(local_user(),'system','blocked'); - if($str_blocked) { + if(! local_user() && ($mode == 'network')) { + $sys = get_sys_channel(); + $id = $sys['channel_id']; + $str_blocked = get_pconfig($id,'system','blocked'); + } + + if($str_blocked) { $arr_blocked = explode(',',$str_blocked); for($x = 0; $x < count($arr_blocked); $x ++) - $arr_blocked[$x] = trim($arr_blocked[$x]); - } + $arr_blocked[$x] = trim($arr_blocked[$x]); } From b86c4156fc98b8fe803e14e87e92c75861a68607 Mon Sep 17 00:00:00 2001 From: marijus Date: Wed, 10 Dec 2014 22:13:44 +0100 Subject: [PATCH 27/29] some work on profile page - mostly whitespace --- view/tpl/profile_advanced.tpl | 454 +++++++++++++++++----------------- 1 file changed, 225 insertions(+), 229 deletions(-) diff --git a/view/tpl/profile_advanced.tpl b/view/tpl/profile_advanced.tpl index aa169e6c0..1f99bf1ad 100755 --- a/view/tpl/profile_advanced.tpl +++ b/view/tpl/profile_advanced.tpl @@ -1,233 +1,229 @@ -
-

{{$title}}

+
+
+ +

{{$title}}

+
+
+
+
+
{{$profile.fullname.0}}
+
{{$profile.fullname.1}}
+
-{{if $profile.canlike || $profile.like_count}} -
-{{if $profile.canlike}} - -{{/if}} + {{if $profile.gender}} +
+
{{$profile.gender.0}}
+
{{$profile.gender.1}}
+
+ {{/if}} + + {{if $profile.birthday}} +
+
{{$profile.birthday.0}}
+
{{$profile.birthday.1}}
+
+ {{/if}} + + {{if $profile.age}} +
+
{{$profile.age.0}}
+
{{$profile.age.1}}
+
+ {{/if}} + + {{if $profile.marital}} +
+
{{$profile.marital.0}}
+
{{$profile.marital.1}}{{if $profile.marital.with}} ({{$profile.marital.with}}){{/if}}{{if $profile.howlong}} {{$profile.howlong}}{{/if}}
+
+ {{/if}} + + {{if $profile.sexual}} +
+
{{$profile.sexual.0}}
+
{{$profile.sexual.1}}
+
+ {{/if}} + + {{if $profile.keywords}} +
+
{{$profile.keywords.0}}
+
{{$profile.keywords.1}}
+
+ {{/if}} + + {{if $profile.homepage}} +
+
{{$profile.homepage.0}}
+
{{$profile.homepage.1}}
+
+ {{/if}} + + {{if $profile.hometown}} +
+
{{$profile.hometown.0}}
+
{{$profile.hometown.1}}
+
+ {{/if}} + + {{if $profile.politic}} +
+
{{$profile.politic.0}}
+
{{$profile.politic.1}}
+
+ {{/if}} + + {{if $profile.religion}} +
+
{{$profile.religion.0}}
+
{{$profile.religion.1}}
+
+ {{/if}} + + {{if $profile.about}} +
+
{{$profile.about.0}}
+
{{$profile.about.1}}
+
+ {{/if}} + + {{if $profile.interest}} +
+
{{$profile.interest.0}}
+
{{$profile.interest.1}}
+
+ {{/if}} + + {{if $profile.likes}} +
+
{{$profile.likes.0}}
+
{{$profile.likes.1}}
+
+ {{/if}} + + {{if $profile.dislikes}} +
+
{{$profile.dislikes.0}}
+
{{$profile.dislikes.1}}
+
+ {{/if}} + + {{if $profile.contact}} +
+
{{$profile.contact.0}}
+
{{$profile.contact.1}}
+
+ {{/if}} + + {{if $profile.channels}} +
+
{{$profile.channels.0}}
+
{{$profile.channels.1}}
+
+ {{/if}} -{{if $profile.like_count}} -
- -{{if $profile.likers}} - -{{/if}} -
-{{/if}} -
-{{/if}} - -
-
{{$profile.fullname.0}}
-
{{$profile.fullname.1}}
-
- -{{if $profile.gender}} -
-
{{$profile.gender.0}}
-
{{$profile.gender.1}}
-
-{{/if}} - -{{if $profile.birthday}} -
-
{{$profile.birthday.0}}
-
{{$profile.birthday.1}}
-
-{{/if}} - -{{if $profile.age}} -
-
{{$profile.age.0}}
-
{{$profile.age.1}}
-
-{{/if}} - -{{if $profile.marital}} -
-
{{$profile.marital.0}}
-
{{$profile.marital.1}}{{if $profile.marital.with}} ({{$profile.marital.with}}){{/if}}{{if $profile.howlong}} {{$profile.howlong}}{{/if}}
-
-{{/if}} - -{{if $profile.sexual}} -
-
{{$profile.sexual.0}}
-
{{$profile.sexual.1}}
-
-{{/if}} - -{{if $profile.keywords}} -
-
{{$profile.keywords.0}}
-
{{$profile.keywords.1}}
-
-{{/if}} - -{{if $profile.homepage}} -
-
{{$profile.homepage.0}}
-
{{$profile.homepage.1}}
-
-{{/if}} - -{{if $profile.hometown}} -
-
{{$profile.hometown.0}}
-
{{$profile.hometown.1}}
-
-{{/if}} - -{{if $profile.politic}} -
-
{{$profile.politic.0}}
-
{{$profile.politic.1}}
-
-{{/if}} - -{{if $profile.religion}} -
-
{{$profile.religion.0}}
-
{{$profile.religion.1}}
-
-{{/if}} - -{{if $profile.about}} -
-
{{$profile.about.0}}
-
{{$profile.about.1}}
-
-{{/if}} - -{{if $profile.interest}} -
-
{{$profile.interest.0}}
-
{{$profile.interest.1}}
-
-{{/if}} - -{{if $profile.likes}} -
-
{{$profile.likes.0}}
-
{{$profile.likes.1}}
-
-{{/if}} - -{{if $profile.dislikes}} -
-
{{$profile.dislikes.0}}
-
{{$profile.dislikes.1}}
-
-{{/if}} - -{{if $profile.contact}} -
-
{{$profile.contact.0}}
-
{{$profile.contact.1}}
-
-{{/if}} - -{{if $profile.channels}} -
-
{{$profile.channels.0}}
-
{{$profile.channels.1}}
-
-{{/if}} - - -{{if $profile.music}} -
-
{{$profile.music.0}}
-
{{$profile.music.1}}
-
-{{/if}} - - -{{if $profile.book}} -
-
{{$profile.book.0}}
-
{{$profile.book.1}}
-
-{{/if}} - - -{{if $profile.tv}} -
-
{{$profile.tv.0}}
-
{{$profile.tv.1}}
-
-{{/if}} - - -{{if $profile.film}} -
-
{{$profile.film.0}}
-
{{$profile.film.1}}
-
-{{/if}} - - -{{if $profile.romance}} -
-
{{$profile.romance.0}}
-
{{$profile.romance.1}}
-
-{{/if}} - - -{{if $profile.work}} -
-
{{$profile.work.0}}
-
{{$profile.work.1}}
-
-{{/if}} - -{{if $profile.education}} -
-
{{$profile.education.0}}
-
{{$profile.education.1}}
-
-{{/if}} - -{{foreach $profile.extra_fields as $f}} -{{if $profile.$f}} -
-
{{$profile.$f.0}}
-
{{$profile.$f.1}}
-
-{{/if}} -{{/foreach}} - - -{{if $things}} -{{foreach $things as $key => $items}} -{{$profile.fullname.1}} {{$key}} -
    -{{foreach $items as $item}} -
  • {{if $item.img}}{{$item.term}}{{/if}} -{{$item.term}} -{{if $profile.canlike}}
    - -{{/if}} -{{if $item.like_count}} -
    - -{{if $item.likes}} - -{{/if}} -
    -{{/if}} -
  • -{{/foreach}} -
-
-{{/foreach}} -{{/if}} - + {{if $profile.music}} +
+
{{$profile.music.0}}
+
{{$profile.music.1}}
+
+ {{/if}} + + + {{if $profile.book}} +
+
{{$profile.book.0}}
+
{{$profile.book.1}}
+
+ {{/if}} + + + {{if $profile.tv}} +
+
{{$profile.tv.0}}
+
{{$profile.tv.1}}
+
+ {{/if}} + + + {{if $profile.film}} +
+
{{$profile.film.0}}
+
{{$profile.film.1}}
+
+ {{/if}} + + + {{if $profile.romance}} +
+
{{$profile.romance.0}}
+
{{$profile.romance.1}}
+
+ {{/if}} + + + {{if $profile.work}} +
+
{{$profile.work.0}}
+
{{$profile.work.1}}
+
+ {{/if}} + + {{if $profile.education}} +
+
{{$profile.education.0}}
+
{{$profile.education.1}}
+
+ {{/if}} + + {{foreach $profile.extra_fields as $f}} + {{if $profile.$f}} +
+
{{$profile.$f.0}}
+
{{$profile.$f.1}}
+
+ {{/if}} + {{/foreach}} + + + {{if $things}} + {{foreach $things as $key => $items}} + {{$profile.fullname.1}} {{$key}} +
    + {{foreach $items as $item}} +
  • {{if $item.img}}{{$item.term}}{{/if}} + {{$item.term}} + {{if $profile.canlike}}
    + + {{/if}} + {{if $item.like_count}} +
    + + {{if $item.likes}} + + {{/if}} +
    + {{/if}} +
  • + {{/foreach}} +
+
+ {{/foreach}} + {{/if}} +
From 81fdb1cdfc3fb6e17321d84ffd2ba4908e5e4d8c Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Wed, 10 Dec 2014 21:41:59 +0000 Subject: [PATCH 28/29] Bring back 'no special theme for mobile' --- mod/settings.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mod/settings.php b/mod/settings.php index 1643387ea..201a4aa2a 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -160,7 +160,9 @@ function settings_post(&$a) { $itemspage = 100; - if($mobile_theme !== '') { + if ($mobile_theme == "---") + del_pconfig(local_user(),'system',mobile_theme); + else { set_pconfig(local_user(),'system','mobile_theme',$mobile_theme); } @@ -755,7 +757,6 @@ function settings_content(&$a) { $themes = array(); - $mobile_themes = array("---" => t('No special theme for mobile devices')); $files = glob('view/theme/*'); if($allowed_themes) { foreach($allowed_themes as $th) { @@ -764,19 +765,20 @@ function settings_content(&$a) { $unsupported = file_exists('view/theme/' . $th . '/unsupported'); $is_mobile = file_exists('view/theme/' . $th . '/mobile'); $is_library = file_exists('view/theme/'. $th . '/library'); + $mobile_themes["---"] = t("No special theme for mobile devices"); if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){ $theme_name = (($is_experimental) ? sprintf(t('%s - (Experimental)'), $f) : $f); - if (! $is_library) { if($is_mobile) { - $themes[$f]=$theme_name . ' (' . t('mobile') . ')'; + $mobile_themes[$f] = $themes[$f] = $theme_name . ' (' . t('mobile') . ')'; } else { - $themes[$f]=$theme_name; + $mobile_themes[$f] = $themes[$f] = $theme_name; } } } + } } $theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']); @@ -812,7 +814,7 @@ function settings_content(&$a) { '$uid' => local_user(), '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes, 'preview'), - '$mobile_theme' => array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $themes, ''), + '$mobile_theme' => array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, ''), '$user_scalable' => array('user_scalable', t("Enable user zoom on mobile devices"), $user_scalable, ''), '$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')), '$itemspage' => array('itemspage', t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 100 items')), From c91aa863d85e6d3b3a260fefe5e281d66730c4c9 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Wed, 10 Dec 2014 21:56:44 +0000 Subject: [PATCH 29/29] Missing '' --- mod/settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/settings.php b/mod/settings.php index 201a4aa2a..ea7b2ba06 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -161,7 +161,7 @@ function settings_post(&$a) { if ($mobile_theme == "---") - del_pconfig(local_user(),'system',mobile_theme); + del_pconfig(local_user(),'system','mobile_theme'); else { set_pconfig(local_user(),'system','mobile_theme',$mobile_theme); }