From cddcf9d3abef83eebd83599bb1c7e8583cf9c2e9 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 11 May 2015 17:50:17 -0700 Subject: [PATCH 1/7] missing translation --- mod/mitem.php | 2 +- version.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/mitem.php b/mod/mitem.php index e4a4b7030..b03280105 100644 --- a/mod/mitem.php +++ b/mod/mitem.php @@ -159,7 +159,7 @@ function mitem_content(&$a) { '$permdesc' => t("\x28click to open/close\x29"), '$aclselect' => populate_acl($perm_defaults,false), '$mitem_desc' => array('mitem_desc', t('Link Name'), '', 'Visible name of the link','*'), - '$mitem_link' => array('mitem_link', t('Link or Submenu Target'), '', 'Enter URL of the link or select a menu name to create a submenu', '*', 'list="menu-names"'), + '$mitem_link' => array('mitem_link', t('Link or Submenu Target'), '', t('Enter URL of the link or select a menu name to create a submenu'), '*', 'list="menu-names"'), '$usezid' => array('usezid', t('Use RedMatrix magic-auth if available'), true, ''), '$newwin' => array('newwin', t('Open link in new window'), false,''), '$mitem_order' => array('mitem_order', t('Order in list'),'0',t('Higher numbers will sink to bottom of listing')), diff --git a/version.inc b/version.inc index 387119390..f6946d516 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-05-10.1028 +2015-05-11.1029 From aeb69dcbbe38bc2058ebf43305e27d354fa21f9b Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 11 May 2015 19:36:07 -0700 Subject: [PATCH 2/7] let the site admin import a record directly from the probe diagnostic --- mod/probe.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/probe.php b/mod/probe.php index 8e0b60dcc..62a2227b0 100644 --- a/mod/probe.php +++ b/mod/probe.php @@ -15,6 +15,7 @@ function probe_content(&$a) { if(x($_GET,'addr')) { $channel = $a->get_channel(); $addr = trim($_GET['addr']); + $do_import = ((intval($_GET['import']) && is_site_admin()) ? true : false); $res = zot_finger($addr,$channel,false); $o .= '
';
 		if($res['success'])
@@ -29,6 +30,8 @@ function probe_content(&$a) {
 				$o .= sprintf( t('Fetching URL returns error: %1$s'),$res['error'] . "\r\n\r\n");
 
 		}
+		if($do_import && $j)
+			$x = import_xchan($j);
 		if($j && $j['permissions'] && $j['permissions']['iv'])
 			$j['permissions'] = json_decode(crypto_unencapsulate($j['permissions'],$channel['channel_prvkey']),true);
 		$o .= str_replace("\n",'
',print_r($j,true)); From f2a0dac653f9f372129f373104cf5cf56c108b1f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 11 May 2015 22:57:12 -0700 Subject: [PATCH 3/7] fix a couple of miscellaneous errors which showed up in the logs --- include/network.php | 5 ++++- include/text.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/network.php b/include/network.php index a0782692e..e0c8885fd 100644 --- a/include/network.php +++ b/include/network.php @@ -603,7 +603,7 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) $scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[3]); else $scaled = $mtch[3]; - $i = z_fetch_url($scaled); + $i = z_fetch_url($scaled,true); $cache = get_config('system','itemcache'); @@ -613,7 +613,10 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) } // guess mimetype from headers or filename + $type = guess_image_type($mtch[3],$i['header']); + if(strpos($type,'image') === false) + continue; if($i['success']) { $ph = photo_factory($i['body'], $type); diff --git a/include/text.php b/include/text.php index deb5a4c90..6ed06e92a 100644 --- a/include/text.php +++ b/include/text.php @@ -2244,7 +2244,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $d // The '=' is needed to not replace color codes if the code is also used as a tag // Much better would be to somehow completely avoiding things in e.g. [color]-tags. // This would allow writing things like "my favourite tag=#foobar". - $body = preg_replace('/(? Date: Tue, 12 May 2015 23:03:13 +0200 Subject: [PATCH 4/7] Dutch 100\% again --- view/nl/messages.po | 108 +++++++++++++++++++++++++------------------- view/nl/strings.php | 24 ++++++---- 2 files changed, 76 insertions(+), 56 deletions(-) diff --git a/view/nl/messages.po b/view/nl/messages.po index cbea8f3e8..41da0a0d6 100644 --- a/view/nl/messages.po +++ b/view/nl/messages.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: Redmatrix\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-05-01 00:03-0700\n" -"PO-Revision-Date: 2015-05-07 12:20+0000\n" +"POT-Creation-Date: 2015-05-08 00:03-0700\n" +"PO-Revision-Date: 2015-05-12 20:58+0000\n" "Last-Translator: jeroenpraat \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/red-matrix/language/nl/)\n" "MIME-Version: 1.0\n" @@ -2339,49 +2339,6 @@ msgstr "Bezoek het %2$s van %1$s" msgid "%1$s has an updated %2$s, changing %3$s." msgstr "%1$s heeft een aangepaste %2$s, %3$s veranderd." -#: ../../include/bbcode.php:122 ../../include/bbcode.php:743 -#: ../../include/bbcode.php:746 ../../include/bbcode.php:751 -#: ../../include/bbcode.php:754 ../../include/bbcode.php:757 -#: ../../include/bbcode.php:760 ../../include/bbcode.php:765 -#: ../../include/bbcode.php:768 ../../include/bbcode.php:773 -#: ../../include/bbcode.php:776 ../../include/bbcode.php:779 -#: ../../include/bbcode.php:782 -msgid "Image/photo" -msgstr "Afbeelding/foto" - -#: ../../include/bbcode.php:161 ../../include/bbcode.php:793 -msgid "Encrypted content" -msgstr "Versleutelde inhoud" - -#: ../../include/bbcode.php:177 -msgid "Install design element: " -msgstr "Installeer ontwerpelement: " - -#: ../../include/bbcode.php:190 -msgid "QR code" -msgstr "QR-code" - -#: ../../include/bbcode.php:241 -#, php-format -msgid "%1$s wrote the following %2$s %3$s" -msgstr "%1$s schreef het volgende %2$s %3$s" - -#: ../../include/bbcode.php:243 -msgid "post" -msgstr "bericht" - -#: ../../include/bbcode.php:493 -msgid "Different viewers will see this text differently" -msgstr "Deze tekst wordt per persoon anders weergeven." - -#: ../../include/bbcode.php:704 -msgid "$1 spoiler" -msgstr "$1 spoiler" - -#: ../../include/bbcode.php:731 -msgid "$1 wrote:" -msgstr "$1 schreef:" - #: ../../include/items.php:399 ../../mod/like.php:270 #: ../../mod/subthread.php:49 ../../mod/group.php:68 ../../mod/profperm.php:23 #: ../../mod/bulksetclose.php:11 ../../index.php:392 @@ -2690,7 +2647,7 @@ msgstr "oneens" #: ../../include/conversation.php:573 ../../mod/photos.php:985 msgctxt "title" msgid "Abstain" -msgstr "onthoudingen" +msgstr "onthouding" #: ../../include/conversation.php:574 ../../mod/photos.php:986 msgctxt "title" @@ -3108,6 +3065,49 @@ msgid_plural "Abstains" msgstr[0] "onthouding" msgstr[1] "onthoudingen" +#: ../../include/bbcode.php:122 ../../include/bbcode.php:743 +#: ../../include/bbcode.php:746 ../../include/bbcode.php:751 +#: ../../include/bbcode.php:754 ../../include/bbcode.php:757 +#: ../../include/bbcode.php:760 ../../include/bbcode.php:765 +#: ../../include/bbcode.php:768 ../../include/bbcode.php:773 +#: ../../include/bbcode.php:776 ../../include/bbcode.php:779 +#: ../../include/bbcode.php:782 +msgid "Image/photo" +msgstr "Afbeelding/foto" + +#: ../../include/bbcode.php:161 ../../include/bbcode.php:793 +msgid "Encrypted content" +msgstr "Versleutelde inhoud" + +#: ../../include/bbcode.php:177 +msgid "Install design element: " +msgstr "Installeer ontwerpelement: " + +#: ../../include/bbcode.php:190 +msgid "QR code" +msgstr "QR-code" + +#: ../../include/bbcode.php:241 +#, php-format +msgid "%1$s wrote the following %2$s %3$s" +msgstr "%1$s schreef het volgende %2$s %3$s" + +#: ../../include/bbcode.php:243 +msgid "post" +msgstr "bericht" + +#: ../../include/bbcode.php:493 +msgid "Different viewers will see this text differently" +msgstr "Deze tekst wordt per persoon anders weergeven." + +#: ../../include/bbcode.php:704 +msgid "$1 spoiler" +msgstr "$1 spoiler" + +#: ../../include/bbcode.php:731 +msgid "$1 wrote:" +msgstr "$1 schreef:" + #: ../../include/photos.php:94 #, php-format msgid "Image exceeds website size limit of %lu bytes" @@ -3851,6 +3851,22 @@ msgstr "Chatkanaal niet gevonden" msgid "Room is full" msgstr "Chatkanaal is vol" +#: ../../include/diaspora.php:2433 +msgid "Please choose" +msgstr "Maak een keuze" + +#: ../../include/diaspora.php:2435 +msgid "Agree" +msgstr "Eens" + +#: ../../include/diaspora.php:2437 +msgid "Disagree" +msgstr "Oneens" + +#: ../../include/diaspora.php:2439 +msgid "Abstain" +msgstr "onthouding" + #: ../../mod/achievements.php:34 msgid "Some blurb about what to do when you're new here" msgstr "Welkom op de RedMatrix. Klik op de tab ontdekken of klik rechtsboven op de kanalengids, om kanalen te vinden. Rechtsboven vind je ook onze apps, waar je vrijwel alles van de RedMatrix kan vinden. Voor hulp met de RedMatrix klik je op het vraagteken of als je meer vragen hebt stel je die in het supportkanaal (liefst in het Engels)." diff --git a/view/nl/strings.php b/view/nl/strings.php index 8dba1d207..b6d2e1ef1 100644 --- a/view/nl/strings.php +++ b/view/nl/strings.php @@ -544,15 +544,6 @@ $a->strings["public profile"] = "openbaar profiel"; $a->strings["%1\$s changed %2\$s to “%3\$s”"] = "%1\$s veranderde %2\$s naar “%3\$s”"; $a->strings["Visit %1\$s's %2\$s"] = "Bezoek het %2\$s van %1\$s"; $a->strings["%1\$s has an updated %2\$s, changing %3\$s."] = "%1\$s heeft een aangepaste %2\$s, %3\$s veranderd."; -$a->strings["Image/photo"] = "Afbeelding/foto"; -$a->strings["Encrypted content"] = "Versleutelde inhoud"; -$a->strings["Install design element: "] = "Installeer ontwerpelement: "; -$a->strings["QR code"] = "QR-code"; -$a->strings["%1\$s wrote the following %2\$s %3\$s"] = "%1\$s schreef het volgende %2\$s %3\$s"; -$a->strings["post"] = "bericht"; -$a->strings["Different viewers will see this text differently"] = "Deze tekst wordt per persoon anders weergeven."; -$a->strings["$1 spoiler"] = "$1 spoiler"; -$a->strings["$1 wrote:"] = "$1 schreef:"; $a->strings["Permission denied"] = "Toegang geweigerd"; $a->strings["(Unknown)"] = "(Onbekend)"; $a->strings["Visible to anybody on the internet."] = "Voor iedereen op het internet zichtbaar."; @@ -613,7 +604,7 @@ $a->strings["__ctx:title__ Likes"] = "vinden dit leuk"; $a->strings["__ctx:title__ Dislikes"] = "vinden dit niet leuk"; $a->strings["__ctx:title__ Agree"] = "eens"; $a->strings["__ctx:title__ Disagree"] = "oneens"; -$a->strings["__ctx:title__ Abstain"] = "onthoudingen"; +$a->strings["__ctx:title__ Abstain"] = "onthouding"; $a->strings["__ctx:title__ Attending"] = "aanwezig"; $a->strings["__ctx:title__ Not attending"] = "niet aanwezig"; $a->strings["__ctx:title__ Might attend"] = "mogelijk aanwezig"; @@ -729,6 +720,15 @@ $a->strings["__ctx:noun__ Abstain"] = array( 0 => "onthouding", 1 => "onthoudingen", ); +$a->strings["Image/photo"] = "Afbeelding/foto"; +$a->strings["Encrypted content"] = "Versleutelde inhoud"; +$a->strings["Install design element: "] = "Installeer ontwerpelement: "; +$a->strings["QR code"] = "QR-code"; +$a->strings["%1\$s wrote the following %2\$s %3\$s"] = "%1\$s schreef het volgende %2\$s %3\$s"; +$a->strings["post"] = "bericht"; +$a->strings["Different viewers will see this text differently"] = "Deze tekst wordt per persoon anders weergeven."; +$a->strings["$1 spoiler"] = "$1 spoiler"; +$a->strings["$1 wrote:"] = "$1 schreef:"; $a->strings["Image exceeds website size limit of %lu bytes"] = "Afbeelding is groter dan op deze hub toegestane limiet van %lu bytes"; $a->strings["Image file is empty."] = "Afbeeldingsbestand is leeg"; $a->strings["Unable to process image"] = "Afbeelding kan niet verwerkt worden"; @@ -911,6 +911,10 @@ $a->strings["Duplicate room name"] = "Naam chatkanaal bestaat al"; $a->strings["Invalid room specifier."] = "Ongeldige omschrijving chatkanaal"; $a->strings["Room not found."] = "Chatkanaal niet gevonden"; $a->strings["Room is full"] = "Chatkanaal is vol"; +$a->strings["Please choose"] = "Maak een keuze"; +$a->strings["Agree"] = "Eens"; +$a->strings["Disagree"] = "Oneens"; +$a->strings["Abstain"] = "onthouding"; $a->strings["Some blurb about what to do when you're new here"] = "Welkom op de RedMatrix. Klik op de tab ontdekken of klik rechtsboven op de kanalengids, om kanalen te vinden. Rechtsboven vind je ook onze apps, waar je vrijwel alles van de RedMatrix kan vinden. Voor hulp met de RedMatrix klik je op het vraagteken of als je meer vragen hebt stel je die in het supportkanaal (liefst in het Engels)."; $a->strings["You have created %1$.0f of %2$.0f allowed channels."] = "Je hebt %1$.0f van totaal %2$.0f toegestane kanalen aangemaakt."; $a->strings["Create a new channel"] = "Nieuw kanaal aanmaken"; From 5dcdb676fd075eb1cbf8a81a572444dd7b2e9eca Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 12 May 2015 16:45:44 -0700 Subject: [PATCH 5/7] version update --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index f6946d516..574787527 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-05-11.1029 +2015-05-12.1030 From 19706705965ffa40799f1e2ca6c061f00eff74b6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 12 May 2015 17:06:47 -0700 Subject: [PATCH 6/7] replace project name with $product or $Product in strings to avoid merge issues across different project names. Currently a place-holder. The strings themselves have not yet been modified. --- include/language.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/include/language.php b/include/language.php index 1e8528dc1..0af72142f 100644 --- a/include/language.php +++ b/include/language.php @@ -159,12 +159,25 @@ function t($s, $ctx = '') { if (x($a->strings, $cs)) { $t = $a->strings[$cs]; - return is_array($t) ? $t[0] : $t; + return ((is_array($t)) ? translate_product($t[0]) : translate_product($t)); } - return $s; + return translate_product($s); } +/** + * @brief translate product name + * Merging strings from different project names is problematic so we'll do that with a string replacement + */ + +function translate_product($s) { + + return str_replace(array('$product','$Product'),array(RED_PLATFORM,ucfirst(RED_PLATFORM)),$s); + +} + + + /** * @brief * From 1e0e812440b8b87c39a88692e39eb0baca736b6e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 12 May 2015 18:11:54 -0700 Subject: [PATCH 7/7] provide a method for loading site/custom widgets --- include/comanche.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/comanche.php b/include/comanche.php index f385f3c5a..3030ae5c6 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -245,6 +245,9 @@ function comanche_widget($name, $text) { } } + if(file_exists('widget/' . trim($name) . '.php')) + require_once('widget/' . trim($name) . '.php'); + $func = 'widget_' . trim($name); if (function_exists($func)) return $func($vars);