serendipity_loadGlobalThemeOptions und Constants

Hier können Probleme und alles andere in Deutscher Sprache gelöst werden.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: serendipity_loadGlobalThemeOptions und Constants

Post by yellowled »

Timbalu wrote:hmm, bei mir werden sie nur als t_global gespeichert.
Keinen Schimmer, muss wohl gelegentlich mal das dev-Blog frisch aufsetzen. Muss wie alles andere im Moment warten.
Timbalu wrote:Und das im Gegensatz zur 'amount' Änderung sofort!
Ich bin mir ziemlich sicher, dass wir einen Patch für amount von abdussammad hatten, gegen den es aber irgendwelche Sicherheitsbedenken gab. Vielleicht suchst Du mal im Forum danach, müsste allerdings ziemlich alt sein.

YL
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: serendipity_loadGlobalThemeOptions und Constants

Post by yellowled »

ich stelle da gerade (in 1.7-alpha1) fest, dass mir der Beispielcode aus BP

Code: Select all

$template_global_config = array('navigation' => true);

$template_loaded_config = serendipity_loadThemeOptions($template_config, $serendipity['smarty_vars']['template_option']);

serendipity_loadGlobalThemeOptions($template_config, $template_loaded_config, $template_global_config);
kein Feld mehr ausgibt, um die Anzahl der Links in der Navigation anzugeben (weder in BP noch im Template, an dem ich arbeite). Fehlt mir was oder habt Ihr da versehentlich an der falschen Schraube gedreht? :)

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_loadGlobalThemeOptions und Constants

Post by Timbalu »

Upps den habe ich dort eingebaut, glaube ich

Probierst du mal aus bitte, in der functions_config.inc.php die Zeile 2128 in dies zu verändern und sie hinter die nächste } also 2 Zeilen weiter zu setzen

Code: Select all

$template_config[] = $conf_amount ? $conf_amount : $template_loaded_config['amount'];
Wenn du mir Rückmeldung gibst, patch ich das für Garvin. Danke.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: serendipity_loadGlobalThemeOptions und Constants

Post by yellowled »

Timbalu wrote:Probierst du mal aus bitte, in der functions_config.inc.php die Zeile 2128 in dies zu verändern und sie hinter die nächste } also 2 Zeilen weiter zu setzen
In 2128 auskommentiert und hinter der nächsten schließenden geschweiften Klammer in 2130 entsprechend geändert eingefügt. Ergibt in "Styles verwalten" bai Aufruf:

Code: Select all

Warning: Invalid argument supplied for foreach() in /var/www/serendipity/include/admin/templates.inc.php on line 19 
YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_loadGlobalThemeOptions und Constants

Post by Timbalu »

son mist,
wie gut das dir das aufgestoßen war! Ich habe die ganze Zeit das falsche array angepinkelt ;-)
Zwischen navlinks = array() und if (empty($template... bitte alles ersetzen.

Code: Select all

        $navlinks = array();

        foreach(array_reverse($template_config) as $search_conf) {
            if( in_array('amount', $search_conf) ) { $amountbytemplate = true; break; }
        }
        $conf_amount = array(
                'var'           => 'amount',
                'name'          => NAVLINK_AMOUNT,
                'type'          => 'string',
                'default'       => '5',
                'scope'         => 'global'
        );
        if (!$amountbytemplate) { 
            $template_config[] = $conf_amount;
        }

        if (empty($template_loaded_config['amount'])) {
Ich hoffe das klappt dann.

btw @Garvin,
stünde es serendipity nicht gut eine schnelle und universale array recursive Funktion zur Verfügung zu stellen? serendipity_walkRecursive konnte ich hier nicht gebrauchen.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: serendipity_loadGlobalThemeOptions und Constants

Post by yellowled »

Timbalu wrote:Zwischen navlinks = array() und if (empty($template... bitte alles ersetzen.
Jawoll, das tut.

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_loadGlobalThemeOptions und Constants

Post by Timbalu »

Hi Garvin

Code: Select all

Index: functions_config.inc.php
===================================================================
--- functions_config.inc.php	(Revision 2768)
+++ functions_config.inc.php	(Arbeitskopie)
@@ -2116,15 +2116,17 @@
     if ($supported['navigation']) {
         $navlinks = array();
 
-        if (!isset($template_loaded_config['amount'])) { 
-            $conf_amount = array(
+        foreach(array_reverse($template_config) as $search_conf) {
+            if( in_array('amount', $search_conf) ) { $amountbytemplate = true; break; }
+        }
+        $conf_amount = array(
                 'var'           => 'amount',
                 'name'          => NAVLINK_AMOUNT,
-                'desc'          => NAVLINK_AMOUNT_BLAHBLAH,
                 'type'          => 'string',
                 'default'       => '5',
                 'scope'         => 'global'
-            );
+        );
+        if (!$amountbytemplate) { 
             $template_config[] = $conf_amount;
         }
 
könntest du auch noch mal diesen Punkt mit der zickigen Navigation (YL) ab Mitte/Ende Seite 1 von diesem Thread nachsehen? Solange der Navigationsleisten Amount in der template config nicht wirklich vollständig reloaded wird, gibt es Probleme, und auch der options table bräuchte ev. ein aktuelleres truncate...
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: serendipity_loadGlobalThemeOptions und Constants

Post by yellowled »

Timbalu wrote:könntest du auch noch mal diesen Punkt mit der zickigen Navigation (YL) ab Mitte/Ende Seite 1 von diesem Thread nachsehen?
Just for the record: Das zeigt sich in dieser (neu aufgesetzten) Instanz des dev-Blog bisher nicht.

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_loadGlobalThemeOptions und Constants

Post by Timbalu »

auch nicht die amount reload / options table Geschichte???
Last edited by Timbalu on Tue Jul 26, 2011 9:16 am, edited 1 time in total.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: serendipity_loadGlobalThemeOptions und Constants

Post by yellowled »

Timbalu wrote:auch nicht die amount reload Geschichte???
Was genau meinst Du? Dass man „Styles verwalten“ neu laden muss, damit Änderungen wirksam werden, bin ich nicht anders gewöhnt, das ist auch nach wie vor so. Aber das Feld zum Ändern der Anzahl der Links wird jetzt ausgegeben und funktioniert.

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: serendipity_loadGlobalThemeOptions und Constants

Post by garvinhicking »

Hi!

Wow, äh. Das ganze array_reverse und in_array ist performancemäßig echt teuer, zumal es ja bei JEDEM request immer wieder ausgeführt wird. Finde ich etwas uncool - habe mir den ganzen Patch noch nicht so genau angeguckt, bin aber ob der Probleme und der dafür notwendigen "teuren" Code-Calls gerade eher dazu eingestellt das ganze zum ursprünglchen Zustand zu reverten?!

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_loadGlobalThemeOptions und Constants

Post by Timbalu »

Bin wieder da...
@Garvin: Die besprochenen "Probleme" bezogen sich aber nicht auf den eingefügten Patch.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: serendipity_loadGlobalThemeOptions und Constants

Post by yellowled »

*bump*

Kinners, gefixt isses aber in 1.7-alpha1 immer noch nicht?

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_loadGlobalThemeOptions und Constants

Post by Timbalu »

Ist das eine neue Alpha 1.7?
Yupp, dort ist wieder open, da Garvin mein Geknitter wieder rückgängig gemacht hat. Ein ev. verbesserter Patch ist in der Röhre, bis er Zeit findet das fachgerecht auseinander zu klamüsern.
Könntest du das auf dein Problem hin eventuell mal testen?

Code: Select all

    Index: functions_config.inc.php
    ===================================================================
    --- functions_config.inc.php   (Revision 2771)
    +++ functions_config.inc.php   (Arbeitskopie)
    @@ -2116,19 +2116,16 @@
         if ($supported['navigation']) {
             $navlinks = array();

    -        if (!isset($template_loaded_config['amount'])) {
    -            $conf_amount = array(
    +        $conf_amount = array(
                     'var'           => 'amount',
                     'name'          => NAVLINK_AMOUNT,
    -                'desc'          => NAVLINK_AMOUNT_BLAHBLAH,
                     'type'          => 'string',
                     'default'       => '5',
                     'scope'         => 'global'
    -            );
    -            $template_config[] = $conf_amount;
    -        }
    +        );

    -        if (empty($template_loaded_config['amount'])) {
    +        if (!isset($template_loaded_config['amount']) || empty($template_loaded_config['amount'])) {
    +            $template_config[] = $conf_amount;
                 $template_loaded_config['amount'] = $conf_amount['default'];
             }
         
Das dahinter liegende eigentliche Problem liegt aber in der Verzögerung zwischen Config submit und dem options table, glaube ich. Und da sind wir hoffentlich gerade dran, da das auch mit dem boolean etc auftritt.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: serendipity_loadGlobalThemeOptions und Constants

Post by yellowled »

Timbalu wrote:Ist das eine neue Alpha 1.7?
Aktueller svn/trunk halt.
Timbalu wrote:Könntest du das auf dein Problem hin eventuell mal testen?
Akut nicht, aber sicherlich irgendwann am Wochenende.

YL
Post Reply