Re: Warning: A non-numeric value encountered in...
Posted: Wed Dec 13, 2017 3:58 pm
I'll wait. But anyway, there is still the issue with 2lang. There is shown nothing even on localhost.
Welcome to the CMSimple_XH–Community!
https://cmsimpleforum.com/
Code: Select all
<?php if (function_exists('opcache_invalidate')) opcache_invalidate(__FILE__)?>
Hm, the "daily" pages need to have English names as well, since date('l', …) returns always English day names.Tata wrote:I'll wait. But anyway, there is still the issue with 2lang. There is shown nothing even on localhost.
That would only cause template.htm to be invalidated. You can try:Tata wrote:Addedinto the template: no change so far.Code: Select all
<?php if (function_exists('opcache_invalidate')) opcache_invalidate(__FILE__)?>
Code: Select all
<?php if (function_exists('opcache_reset')) opcache_reset()?>
I was googling after some localisation but haven't found nothing. The EN day names make no big sense on another 2lang pages.cmb wrote:Hm, the "daily" pages need to have English names as well, since date('l', …) returns always English day names.
Code: Select all
$day_name = explode(',', $plugin_tx['week_plan_xh']['day_names']);
$day_name = array_map('trim', $day_name);
Code: Select all
<div class='w_plan_next_day'>" .
newsbox(date('l', strtotime(' + 1 day'))) .
"</div>
Well, there is strftime(), but this relies on the locale setting, which is not really reliable on multi-threaded web servers. Furthermore, there is IntlDateFormatter, but the Intl extension is often unavailable.Tata wrote:I was googling after some localisation but haven't found nothing.
These won't be shown to visitors, though, so if the admin has basic English skills, sticking with English day names appears to be acceptable.Tata wrote:The EN day names make no big sense on another 2lang pages.
Well, you could call newsbox() like so:Tata wrote:It seems, there would be some workaround - evaluating the number of the day with its equivalent inSo it would actualise the call using language strings forCode: Select all
$day_name = explode(',', $plugin_tx['week_plan_xh']['day_names']); $day_name = array_map('trim', $day_name);
Code: Select all
<div class='w_plan_next_day'>" . newsbox(date('l', strtotime(' + 1 day'))) . "</div>
Code: Select all
newsbox($day_name[date('w', strtotime('+ 1 day'))])