ExBB Community » Разное » О жизни » Директивы нормальной работы ExBB 1.1.3 и PHP 8.x

Страниц (1): [1]
 

1. sqrt - 29 октября 2023 — 17:37 - перейти к сообщению
1) На индексной и других страницах, а также в Админке: setmodule.php?module=memcontrol и setsmiles.php:
CODE:
Warning: Resource ID#22 used as offset, casting to integer (22) in W:\domains\bbb.ru\forums\include\fm.class.php on line 662

Warning: Resource ID#20 used as offset, casting to integer (20) in W:\domains\bbb.ru\forums\include\fm.class.php on line 634

Warning: Resource ID#19 used as offset, casting to integer (19) in W:\domains\bbb.ru\forums\include\fm.class.php on line 662

Warning: Resource ID#27 used as offset, casting to integer (27) in W:\domains\bbb.ru\forums\include\fm.class.php on line 634

Warning: Resource ID#25 used as offset, casting to integer (25) in W:\domains\bbb.ru\forums\include\fm.class.php on line 634

Warning: Resource ID#30 used as offset, casting to integer (30) in W:\domains\bbb.ru\forums\include\fm.class.php on line 662

Deprecated: Function strftime() is deprecated in W:\domains\bbb.ru\forums\include\fm.class.php on line 275

Deprecated: Function strftime() is deprecated in W:\domains\bbb.ru\forums\include\fm.class.php on line 276

Deprecated: Function strftime() is deprecated in W:\domains\bbb.ru\forums\include\fm.class.php on line 277

Открыть: include/fm.class.php
Найти:
CODE:
function _DateFormat($time) {
$rus_m = array( '01' => 'Января', '02' => 'Февраля', '03' => 'Марта', '04' => 'Апреля', '05' => 'Мая', '06' => 'Июня', '07' => 'Июля', '08' => 'Августа', '09' => 'Сентября', '10' => 'Октября', '11' => 'Ноября', '12' => 'Декабря' );
$currDay = strftime("%d", $time);
$currMonth = strftime("%m", $time);
$currYear = strftime("%Y", $time);
$tm = date("H:i:s", $time);

return $currDay . ' ' . $rus_m[$currMonth] . ', ' . $currYear . ' - ' . $tm;
}

Заменить на:
CODE:
function _DateFormat($time) {
$rus_m = array( '01' => 'Января', '02' => 'Февраля', '03' => 'Марта', '04' => 'Апреля', '05' => 'Мая', '06' => 'Июня', '07' => 'Июля', '08' => 'Августа', '09' => 'Сентября', '10' => 'Октября', '11' => 'Ноября', '12' => 'Декабря' );
$currDay = date('d', $time);
$currMonth = date('m', $time);
$currYear = date('Y', $time);
$tm = date("H:i:s", $time);

return $currDay . ' ' . $rus_m[$currMonth] . ', ' . $currYear . ' - ' . $tm;
}

Найти:
CODE:
function _Write(&$fp, $arr) {
fseek($fp, 0);
ftruncate($fp, 0);
fwrite($fp, '<?die;?>' . serialize($arr));
fflush($fp);
flock($fp, 3);
fclose($fp);
clearstatcache();
unset( $arr, $this->_FilePointers[$fp] );

return;
}

Заменить на:
CODE:
function _Write(&$fp, $arr) {
fseek($fp, 0);
ftruncate($fp, 0);
fwrite($fp, '<?die;?>' . serialize($arr));
fflush($fp);
flock($fp, 3);
fclose($fp);
clearstatcache();
unset( $arr, $this->_FilePointers[(int)$fp] );

return;
}

Найти:
CODE:
function _Fclose($fp) {
fclose($fp);
unset( $this->_FilePointers[$fp] );
}

Заменить на:
CODE:
function _Fclose($fp) {
fclose($fp);
unset( $this->_FilePointers[(int)$fp]);
}


2) На главной станице АЦ admincenter.php в случае, если не включена функция exec() на хостинге:
CODE:
Fatal error: Uncaught Error: Call to undefined function exec() in /admincenter.php:54 Stack trace: #0 {main} thrown in /admincenter.php on line 54


Найти и удалить (спорное решение, или надо включить функцию через ПУ хостера или не будет отображаться "нагрузка сервера"Подмигивание:
CODE:
$loaded = @exec('uptime');
if (preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', $loaded, $srv_load)) {
$server_load = $srv_load[1] . ' ' . $srv_load[2] . ' ' . $srv_load[3];
}
2. sqrt - 2 ноября 2023 — 08:43 - перейти к сообщению
Открыть include/fm_class.php
Найти:
CODE:
function _JoinDate($time) {
$months = array( '00' => '', '01' => 'Янв.', '02' => 'Февр.', '03' => 'Март', '04' => 'Апр.', '05' => 'Май', '06' => 'Июнь', '07' => 'Июль', '08' => 'Авг.', '09' => 'Сент.', '10' => 'Окт.', '11' => 'Нояб.', '12' => 'Дек.' );
$currMonth = strftime("%m", $time);
$currYear = strftime("%Y", $time);

return $months["$currMonth"] . " " . $currYear;
}

Заменить на:
CODE:
function _JoinDate($time) {
$months = array( '00' => '', '01' => 'Янв.', '02' => 'Февр.', '03' => 'Март', '04' => 'Апр.', '05' => 'Май', '06' => 'Июнь', '07' => 'Июль', '08' => 'Авг.', '09' => 'Сент.', '10' => 'Окт.', '11' => 'Нояб.', '12' => 'Дек.' );
$currMonth = date('m', $time);
$currYear = date('Y', $time);

return $months["$currMonth"] . " " . $currYear;
}
3. 1Bot - 22 декабря 2023 — 08:21 - перейти к сообщению
sqrt , Спасибо!
4. Guyver - 23 декабря 2023 — 08:52 - перейти к сообщению
Ну хоть пустые, а не отключенные... Жалко, конечно. За то время, когда всё тут забросили, я раза 3 точно создал бы новые темы в модах, которые прикрутил на своём форуме. Но увы и ах... Это всё явно не добавило "игроков на серверах" Растерялся
5. sqrt - 8 января 2024 — 07:12 - перейти к сообщению
Также появляется предупреждение:
CODE:
Warning: Undefined array key "BelongTopicsByUser" in /forums/modules/belong/frontindex.php on line 126

и в шаблонах, если установлен модуль поиска тем и сообщений пользователя "Belong", модуль включен и, если зайти в профиль какого-то пользователя гостем (именно гостем). Если зайти пользователем зарегистрированным, то предупреждения не возникает[/code]
Причина - полное различие по ключам массива в русской и английской интерпретации. Перевел так \modules\belong\language\english\lang.php:
CODE:
$this->LANG['BelongModuleTitle'] = 'Search user topics and posts';
$this->LANG['BelongNoModuleSkin'] = 'Could not find a skin that supports this module. Contact the forum administrator!';
$this->LANG['BelongTopicsByUser'] = 'List of topics authored by %s';
$this->LANG['BelongUserNotFound'] = 'User not found or deleted!';
$this->LANG['BelongNoTopics'] = 'No topics found by %s';
$this->LANG['BelongIncorrectPage'] = 'Incorrect page number';
$this->LANG['BelongViews'] = 'Views';
$this->LANG['BelongUserDeleted'] = '<i>Deleted</i>';
$this->LANG['BelongPostsByUser'] = 'List of posts authored by %s';
$this->LANG['BelongNoPosts'] = 'No posts found by user %s';
$this->LANG['BelongPostsFound'] = 'Posts found:';
$this->LANG['BelongTopic'] = 'Topic:';
$this->LANG['BelongFindAllTopics'] = 'Find all topics';
$this->LANG['BelongFindAllPosts'] = 'Find all posts';
6. sqrt - 8 января 2024 — 18:53 - перейти к сообщению
sqrt пишет:
и, если зайти в профиль какого-то пользователя гостем (именно гостем). Если зайти пользователем зарегистрированным, то предупреждения не возникает

Вот, насчет этого я был некорректен. Просто у меня по умолчанию для гостя включен английский язык, а тестовые аккаунты были на русском. Поэтому тут проблема исключительно была в неправильных значениях ключей массивов в английских языковых файлах PHP.
7. sqrt - 8 января 2024 — 19:06 - перейти к сообщению
sqrt пишет:
Причина - полное различие по ключам массива в русской и английской интерпретации. Перевел так \modules\belong\language\english\lang.php:

А в файле до моей правки было вот это:
CODE:
<?php
$this->LANG['ModuleTitle'] = 'Configuring the module "Search for topics and user messages"';
$this->LANG['BelongMembersPerDb'] = 'How many user records are stored in one database?';
$this->LANG['BelongMembersPerDbDesc'] = 'This parameter affects the performance of the module, changing it will require manual indexing of the database of the module.';
$this->LANG['BelongViewTopics'] = 'Allow viewing a list of user topics?';
$this->LANG['BelongViewPosts'] = 'Allow viewing the list of user messages?';
$this->LANG['BelongIndexDbs'] = 'Manual indexing of module databases';
$this->LANG['BelongIndexDbsDesc'] = 'Run this procedure to update information on topics and posts of users';
$this->LANG['BelongExecute'] = 'Run';
$this->LANG['ModuleUpdateOk'] = 'The configuration of the "Search for topics and user posts" module has been successfully changed!';
$this->LANG['BelongIndexingProgress'] =' Indexing in progress: %d%% (%d: %d) completed. Do not close this window until the procedure is completed! ';
$this->LANG['BelongIndexingOk'] = 'Indexing the database of the module completed successfully!';
?>

Вот, у меня и возник вопрос, откуда такая мура, вообще, взялась...

Яндекс.Метрика   

Powered by ExBB
[Script Execution time: 0.0167]     [ ]