Перейти к контенту

dimitry

Пользователи
  • Число публикаций

    207
  • Регистрация

  • Последнее посещение

  • Дней в топе

    1

dimitry последний раз побеждал 10 Августа 2018

dimitry - автор самых популярных публикаций!

Недавние посетители профиля

11 157 просмотров профиля

Достижения dimitry

  1. Внимание! Данный мод НЕ работает в современных браузерах. Их обработчики яваскриптов неправильно обрабатывают имеющуюся в коде мода устаревшую версию. На Opera 12.17 все работает даже при Apache 2.4 php 5.6 и mysql 5.7. Проблема, быстрее всего, в файле skin_topic.php. Переделывать нужно, в первую очередь, функцию модерирования: function Mod_Panel($data, $fid, $tid, $key="") { global $ibforums; return <<<EOF <div align='right' style='float:right;width:auto'> <form method='POST' style='display:inline' name='modform' action='{$ibforums->base_url}'> <input type='hidden' name='t' value='$tid' /> <input type='hidden' name='f' value='$fid' /> <input type='hidden' name='st' value='{$ibforums->input['st']}' /> <input type='hidden' name='auth_key' value='$key' /> <input type='hidden' name='act' value='Mod' /> <select name='CODE' class='forminput' style="font-weight:bold;color:red" onchange= "var w2m; if (document.getElementById){w2m=document.getElementById('w2m'); } else if (document.all){w2m=document.all['w2m']; } else if (document.layers){w2m=document.layers['w2m']; } if (this.value=='67') {w2m.style.display='';} else {w2m.style.display='none';}"> <option value='-1' style='color:black'>{$ibforums->lang['moderation_ops']}</option> $data </select> <input type='submit' value='{$ibforums->lang['jmp_go']}' class='forminput' onClick='collect_pidz();' /> <script type="text/javascript"> <!-- function collect_pidz() { for (var i in document.collect.elements){ if (i.indexOf('pozt')!=-1){ var ne=document.createElement("input"); ne.name=document.collect[i].name; ne.type='text'; ne.style.display='none'; if (document.collect[i].checked.toString()=='true') ne.value=1; else ne.value=0; document.modform.appendChild(ne); }}} //--> </script> <div style='display:none;' id='w2m'><input type='text' class='textinput' style='width:250px;' name='where2move' value="{$ibforums->lang['where2move']}" onclick="this.select();"/></div></form> </div> EOF; }
  2. Теперь по поводу совместимости установочного скрипта форума IPB 1.3.1 sm_install.php 1) Безусловно: Найти везде: TYPE=MyISAM Заменить везде на: ENGINE=MyISAM 2) Ошибка specified key was too long; max key length is 1000 bytes mysql Решение пока такое: Найти везде: varchar(255) Заменить везде на: varchar(128) sm_install.php
  3. Может, уже мало кому это нужно, но, если требуется отображение на портале IP Dynamiclite только новостей (статей) и не нужно отображать прочие панели (логин, последние обсуждения, поиск и прочее) и при этом хочется, чтобы новости выводились на всю ширину экрана, а не с перекосом вправо, то: 1) Новости доступны по адресу index.php?act=home2) Открыть skin_csite.phpНайти и удалить: <td width="200" class='row3' valign="top"> <!-- LEFT --> <!--CS.TEMPLATE.WELCOMEBOX--> <!--CS.TEMPLATE.SEARCH--> <!--CS.TEMPLATE.SITENAV--> <!--CS.TEMPLATE.CHANGESKIN--> <!--CS.TEMPLATE.ONLINEUSERS--> <!--CS.TEMPLATE.POLL--> <!--CS.TEMPLATE.LATESTPOSTS--> <!--CS.TEMPLATE.RECENTARTICLES--> <!--CS.TEMPLATE.AFFILIATES--> <!--END LEFT--> <br /><img src='{$ibforums->vars['img_url']}/spacer.gif' alt='' width='200' height='1' /> </td> <!--SPACER-->Найти: <td width="5" class='row3'> </td> <td width="90%" class='row3' valign="top"> <!--MAIN--> <!--CS.TEMPLATE.ARTICLES--> <!--END MAIN--> </td> </tr>Заменить на: <td width="100%" class='row3' valign="top"> <!--MAIN--> <!--CS.TEMPLATE.ARTICLES--> <!--END MAIN--> </td>
  4. Многие уже давно подстроили ipb 1.3.1 под MySQL 5.x, однако с выходом MySQL 5.7 возникают ошибки БД: 1) Ошибка mysql sql_mode=only_full_group_byна индексной странице получил подарок: mySQL query error: SELECT g.*, m.* FROM ibf_members m LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup) WHERE m.last_activity >= '1471640400' AND m.mgroup <> '2' GROUP BY m.name ORDER BY m.last_activity DESC mySQL error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ddd.g.g_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by mySQL error code: На showtopic получил: mySQL query error: SELECT p.*, m.id,m.name,m.mgroup,m.email,m.joined,m.avatar,m.avatar_size,m.posts,m.aim_name,m.icq_number, m.signature, m.website,m.yahoo,m.integ_msg,m.title,m.hide_email,m.msnname, m.warn_level, m.warn_lastwarn, g.g_id, g.g_title, g.g_icon, g.g_dohtml, s.login_type, s.running_time, g.g_hide_from_list, g.g_can_view_on_off FROM ibf_posts p LEFT JOIN ibf_members m ON (p.author_id=m.id) LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup) LEFT JOIN ibf_sessions s ON (s.member_id=p.author_id AND s.member_id<>0 AND s.member_id IS NOT NULL) LEFT JOIN ibf_pfields_content pc ON (pc.member_id=p.author_id) WHERE p.topic_id=473 and p.queued != 1 GROUP BY pid ORDER BY p.post_date asc LIMIT 0, 30 mySQL error: Expression #48 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ddd.s.login_type' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by или: mySQL query error: SELECT p.*, m.id,m.name,m.mgroup,m.email,m.joined,m.avatar,m.avatar_size,m.posts,m.aim_name,m.icq_number, m.signature, m.website,m.yahoo,m.integ_msg,m.title,m.hide_email,m.msnname, m.warn_level, m.warn_lastwarn, g.g_id, g.g_title, g.g_icon, g.g_dohtml, s.login_type, s.running_time, g.g_hide_from_list, g.g_can_view_on_off FROM ibf_posts p LEFT JOIN ibf_members m ON (p.author_id=m.id) LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup) LEFT JOIN ibf_sessions s ON (s.member_id=p.author_id AND s.member_id<>0 AND s.member_id IS NOT NULL) LEFT JOIN ibf_pfields_content pc ON (pc.member_id=p.author_id) WHERE p.topic_id=527 and p.queued != 1 GROUP BY pid ORDER BY p.post_date asc LIMIT -30, 30 mySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-30, 30' at line 11 mySQL error code: Date: Tuesday 24th 2020f March 2020 02:11:04 AMна showforum получил ошибку неявной записи: mySQL query error: UPDATE ibf_sessions SET member_name='',member_id='0',member_group='2',login_type='0', running_time='1471718686', in_forum='332', in_topic='', location='SF,,' WHERE id='a85128f6bfeb1d83f6d48b296562257d' mySQL error: Incorrect integer value: '' for column 'in_topic' at row 1 mySQL error code: Постинговые, вроде, открываются. Например, вот такое: index.php?act=Post&CODE=06&f=332&t=473&p=714 При этом предпросмотр работает, а при отправке данных - ошибка БД абсолютно без информации в окне. admin.php и индексная там - открываются. При этом страницы многих пунктов меню открываются, а, например, Настройка языков выдает ошибку: mySQL query error: select ibf_languages.*, count(ibf_members.id) as mcount from ibf_languages left join ibf_members on(ibf_members.language=ibf_languages.ldir) where (ibf_members.language is not null or ibf_members.language = 'en') group by ibf_languages.ldir order by ibf_languages.lname mySQL error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ddd.ibf_languages.lid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by В MySQL 5.6 все работает. Как видно, в 5.7 надо решать вопросы нововведений, из-за которых идут ошибки https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html Решение: Периодические запросы в БД: SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))Решение для сервера: mysql_my.ini Прописать под директивой [mysqld] режим sql, не включающий режима only full group by: sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" или, в крайнем случае, что не есть здорово: sql-mode="" Если без сервера, то пока так (верно или нет - не знаю): Topics.php Найти: 1 или 2 раза: GROUP BY pid ORDER BY p.{$ibforums->vars['post_order_column']} {$ibforums->vars['post_order_sort']} LIMIT $first, ".$ibforums->vars['display_max_posts']);внутри заменить LIMIT $first на LIMIT 0
  5. Unfortunately, I stopped, no longer doing it, because progress is taking leaps and bounds and everything is becoming obsolete. // К сожалению, остановился, больше не занимаюсь, ибо прогресс идет семимильными шагами и всё устаревает.
  6. Откорректировал ошибки preg_replace, связанные с e Прикладываю откорректированные файлы, сами смотрите и сравнивайте. Откорректированные файлы.zip В частности, примеры по отдельным файлам и сложные конструкции: 1) emailer.php: //$this->message = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->message ); $this->message = preg_replace_callback( "/<#(.+?)#>/", function ($match) use ($words) { return $words[$match[1]]; }, $this->message); 2) post_parser.php: //$txt = preg_replace( "#\[img\](.+?)\[/img\]#ie" , "\$this->regex_check_image('\\1')", $txt ); $txt = preg_replace_callback( "#\[img\](.+?)\[/img\]#i" , function ($match) { return $this-regex_check_image($match[1]); } , $txt); //$txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt ); $txt = preg_replace_callback( "#\[url\](\S+?)\[/url\]#i" , function ($match) { return $this-regex_build_url(array('html' => $match[1], 'show' => $match[1])); } , $txt); //$txt = preg_replace( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt ); $txt = preg_replace_callback( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#i" , function ($match) { return $this-regex_build_url(array('html' => $match[1], 'show' => $match[2])); } , $txt); //$txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt ); $txt = preg_replace_callback( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#i" ,function ($match) { return $this-regex_build_url(array('html' => $match[1], 'show' => $match[2])); } , $txt); //$txt = preg_replace( "#\[spoiler\]#ie" , "\$this->regex_simple_spoiler_tag()" , $txt ); $txt = preg_replace_callback( "#\[spoiler\]#i" , function () { return $this->regex_simple_spoiler_tag(); } , $txt); //$txt = preg_replace( "#\[/spoiler\]#ie" , "\$this->regex_close_spoiler()" , $txt ); $txt = preg_replace_callback( "#\[/spoiler\]#i" , function () { return $this->regex_close_spoiler(); } , $txt); //$txt = preg_replace( "#(<!--SpoilerEBegin-->.+?<!--SpoilerEnd-->)#es", "\$this->regex_preserve_spacing('\\1')", trim($txt) ); $txt = preg_replace_callback( "#(<!--SpoilerEBegin-->.+?<!--SpoilerEnd-->)#s", function ($match) { return $this->regex_preserve_spacing($match[1]); } , trim($txt)); return $txt; 3) Profile.php: Посложнее: //--------------------------------------------------- // Is this our profile? //--------------------------------------------------- if ($member['id'] == $this->member['id']) { //$this->output = preg_replace( "/<!--MEM OPTIONS-->/", "'.\$this->html->user_edit(\$info).'", $this->output ); $this->output = preg_replace_callback( "/<!--MEM OPTIONS-->/", function () use ($info) { return $this->html->user_edit($info); }, $this->output); } 4) Post.php: Если есть склейка сообщений: //$row['post'] = preg_replace( "#\[mergetime\](\d+)\[/mergetime\]#ies", "\$std->get_date( '\\1', 'MERGE' )", $row['post'] ); $row['post'] = preg_replace_callback( "#\[mergetime\](\d+)\[/mergetime\]#is", function ($match) { return $std->get_date($match[1], 'MERGE' ); }, $row['post']); 5) post_poll.php и post_poll_after.php: $this->poll_choices = preg_replace( "/<br><br>/" , "" , $this->poll_choices ); //$this->poll_choices = preg_replace( "/<br>/e" , "\$this->regex_count_choices()" , $this->poll_choices ); $this->poll_choices = preg_replace_callback( "/<br>/" , function () { return $this->regex_count_choices(); } ,$this->poll_choices); 6) print_page.php //$message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#" , "(FLASH MOVIE)" , $message ); $message = preg_replace_callback( "#<!--Flash (.+?)-->.+?<!--End Flash-->#" , function () { return '(FLASH MOVIE)'; }, $message);7) Search.php //$ibforums->input['end_day'] = preg_replace( "/e/", "", $ibforums->input['end_day']); $ibforums->input['end_day'] = preg_replace( "//", function () { return ; } ,$ibforums->input['end_day']);
  7. Да, если вставить код в начало // Включение протоколирования ошибок error_reporting(1); // Включать в отчет простые описания ошибок error_reporting(E_ERROR | E_WARNING | E_PARSE); // Включать в отчет E_NOTICE сообщения (добавятся сообщения о //непроинициализированных переменных или ошибках в именах переменных) error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // Добавлять в отчет все PHP ошибки (см. список изменений) error_reporting(E_ALL); // Добавлять в отчет все PHP ошибки error_reporting(-1); // То же, что и error_reporting(E_ALL); ini_set('error_reporting', E_ALL); error_reporting( E_ALL ); ini_set( 'display_errors', 1 ); в, например, выдающий белую страницу в PHP 7, файл Reputation.php и просмотреть даже под PHP 5.6, то выдаст: Notice: Undefined index: leave_out in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 936 Notice: Use of undefined constant NAV - assumed 'NAV' in C:\OpenServer\domains\ddd.ru\forums\sources\Reputation.php on line 148 Notice: Undefined index: ipscheck in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 2266 Notice: Undefined index: ipb_reg_number in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 2407 Notice: Undefined index: ips_cp_purchase in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 2429 Notice: Use of undefined constant img_url - assumed 'img_url' in C:\OpenServer\domains\ddd.ru\forums\Skin\s1\skin_global.php on line 283 Notice: Use of undefined constant ls_download - assumed 'ls_download' in C:\OpenServer\domains\ddd.ru\forums\Skin\s1\skin_global.php on line 283 Notice: Undefined index: shop_cart in C:\OpenServer\domains\ddd.ru\forums\Skin\s1\skin_global.php on line 398 Notice: Use of undefined constant TEXT - assumed 'TEXT' in C:\OpenServer\domains\ddd.ru\forums\Skin\s1\skin_global.php on line 413 Notice: Undefined index: chat_account_no in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 2548 Notice: Undefined index: top_site_list_integrate in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 2564 Если вставить в Forums.php, то там ошибок, вообще, тьма. Если не вставлять текст, то ошибки не отображаются и все работает. А что вы посоветуете с deprecated глобальными переменными?
  8. 12) У кого установлен мод Репутации, то любое обращение к странице репутации: так: index.php?act=rep&CODE=totals или, например, так: index.php?act=rep&CODE=01&mid=3&t=p приводит к белой странице (на PHP 5.6.3 - все нормально) Единственное, что было ненормально у меня на 5.6.3 так это то, что не обновилось количество баллов репутации по участнику (их уже давно 0, а пишет 1) и при просмотре репутации отдано index.php?act=rep&CODE=04&mid=1 получаю аж фатальную ошибку: Fatal error: Call to a member function ShowNone() on null in C:\OpenServer\domains\ddd.ru\forums\sources\Reputation.php on line 842 вот этот кусок кода файла Reputation.php: $DB->query("SELECT r.*, m.name, t.title FROM ibf_reputation r LEFT JOIN ibf_members m ON (m.id=r.member_id) LEFT JOIN ibf_topics t ON (r.topic_id=t.tid) WHERE r.from_id='".$memid. "'". $pfix. "ORDER BY r.msg_date DESC LIMIT ".$ibforums->input['st'].", ".$ibforums->vars['rep_per_page']); [size=4][color=#ff0000]842 строка [/color][/size]if (! $DB->get_num_rows() ) $output .= $rep_html->ShowNone(); while ( $i = $DB->fetch_row() ) { switch ($i['CODE']) { case '01': $i['img'] = $ibforums->vars['img_url']."/r_up.gif"; break; case '02': $i['img'] = $ibforums->vars['img_url']."/r_down.gif"; break; } $i['date'] = $std->get_date($i['msg_date'], 'LONG'); Если кто знает, как это все исправить, то помогите это сделать: вот весь файл Reputation.php из \sources\, требующий правки: Reputation.php 13) Капча GD, которая работала, как, скажем, арифметический пример сложения 2-х двузначных чисел с вводом суммы в окне, - не работает, отображается только в PHP 5.6.3 работает нормально. Более того в \sources\libcaptcha.php есть участок в самом конце, приводящий к ошибке вывода заголовков (headers already sent): if(function_exists("imagejpeg")) { header("Content-Type: image/jpeg"); imagejpeg($img2, null, $jpeg_quality); } else if(function_exists("imagegif")) { header("Content-Type: image/gif"); imagegif($img2); } else if(function_exists("imagepng")) { header("Content-Type: image/x-png"); imagepng($img2); } пока сделал так, но, возможно это некорректно, поэтому, кто знает правильнее, - подправьте: if(function_exists("imagejpeg")) { imagejpeg($img2, null, $jpeg_quality); } else if(function_exists("imagegif")) { imagegif($img2); } else if(function_exists("imagepng")) { imagepng($img2); } Опять же, если кто знает, как правильно подправить captcha.php или участок в Register.php, отзовитесь. captcha.php Register.php 14) Далее: Достаточно тяжелая и неприятная вещь: в IPB в некоторых файлах, связанных с отправкой сообщений есть такая вещь как preg_replace(). Так вот, если в параметрах этой функции содержится символ e, особенно идущий как, например: $message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e" , "(FLASH MOVIE)" , $message );или eisили \e, то и тут эти наши уважаемые разработчики-оптимизаторы PHP нам ТАК нагадили. Теперь это приводит к ворнингам типа: Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in теперь подобные конструкции надо аккуратно переделывать, используя теперь preg_replace_callback(), не запутываясь в символах и кавычках. Особенно, если была установлена панель BB-кодов того самого IgorekM Прошу Вашей помощи по переделке выражений! Что нужно переделывать: а) emailer.php $this->message = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->message ); $message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e" , "(FLASH MOVIE)" , $message ); б) Profile.php //--------------------------------------------------- // Is this our profile? //--------------------------------------------------- if ($member['id'] == $this->member['id']) { $this->output = preg_replace( "/<!--MEM OPTIONS-->/e", "\$this->html->user_edit(\$info)", $this->output ); } в) post_parser.php - вообще, тьма: в разных функциях $txt = preg_replace( "#\[img\](.+?)\[/img\]#ie" , "\$this->regex_check_image('\\1')", $txt ); $txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt ); $txt = preg_replace( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt ); $txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt ); $txt = preg_replace( "#(\?|&|;|&)s=([0-9a-zA-Z]){32}(&|;|&|$)?#e", "\$this->regex_bash_session('\\1', '\\3')", $txt ); $txt = preg_replace( "/<br>|<br \/>/", "\n", $txt ); $txt = preg_replace( "#\[mod\](.+?)\[/mod\]#ies", "\$this->regex_exclaim_tags(1, '\\1', ".$ibforums->vars['post_mod_html'].")", $txt ); $txt = preg_replace( "#\[ex\](.+?)\[/ex\]#ies", "\$this->regex_exclaim_tags(2, '\\1', ".$ibforums->vars['post_ex_html'].")", $txt ); $txt = preg_replace($_exclaim_pattern, "", $txt); $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt ); $txt = preg_replace( "#\[hide\](.+?)\[/hide\]#ies", "\$this->regex_hide_tag('\\1')", $txt ); $txt = preg_replace( "#(^|\s)((http|https|news|ftp)://\w+[^\s\[\]]+)#ie" , "\$this->regex_build_url(array('html' => '\\2', 'show' => '\\2', 'st' => '\\1'))", $txt ); $txt = preg_replace( "#(\[quote(.+?)?\].*\[/quote\])#ies" , "\$this->regex_parse_quotes('\\1')" , $txt ); $txt = preg_replace( "#(\[w].*\[/w\])#ies" , "\$this->regex_parse_w('\\1')" , $txt ); $txt = preg_replace( "#(\[w].*\[/w\])#ies" , "\$this->regex_parse_w('\\1')" , $txt ); $txt = preg_replace( "#(\[w].*\[/w\])#ies" , "\$this->regex_parse_w('\\1')" , $txt ); $txt = preg_replace( "#(\[spoiler].*\[/spoiler\])#ies" , "\$this->regex_parse_spoiler('\\1')" , $txt ); $txt = preg_replace( "#\[sql\](.+?)\[/sql\]#ies" , "\$this->regex_sql_tag('\\1')" , $txt ); $txt = preg_replace( "#\[html\](.+?)\[/html\]#ies" , "\$this->regex_html_tag('\\1')" , $txt ); $txt = preg_replace( "#\n?\[list\](.+?)\[/list\]\n?#ies", "\$this->regex_list('\\1')" , $txt ); $txt = preg_replace( "#\n?\[list=(a|A|i|I|1)\](.+?)\[/list\]\n?#ies", "\$this->regex_list('\\2','\\1')" , $txt ); $txt = preg_replace( "#\[img\](.+?)\[/img\]#ie" , "\$this->regex_check_image('\\1')" , $txt ); $txt = preg_replace( "#(\[flash=)(\S+?)(\,)(\S+?)(\])(\S+?)(\[\/flash\])#ie", "\$this->regex_check_flash('\\2','\\4','\\6')", $txt ); $txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt ); $txt = preg_replace( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt ); $txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt ); $txt = preg_replace( "#\[size=([0-9]+)\](.+?)\[/size\]#ies" , "\$this->regex_font_attr(array('s'=>'size','1'=>'\\1','2'=>'\\2'))", $txt ); $txt = preg_replace( "#\[font=([a-zA-Z]+)\](.*?)\[/font\]#ies" , "\$this->regex_font_attr(array('s'=>'font','1'=>'\\1','2'=>'\\2'))", $txt ); $txt = preg_replace( "#\[color=([a-zA-Z]+)\](.+?)\[/color\]#ies" , "\$this->regex_font_attr(array('s'=>'col' ,'1'=>'\\1','2'=>'\\2'))", $txt ); $txt = preg_replace( "#\[private=([^\]]+)\](.+?)\[/private\]#ies", "\$this->regex_private(array('name'=>'\\1','line'=>'\\2'))", $txt ); $txt = preg_replace( "#\[mod\](.+?)\[/mod\]#ies", "\$this->regex_mod_tag('\\1')", $txt ); $txt = preg_replace( "#\[ex\](.+?)\[/ex\]#ies", "\$this->regex_exclaime_tag('\\1')", $txt ); $txt = preg_replace( "!(?<=[^\w&;/])$code(?=.\W|\W.|\W$)!ei", "\$this->convert_emoticon('$code', '$image')", $txt ); $txt = preg_replace( "#\[checklink\](\S+?)\[/checklink\]#ie", "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\1', 'checklink' => true))", $txt ); [/code] [code=auto:0]function post_db_parse($t="", $use_html=0) { global $ibforums, $DB; if ( $use_html ) { $t = preg_replace( "#\[dohtml\](.+?)\[/dohtml\]#ies", "\$this->parse_html('\\1')", $t ); } else { $t = preg_replace( "#(\[dohtml\])(.+?)(\[/dohtml\])#ies", "\$this->my_strip_tags('\\2')", $t ); } return $t; } [/code] [code=auto:0]$txt = preg_replace( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#eis" , "\$this->unconvert_sql(\"\\2\")", $txt); $txt = preg_replace( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#e", "\$this->unconvert_htm(\"\\2\")", $txt); $txt = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e" , "\$this->unconvert_flash('\\1')", $txt ); [/code] [code=auto:0]$txt = preg_replace( "#<!--me&(.+?)-->(.+?)<!--e--me-->#e" , "\$this->unconvert_me('\\1', '\\2')", $txt ); $txt = preg_replace( "#<span style=['\"]font-size:(.+?)pt;line-height:100%['\"]>(.+?)</span>#se" , "\$this->unconvert_size('\\1', '\\2')", $txt );[/code][/code] Да и, откровенно говоря, [code=auto:0] $txt = preg_replace( "#\[video\](\S+?)\[/video\]#ies", "\$this->regex_build_src('\\1', 'video')", $txt ); $txt = preg_replace( "#\[sound\](\S+?)\[/sound\]#ies", "\$this->regex_build_src('\\1', 'sound')", $txt ); [/code] [/code] с выводом тегов [sound] и [video] тоже не работает (еще в PHP 5.6.3 отметил) далее, парсинг цитат: [code=auto:0] $this->quote_html = $this->wrap_style( array( 'STYLE' => 'QUOTE' ) ); $txt = preg_replace( "#\[quote\]#ie" , "\$this->regex_simple_quote_tag()" , $txt ); $txt = preg_replace( "#\[quote=([^\]]+?),([^\]]+?)\]#ie" , "\$this->regex_quote_tag('\\1', '\\2')" , $txt ); $txt = preg_replace( "#\[quote=([^\]]+?)\]#ie" , "\$this->regex_quote_tag('\\1', '')" , $txt ); $txt = preg_replace( "#\[/quote\]#ie" , "\$this->regex_close_quote()" , $txt ); //-- mod_bbcode begin $txt = str_replace( "\n", "<br />", $txt ); //-- mod_bbcode end $txt = preg_replace( "/\n/", "<br>", $txt ); if ( ($this->quote_open == $this->quote_closed) and ($this->quote_error == 0) ) { $txt = preg_replace( "#(<!--QuoteEBegin-->.+?<!--QuoteEnd-->)#es", "\$this->regex_preserve_spacing('\\1')", trim($txt) ); return $txt; } else { return $the_txt; } [/code] тег [w]: [code=auto:0] function regex_parse_w($the_txt="") { if ($the_txt == "") return; $txt = $the_txt; $this->w_html = $this->wrap_style( array( 'STYLE' => 'w' ) ); $txt = preg_replace( "#\[w\]#ie" , "\$this->regex_simple_w_tag()" , $txt ); $txt = preg_replace( "#\[/w\]#ie" , "\$this->regex_close_w()" , $txt ); $txt = preg_replace( "/\n/", "<br>", $txt ); if ( ($this->w_open == $this->w_closed) ) { // Preserve spacing $txt = preg_replace( "#(<!--wEBegin-->.+?<!--wEnd-->)#es", "\$this->regex_preserve_spacing('\\1')", trim($txt) ); return $txt; } else { return $the_txt; } } [/code] спойлер: [code=auto:0] [/code] [code=auto:0]function regex_parse_spoiler($the_txt="") { if ($the_txt == "") return; $txt = $the_txt; $this->spoiler_html = $this->wrap_style( array( 'STYLE' => 'SPOILER' ) ); $txt = preg_replace( "#\[spoiler\]#ie" , "\$this->regex_simple_spoiler_tag()" , $txt ); $txt = preg_replace( "#\[/spoiler\]#ie" , "\$this->regex_close_spoiler()" , $txt ); $txt = preg_replace( "/\n/", "<br>", $txt ); if ( ($this->spoiler_open == $this->spoiler_closed) ) { // Preserve spacing $txt = preg_replace( "#(<!--SpoilerEBegin-->.+?<!--SpoilerEnd-->)#es", "\$this->regex_preserve_spacing('\\1')", trim($txt) ); return $txt; } else { return $the_txt; } } [/code] г) Post.php если уставнолен мод склейки сообщений: [code=auto:0]$row['post'] = preg_replace( "#\[mergetime\](\d+)\[/mergetime\]#ies", "\$std->get_date( '\\1', 'MERGE' )", $row['post'] ); [/code] д) ad_forums.php: [code=auto:0] $cat = preg_replace( "/^c_(\d+).*$/e", "\\1", $IN['MOVE_ID'] ); [/code] е) у кого установлен мод магазина Lightshop: файл: \sources\Admin\ad_lightshop.php [code=auto:0]$this->text->mail[$IN['status']] = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->mail[$IN['status']] ); $this->text->subj[$IN['status']] = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->subj[$IN['status']] ); $mailm = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->mail[$IN['status'].'_author'] ); $subjm = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->subj[$IN['status'].'_author'] ); $this->text->mail[$IN['status']] = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->mail[$IN['status']] ); $this->text->subj[$IN['status']] = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->subj[$IN['status']] ); $mailm = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->mail[$IN['status'].'_author'] ); $subjm = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->subj[$IN['status'].'_author'] ); [/code] ё) у кого установлен мод магазина Lightshop: файл: \sources\Lightshop.php в разных функциях: [code=auto:0] $this->text->mail['confirm'] = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->mail['confirm'] ); Line 3297: $this->text->subj['confirm'] = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->subj['confirm'] ); Line 3299: $this->text->mail['confirm_manag'] = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->mail['confirm_manag'] ); Line 3344: $mailm = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->mail['confirm_author'] ); Line 3346: $subjm = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->subj['confirm_author'] );s->text->mail['confirm_author'] ); [/code] ж) post_poll.php [code=auto:0] $this->poll_choices = preg_replace( "/<br>/e" , "\$this->regex_count_choices()" , $this->poll_choices ); [/code][/code] з) post_poll_after.php [code=auto:0]$this->poll_choices = preg_replace( "/<br>/e" , "\$this->regex_count_choices()" , $this->poll_choices ); [/code] и) print_page.php [code=auto:0]$message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e" , "(FLASH MOVIE)" , $message ); //$message = preg_replace( "#<img src=[\"'](\S+?)['\"].+"."?".">#" , "(IMAGE: \\1)" , $message ); $message = preg_replace( "#<a href=[\"'](http|https|ftp|news)://(\S+?)['\"].+?".">(.+?)</a>#" , "\\1://\\2" , $message ); //$message = preg_replace( "#<a href=[\"']mailto:(.+?)['\"]>(.+?)</a>#" , "(EMAIL: \\2)" , $message ); //$message = preg_replace( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#e" , "\n\n--------------- SQL -----------\n\\2\n----------------\n\n", $message); //$message = preg_replace( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#e", "\n\n-------------- HTML -----------\n\\2\n----------------\n\n", $message); [/code] й) Если установлен мод BB-кодов: \sources\mods\bbcode\CodeChange.php [code=auto:0]Line 237: $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt ); Line 249: $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt ); [/code] [/code] \sources\mods\bbcode\mod_bbcode_func.php [code=auto:0]$txt = preg_replace("`<base64_encode\((.*?)\)>`ies", "\$this->base64_encode('\\1')", $txt);[/code] к) если установлено немецкое, указанное выше, обновление безопасности: \sources\mods\sec_update_131_A\CodeChange.php [code=auto:0] Line 1471: $ibforums->input['username'] = preg_replace("/([0-9]+);/ie", "\$this->convert_html_char('\\1')", $ibforums->input['username'] ); Line 1483: $ibforums->input['UserName'] = preg_replace("/([0-9]+);/ie", "\$this->convert_html_char('\\1')", $ibforums->input['UserName'] ); [/code] \sources\mods\sec_update_131_B\CodeChange.php [code=auto:0] Line 378: $cat = preg_replace( "/^c_(\d+).*$/e", "\\1", $IN['MOVE_ID'] ); Line 379: $parent = preg_replace( "/^c.*_/e", "", $IN['MOVE_ID'] ); [/code] л) Register.php [code=auto:0] Line 180: $ibforums->input['username'] = preg_replace("/([0-9]+);/ie", "\$this->convert_html_char('\\1')", $ibforums->input['username'] ); Line 743: $ibforums->input['UserName'] = preg_replace("/([0-9]+);/ie", "\$this->convert_html_char('\\1')", $ibforums->input['UserName'] ); [/code] м) Reputation.php Если установлен мод репутации [code=auto:0] [code=auto:0]Line 721: $i['comment'] = preg_replace('/#DAT_(.+?)_#EDAT/e', "\$std->get_date('\\1', 'LONG')", $i['comment']); [/code] н) Search.php [code=auto:0] $ibforums->input['end_day'] = preg_replace( "/e/", "", $ibforums->input['end_day']); [/code] о) xChat.php (если установлен чат) в \sources\xChat.php [code=auto:0]$txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie" , "\$this->parser->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt ); $txt = preg_replace( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#ie" , "\$this->parser->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt ); $txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie" , "\$this->parser->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt ); $txt = preg_replace( "#\[size=([^\]]+)\](.+?)\[/size\]#ies" , "\$this->parser->regex_font_attr(array('s'=>'size','1'=>'\\1','2'=>'\\2'))", $txt ); $txt = preg_replace( "#\[font=([^\]]+)\](.*?)\[/font\]#ies" , "\$this->parser->regex_font_attr(array('s'=>'font','1'=>'\\1','2'=>'\\2'))", $txt ); $txt = preg_replace( "#\[color=([^\]]+)\](.+?)\[/color\]#ies" , "\$this->parser->regex_font_attr(array('s'=>'col' ,'1'=>'\\1','2'=>'\\2'))", $txt );[/code] п) xShoutbox.php (если установлен чат) в \sources\\xShoutbox_functions.php переделать везде, где есть это [code=auto:0][b]e[/b][/code] [code=auto:0] $txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt ); $txt = preg_replace( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt ); $txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt ); $txt = preg_replace( "!(?<=[^\w&;/])$code(?=.\W|\W.|\W$)!ei", "\$this->convert_emoticon('$code', '$image')", $txt ); //$txt = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1" , $txt ); $txt = preg_replace( "#\[size=([^\]]+)\](.+?)\[/size\]#ies" , "\$this->regex_font_attr(array('s'=>'size','1'=>'\\1','2'=>'\\2'))", $txt ); $txt = preg_replace( "#\[font=([^\]]+)\](.*?)\[/font\]#ies" , "\$this->regex_font_attr(array('s'=>'font','1'=>'\\1','2'=>'\\2'))", $txt ); $txt = preg_replace( "#\[color=([^\]]+)\](.+?)\[/color\]#ies" , "\$this->regex_font_attr(array('s'=>'col' ,'1'=>'\\1','2'=>'\\2'))", $txt ); $url['html'] = preg_replace( "/([\.,\?]|!)$/", "", $url['html'] ); $url['show'] = preg_replace( "/([\.,\?]|!)$/", "", $url['show'] ); $url['html'] = preg_replace( "/&/" , "&" , $url['html'] ); $url['html'] = preg_replace( "/javascript:/i", "java script: ", $url['html'] ); $url['show'] = preg_replace( "/&/" , "&" , $url['show'] ); $url['show'] = preg_replace( "/javascript:/i", "javascript: ", $url['show'] ); $stripped = preg_replace( "#^(http|ftp|https|news)://(\S+)$#i", "\\2", $url['show'] ); $uri_type = preg_replace( "#^(http|ftp|https|news)://(\S+)$#i", "\\1", $url['show'] ); $IN['1'] = preg_replace( "/[&\(\)\.\%]/", "", $IN['1'] ); $txt = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1" , $txt ); $txt = preg_replace( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#eis" , "\$this->unconvert_sql(\"\\2\")", $txt); $txt = preg_replace( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#e", "\$this->unconvert_htm(\"\\2\")", $txt); $txt = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e" , "\$this->unconvert_flash('\\1')", $txt ); $txt = preg_replace( "#<img src=[\"'](\S+?)['\"].+?".">#" , "\[IMG\]\\1\[/IMG\]" , $txt ); $txt = preg_replace( "#<a href=[\"']mailto:(.+?)['\"]>(.+?)</a>#" , "\[EMAIL=\\1\]\\2\[/EMAIL\]" , $txt ); $txt = preg_replace( "#<a href=[\"'](http://|https://|ftp://|news://)?(\S+?)['\"].+?".">(.+?)</a>#" , "\[URL=\\1\\2\]\\3\[/URL\]" , $txt ); $txt = preg_replace( "#<!--QuoteBegin-->(.+?)<!--QuoteEBegin-->#" , '[QUOTE]' , $txt ); $txt = preg_replace( "#<!--QuoteBegin-{1,2}([^>]+?)\+([^>]+?)-->(.+?)<!--QuoteEBegin-->#" , "[QUOTE=\\1,\\2]" , $txt ); $txt = preg_replace( "#<!--QuoteBegin-{1,2}([^>]+?)\+-->(.+?)<!--QuoteEBegin-->#" , "[QUOTE=\\1]" , $txt ); $txt = preg_replace( "#<!--QuoteEnd-->(.+?)<!--QuoteEEnd-->#" , '[/QUOTE]' , $txt ); $txt = preg_replace( "#<!--c1-->(.+?)<!--ec1-->#", '[CODE]' , $txt ); $txt = preg_replace( "#<!--c2-->(.+?)<!--ec2-->#", '[/CODE]' , $txt ); $txt = preg_replace( "#<i>(.+?)</i>#is" , "\[i\]\\1\[/i\]" , $txt ); $txt = preg_replace( "#<b>(.+?)</b>#is" , "\[b\]\\1\[/b\]" , $txt ); $txt = preg_replace( "#<s>(.+?)</s>#is" , "\[s\]\\1\[/s\]" , $txt ); $txt = preg_replace( "#<u>(.+?)</u>#is" , "\[u\]\\1\[/u\]" , $txt ); $txt = preg_replace( "#(\n){0,}<ul>#" , "\\1\[LIST\]" , $txt ); $txt = preg_replace( "#(\n){0,}<ol type='(a|A|i|I|1)'>#" , "\\1\[LIST=\\2\]\n" , $txt ); $txt = preg_replace( "#(\n){0,}<li>#" , "\n\[*\]" , $txt ); $txt = preg_replace( "#(\n){0,}</ul>(\n){0,}#", "\n\[/LIST\]\\2" , $txt ); $txt = preg_replace( "#(\n){0,}</ol>(\n){0,}#", "\n\[/LIST\]\\2" , $txt ); $txt = preg_replace( "#<!--me&(.+?)-->(.+?)<!--e--me-->#e" , "\$this->unconvert_me('\\1', '\\2')", $txt ); $txt = preg_replace( "#<span style=['\"]font-size:(.+?)pt;line-height:100%['\"]>(.+?)</span>#se" , "\$this->unconvert_size('\\1', '\\2')", $txt ); $txt = preg_replace( "#<span style=['\"]color:(.+?)['\"]>(.+?)</span>#is" , "\[color=\\1\]\\2\[/color\]", $txt ); $txt = preg_replace( "#<span style=['\"]font-family:(.+?)['\"]>(.+?)</span>#is", "\[font=\\1\]\\2\[/font\]", $txt ); $txt = preg_replace( "#(\[/QUOTE\])\s*?<br>\s*#si", "\\1\n", $txt ); $txt = preg_replace( "#<!--EDIT\|.+?\|.+?-->#" , "" , $txt ); $txt = preg_replace( "#<br>#", "\n", $txt ); $text = preg_replace( "/(^|\b)".$r['type']."(\b|!|\?|\.|,|$)/i", "$replace", $text ); $text = preg_replace( "/".$r['type']."/i", "$replace", $text ); 15) Опять по mysqli: ad_templates.php это: //+------------------------------- // Update the DB //+------------------------------- $string = $DB->compile_db_update_string( array ( 'section_content' => str_replace("\'","'",mysql_escape_string($text)), 'updated' => time(), ) ); на это: //+------------------------------- // Update the DB //+------------------------------- $string = $DB->compile_db_update_string( array ( 'section_content' => str_replace("\'","'",mysqli_escape_string($text)), 'updated' => time(), ) );
  9. Думаю, что наступает пора заняться модернизацией кода для IPB 1.3 под PHP 7 для тех, кто до сих пор пользуется версией IPB 1.3 и не хочет с ней расставаться. В функционале PHP 7, по-быстрому говоря, теперь не признают бывшие стандартные функции, содержащие в своем названии mysql , - теперь все функции должны идти как mysqli: это касается абсолютно всех функций будь-то mysql_query() -> mysqli_query() , mysql_fetch_row() -> mysqli_fetch_row() и даже mysql_error() -> mysql_error(). Причем, ко всему прочему, данные функции i требуют обязательного указаниия, как минимум 2-х параметров, а где-то что-то должно быть целым итд. И это только начало. Далее по порядку, попытался насколько мог подправить код, но, все равно, хочется попросить еще помощи и от участников форума. Также необходимо, чтобы были установлены все патчи для PHP 5 (Включая PHP 5.4.x и выше из этой темы http://forums.ibresource.ru/topic/19364-php-5-direktivy-php-dlia-normalnoj-raboty-s-ipb-13/)и MySQL 5. 1) Файл: mySQL.php - тут правок полно. В частности, было: /*========================================================================*/ // Connect to the database /*========================================================================*/ function connect() { //-------------------------- // Done SQL prefix yet? //-------------------------- if ( ! defined( 'SQL_PREFIX' ) ) { $this->obj['sql_tbl_prefix'] = $this->obj['sql_tbl_prefix'] ? $this->obj['sql_tbl_prefix'] : 'ibf_'; define( 'SQL_PREFIX', $this->obj['sql_tbl_prefix'] ); } if ($this->obj['persistent']) { $this->connection_id = mysql_pconnect( $this->obj['sql_host'] , $this->obj['sql_user'] , $this->obj['sql_pass'] ); } else { $this->connection_id = mysql_connect( $this->obj['sql_host'] , $this->obj['sql_user'] , $this->obj['sql_pass'] ); } if ( !mysql_select_db($this->obj['sql_database'], $this->connection_id) ) { echo ("ERROR: Cannot find database ".$this->obj['sql_database']); } mysql_query("SET NAMES 'cp1251'"); mysql_query("SET COLLATION_CONNECTION=CP1251_GENERAL_CI"); } Сделал так: /*========================================================================*/ // Connect to the database /*========================================================================*/ function connect() { //-------------------------- // Done SQL prefix yet? //-------------------------- if ( ! defined( 'SQL_PREFIX' ) ) { $this->obj['sql_tbl_prefix'] = $this->obj['sql_tbl_prefix'] ? $this->obj['sql_tbl_prefix'] : 'ibf_'; define( 'SQL_PREFIX', $this->obj['sql_tbl_prefix'] ); } if ($this->obj['persistent']) { $this->connection_id = mysqli_pconnect( $this->obj['sql_host'] , $this->obj['sql_user'] , $this->obj['sql_pass'] , $this->obj['sql_database'] ); } else { $this->connection_id = mysqli_connect( $this->obj['sql_host'] , $this->obj['sql_user'] , $this->obj['sql_pass'] , $this->obj['sql_database'] ); } if ( !$this->connection_id) { echo ("ERROR: Cannot find database ".$this->obj['sql_database']); } mysqli_query($this->connection_id, "SET NAMES 'cp1251'"); mysqli_query($this->connection_id, "SET COLLATION_CONNECTION=CP1251_GENERAL_CI"); } далее в файле: $this->query_id = mysql_query($the_query, $this->connection_id); заменено на: $this->query_id = mysqli_query($this->connection_id, $the_query); Т.е. параметры просто меняются местами. далее: $this->record_row = mysql_fetch_array($query_id, MYSQL_ASSOC); заменено на: $this->record_row = mysqli_fetch_array($query_id, MYSQLI_ASSOC); итд по всему файлу, включая выводы ошибок. Подробно расписывать не буду - прикреплю лучше файл mySQL.php к посту, а там сами посмотрите. mySQL.php 2) index.php: Там было вот такое: class info { var $member = array(); var $input = array(); var $session_id = ""; var $base_url = ""; var $vars = ""; var $skin_id = "0"; // Skin Dir name var $skin_rid = ""; // Real skin id (numerical only) var $lang_id = "en"; var $skin = ""; var $lang = ""; var $server_load = 0; var $version = "v1.3"; var $lastclick = ""; var $location = ""; var $debug_html = ""; var $perm_id = ""; var $forum_read = array(); var $topic_cache = ""; var $session_type = ""; function _info () { global $sess, $std, $DB, $INFO; $this->vars = $INFO; $this->vars['TEAM_ICON_URL'] = $INFO['html_url'] . '/team_icons'; $this->vars['AVATARS_URL'] = $INFO['html_url'] . '/avatars'; $this->vars['EMOTICONS_URL'] = $INFO['html_url'] . '/emoticons'; $this->vars['mime_img'] = $INFO['html_url'] . '/mime_types'; } } в PHP 7 это приводит к постоянному ворнингу на всех страницах: необходимо в этом классе function _info () заменить на: function __construct () То же самое нужно произвести практически в 85% файлах форума, где функция в классе имеет то же имя, что и сам класс (заменить функцию на function __construct ()) - проверил - работает и на версиях PHP 5.2.х и выше. 3) index.php Если у кого-то был установлен мод типа cookie IP ban, то $usersip = getenv("REMOTE_ADDR"); if(!$_COOKIE["CookieIp"]) { // Mmmm cookie setcookie("CookieIp", $usersip, time() + 99*99*99*99); } 99*99*99*99 - вот это дело уже приводит к ворнингу сделал так: setcookie("CookieIp", $usersip, time() + 9999999);4) admin.php: Если у кого установлен мод учета поисковиков mod_spider, то получаем ошибку: //-- mod_spider begin if ($IN['act'] == "op" && $IN['code'] == "spider") { if (file_exists(ROOT_PATH."sources/mods/spider/mod_spider_ad_func.php")) { require ROOT_PATH."sources/mods/spider/mod_spider_ad_func.php"; } else { die("Could not call required function from file 'sources/mods/spider/mod_spider_ad_func.php'<br>Does it exist?"); } break; } //-- mod_spider end убираем из этого участка: break;5) ipchat.php: $DB = @mysql_connect( $db_info['host'], $db_info['user'], $db_info['pass'] ); if ( ! @mysql_select_db( $db_info['database'] ) ) { die_nice(); //-- script exits --// } заменен на: $DB = @mysqli_connect( $db_info['host'], $db_info['user'], $db_info['pass'], $db_info['database'] ); if ( ! $DB ) { die_nice(); //-- script exits --// } if ( ! $member = @mysql_fetch_array( $query_id, MYSQL_ASSOC ) ) на: if ( ! $member = @mysqli_fetch_array( $query_id, MYSQLI_ASSOC ) ) вот такое: $query_id = @mysql_query("SELECT m.mgroup, m.password, m.name, m.id FROM {$db_info['tbl_prefix']}members m WHERE m.name='".addslashes($username)."' LIMIT 1" ,$DB); заменил на такое: $query_id = @mysqli_query($DB, "SELECT m.mgroup, m.password, m.name, m.id FROM {$db_info['tbl_prefix']}members m WHERE m.name='".addslashes($username)."' LIMIT 1" ); это: @mysql_close(); на это: @mysqli_close($access); прикреплю файл, т.к. еще там есть участки ipchat.php 6) jcounter.php (это файл, по-моему из мода статистики, в оригинальном IPB его нет, файл лежит в корне (где index.php) вот такого там до черта: mysql_query($DB, "SELECT ...) переставил: mysqli_query($DB, "SELECT ... опять же, прикрепляю: jcounter.php 7) postwarn.php (это файл, по-моему из мода предупреждений или защиты от перебора пароля Secure login - уже не помню, в оригинальном IPB его нет, файл лежит в \sources\misc\ Файл мизерный. Вот его весь старый код: <?php /* +--------------------------------------------------------------------------- | | > : Advanced Warn | +-------------------------------------------------------------------------- */ require('../../conf_global.php'); $connection_id = mysql_connect($INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass']); mysql_select_db($INFO['sql_database'], $connection_id); mysql_query("UPDATE ".$INFO['sql_tbl_prefix']."members SET `set_warn` = 0 WHERE `warn_exp` < ".time()); mysql_close($connection_id); переделал так: <?php /* +--------------------------------------------------------------------------- | | > : Advanced Warn | +-------------------------------------------------------------------------- */ require('../../conf_global.php'); $connection_id = mysqli_connect($INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass'], $INFO['sql_database']); mysqli_query($connection_id, "UPDATE ".$INFO['sql_tbl_prefix']."members SET `set_warn` = 0 WHERE `warn_exp` < ".time()); mysqli_close($connection_id); ?> 8) А вот это уже серьезно и из оригинального кода IPB: functions.php: Найти: foreach ($user_raw_permissions AS $data) { $new_data = split(':', $data); $this->member['forum_perms'][ $new_data[0] ] = $new_data[1]; } это приводит к ошибке, поэтому заменил split() на explode() вот так: foreach ($user_raw_permissions AS $data) { $new_data = explode(':', $data); $this->member['forum_perms'][ $new_data[0] ] = $new_data[1]; } то же для ad_member.php: это $user_raw_permissions = split(';', $mem['forum_access']); foreach ($user_raw_permissions AS $data) { $new_data = split(':', $data); $user_permissions[ $new_data[0] ] = $new_data[1]; } заменить на: $user_raw_permissions = explode(';', $mem['forum_access']); foreach ($user_raw_permissions AS $data) { $new_data = explode(':', $data); $user_permissions[ $new_data[0] ] = $new_data[1]; } modules\mod_banka.php: это: $banarr = split(":", $val); на: $banarr = explode(":", $val); sources\Portal.php: это: function do_welcomepanel() { global $DB, $ibforums, $std; if ( $ibforums->vars['portal_welcomepanel'] ) { if ($ibforums->member['id']) { $DB->query("SELECT * FROM ibf_members WHERE id='".$ibforums->member['id']."'"); $member = $DB->fetch_row(); $avatar_size = $member['avatar_size']; list($w,$h) = split("x","$avatar_size",2); на это: function do_welcomepanel() { global $DB, $ibforums, $std; if ( $ibforums->vars['portal_welcomepanel'] ) { if ($ibforums->member['id']) { $DB->query("SELECT * FROM ibf_members WHERE id='".$ibforums->member['id']."'"); $member = $DB->fetch_row(); $avatar_size = $member['avatar_size']; list($w,$h) = explode("x","$avatar_size",2); 9) У кого установлен мод наград (Award mod) в Topics.php есть участок в конце функции: // Parse the member info //-------------------------------------------------------------- function parse_member($member=array()) {, относящийся в данному моду: $n = mysql_num_rows(mysql_query("SELECT * FROM ibf_awards WHERE mid='{$member['id']}'")); if ($n > 0) { $member['awards'] = "Награды: <a href='{$ibforums->vars['board_url']}/index.php?act=Awards&id={$member['id']}'>$n</a>"; } else { $member['awards'] = "Награды: <i>Нет</i>"; вот это хозяйство: $n = mysql_num_rows(mysql_query("SELECT * FROM ibf_awards WHERE mid='{$member['id']}'")); if ($n > 0) { $member['awards'] = "Награды: <a href='{$ibforums->vars['board_url']}/index.php?act=Awards&id={$member['id']}'>$n</a>"; } else { $member['awards'] = "Награды: <i>Нет</i>"; } в PHP 7 приводит к фатальной ошибке и для mysqli_query требуется задать еще параметры, поэтому удалил этот код: 10) У тех, у кого установлены моды BB-кодов, Secure login (Для тех, кто не в курсе поясню, что пока (на момент написания этого поста есть сайт https://www1.rwb-essen.de/ibforen/index.php?ind=downloads&op=section_view&idev=1, где еще чего-то там кумекают по версии IPB 1.3 Прикреплю к данному посту еще файлы оттуда: Mod_mySQL5_1_0_2.zip - коррекция под MySQL 5.x . Mod_sec_update_131_2_8_0.zip - это обновление безопасности от немцев (последняя правка 14.06.2015), включающая навероты по безопасности, тот самый антибрут и пр. - ставить или не ставить - решайте сами. Update_IPB_13_131.zip - Это Обновление с IPB 1.3 до IPB 1.3.1) Так вот, если уставолены указанные выше моды, в т.ч. мод enhanced_topics, то в файлах типа mod_enhanced_topics_install.php найти: $query_id = mysql_query($the_query); if ($query_id) { mysql_free_result( $query_id ); }; заменить на: $query_id = mysqli_query($this->connection_id, $the_query); if ($query_id) { mysqli_free_result( $query_id ); }; итп. 11) Кстати, при тестировании на MySQL 5.7 на OpenServer необходимо в C:\OpenServer\userdata\config\MySQL-5.7_my.ini установить хотя бы: sql-mode="" т.е., убрать все между кавычками, иначе это будет приводить к ошибкам MySQL 5.7: MySQL 5.7 (Apache 2.4, PHP 5.6 (еще даже!)). Так при тесте на локалке с условным именем БД ddd на индексной странице получил подарок: mySQL query error: SELECT g.*, m.* FROM ibf_members m LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup) WHERE m.last_activity >= '1471640400' AND m.mgroup <> '2' GROUP BY m.name ORDER BY m.last_activity DESC mySQL error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ddd.g.g_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by mySQL error code: На showtopic получил: mySQL query error: SELECT p.*, m.id,m.name,m.mgroup,m.email,m.joined,m.avatar,m.avatar_size,m.posts,m.aim_name,m.icq_number, m.signature, m.website,m.yahoo,m.integ_msg,m.title,m.hide_email,m.msnname, m.warn_level, m.warn_lastwarn, g.g_id, g.g_title, g.g_icon, g.g_dohtml, s.login_type, s.running_time, g.g_hide_from_list, g.g_can_view_on_off FROM ibf_posts p LEFT JOIN ibf_members m ON (p.author_id=m.id) LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup) LEFT JOIN ibf_sessions s ON (s.member_id=p.author_id AND s.member_id<>0 AND s.member_id IS NOT NULL) LEFT JOIN ibf_pfields_content pc ON (pc.member_id=p.author_id) WHERE p.topic_id=473 and p.queued != 1 GROUP BY pid ORDER BY p.post_date asc LIMIT 0, 30 mySQL error: Expression #48 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ddd.s.login_type' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by на showforum получил ошибку неявной записи: mySQL query error: UPDATE ibf_sessions SET member_name='',member_id='0',member_group='2',login_type='0', running_time='1471718686', in_forum='332', in_topic='', location='SF,,' WHERE id='a85128f6bfeb1d83f6d48b296562257d' mySQL error: Incorrect integer value: '' for column 'in_topic' at row 1 mySQL error code: Постинговые, вроде, открываются. Например, вот такое: index.php?act=Post&CODE=06&f=332&t=473&p=714 При этом предпросмотр работает, а при отправке данных - ошибка БД абсолютно без информации в окне. admin.php и индексная там - открываются. При этом страницы многих пунктов меню открываются, а, например, Настройка языков выдает ошибку: mySQL query error: select ibf_languages.*, count(ibf_members.id) as mcount from ibf_languages left join ibf_members on(ibf_members.language=ibf_languages.ldir) where (ibf_members.language is not null or ibf_members.language = 'en') group by ibf_languages.ldir order by ibf_languages.lname mySQL error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ddd.ibf_languages.lid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by В MySQL 5.6 все работает. Как видно, в 5.7 надо решать вопросы нововведений, из-за которых идут ошибки https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html
  10. Решил проблему: Решение: skin_topic.php В функции function Show_attachments должно быть: function Show_attachments($data="") { global $ibforums; $IPBHTML = ""; //--starthtml--// $IPBHTML .= <<<EOF <a href="{$ibforums->base_url}act=Attach&type={$data['method']}&id={$data['id']}&mid={$ibforums->member['id']}" title="{$ibforums->lang['attach_dl']}" target="_blank"><img src="{$ibforums->vars['mime_img']}/{$data['image']}" alt="{$ibforums->lang['attached_file']}" /></a> <a href="{$ibforums->base_url}act=Attach&type={$data['method']}&id={$data['id']}&mid={$ibforums->member['id']}" title="{$ibforums->lang['attach_dl']}" target="_blank">{$data['name']}</a> ( {$data['size']} ) <span class="desc">{$ibforums->lang['attach_hits']}: {$data['hits']}</span> (<a href='javascript:' onclick="window.open('index.php?act=Attach&type=view&id={$data['id']}', 'Downloaders', 'width=150,height=200,resizable=no,location=no,directories=no,status=no,menubar=no,toolbar=no')">{$ibforums->lang['view_who_dled']}</a>)</span> EOF; //--endhtml--// return $IPBHTML; } Т.е. <a href="{$ibforums->base_url}act=Attach&type={$data['method']}&id={$data['id']}" дважды заменить на: <a href="{$ibforums->base_url}act=Attach&type={$data['method']}&id={$data['id']}&mid={$ibforums->member['id']}" в </span> (<a href='javascript:' onclick="window.open('index.php?act=Attach&type=view&id={$data['pid']}', 'Downloaders', 'width=150,height=200,resizable=no,location=no,directories=no,status=no,menubar=no,toolbar=no')">{$ibforums->lang['view_who_dled']}</a>)</span> {$data['pid']} заменить на {$data['id']} attach.php Найти: // Update the "hits".. $DB->simple_construct( array( 'update' => 'attachments', 'set' =>"attach_hits=attach_hits+1", 'where' => "attach_id=".$ibforums->input['id'] ) ); $DB->simple_exec(); $ga = $DB->query("SELECT * FROM ibf_attachmentdls WHERE aid='{$post['pid']}' AND mid='{$ibforums->input['mid']}'"); if ($DB->get_num_rows($ga) <= 0) { $DB->query("INSERT INTO ibf_attachmentdls (aid, mid) VALUES ('{$post['pid']}', '{$ibforums->input['mid']}')"); } Заменить на: // Update the "hits".. $DB->simple_construct( array( 'update' => 'attachments', 'set' =>"attach_hits=attach_hits+1", 'where' => "attach_id=".$ibforums->input['id'] ) ); $DB->simple_exec(); $ga = $DB->query("SELECT * FROM ibf_attachmentdls WHERE aid='{$post['attach_id']}' AND mid='{$ibforums->input['mid']}'"); if ($DB->get_num_rows($ga) <= 0) { $DB->query("INSERT INTO ibf_attachmentdls (aid, mid) VALUES ('{$post['attach_id']}', '{$ibforums->input['mid']}')"); } т.е. {$post['pid']} заменено на {$post['attach_id']}
  11. На ранее существовавшем сайте invisionize.com был такой мод, как D-View who downloaded attachments версии 1.0, который позволял в посте, к которому был прикреплен файл видеть статистику того, кто и когда скачивал вложения из поста. С наступлением страших версий PHP 5.x работа мода начала хандрить: при просмотре popup окна статистики выдавало белый экран. Пришлось делать правки в файл attach.php. Оригинальный файл дистрибутива IPB 1.3 выглядел так: attach orig.php В архиве с модом шел уже правленный файл attach.php, которым предлагалось заменить оригинальный. Правленный выглядел так: attach_from_mod.php И тот и другой с PHP 5.6 имеют конфликты: 1) участок: @header( "Content-Type: ".$post['attach_type']."\nContent-Disposition: inline; filename=\"".$post['attach_file']."\"\nContent-Length: ".(string)(filesize( $file ) ) ); нужно переделывать, как: @header("Content-Type: ".$post['attach_type']); @header("Content-Disposition: inline; filename=\"".$post['attach_file']."\""); @header("Content-Length: ".(string)(filesize($file) ) ); (Song) 2) это $DB->query("SELECT pid, attach_id, attach_type, attach_file FROM ibf_posts WHERE pid='".$ibforums->input['id']."'"); if ( !$DB->get_num_rows() ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); } $post = $DB->fetch_row(); if ( $post['attach_id'] == "" ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); } $file = $ibforums->vars['upload_dir']."/".$post['attach_id']; if ( file_exists( $file ) and ( $post['attach_type'] != "" ) ) { // Update the "hits".. $DB->query("UPDATE ibf_posts SET attach_hits=attach_hits+1 WHERE pid='".$post['pid']."'"); $ga = $DB->query("SELECT * FROM ibf_attachmentdls WHERE aid='{$post['pid']}' AND mid='{$ibforums->input['mid']}'"); if ($DB->get_num_rows($ga) <= 0) { $DB->query("INSERT INTO ibf_attachmentdls (aid, mid) VALUES ('{$post['pid']}', '{$ibforums->input['mid']}')"); } заменено на это: $DB->simple_construct( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_id=".$ibforums->input['id'] ) ); $DB->simple_exec(); if ( !$DB->get_num_rows() ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); } $post = $DB->fetch_row(); if ( $post['attach_id'] == "" ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); } $file = $ibforums->vars['upload_dir']."/".$post['attach_location']; if ( file_exists( $file ) and ( $ibforums->cache['attachtypes'][ $post['attach_ext'] ]['atype_mimetype'] != "" ) ) { // Update the "hits".. $DB->simple_construct( array( 'update' => 'attachments', 'set' =>"attach_hits=attach_hits+1", 'where' => "attach_id=".$ibforums->input['id'] ) ); $DB->simple_exec(); $ga = $DB->query("SELECT * FROM ibf_attachmentdls WHERE aid='{$post['pid']}' AND mid='{$ibforums->input['mid']}'"); if ($DB->get_num_rows($ga) <= 0) { $DB->query("INSERT INTO ibf_attachmentdls (aid, mid) VALUES ('{$post['pid']}', '{$ibforums->input['mid']}')"); } иначе, если этого не сделать, то при клике мышью на скачиваемый файл будет выдаваться ошибка IPB, что ссылка битая и пр., в результате код attach.php выглядит так: attach_my.php skin_topic.php у меня выглядит так: см. вложение skin_topic.php Ошибка, которую мне никак не удается исправить: При скачивании файлов файл нормально, небито скачивается окном сохранения в браузере, счетчик скачиваний нормально считает количество скачиваний, НО при открытии popup окна статистики, кто скачивал все время пишет: Посмотрел БД: CREATE TABLE `ibf_attachmentdls` ( aid int( 11 ) NOT NULL default '0', mid int( 11 ) NOT NULL default '0' ); все есть с правильными установками. Такое ощущение, что в файле attach.php вот в этом верхнем месте: $idx = new attach; class attach { function attach() { global $ibforums, $DB, $std, $print, $skin_universal; $ibforums->lang = $std->load_words($ibforums->lang, 'lang_topic', $ibforums->lang_id); $this->html = $std->load_template('skin_topic'); $ibforums->input['id'] = preg_replace( "/^(\d+)$/", "\\1", $ibforums->input['id'] ); if ($ibforums->input['id'] == "") { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); } if ($ibforums->input['type'] == 'view') { $a = $DB->query("SELECT a.*, m.*, g.* FROM ibf_attachmentdls a LEFT JOIN ibf_members m ON (a.mid=m.id) LEFT JOIN ibf_groups g ON (m.mgroup=g.g_id) WHERE a.aid='{$ibforums->input['id']}'"); if ($DB->get_num_rows($a) <= 0) { $adls = "{$ibforums->lang['no_atc_dls']}"; } else { while ($attach = $DB->fetch_row($a)) { $adls .= "<a href='javascript:' onclick=\"opener.window.location='index.php?showuser={$attach['mid']}'\">{$attach['prefix']}{$attach['name']}{$attach['suffix']}</a><br>\n"; } } $print->pop_up_window("{$ibforums->lang['attach_dls']}", $this->html->attachment_downloaders($adls)); } есть что-то в коде, что не дает данные в БД и статистика скачавших все время нулевая... Еще, что мне не нравится, так это то, что в attach.php указано: $adls , а в skin_topic.php в функции attachment_downloaders это уже идет, как: function attachment_downloaders($dls) { global $ibforums; return <<<EOF <div align='center' class='tableborder'> <table align='center' width="100%" cellpadding="3" cellspacing="0"> <tr> <td width="100%"> {$dls} </td> </tr> </table> </div> EOF; } D-View who downloaded attachments 1.0.zip
  12. Долго не обращал внимания на эту свою ошибку, тут решил посмотреть и выяснил, что виной всему были неправильные установки параметров полей таблицы ibf_stats в БД: Должно быть так: CREATE TABLE IF NOT EXISTS `ibf_stats` ( `TOTAL_REPLIES` int(10) NOT NULL DEFAULT '0', `TOTAL_TOPICS` int(10) NOT NULL DEFAULT '0', `LAST_MEM_NAME` varchar(32) DEFAULT NULL, `LAST_MEM_ID` mediumint(8) NOT NULL DEFAULT '0', `MOST_DATE` int(10) DEFAULT NULL, `MOST_COUNT` int(10) DEFAULT '0', `MEM_COUNT` mediumint(8) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=cp1251; Так вот, каким-то чудным образом было: CREATE TABLE IF NOT EXISTS `ibf_stats` ( `TOTAL_REPLIES` int(10) DEFAULT '0', `TOTAL_TOPICS` int(10) DEFAULT '0', `LAST_MEM_NAME` varchar(32) DEFAULT NULL, `LAST_MEM_ID` mediumint(8) DEFAULT '0', `MOST_DATE` int(10) DEFAULT NULL, `MOST_COUNT` int(10) DEFAULT '0', `MEM_COUNT` mediumint(8) DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=cp1251; , т.е. везде было NULL - ДА! После этого ресинхронизировал (Пересчитал) статистику через АЦ Также решил убрать сведения о статистике вниз на панель статистики: skin_boards.php: Найти в functions_WelcomePanel: {$ibforums->lang['top_starter']}: <a href="{$ibforums->base_url}showuser={$data['tt_id']}">{$data['tt_name']}</a> [{$data['tt_num']}]<br /> {$ibforums->lang['top_poster']}: <a href="{$ibforums->base_url}showuser={$data['tp_id']}">{$data['tp_name']}</a> [{$data['tp_num']}]<br /> и удалить его оттуда Найти: function ShowStats($text) { global $ibforums; return <<<EOF <tr> <td class='pformstrip' colspan='2'>{$ibforums->lang['board_stats']}</td> </tr> <tr> <td class='row2' width='5%' valign='middle'><{F_STATS}></td> <td class='row4' width="95%" align='left'>$text<br /> </tr> EOF; } заменить на: function ShowStats($text, $data="") { global $ibforums, $stats; return <<<EOF <tr> <td class='pformstrip' colspan='2'>{$ibforums->lang['board_stats']}</td> </tr> <tr> <td class='row2' width='5%' valign='middle'><{F_STATS}></td> <td class='row4' width="95%" align='left'>{$ibforums->lang['top_starter']}: <a href="{$ibforums->base_url}showuser={$data['tt_id']}">{$data['tt_name']}</a> [{$data['tt_num']}]<br /> {$ibforums->lang['top_poster']}: <a href="{$ibforums->base_url}showuser={$data['tp_id']}">{$data['tp_name']}</a> [{$data['tp_num']}]<br />$text<br /> {$ibforums->lang['most_online']}</td> </tr> EOF; } Открыть Boards.php Найти: //*********************************************/ // Add in show stats //*********************************************/ if ($ibforums->vars['show_totals']) { $DB->query("SELECT * FROM ibf_stats"); $stats = $DB->fetch_row(); // Update the most active count if needed if ($active['TOTAL'] > $stats['MOST_COUNT']) { $DB->query("UPDATE ibf_stats SET MOST_DATE='".time()."', MOST_COUNT='".$active[TOTAL]."'"); $stats['MOST_COUNT'] = $active[TOTAL]; $stats['MOST_DATE'] = time(); } $most_time = $std->get_date( $stats['MOST_DATE'], 'LONG' ); $ibforums->lang['most_online'] = str_replace( "<#NUM#>" , $std->do_number_format($stats['MOST_COUNT']) , $ibforums->lang['most_online'] ); $ibforums->lang['most_online'] = str_replace( "<#DATE#>", $most_time , $ibforums->lang['most_online'] ); $total_posts = $stats['TOTAL_REPLIES'] + $stats['TOTAL_TOPICS']; $total_posts = $std->do_number_format($total_posts); $stats['MEM_COUNT'] = $std->do_number_format($stats['MEM_COUNT']); $link = $ibforums->base_url."showuser=".$stats['LAST_MEM_ID']; $ibforums->lang['total_word_string'] = str_replace( "<#posts#>" , "$total_posts" , $ibforums->lang['total_word_string'] ); $ibforums->lang['total_word_string'] = str_replace( "<#reg#>" , $stats['MEM_COUNT'] , $ibforums->lang['total_word_string'] ); $ibforums->lang['total_word_string'] = str_replace( "<#mem#>" , $stats['LAST_MEM_NAME'] , $ibforums->lang['total_word_string'] ); $ibforums->lang['total_word_string'] = str_replace( "<#link#>" , $link , $ibforums->lang['total_word_string'] ); $stats_html .= $this->html->ShowStats($ibforums->lang['total_word_string']); } Заменить на: //*********************************************/ // Add in show stats //*********************************************/ if ($ibforums->vars['show_totals']) { $DB->query("SELECT * FROM ibf_stats"); $stats = $DB->fetch_row(); $DB->query("SELECT `starter_id` AS id, `starter_name` AS name, COUNT(*) AS `num` FROM `ibf_topics` WHERE starter_id > 0 GROUP BY id ORDER BY num DESC LIMIT 1"); $row = $DB->fetch_row(); $data['tt_id'] = $row[id]; $data['tt_name'] = $row[name]; $data['tt_num'] = $row[num]; $DB->query("SELECT `id`,`name`,`posts` FROM `ibf_members` WHERE 1 AND id > 0 ORDER BY `posts` DESC LIMIT 1"); $row = $DB->fetch_row(); $data['tp_id'] = $row[id]; $data['tp_name'] = $row[name]; $data['tp_num'] = $row[posts]; // Update the most active count if needed if ($active['TOTAL'] > $stats['MOST_COUNT']) { $DB->query("UPDATE ibf_stats SET MOST_DATE='".time()."', MOST_COUNT='".$active[TOTAL]."'"); $stats['MOST_COUNT'] = $active[TOTAL]; $stats['MOST_DATE'] = time(); } $most_time = $std->get_date( $stats['MOST_DATE'], 'LONG' ); $ibforums->lang['most_online'] = str_replace( "<#NUM#>" , $std->do_number_format($stats['MOST_COUNT']) , $ibforums->lang['most_online'] ); $ibforums->lang['most_online'] = str_replace( "<#DATE#>", $most_time , $ibforums->lang['most_online'] ); $total_posts = $stats['TOTAL_REPLIES'] + $stats['TOTAL_TOPICS']; $total_posts = $std->do_number_format($total_posts); $stats['MEM_COUNT'] = $std->do_number_format($stats['MEM_COUNT']); $link = $ibforums->base_url."showuser=".$stats['LAST_MEM_ID']; $ibforums->lang['total_word_string'] = str_replace( "<#posts#>" , "$total_posts" , $ibforums->lang['total_word_string'] ); $ibforums->lang['total_word_string'] = str_replace( "<#reg#>" , $stats['MEM_COUNT'] , $ibforums->lang['total_word_string'] ); $ibforums->lang['total_word_string'] = str_replace( "<#mem#>" , $stats['LAST_MEM_NAME'] , $ibforums->lang['total_word_string'] ); $ibforums->lang['total_word_string'] = str_replace( "<#link#>" , $link , $ibforums->lang['total_word_string'] ); $stats_html .= $this->html->ShowStats($ibforums->lang['total_word_string'], $data); }
  13. Коротко и ясно: https://git.qrm24.com/neo/iptorrent
  14. Хорошо, что бы вы предложили бы сделать в вышеуказанных случаях в вышеуказанных файлах с проблемой с Illegal string offset
  15. dimitry

    [1.x.x]Дневники - Журналы (v1.05)

    Да, спасибо, именно в этом и было дело: в index.php добавил этот участок после: //----------------------------------------------- // USER CONFIGURABLE ELEMENTS //----------------------------------------------- и в journal.php после: //----------------------------------------------- // Start Original IPB 1.2 source //----------------------------------------------- P.S. Что интересно, пока редактировал в браузере была открыта главная страница журнала и слева форма для ввода логина и пароля. Когда исправления еще не было, я туда вводил аутентификационные данные, но после нажатия вход - все исчезало и залогинивания не происходило. Стоило только сохранить изменения и перезагрузить измененные файлы, то уже в форме логин появился мой ранее введенный логин (из куков, конечно), что уже сразу заявило о том, что проблема была именно в этом.
×
×
  • Создать...

Важная информация

Находясь на нашем сайте, вы соглашаетесь на использование файлов cookie, а также с нашим положением о конфиденциальности Политика конфиденциальности и пользовательским соглашением Условия использования.