Skip to content

Commit

Permalink
Merge pull request #33 from mobilecms-pro/master
Browse files Browse the repository at this point in the history
исправлены ошибки инсталятора, вывода последних тем форума
  • Loading branch information
KpuTuK authored Oct 5, 2019
2 parents f17772c + 1e427df commit 2e03e39
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 9 additions & 3 deletions install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,14 @@
$dump = str_replace('{CMS_VERSION}', '2.7.1 beta', $dump);

$queryes = explode('//=====================================//', $dump);
$i = 0;
$success = 0;
$errors = [];
foreach ($queryes as $query) {
if (@mysqli_query($link, trim($query))) {
$i++;
$success++;
continue;
}
$errors[] = mysqli_error($link);
}

# Создаем файл конфигурации системы
Expand All @@ -204,7 +207,10 @@
<p>
<?php echo 'Запросов отправлено: ' . count($queryes); ?>
<br />
<?php echo 'Успешно : ' . count($queryes); ?>
<?php echo 'Успешно: ' . $success; ?>
<br />
<?php echo 'Ошибки '. count($errors) .' <br />: ';
echo implode('<br />', $errors) ?>
<br />
Файл конфигурации системы успешно создан, дамп базы данных залит.
</p>
Expand Down
6 changes: 3 additions & 3 deletions install/system_dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ CREATE TABLE IF NOT EXISTS `a_modules` (
`installed` tinyint(1) NOT NULL,
`status` enum('on','off') NOT NULL default 'off',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=24 ;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
//=====================================//
INSERT INTO `a_modules` (`id`, `name`, `title`, `admin_link`, `description`, `installed`, `status`) VALUES
(5, 'downloads', 'Загрузки', 'downloads/admin', 'Модуль загрузок', 1, 'on'),
Expand All @@ -281,7 +281,7 @@ INSERT INTO `a_modules` (`id`, `name`, `title`, `admin_link`, `description`, `in
(21, 'html', 'HTML/текстовые вставки', '', 'HTML/текстовые вставки в главную страницу', 1, 'on'),
(22, 'lib', 'Библиотека', 'lib/admin', 'Модуль библиотеки', 1, 'on'),
(23, 'photo', 'Фотоальбомы', '', 'Модуль фотоальбомов', 1, 'on'),
(24, 'blog', 'Блоги', '', 'Модуль блогов', 1, 'on'),
(24, 'blog', 'Блоги', '', 'Модуль блогов', 1, 'on');
//=====================================//
CREATE TABLE IF NOT EXISTS `a_news` (
`news_id` int(11) NOT NULL auto_increment,
Expand Down Expand Up @@ -541,7 +541,7 @@ INSERT INTO a_config (`id`, `module`, `key` , `value`) VALUES
(NULL , 'user', 'user_moderate', '1'),
(NULL , 'user', 'registration_stop', '0'),
(NULL , 'downloads', 'user_upload', '1'),
(NULL , 'downloads', 'moderation', '0'),
(NULL , 'downloads', 'moderation', '0');
//=====================================//
CREATE TABLE IF NOT EXISTS a_guests (
`id` int(11) NOT NULL auto_increment,
Expand Down
2 changes: 1 addition & 1 deletion modules/forum/helpers/forum_widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function display($widget_id)
$topics = $db->get_array('SELECT SQL_CALC_FOUND_ROWS ft.*, u.username AS last_username
FROM #__forum_topics AS ft
INNER JOIN #__users AS u ON ft.last_user_id = u.user_id
ORDER BY ft.time DESC
ORDER BY ft.last_message_time DESC
LIMIT 0, 4');
foreach($topics as $topic){
$text .= '<div class="menu">'.
Expand Down

0 comments on commit 2e03e39

Please sign in to comment.