Страниц (3): [1] 2 3 »
Найдено сообщений: 37 |
sqrt |
Отправлено: 8 января 2024 — 19:06 • Тема: Директивы нормальной работы ExBB 1.1.3 и PHP 8.x • Форум: О жизни |
Ответов: 6 Просмотров: 684
|
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!';
?>
Вот, у меня и возник вопрос, откуда такая мура, вообще, взялась... |
sqrt |
Отправлено: 8 января 2024 — 18:53 • Тема: Директивы нормальной работы ExBB 1.1.3 и PHP 8.x • Форум: О жизни |
Ответов: 6 Просмотров: 684
|
sqrt пишет:и, если зайти в профиль какого-то пользователя гостем (именно гостем). Если зайти пользователем зарегистрированным, то предупреждения не возникает
Вот, насчет этого я был некорректен. Просто у меня по умолчанию для гостя включен английский язык, а тестовые аккаунты были на русском. Поэтому тут проблема исключительно была в неправильных значениях ключей массивов в английских языковых файлах PHP. |
sqrt |
Отправлено: 8 января 2024 — 07:12 • Тема: Директивы нормальной работы ExBB 1.1.3 и PHP 8.x • Форум: О жизни |
Ответов: 6 Просмотров: 684
|
Также появляется предупреждение:
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'; |
sqrt |
Отправлено: 2 ноября 2023 — 08:43 • Тема: Директивы нормальной работы ExBB 1.1.3 и PHP 8.x • Форум: О жизни |
Ответов: 6 Просмотров: 684
|
Открыть 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;
} |
sqrt |
Отправлено: 29 октября 2023 — 17:37 • Тема: Директивы нормальной работы ExBB 1.1.3 и PHP 8.x • Форум: О жизни |
Ответов: 6 Просмотров: 684
|
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];
}
|
sqrt |
Отправлено: 4 апреля 2020 — 17:45 • Тема: ExBB english language pack • Форум: Локализация |
Ответов: 1 Просмотров: 9079
|
Выкладываю подкорректированный пакет английской локализации форума версии ExBB 1.1.3 с переведенными на английский язык модулями, входящими в официальный дистрибутив.
Открыть logos.tpl (InvisionExbb)
Найти:
CODE:<a href="loginout.php">Вход</a>
Заменить на:
CODE:<a href="loginout.php" title="'.$fm->LANG['Login'].'">'.$fm->LANG['Login'].'</a>
Прикрепляю допереведенную английскую локализацию версии ExBB 1.1.3, где допереведены и все вошедшие модификации. Возможно, в шаблонах или еще где-то будет что-то встречаться недопереведенное, напишите - исправлю. Если сам найду, - переработаю. |
sqrt |
Отправлено: 18 марта 2020 — 17:09 • Тема: Общие ошибки и баги сюда • Форум: Решение проблем |
Ответов: 66 Просмотров: 30723
|
Taki пишет:При нажатии на профиль стало писать выше форума (сверху)
CODE:Warning: Illegal string offset 'usertime' in C:\OpenServer\domains\site\profile.php on line 170
profile.php
Найти:
CODE:$postdate = $fm->_DateFormat($user['lastpost']['date'] + $fm->user['timedif'] ['usertime']* 3600);
Заменить на:
CODE:$postdate = $fm->_DateFormat($user['lastpost']['date'] + $fm->user['timedif'] * 3600); |
sqrt |
Отправлено: 17 марта 2020 — 18:03 • Тема: Function create_function() is Deprecated. • Форум: Решение проблем |
Ответов: 21 Просмотров: 10179
|
Speaker пишет:1Bot
А что делать с этими файлами?
modules/threadstop/frontindex.php
modules/mailer/Mailer.Class.php
В них тоже есть create_function()
modules/mailer/Mailer.Class.php
Найти:
CODE:
uasort($list, create_function('$a, $b', 'if ($a[0] == $b[0]) return 0; return $a[0] < $b[0] ? -1 : 1;'));
Заменить на:
CODE:uasort($list, function($a, $b) {if ($a[0] == $b[0]) return 0; return $a[0] < $b[0] ? -1 : 1;});
modules/threadstop/frontindex.php
Найти:
CODE:uasort($array, create_function('$a,$b', $function));
Заменить на:
CODE:uasort($array, function($a,$b) return $function); |
sqrt |
Отправлено: 5 июня 2017 — 18:19 • Тема: ExBB 2.0.0-Pre • Форум: Релизы |
Ответов: 138 Просмотров: 80159
|
WebMaster пишет:Кто-то ещё ждёт дальнейших доработок?
Все с нетерпением ждут окончательного релиза со всеми доработками и совместимостями. |
sqrt |
Отправлено: 5 января 2017 — 14:29 • Тема: Вопросы от новичков • Форум: Обсуждаем |
Ответов: 288 Просмотров: 160563
|
Еще как вариант:
boardinfo.php
CODE:$this->exbb['file_upload'] = TRUE;
$this->exbb['autoup'] = TRUE;
в post.php и postings.php
переделать так:
CODE:$upload = ( $fm->exbb['file_upload'] === true && $allforums[$forum_id]['upload'] !== 0 && ( $fm->user['upload'] === true || $fm->exbb['autoup'] === true)) ? $allforums[$forum_id]['upload'] : 0;
Пока срабатывает, но, может быть, еще кто-нибудь знает, как еще здесь можно извернуться? |
sqrt |
Отправлено: 5 января 2017 — 13:57 • Тема: Вопросы от новичков • Форум: Обсуждаем |
Ответов: 288 Просмотров: 160563
|
В продолжение развития мысли о расширении прав доступа для гостей. Например, чтобы сделать ссылки видимыми для гостей нужно. Извиняюсь, если повтор:
Разрешение скачивать файлы гостям:
CODE:Открыть:
topic.php
Найти:
$attachurl = ( $fm->user['id'] !== 0 ) ? '<a href="printfile.php?action=attach&f=' . $forum_id . '&t=' . $topic_id . '&id=' . $attach_ID . '" target="_blank">' . $attach_name . '</a>' : '' . $fm->LANG['ViewAttachLink'] . '';
Заменить на:
$attachurl = ( $fm->user['id'] !== 0 ) ? '<a href="printfile.php?action=attach&f=' . $forum_id . '&t=' . $topic_id . '&id=' . $attach_ID . '" target="_blank">' . $attach_name . '</a>' : '<a href="printfile.php?action=attach&f=' . $forum_id . '&t=' . $topic_id . '&id=' . $attach_ID . '" target="_blank">' . $attach_name . '</a>';
Если у админа, возникнет также идея о разрешении гостям загружать файлы. Понятно, что можно сделать так:
CODE:Открыть:
post.php
Найти в function newthread(), function addnewthread(), function reply (), function add reply ():
$upload = ( $fm->exbb['file_upload'] === true && $allforums[$forum_id]['upload'] !== 0 && ( $fm->user['upload'] === true || $fm->exbb['autoup'] === true && $fm->user['id'] ) ) ? $allforums[$forum_id]['upload'] : 0;
Заменить на:
$upload = $allforums[$forum_id]['upload'];
Открыть:
postings.php
Найти в function editform(), function processedit():
$upload = ( $fm->exbb['file_upload'] === true && $allforums[$forum_id]['upload'] !== 0 && ( $fm->user['upload'] === true || $fm->exbb['autoup'] === true && $fm->user['id'] ) ) ? $allforums[$forum_id]['upload'] : 0;
Заменить на:
$upload = $allforums[$forum_id]['upload'];
, но это слишком просто и нехорошо, т.к. это даст, вообще, чуть ли не всем и везде права загружать вложения.
Если расшифровать условие:
CODE:$upload = ( $fm->exbb['file_upload'] === true && $allforums[$forum_id]['upload'] !== 0 && ( $fm->user['upload'] === true || $fm->exbb['autoup'] === true && $fm->user['id'] ) ) ? $allforums[$forum_id]['upload'] : 0;
CODE: $fm->exbb['file_upload'] === true - Если на всём форуме разрешено постить
Цитата:Разрешить прикрепление файлов?
CODE:&& $allforums[$forum_id]['upload'] !== 0 - И на конкретном форуме загрузка вложений НЕ отключена
И -
CODE:$fm->user['upload'] === true - это, быстрее всего условие, что в админке включена функция на разрешение аплоада данному юзеру Цитата:Разрешить загрузку файлов? Позволить пользователю прикреплять файлы к сообщению в форумах, в которых это разрешено.
и далее возникает вопрос по коду:
CODE:|| $fm->exbb['autoup'] === true && $fm->user['id'] - это что-то типа ИЛИ - Цитата:Разрешать зарегистрировавшимся прикреплять файлы к сообщениям в форумах, которых это разрешено?
Иначе Администратор сам выбирает пользователей, которым разрешено прикреплять файлы.
И - это конкретный юзер, то ДА на загрузку по данному форуму иначе НЕТ (пусто) (CODE:) ) ? $allforums[$forum_id]['upload'] : 0; .
Вопрос я уже озвучил, - как более правильно переделать условие? |
sqrt |
Отправлено: 29 октября 2016 — 04:07 • Тема: Мод: Ограничение времени редактирования сообщений • Форум: Модификации и дополнения |
Ответов: 44 Просмотров: 35088
|
Ух ты, как тема актуализировалась!
Может, кто сможет предложить вариант модификации файлов postings.php и topic.php так, чтобы можно простому пользователю было хотя бы так же на заданное время редактирования редактировать и удалять опросы в теме, а то пока что-то не выходит.
Так, postings.php
Спойлер (Отобразить)CODE:function poll_edit() {
global $fm;
$allforums = $fm->_Read(FM_ALLFORUMS);
if (( $topic_id = $fm->_Intval('topic') ) === 0 || ( $forum_id = $fm->_Intval('forum') ) === 0 || !isset( $allforums[$forum_id] )) {
$fm->_Message($fm->LANG['MainMsg'], $fm->LANG['CorrectPost']);
}
$fm->_GetModerators($forum_id, $allforums);
if ($fm->_Moderator === false ) {
$fm->_Message($fm->LANG['Poll'], $fm->LANG['EditNo']);
}
$forumname = $allforums[$forum_id]['name'];
$list = $fm->_Read2Write($fp_list, 'forum' . $forum_id . '/list.php');
if (!isset( $list[$topic_id] ) || !file_exists('forum' . $forum_id . '/' . $topic_id . '-poll.php')) {
$fm->_Message($fm->LANG['MainMsg'], $fm->LANG['CorrectPost']);
}
$topicname = ( isset( $list[$topic_id]['tnun'] ) ) ? $list[$topic_id]['name'] . ' - ' . $list[$topic_id]['tnun'] : $list[$topic_id]['name'];
$poll_data = $fm->_Read2Write($fp_poll, 'forum' . $forum_id . '/' . $topic_id . '-poll.php', false);
if ($fm->_Boolean($fm->input, 'savepoll') === true) {
if ($fm->_Boolean($fm->input, 'delpoll') === true) {
if ($fm->_Boolean($fm->input, 'request') === true && $fm->_POST === true) {
$fm->_Fclose($fp_poll);
unlink('forum' . $forum_id . '/' . $topic_id . '-poll.php');
$list[$topic_id]['poll'] = false;
$fm->_Write($fp_list, $list);
// Запишем в лог информацию об удалении опроса
$fm->_WriteLog(sprintf($fm->LANG['DeletePollLog'], $list[$topic_id]['name'], strip_tags($forumname)), 2);
$fm->_Message($fm->LANG['PollDel'], $fm->LANG['PollDeleteOk'], 'topic.php?forum=' . $forum_id . '&topic=' . $topic_id);
}
...
CODE:if ($fm->_Moderator === false && $fm->exbb['edit_time'] && $fm->_Nowtime - $post_id > $fm->exbb['edit_time'] * 60) {
$fm->_Message($fm->LANG['Poll'], $fm->LANG['EditNo']);
}
- не катит. Что-то еще там где-то не дает.
topic.php
Спойлер (Отобразить)CODE:function poll($forum_id, $topic_id) {
global $fm, $topic, $firstkey, $_icon;
$pollfile = 'forum' . $forum_id . '/' . $topic_id . '-poll.php';
if (!file_exists($pollfile)) {
return '';
}
$poll_data = $fm->_Read($pollfile, false);
if (!$poll_data['pollname']) {
$poll_data['pollname'] = $topic['name'];
}
$poll_title = $poll_data['pollname'];
$moderlinks = $pollch = $do = '';
if (isset( $poll_data['ids'][$fm->user['id']] ) || $topic['state'] == 'closed') {
foreach ($poll_data['choices'] as $choice) {
$pid = $choice[0];
$ptext = $choice[1];
$votes = $choice[2];
if (!$ptext) {
continue;
}
$percent = ( $votes == 0 ) ? 0 : $votes / $poll_data['votes'] * 100;
$percent = sprintf('%.2f', $percent) . '%';
$width = ( $percent > 0 ) ? (int)$percent * 2 : 0;
include( './templates/' . DEF_SKIN . '/poll_data.tpl' );
}
$do = '<b>' . $fm->LANG['VoteCount'] . $poll_data['votes'] . '</b>';
}
else {
foreach ($poll_data['choices'] as $choice) {
$pid = $choice[0];
$ptext = $choice[1];
if (!$ptext) {
continue;
}
include( './templates/' . DEF_SKIN . '/poll_view.tpl' );
}
$do = '<input type="submit" name="submit" value="' . $fm->LANG['Vote'] . '" class="button" />';
}
$edit = '<a href="postings.php?action=poll&forum=' . $forum_id . '&topic=' . $topic_id . '">' . $_icon['edit'] . '</a>' . $_icon['divider'];
$del = '<a href="postings.php?action=poll&delpoll=yes&savepoll=yes&forum=' . $forum_id . '&topic=' . $topic_id . '">' . $_icon['del'] . '</a>';
$moderlinks = ( $fm->_Moderator === true) ? $edit . ' ' . $del : null;
include( './templates/' . DEF_SKIN . '/poll.tpl' );
unset( $poll_data, $pollch );
return $poll_html;
}
Так, например, вот такая история
CODE:
$moderlinks = ( $fm->_Moderator === true || ( $fm->user['id'] === $member_id && $fm->user['id'] && $topic['state'] != 'closed' )) ? $edit . ' ' . $del : null;
не работает, - кнопки у простого пользователя все равно не появляются...
Примечание по вышеуказанному коду для topic.php: Сделал так, чтобы гости видели опрос и результаты голосования, но голосовать по-прежнему права не имеют (иначе там чехарда просто получится). |
|
Страниц (3): [1] 2 3 »
|