Glossaire_XH
Moderator: Tata
Re: Glossaire_XH
Un autre problème se pose, par exemple, si vous avez le anchorific-Script dans le template.
L'utilisation des titres h4 dans le popup est défavorable et perturbe également la structure de la page. Peut-être qu'une classe CSS serait appropriée.
L'utilisation des titres h4 dans le popup est défavorable et perturbe également la structure de la page. Peut-être qu'une classe CSS serait appropriée.
Re: Glossaire_XH
sorry but i don't have the solution for now.cmb wrote: ↑Mon Sep 21, 2020 12:47 pmI don't have the source code at hand, but create_function() should be replaced by an anonymous function.
I am unable to fix this deprecated function.
I have to change this :
Code: Select all
function array_key_multi_sort(&$arr, $l , $strnat='strnatcasecmp') {
//return usort($arr, create_function('$a, $b', "return $strnat(OteAccents(\$a['$l']), OteAccents(\$b['$l']));"));
}
if (is_array($lignes)) {array_key_multi_sort($lignes, $choix_tri , $strnat='strnatcasecmp');}
Code: Select all
function array_key_multi_sort(&$arr, $l , $strnat='strnatcasecmp') {
return usort($arr,
function($a, $b){
return strnatcasecmp(OteAccents($a[$l]), OteAccents($b[$l]));
}
);
}
if (is_array($lignes)) {array_key_multi_sort($lignes, $choix_tri , $strnat='strnatcasecmp');}
Re: Glossaire_XH
Don't panic! I fully understand that.
I'm currently working on a modified version, just for my own needs
The plugin is surely applicable in most cases without problems.
The only worry is that the deprecated function will not work with PHP 8 anymore.
Thanks for your help.
Re: Glossaire_XH
Maybe the following works:
Code: Select all
function array_key_multi_sort(&$arr, $l , $strnat='strnatcasecmp') {
//return usort($arr, create_function('$a, $b', "return $strnat(OteAccents(\$a['$l']), OteAccents(\$b['$l']));"));
return usort($arr,
function($a, $b) use ($l, $strnat) {
return $strnat(OteAccents($a[$l]), OteAccents($b[$l]));
}
);
}
if (is_array($lignes)) {array_key_multi_sort($lignes, $choix_tri , $strnat='strnatcasecmp');}
Christoph M. Becker – Plugins for CMSimple_XH
Re: Glossaire_XH
The function seems to work well.
The error message is gone in any case and the plugin works as desired.
If I notice anything later, I will report here.
Thanks for the help.
Re: Glossaire_XH
indeed, I had forgotten this detail.cmb wrote: ↑Mon Sep 21, 2020 4:31 pmMaybe the following works:The relevant change is use($l, $strnat); without it, these variables are not defined in the anonymous function.Code: Select all
function array_key_multi_sort(&$arr, $l , $strnat='strnatcasecmp') { //return usort($arr, create_function('$a, $b', "return $strnat(OteAccents(\$a['$l']), OteAccents(\$b['$l']));")); return usort($arr, function($a, $b) use ($l, $strnat) { return $strnat(OteAccents($a[$l]), OteAccents($b[$l])); } ); } if (is_array($lignes)) {array_key_multi_sort($lignes, $choix_tri , $strnat='strnatcasecmp');}
Thanks for this correction.
This function is used to filter the columns of words in the administration and everything works perfectly.
I don't believe there are any other deprecated functions in the code but I will check and update the plugin on my site.
I remain attentive to the various comments.
Thanks again.
Re: Glossaire_XH
That's good. And since you're in the middle of it, I might as well make a few more comments.
But please don't feel pressured - they are just comments from a non-expert.
As mentioned above, no headings should appear in the popups (<h3>, <h4>). This can be done with a paragraph with CSS class.
(E.g. in the file gloss_inc2.inc in line 125-126 and line 169.)
The font in the popups should theoretically be like this:
Code: Select all
font-family: system-ui;
But you can read here for example: https://css-tricks.com/snippets/css/system-font-stack/. But, that becomes too much effort.
Arial, Verdana and Co, which are suggested in the plugin, did not please me.
So I simply added a new option to the select fields for the font selection. Namely: font-family: inherit
So at least the template font is used, which fits quite well in my case.
In the file admin.php I added two lines:
Code: Select all
Line 857:
<option value="inherit"'.(($titre[2] == "inherit") ? " selected=\"selected\"" : "").'>inherit</option>
...
Line 912:
<option value="inherit"'.(($defin[2] == "inherit") ? " selected=\"selected\"" : "").'>inherit</option>
Re: Glossaire_XH
What I have forgotten ...
The terms found on the page will get a link:
This can also be unfavorable under certain circumstances. On the one hand it creates an entry in the browsing history - on the other hand it can lead to jumps if you click on it.
Maybe it's enough to style the term via CSS and give it an ID ???
The terms found on the page will get a link:
Code: Select all
<a href="#gpop3" class="gpop">The Term</a>
Maybe it's enough to style the term via CSS and give it an ID ???
Re: Glossaire_XH
it seems like a good idea to test.frase wrote: ↑Tue Sep 22, 2020 12:15 am...
So I simply added a new option to the select fields for the font selection. Namely: font-family: inherit
So at least the template font is used, which fits quite well in my case.
In the file admin.php I added two lines:
Code: Select all
Line 857: <option value="inherit"'.(($titre[2] == "inherit") ? " selected=\"selected\"" : "").'>inherit</option> ... Line 912: <option value="inherit"'.(($defin[2] == "inherit") ? " selected=\"selected\"" : "").'>inherit</option>
Re: Glossaire_XH
I created this plugin about fifteen years ago for another CMS at the time. I evolved it over time and adapted it to CMSimple later.frase wrote: ↑Tue Sep 22, 2020 12:44 amWhat I have forgotten ...
The terms found on the page will get a link:This can also be unfavorable under certain circumstances. On the one hand it creates an entry in the browsing history - on the other hand it can lead to jumps if you click on it.Code: Select all
<a href="#gpop3" class="gpop">The Term</a>
Maybe it's enough to style the term via CSS and give it an ID ???
Today, we could surely review its design. If I had to do it again, I would surely do otherwise.
But I have neither the time nor the will currently (I am looking for a job and have health problems) to tackle such a project.
It will therefore remain as it is now, structurally speaking. I will make a decision later on whether to redesign this plugin or abandon it.
Thank you for your understanding.