From 876345c053c49d77639a279a24221ec69eb804fc Mon Sep 17 00:00:00 2001 From: Ian Date: Fri, 19 Apr 2024 17:40:29 +0200 Subject: [PATCH 1/5] lang API: Fixup dd832254472a702921fdb9f7bbbe0ac4af687d2c#diff-9ab5e4fd4c9b654a7843bf0b989f8c4653595e31aa0875417172955a6a215464 for the undocumented private variable usage to overwrite lang constants via user theme I think backend allowance was just an overseen mistake while this commit was a draft commit for splitting up backend and frontend themes for Serendipity 2.0. It makes no sense to have this anywhere other than for individual user frontend themes. The less it runs through, the less possible regressions it has. It was done in the early days to allow overwriting certain core constants in themes for frontend templates, e.g. POWERED_BY. --- include/lang.inc.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/include/lang.inc.php b/include/lang.inc.php index 647008f17..cdcc10685 100644 --- a/include/lang.inc.php +++ b/include/lang.inc.php @@ -14,23 +14,20 @@ $charset = serendipity_getCharset(); // The following variable can be set in serendipity_config_local.inc.php to force your templates being able to use language override includes - if (isset($serendipity['useTemplateLanguage']) && $serendipity['useTemplateLanguage'] === true) { + // An un-promoted private variable set, to first serve template based serendipity lang constants that have higher priority. + // We do not allow this for backend constants and both, the fallback "default" and the standard theme (currently "pure") ! + if (isset($serendipity['useTemplateLanguage']) && $serendipity['useTemplateLanguage'] === true && !empty($serendipity['template']) + && !defined('IN_serendipity_admin') && !in_array($serendipity['template'], ['default', 'default-php', $serendipity['defaultTemplate']])) { if (defined('S9Y_DATA_PATH')) { @include_once (S9Y_DATA_PATH . 'templates/' . $serendipity['template'] . '/' . $charset . 'lang_' . $serendipity['lang'] . '.inc.php'); @include_once (S9Y_DATA_PATH . 'templates/' . $serendipity['template'] . '/lang_en.inc.php'); - - @include_once (S9Y_DATA_PATH . 'templates/' . $serendipity['template_backend'] . '/' . $charset . 'lang_' . $serendipity['lang'] . '.inc.php'); - @include_once (S9Y_DATA_PATH . 'templates/' . $serendipity['template_backend'] . '/lang_en.inc.php'); } else { @include_once (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template'] . '/' . $charset . 'lang_' . $serendipity['lang'] . '.inc.php'); @include_once (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template'] . '/lang_en.inc.php'); - - @include_once (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template_backend'] . '/' . $charset . 'lang_' . $serendipity['lang'] . '.inc.php'); - @include_once (S9Y_INCLUDE_PATH . 'templates/' . $serendipity['template_backend'] . '/lang_en.inc.php'); } } - // Try and include preferred language from the configurated setting + // Try and include preferred language from the configured setting if (@include(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_'. $serendipity['lang'] .'.inc.php') ) { // Only here can we truly say the language is loaded @@ -42,9 +39,9 @@ // If no config file is loaded, language includes are not available. // Now include one. Try to auto-guess the language by looking up the HTTP_ACCEPT_LANGUAGE. serendipity_detectLang(true); - } //endif + } - // Do fallback to english + // Do fall back to english if (IS_installed === false || (defined('IS_up2date') && IS_up2date === false)) { @include_once(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_en.inc.php'); } From 5155ce5a96f2afa8252816b878d235b4d0a5afcd Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 24 Apr 2024 17:54:04 +0200 Subject: [PATCH 2/5] b46: Fix [en] typo and [de] wording in B46_INSTR "featured" article details --- templates/b46/UTF-8/lang_de.inc.php | 2 +- templates/b46/lang_de.inc.php | 2 +- templates/b46/lang_en.inc.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/b46/UTF-8/lang_de.inc.php b/templates/b46/UTF-8/lang_de.inc.php index 42a87d361..a0b7ba41c 100644 --- a/templates/b46/UTF-8/lang_de.inc.php +++ b/templates/b46/UTF-8/lang_de.inc.php @@ -35,6 +35,6 @@
  • Erstellen Sie nun einen Eintrag der im Weiteren als Featured Article in diesen Theme Optionen als "'.B46_LEAD.'" verlinkt werden soll. Achten Sie darauf, diesen Eintrag nur der Kategorie "feature" zuzuordnen und in den "Erweiterten Eigenschaften von Artikeln" des Eintragsformulares ein Häckchen bei "Nicht in Artikelübersicht zeigen" und (optional) "Eintragsinhalt im RSS-Feed verstecken" zu setzen.
  • Nutzen Sie einfach die Artikel Vorschau, um sich den Link zum Artikel einfach herauszukopieren (Titel mit rechten Maustaste "Link speichern"). Den kopierten Link setzen Sie dort ein, wo hier beispielhaft "#" als "url=#" im Array: "image=/uploads/features/fa_1.webp&height=350px&title=My first longer featured blog post with ID 1&text=Summary feature of my post’s contents.&url=#&link=Continue reading..." steht (siehe voll funktionierendes Demo Beispiel in der Info zur Option "'.B46_LEAD.'").
  • -

    Et voilà ! Ihr herausgehobener "featured article" wird nun auf den Blog-Artikel als ganzer Artikel verweisen. Ansonsten ist er nur über den Archives-/Kategorielink im Blog erreichbar. Wird dieser Artikel irgendwann für einen anderen/neuen als normaler Artikel zurückgestuft, so ändern Sie im Artikel selbst die Kategorie und nehmen die beiden Häcken in den Erweiterte Eigenschaften von Artikeln (wie oben beschrieben) wieder heraus. Sie sehen also mit dieser Theme Option eine andere Art des Umganges mit quasi "Dauerhaften Artikeln", die ansonsten natürlich zum Serendipity Standardrepertoire in den "Erweiterten Artikeleigenschaften" gehören.

    +

    Et voilà ! Ihr besonders beworbener, "featured"-Artikel wird nun auf den Eintrag als ganzen Artikel verweisen. Ansonsten ist er nur über den Archives-/Kategorielink im Blog erreichbar. Wird dieser Artikel irgendwann für einen anderen/neuen als normaler Artikel zurückgestuft, so ändern Sie im Artikel selbst die Kategorie und nehmen die beiden Häkchen in den "Erweiterten Eigenschaften für Einträge" (wie oben beschrieben) wieder heraus. Wie Sie sehen, können Sie mit dieser Theme-Option eine andere Art des Umganges mit "Dauerhaften Einträgen" ermöglichen, die ansonsten natürlich zum Serendipity Standardrepertoire von Serendipity in den "Erweiterten Artikeleigenschaften" gehören.

    '); diff --git a/templates/b46/lang_de.inc.php b/templates/b46/lang_de.inc.php index 7029490a1..2a248ad72 100644 --- a/templates/b46/lang_de.inc.php +++ b/templates/b46/lang_de.inc.php @@ -35,6 +35,6 @@
  • Erstellen Sie nun einen Eintrag der im Weiteren als Featured Article in diesen Theme Optionen als "'.B46_LEAD.'" verlinkt werden soll. Achten Sie darauf, diesen Eintrag nur der Kategorie "feature" zuzuordnen und in den "Erweiterten Eigenschaften von Artikeln" des Eintragsformulares ein Häckchen bei "Nicht in Artikelübersicht zeigen" und (optional) "Eintragsinhalt im RSS-Feed verstecken" zu setzen.
  • Nutzen Sie einfach die Artikel Vorschau, um sich den Link zum Artikel einfach herauszukopieren (Titel mit rechten Maustaste "Link speichern"). Den kopierten Link setzen Sie dort ein, wo hier beispielhaft "#" als "url=#" im Array: "image=/uploads/features/fa_1.webp&height=350px&title=My first longer featured blog post with ID 1&text=Summary feature of my posts contents.&url=#&link=Continue reading..." steht (siehe voll funktionierendes Demo Beispiel in der Info zur Option "'.B46_LEAD.'").
  • -

    Et voila ! Ihr herausgehobener "featured article" wird nun auf den Blog-Artikel als ganzer Artikel verweisen. Ansonsten ist er nur über den Archives-/Kategorielink im Blog erreichbar. Wird dieser Artikel irgendwann für einen anderen/neuen als normaler Artikel zurückgestuft, so ändern Sie im Artikel selbst die Kategorie und nehmen die beiden Häcken in den Erweiterte Eigenschaften von Artikeln (wie oben beschrieben) wieder heraus. Sie sehen also mit dieser Theme Option eine andere Art des Umganges mit quasi "Dauerhaften Artikeln", die ansonsten natürlich zum Serendipity Standardrepertoire in den "Erweiterten Artikeleigenschaften" gehören.

    +

    Et voilà ! Ihr besonders beworbener, "featured"-Artikel wird nun auf den Eintrag als ganzen Artikel verweisen. Ansonsten ist er nur über den Archives-/Kategorielink im Blog erreichbar. Wird dieser Artikel irgendwann für einen anderen/neuen als normaler Artikel zurückgestuft, so ändern Sie im Artikel selbst die Kategorie und nehmen die beiden Häkchen in den "Erweiterten Eigenschaften für Einträge" (wie oben beschrieben) wieder heraus. Wie Sie sehen, können Sie mit dieser Theme-Option eine andere Art des Umganges mit "Dauerhaften Einträgen" ermöglichen, die ansonsten natürlich zum Serendipity Standardrepertoire von Serendipity in den "Erweiterten Artikeleigenschaften" gehören.

    '); diff --git a/templates/b46/lang_en.inc.php b/templates/b46/lang_en.inc.php index 6177595be..ae7ce45f7 100644 --- a/templates/b46/lang_en.inc.php +++ b/templates/b46/lang_en.inc.php @@ -38,6 +38,6 @@
  • Then create an entry that will be linked as a featured article here in these theme options in "'.B46_LEAD.'". Make sure to assign this entry only to the category "feature" and to check "Do not show in article overview" and (optionally) "Hide entry content in RSS feed" in the "Extended properties for entries" section of the entry form.
  • Simply use the article preview to copy the link to the article (right-click the title with mouse and "Save link"). Insert the copied link where "#" lives as "url=#" in the following shortened example array: "image=/uploads/features/fa_1.webp&height=350px&title=My first longer featured blog post with ID 1&text=Summary feature of my post contents.&url=#&link=Continue reading..." (see a full functional demo example in the info text of option "'.B46_LEAD.'" down below).
  • -

    Et voila ! Your promoted "featured article" will now link to the featured article as a single full article. Otherwise, it will only be link-accessible via the archives/category link in the blog. If at some point this article is back demoted for another/new one as a normal article, you have to only change the category in the article itself and uncheck the two ckeckboxes in the "Extended properties for entries" (as described above). As you can see, you now are able to enable a different way of dealing with "sticky articles" with this theme option, which are otherwise of course part of Serendipity\'s standard repertoire in the "Advanced article properties".

    +

    Et voila ! Your promoted "featured article" will now link to the featured article as a single full article. Otherwise, it will only be link-accessible via the archives/category link in the blog. If at some point this article is back demoted for another/new one as a normal article, you have to only change the category in the article itself and uncheck the two checkboxes in the "Extended properties for entries" (as described above). As you can see, you now are able to enable a different way of dealing with "sticky articles" with this theme option, which are otherwise of course part of Serendipity\'s standard repertoire in the "Advanced article properties".

    '); From e76d4ff7ce07f1c098042f59d72a893317ed965e Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 24 Apr 2024 17:54:50 +0200 Subject: [PATCH 3/5] b46: Change lm date for 5155ce5a96f2afa8252816b878d235b4d0a5afcd --- templates/b46/info.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/b46/info.txt b/templates/b46/info.txt index 70c5501f2..3f00fe29f 100644 --- a/templates/b46/info.txt +++ b/templates/b46/info.txt @@ -1,6 +1,6 @@ Name: B46 [Black Edition] Author: Ian Styx -Date: 2024-02-28 +Date: 2024-04-22 Require Serendipity: 3.5 Backend: No Responsive: Yes From eb1b2953418cac374ec78bf4848eb7398acb12b1 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 24 Apr 2024 17:56:35 +0200 Subject: [PATCH 4/5] default: Improve #media_pane_sort .hideSubDirLabel {} for .mpf-content break --- templates/default/admin/style.css | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/templates/default/admin/style.css b/templates/default/admin/style.css index 26dfb83f4..749ca0fb4 100644 --- a/templates/default/admin/style.css +++ b/templates/default/admin/style.css @@ -4181,6 +4181,9 @@ img.mfp-img { #serendipity_comments_list .pingback.actions { margin-top: 1.5em; } + #media_pane_sort .hideSubDirLabel { + white-space: pre; + } .js .media_controls video { max-width: 24em; } @@ -5273,10 +5276,6 @@ img.mfp-img { width: 100%; } - #media_pane_sort .hideSubDirLabel { - white-space: pre; - } - .actions li, .actions_extra { margin: 0 .3em .5em 0; From d67dbde0897198f80dd5fcbeceea8121fdb7cd25 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 24 Apr 2024 17:56:50 +0200 Subject: [PATCH 5/5] styx: Improve #media_pane_sort .hideSubDirLabel {} for .mpf-content break --- templates/styx/admin/style.css | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/templates/styx/admin/style.css b/templates/styx/admin/style.css index 95cf9eaa4..a6f0bce1b 100644 --- a/templates/styx/admin/style.css +++ b/templates/styx/admin/style.css @@ -4489,6 +4489,9 @@ img.mfp-img { #serendipity_comments_list .pingback.actions { margin-top: 1.5em; } + #media_pane_sort .hideSubDirLabel { + white-space: pre; + } .js .media_controls video { max-width: 24em; } @@ -5681,10 +5684,6 @@ img.mfp-img { width: 100%; } - #media_pane_sort .hideSubDirLabel { - white-space: pre; - } - .actions li, .actions_extra { margin: 0 .3em .5em 0;