Jump to content
View in the app

A better way to browse. Learn more.

IPBMafia.ru - поддержка Invision Community, релизы, темы, плагины и приложения

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Boglik

Новичок
  • Регистрация

  • В сети

  1. Была бы здесь система репутации я бы накидал в репу👍 Проанализировал код: добавлены отступы для читаемости(об этом я не подумал, когда публиковал) Если кому интересно в чем различие и кто тоже не знает php, то был изменены переменные и добавлена функция mysqli_set_charset вместо цикла: $rd = "SET CHARACTER SET CP1251"; IF (!$result = mysql_query($rd)) { ECHO "ERROR!!!\n"; } $link = mysqli_connect("$host", "$username", "$password", "$database"); // Был $ipb_db стал $link mysqli_set_charset($link, "utf8"); // установка кодировки utf8 согласно стандартам php7. На php5 функции mysqli_set_charset нет $resultf = mysqli_query($link, "SELECT tid, title, state, posts, starter_id, last_poster_id, last_post, starter_name, last_poster_name, views, topic_hasattach FROM {$prefix}topics WHERE forum_id NOT IN ({$forumexclude}) ORDER BY last_post DESC LIMIT {$num}");
  2. Есть скрипт. Хватило ума довести его до ветки ipb(3.4) но застрял на передаче параметров PHP7.1 Как довести его до ума, чтобы он выводил из базы? <?php //======[ОСНОВНЫЕ НАСТРОЙКИ]====== //Префикс таблицы с IPB $prefix = ''; //Сколько тем выводить $num = 10; //Сколько символов оставить в названии темы после урезания $topic_num_sym = 65; //Имя папки с картинками текущего скина $img_path = '1'; //Формат времени $time = 'H:i'; //Форумы, которые мы не трогаем $forumexclude = '0'; //Сервер БД на котором висит база форума $host=""; //Имя БД $database=""; //Логин БД $username=""; //Пароль БД $password=""; //====[Если не знаем PHP - дальше ничего не трогаем ]========= $ipb_db = mysql_pconnect($host, $username, $password); mysql_select_db($database, $ipb_db); $rd = "SET CHARACTER SET CP1251"; IF (!$result = mysql_query($rd)) { ECHO "ERROR!!!\n"; } $resultf = mysql_query("SELECT tid, title, state, posts, starter_id, last_poster_id, last_post, starter_name, last_poster_name, views, topic_hasattach FROM ".$prefix."topics WHERE (forum_id NOT IN ($forumexclude)) ORDER BY last_post DESC LIMIT $num",$ipb_db) or die(mysql_error()); $row_resultf = mysql_fetch_assoc($resultf); $totalRows_resultf = mysql_num_rows($resultf); do { $topicstrip = $row_resultf['title']; if (strlen($topicstrip) > $topic_num_sym) { $topicstrip = substr($topicstrip,0,$topic_num_sym); $topicstrip = $topicstrip."..."; } $status = ($row_resultf['state'] == "closed") ? "<img src=\"forum/style_images/$img_path/f_closed.gif\" border=\"0\" alt=\"Тема закрыта\">" : ""; $attach = ($row_resultf['topic_hasattach'] == "1") ? "<img src=\"temp/A-Vector/images/files.gif\" border=\"0\" alt=\"В сообщении есть прикрепленные файлы\"> " : ""; $last_date = date($time,$row_resultf['last_post']); $bt.= "<small class=\"3\">$last_date:</small> <b><a title=\"".$row_resultf['title']."\" href=\"forum/index.php?showtopic=".$row_resultf['tid']."&view=getlastpost\">$topicstrip</a></b><br>"; } while($row_resultf = mysql_fetch_assoc($resultf)); mysql_free_result($resultf); echo $bt; return $bt; ?> А здесь PHP 7 Понимаю, что НУЖНО передать 2 параметра вместо одного, но КАКИЕ и КУДА сообразить не могу. [Wed Mar 04 20:32:01.637185 2020] [cgi:error] [pid 2998009] [client ] AH01215: PHP Warning: mysqli_query() expects at least 2 parameters, 1 given in /test.php on line 28 [Wed Mar 04 20:32:01.637479 2020] [cgi:error] [pid 2998009] [client] AH01215: PHP Warning: mysqli_query() expects parameter 1 to be mysqli, string given in /test.php on line 31 [Wed Mar 04 20:32:01.637674 2020] [cgi:error] [pid 2998009] [client ] AH01215: PHP Warning: mysqli_error() expects exactly 1 parameter, 0 given in /test.php on line 31 //====[Если не знаем PHP - дальше ничего не трогаем ]========= $ipb_db = mysqli_connect("$host", "$username", "$password", "$database"); $rd = "SET CHARACTER SET UTF-8"; IF (!$result = mysqli_query($rd)) { ECHO "ERROR!!!\n"; } $resultf = mysqli_query("SELECT tid, title, state, posts, starter_id, last_poster_id, last_post, starter_name, last_poster_name, views, topic_hasattach FROM ".$prefix."topics WHERE (forum_id NOT IN ($forumexclude)) ORDER BY last_post DESC LIMIT $num",$ipb_db) or die(mysqli_error()); $row_resultf = mysqli_fetch_assoc($resultf); $totalRows_resultf = mysqli_num_rows($resultf); do { $topicstrip = $row_resultf['title']; if (strlen($topicstrip) > $topic_num_sym) { $topicstrip = substr($topicstrip,0,$topic_num_sym); $topicstrip = $topicstrip."..."; } $status = ($row_resultf['state'] == "closed") ? "<img src=\"forum/style_images/$img_path/f_closed.gif\" border=\"0\" alt=\"Тема закрыта\">" : ""; $attach = ($row_resultf['topic_hasattach'] == "1") ? "<img src=\"temp/A-Vector/images/files.gif\" border=\"0\" alt=\"В сообщении есть прикрепленные файлы\"> " : ""; $last_date = date($time,$row_resultf['last_post']); $bt.= "<small class=\"3\">$last_date:</small> <b><a title=\"".$row_resultf['title']."\" href=\"forum/index.php?showtopic=".$row_resultf['tid']."&view=getlastpost\">$topicstrip</a></b><br>"; } while($row_resultf = mysqli_fetch_assoc($resultf)); mysqli_free_result($resultf); echo $bt; return $bt; ?>

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.