diff --git a/README.md b/README.md index 7b6e9945d..0512f8c16 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ * **Author:** Bugo [dragomano.ru](https://dragomano.ru/mods/light-portal) * **License:** [BSD 3](https://github.com/dragomano/Light-Portal/blob/master/LICENSE) * **Compatible with:** SMF 2.1 RC2+ / PHP 7.2+ -* **Tested on:** PHP 7.0-7.3 / MariaDB 10.3 / PostgreSQL 9.6 +* **Tested on:** PHP 7.3.13 / MariaDB 10.3.13 / PostgreSQL 9.6.12 * **Hooks only:** Yes * **Languages:** English, Russian, Ukrainian diff --git a/Sources/LightPortal/Block.php b/Sources/LightPortal/Block.php index 85ffe0e3c..f20c174d0 100644 --- a/Sources/LightPortal/Block.php +++ b/Sources/LightPortal/Block.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://opensource.org/licenses/BSD-3-Clause BSD * - * @version 0.2 + * @version 0.3 */ if (!defined('SMF')) @@ -84,7 +84,6 @@ public static function manage() { global $context, $txt; - isAllowedTo('light_portal_manage'); loadTemplate('LightPortal/ManageBlocks'); $context['page_title'] = $txt['lp_portal'] . ' - ' . $txt['lp_blocks_manage']; @@ -299,7 +298,6 @@ public static function add() { global $context, $txt, $scripturl; - isAllowedTo('light_portal_manage'); loadTemplate('LightPortal/ManageBlocks'); $context['page_title'] = $txt['lp_portal'] . ' - ' . $txt['lp_blocks_add_title']; @@ -340,8 +338,6 @@ public static function edit() { global $context, $txt, $user_info, $scripturl; - isAllowedTo('light_portal_manage'); - $item = !empty($_REQUEST['block_id']) ? (int) $_REQUEST['block_id'] : null; $item = $item ?: (!empty($_REQUEST['id']) ? (int) $_REQUEST['id'] : null); diff --git a/Sources/LightPortal/Integration.php b/Sources/LightPortal/Integration.php index 2a85404b5..5493195f2 100644 --- a/Sources/LightPortal/Integration.php +++ b/Sources/LightPortal/Integration.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://opensource.org/licenses/BSD-3-Clause BSD * - * @version 0.2 + * @version 0.3 */ if (!defined('SMF')) @@ -67,7 +67,7 @@ public static function userInfo() global $sourcedir; $lp_constants = [ - 'LP_VERSION' => '0.1', + 'LP_VERSION' => '0.3', 'LP_NAME' => 'Light Portal', 'LP_ADDONS' => $sourcedir . '/LightPortal/addons' ]; @@ -86,6 +86,9 @@ public static function loadTheme() { global $txt; + if (!defined('LP_NAME')) + return; + loadLanguage('LightPortal/'); Subs::runAddons(); @@ -182,8 +185,11 @@ public static function menuButtons(&$buttons) if (!defined('LP_NAME')) return; + $context['allow_light_portal_manage'] = allowedTo('light_portal_manage'); + // Display "Portal settings" in Main Menu => Admin | Отображение пункта "Настройки портала" - if ($context['allow_admin']) { + if ($context['allow_light_portal_manage']) { + $buttons['admin']['show'] = true; $counter = 0; foreach ($buttons['admin']['sub_buttons'] as $area => $dummy) { $counter++; @@ -193,11 +199,11 @@ public static function menuButtons(&$buttons) $buttons['admin']['sub_buttons'] = array_merge( array_slice($buttons['admin']['sub_buttons'], 0, $counter, true), - array( - 'portalsettings' => array( + allowedTo('admin_forum') ? array( + 'portal_settings' => array( 'title' => $txt['lp_settings'], 'href' => $scripturl . '?action=admin;area=lp_settings', - 'show' => allowedTo('admin_forum'), + 'show' => true, 'sub_buttons' => array( 'blocks' => array( 'title' => $txt['lp_blocks'], @@ -212,6 +218,17 @@ public static function menuButtons(&$buttons) ) ) ) + ) : array( + 'portal_blocks' => array( + 'title' => $txt['lp_blocks'], + 'href' => $scripturl . '?action=admin;area=lp_blocks', + 'show' => true + ), + 'portal_pages' => array( + 'title' => $txt['lp_pages'], + 'href' => $scripturl . '?action=admin;area=lp_pages', + 'show' => true + ) ), array_slice($buttons['admin']['sub_buttons'], $counter, null, true) ); @@ -308,7 +325,6 @@ public static function loadIllegalGuestPermissions() public static function loadPermissions(&$permissionGroups, &$permissionList, &$leftPermissionGroups) { $permissionList['membergroup']['light_portal_view'] = array(false, 'light_portal'); - $permissionList['membergroup']['light_portal_manage'] = array(false, 'light_portal'); $leftPermissionGroups[] = 'light_portal'; } diff --git a/Sources/LightPortal/Page.php b/Sources/LightPortal/Page.php index 2689e030b..be374d370 100644 --- a/Sources/LightPortal/Page.php +++ b/Sources/LightPortal/Page.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://opensource.org/licenses/BSD-3-Clause BSD * - * @version 0.2 + * @version 0.3 */ if (!defined('SMF')) @@ -85,7 +85,6 @@ public static function manage() { global $context, $txt, $modSettings, $scripturl, $sourcedir; - isAllowedTo('light_portal_manage'); loadTemplate('LightPortal/ManagePages'); $context['page_title'] = $txt['lp_portal'] . ' - ' . $txt['lp_pages_manage']; @@ -95,7 +94,8 @@ public static function manage() 'description' => $txt['lp_pages_manage_tab_description'] ); - $context['template_layers'][] = 'manage_pages'; + if (allowedTo('admin_forum')) + $context['template_layers'][] = 'manage_pages'; self::postActions(); @@ -241,11 +241,14 @@ public static function getAll($start, $items_per_page, $sort) global $smcFunc, $context; $request = $smcFunc['db_query']('', ' - SELECT page_id, title, alias, type, status, num_views, GREATEST(created_at, updated_at) AS date - FROM {db_prefix}lp_pages + SELECT page_id, author_id, title, alias, type, status, num_views, GREATEST(created_at, updated_at) AS date + FROM {db_prefix}lp_pages' . (allowedTo('admin_forum') ? '' : ' + WHERE author_id = {int:user_id}') . ' ORDER BY ' . $sort . ', page_id LIMIT ' . $start . ', ' . $items_per_page, - array() + array( + 'user_id' => $context['user']['id'] + ) ); $items = []; @@ -282,14 +285,16 @@ public static function getAll($start, $items_per_page, $sort) */ public static function getTotalQuantity() { - global $smcFunc; + global $smcFunc, $context; $request = $smcFunc['db_query']('', ' SELECT COUNT(page_id) FROM {db_prefix}lp_pages - WHERE alias != {string:alias}', + WHERE alias != {string:alias}' . (allowedTo('admin_forum') ? '' : ' + AND author_id = {int:user_id}'), array( - 'alias' => '/' + 'alias' => '/', + 'user_id' => $context['user']['id'] ) ); @@ -380,12 +385,11 @@ public static function add() { global $context, $txt, $scripturl; - isAllowedTo('light_portal_manage'); loadTemplate('LightPortal/ManagePages'); - $context['page_title'] = $txt['lp_portal'] . ' - ' . $txt['lp_pages_add_title']; + $context['page_title'] = $txt['lp_portal'] . ' - ' . $txt['lp_pages_add_title']; $context['page_area_title'] = $txt['lp_pages_add_title']; - $context['canonical_url'] = $scripturl . '?action=admin;area=lp_pages;sa=add'; + $context['canonical_url'] = $scripturl . '?action=admin;area=lp_pages;sa=add'; $context[$context['admin_menu_name']]['tab_data'] = array( 'title' => LP_NAME, @@ -411,7 +415,6 @@ public static function edit() { global $context, $txt, $scripturl; - isAllowedTo('light_portal_manage'); loadTemplate('LightPortal/ManagePages'); $item = !empty($_REQUEST['page_id']) ? (int) $_REQUEST['page_id'] : null; @@ -431,10 +434,13 @@ public static function edit() $context['lp_page'] = self::getData($item, is_int($item) ? false : true); + if (!$context['lp_page']['can_edit']) + fatal_lang_error('lp_page_not_editable', false); + self::validateData(); $context['page_area_title'] = $txt['lp_pages_edit_title'] . ' - ' . $context['lp_page']['title']; - $context['canonical_url'] = $scripturl . '?action=admin;area=lp_pages;sa=edit;id=' . $context['lp_page']['id']; + $context['canonical_url'] = $scripturl . '?action=admin;area=lp_pages;sa=edit;id=' . $context['lp_page']['id']; self::prepareFormFields(); self::prepareEditor(); @@ -717,6 +723,7 @@ public static function setData($item = null) $item = $smcFunc['db_insert']('', '{db_prefix}lp_pages', array_merge(array( + 'author_id' => 'int', 'title' => 'string-255', 'alias' => 'string-255', 'description' => 'string-255', @@ -727,6 +734,7 @@ public static function setData($item = null) 'created_at' => 'int' ), $db_type == 'postgresql' ? array('page_id' => 'int') : array()), array_merge(array( + $context['user']['id'], $context['lp_page']['title'], $context['lp_page']['alias'], $context['lp_page']['description'], @@ -799,14 +807,14 @@ private static function getAutoIncrementValue() */ public static function getData($item, $useAlias = true) { - global $smcFunc; + global $smcFunc, $user_info; if (empty($item)) return; if (($data = cache_get_data('light_portal_page_' . $item, 3600)) == null) { $request = $smcFunc['db_query']('', ' - SELECT page_id, title, alias, description, keywords, content, type, permissions, status, created_at, updated_at + SELECT page_id, author_id, title, alias, description, keywords, content, type, permissions, status, created_at, updated_at FROM {db_prefix}lp_pages WHERE ' . ($useAlias ? 'alias = {string' : 'page_id = {int') . ':item} LIMIT 1', @@ -825,6 +833,7 @@ public static function getData($item, $useAlias = true) $data = array( 'id' => $row['page_id'], + 'author_id' => $row['author_id'], 'title' => $row['title'], 'alias' => $row['alias'], 'description' => $row['description'], @@ -835,7 +844,8 @@ public static function getData($item, $useAlias = true) 'status' => $row['status'], 'created_at' => $row['created_at'], 'updated_at' => $row['updated_at'], - 'can_show' => Subs::canShowItem($row['permissions']) + 'can_show' => Subs::canShowItem($row['permissions']), + 'can_edit' => $user_info['is_admin'] || (allowedTo('light_portal_manage') && $row['author_id'] == $user_info['id']) ); } diff --git a/Sources/LightPortal/Settings.php b/Sources/LightPortal/Settings.php index c661dfbe1..e7a0396c9 100644 --- a/Sources/LightPortal/Settings.php +++ b/Sources/LightPortal/Settings.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://opensource.org/licenses/BSD-3-Clause BSD * - * @version 0.2 + * @version 0.3 */ if (!defined('SMF')) @@ -31,7 +31,6 @@ public static function adminAreas(&$admin_areas) global $sourcedir, $txt; require_once($sourcedir . '/ManageSettings.php'); - loadLanguage('ManageSettings'); // Looking for the "Forum" section... | Ищем раздел "Форум"... @@ -43,7 +42,7 @@ public static function adminAreas(&$admin_areas) array( 'lp_portal' => array( 'title' => $txt['lp_portal'], - 'permission' => array('admin_forum', 'moderate_forum', 'light_portal_manage'), + 'permission' => array('admin_forum', 'light_portal_manage'), 'areas' => array( 'lp_settings' => array( 'label' => $txt['settings'], @@ -51,7 +50,7 @@ public static function adminAreas(&$admin_areas) self::settingArea(); }, 'icon' => 'features', - 'permission' => array('admin_forum', 'light_portal_manage'), + 'permission' => array('admin_forum'), 'subsections' => array() ), 'lp_blocks' => array( @@ -110,8 +109,6 @@ public static function settingArea($return_config = false) { global $sourcedir, $txt, $scripturl, $db_type, $context, $modSettings; - isAllowedTo('light_portal_manage'); - require_once($sourcedir . '/ManageServer.php'); $databases = self::getDatabases(); @@ -121,8 +118,6 @@ public static function settingArea($return_config = false) 'description' => sprintf($txt['lp_php_mysql_info'], LP_VERSION, phpversion(), $databases[$db_type]['name'], eval($databases[$db_type]['version_check'])) ); - $context['permissions_excluded']['light_portal_manage'] = array(-1); - $context['page_title'] = $txt['lp_settings']; $context['settings_title'] = $txt['settings']; $context['post_url'] = $scripturl . '?action=admin;area=lp_settings;save'; @@ -212,9 +207,7 @@ public static function blockArea() 'edit' => 'Block::edit' ); - loadGeneralSettingParameters($subActions, 'main'); - - call_helper(__NAMESPACE__ . '\\' . $subActions[$_REQUEST['sa']]); + self::loadGeneralSettingParameters($subActions, 'main'); } /** @@ -231,7 +224,31 @@ public static function pageArea() 'edit' => 'Page::edit' ); - loadGeneralSettingParameters($subActions, 'main'); + self::loadGeneralSettingParameters($subActions, 'main'); + } + + /** + * Calls the requested subaction if it does exist; otherwise, calls the default action + * Вызывает метод, если он существует; в противном случае вызывается метод по умолчанию + * + * @param array $subActions + * @param string $defaultAction + * @return void + */ + private static function loadGeneralSettingParameters($subActions = [], $defaultAction = null) + { + global $sourcedir, $context; + + isAllowedTo('light_portal_manage'); + + require_once($sourcedir . '/ManageServer.php'); + + $context['sub_template'] = 'show_settings'; + + $defaultAction = $defaultAction ?: key($subActions); + + $_REQUEST['sa'] = isset($_REQUEST['sa'], $subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : $defaultAction; + $context['sub_action'] = $_REQUEST['sa']; call_helper(__NAMESPACE__ . '\\' . $subActions[$_REQUEST['sa']]); } diff --git a/Sources/LightPortal/Subs.php b/Sources/LightPortal/Subs.php index 017f0c5b6..13a9f4b7e 100644 --- a/Sources/LightPortal/Subs.php +++ b/Sources/LightPortal/Subs.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://opensource.org/licenses/BSD-3-Clause BSD * - * @version 0.2 + * @version 0.3 */ if (!defined('SMF')) @@ -407,12 +407,12 @@ public static function getForumLanguages() public static function getTitleClasses() { return [ - 'div.cat_bar > h3.catbg' => '

%1$s

', - 'div.title_bar > h3.titlebg' => '

%1$s

', - 'div.title_bar > h4.titlebg' => '

%1$s

', - 'div.sub_bar > h3.subbg' => '

%1$s

', - 'div.sub_bar > h4.subbg' => '

%1$s

', - 'div.errorbox > h3' => '

%1$s

' + 'div.cat_bar > h3.catbg' => '

%1$s%3$s

', + 'div.title_bar > h3.titlebg' => '

%1$s%3$s

', + 'div.title_bar > h4.titlebg' => '

%1$s%3$s

', + 'div.sub_bar > h3.subbg' => '

%1$s%3$s

', + 'div.sub_bar > h4.subbg' => '

%1$s%3$s

', + 'div.errorbox > h3' => '
%1$s%3$s
' ]; } @@ -425,14 +425,14 @@ public static function getTitleClasses() public static function getContentClasses() { return [ - 'div.roundframe.noup' => '
%1$s
', - 'div.roundframe' => '
%1$s
', - 'div.windowbg' => '
%1$s
', - 'div.information' => '
%1$s
', - 'div.errorbox' => '
%1$s
', - 'div.noticebox' => '
%1$s
', - 'div.infobox' => '
%1$s
', - 'div.descbox' => '
%1$s
', + 'div.roundframe.noup' => '
%1$s
', + 'div.roundframe' => '
%1$s
', + 'div.windowbg' => '
%1$s
', + 'div.information' => '
%1$s
', + 'div.errorbox' => '
%1$s
', + 'div.noticebox' => '
%1$s
', + 'div.infobox' => '
%1$s
', + 'div.descbox' => '
%1$s
', '_' => '%1$s' ]; } diff --git a/Sources/LightPortal/addons/BoardList/BoardList.php b/Sources/LightPortal/addons/BoardList/BoardList.php index ee7b1e49a..128b5867d 100644 --- a/Sources/LightPortal/addons/BoardList/BoardList.php +++ b/Sources/LightPortal/addons/BoardList/BoardList.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://opensource.org/licenses/BSD-3-Clause BSD * - * @version 0.2 + * @version 0.3 */ if (!defined('SMF')) @@ -45,8 +45,8 @@ public static function blockOptions(&$options) $options['boardlist'] = array( 'no_content_class' => true, 'parameters' => array( - 'category_class' => 'div.title_bar > h4.titlebg', - 'board_class' => 'div.roundframe.noup' + 'category_class' => 'div.title_bar > h4.titlebg', + 'board_class' => 'div.roundframe.noup' ) ); } diff --git a/Sources/LightPortal/addons/BoardList/template.php b/Sources/LightPortal/addons/BoardList/template.php index cff712ed8..cc9d8e0fa 100644 --- a/Sources/LightPortal/addons/BoardList/template.php +++ b/Sources/LightPortal/addons/BoardList/template.php @@ -2,33 +2,34 @@ global $context, $scripturl; -if (!empty($context['lp_boardlist'])) { - foreach ($context['lp_boardlist'] as $category) { - echo sprintf($context['lp_all_title_classes'][$parameters['category_class']], $category['name'], ''); +if (empty($context['lp_boardlist'])) + return; - echo ' - - + '; } diff --git a/Sources/LightPortal/addons/Parsedown/Parsedown.php b/Sources/LightPortal/addons/Parsedown/Parsedown.php index 96ede51fc..4c4da3795 100644 --- a/Sources/LightPortal/addons/Parsedown/Parsedown.php +++ b/Sources/LightPortal/addons/Parsedown/Parsedown.php @@ -11,7 +11,7 @@ * @copyright 2019-2020 Bugo * @license https://opensource.org/licenses/BSD-3-Clause BSD * - * @version 0.1 + * @version 0.3 */ if (!defined('SMF')) diff --git a/Sources/LightPortal/addons/RecentTopics/RecentTopics.php b/Sources/LightPortal/addons/RecentTopics/RecentTopics.php new file mode 100644 index 000000000..587ece07e --- /dev/null +++ b/Sources/LightPortal/addons/RecentTopics/RecentTopics.php @@ -0,0 +1,127 @@ + + * @copyright 2019-2020 Bugo + * @license https://opensource.org/licenses/BSD-3-Clause BSD + * + * @version 0.3 + */ + +if (!defined('SMF')) + die('Hacking attempt...'); + +class RecentTopics +{ + /** + * Добавляем заголовок и описание блока + * + * @return void + */ + public static function lang() + { + global $user_info, $txt; + + require_once(__DIR__ . '/langs/' . $user_info['language'] . '.php'); + + $txt['lp_block_types']['recent_topics'] = $txt['lp_recent_topics_addon_title']; + $txt['lp_block_types_descriptions']['recent_topics'] = $txt['lp_recent_topics_addon_desc']; + } + + /** + * Добавляем параметры блока + * + * @param array $options + * @return void + */ + public static function blockOptions(&$options) + { + $options['recent_topics'] = array( + 'parameters' => array( + 'num_topics' => 10 + ) + ); + } + + /** + * Валидируем параметры + * + * @param array $args + * @return void + */ + public static function validateBlockData(&$args) + { + global $context; + + if ($context['current_block']['type'] !== 'recent_topics') + return; + + $args['num_topics'] = FILTER_VALIDATE_INT; + } + + /** + * Добавляем поля конкретно для этого блока + * + * @return void + */ + public static function prepareBlockFields() + { + global $context, $txt; + + if ($context['lp_block']['type'] !== 'recent_topics') + return; + + $context['posting_fields']['num_topics']['label']['text'] = $txt['lp_recent_topics_addon_num_topics']; + $context['posting_fields']['num_topics']['input'] = array( + 'type' => 'number', + 'attributes' => array( + 'id' => 'num_topics', + 'value' => $context['lp_block']['options']['parameters']['num_topics'] + ), + 'options' => array() + ); + } + + /** + * Формируем контент блока + * + * @param string $content + * @param string $type + * @param int $block_id + * @return void + */ + public static function prepareContent(&$content, $type, $block_id) + { + global $context, $boarddir, $txt; + + if ($type !== 'recent_topics') + return; + + $parameters = $context['lp_active_blocks'][$block_id]['parameters'] ?? $context['lp_block']['options']['parameters']; + + if (($recent_topics = cache_get_data('light_portal_recent_topics_addon', 3600)) == null) { + require_once($boarddir . '/SSI.php'); + + $recent_topics = ssi_recentTopics($parameters['num_topics'], null, null, 'array'); + + cache_put_data('light_portal_recent_topics_addon', $recent_topics, 3600); + } + + ob_start(); + + foreach ($recent_topics as $topic) { + echo ' +
+ ', ($topic['is_new'] ? '' . $txt['new'] . '' : ''), $topic['icon'], ' ', $topic['link'], ' ', $txt['by'], ' ', $topic['poster']['link'], '
', $topic['time'], ' +
'; + } + + $content = ob_get_clean(); + } +} diff --git a/Sources/LightPortal/addons/RecentTopics/index.php b/Sources/LightPortal/addons/RecentTopics/index.php new file mode 100644 index 000000000..69278ce68 --- /dev/null +++ b/Sources/LightPortal/addons/RecentTopics/index.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/Sources/LightPortal/addons/RecentTopics/langs/english.php b/Sources/LightPortal/addons/RecentTopics/langs/english.php new file mode 100644 index 000000000..c6e1ee25d --- /dev/null +++ b/Sources/LightPortal/addons/RecentTopics/langs/english.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/Sources/LightPortal/addons/RecentTopics/langs/russian.php b/Sources/LightPortal/addons/RecentTopics/langs/russian.php new file mode 100644 index 000000000..d67e8051d --- /dev/null +++ b/Sources/LightPortal/addons/RecentTopics/langs/russian.php @@ -0,0 +1,6 @@ + -
'; +
'; } // The output of blocks AFTER content | Вывод блоков после контента @@ -136,18 +136,28 @@ function template_portal_below() // Output the title and content of the block | Вывод заголовка и содержимого блока function lp_show_block($block) { - global $context; + global $context, $scripturl, $txt; echo '
'; + if ($context['allow_light_portal_manage']) + $edit_link = ''; + + if (!empty($block['title_style'])) + $style = ' style="' . $block['title_style'] . '"'; + if (!empty($block['title_class'])) - echo sprintf($context['lp_all_title_classes'][$block['title_class']], $block['title'], $block['title_style']); + echo sprintf($context['lp_all_title_classes'][$block['title_class']], $block['title'], $style ?? '', $edit_link ?? ''); else echo $block['title']; + $style = ''; + if (!empty($block['content_style'])) + $style = ' style="' . $block['content_style'] . '"'; + if (!empty($block['content_class'])) - echo sprintf($context['lp_all_content_classes'][$block['content_class']], $block['content'], $block['content_style']); + echo sprintf($context['lp_all_content_classes'][$block['content_class']], $block['content'], $style); else echo $block['content']; diff --git a/Themes/default/LightPortal/ViewPage.template.php b/Themes/default/LightPortal/ViewPage.template.php index 2be73d443..fc240a39c 100644 --- a/Themes/default/LightPortal/ViewPage.template.php +++ b/Themes/default/LightPortal/ViewPage.template.php @@ -7,9 +7,9 @@ function template_show_page() echo '
-

', $context['page_title'], $context['user']['is_admin'] ? '' : '', '

+

', $context['page_title'], $context['lp_page']['can_edit'] ? '' : '', '

-
+
', $context['lp_page']['content'], '
'; } diff --git a/Themes/default/languages/LightPortal/.english.php b/Themes/default/languages/LightPortal/.english.php index d239ff689..fbe355034 100644 --- a/Themes/default/languages/LightPortal/.english.php +++ b/Themes/default/languages/LightPortal/.english.php @@ -1,126 +1,129 @@ -%1$s, PHP version: %2$s, %3$s version: %4$s.'; -$txt['lp_main_page_title'] = 'The main page title'; -$txt['lp_main_page_disable'] = 'Disable the main page'; -$txt['lp_standalone'] = 'Standalone mode'; -$txt['lp_standalone_help'] = 'Everything except portal pages and ignored areas will be disabled.'; -$txt['lp_standalone_excluded_actions'] = 'Ignored actions'; -$txt['lp_standalone_excluded_actions_subtext'] = 'Specify the areas that should remain available offline.'; -$txt['lp_page_editor_type_default'] = 'The type of page editor by default'; -$txt['lp_num_per_page'] = 'Maximum number of items in the page list (for pagination)'; -$txt['groups_light_portal_view'] = 'Who can view the portal elements'; -$txt['groups_light_portal_manage'] = 'Who can manage the portal'; - -// Actions -$txt['lp_title'] = 'Title'; -$txt['lp_actions'] = 'Actions'; -$txt['lp_action_on'] = 'Enable'; -$txt['lp_action_off'] = 'Disable'; -$txt['lp_action_move'] = 'Move'; - -// Blocks -$txt['lp_blocks'] = 'Blocks'; -$txt['lp_blocks_manage'] = 'Manage blocks'; -$txt['lp_blocks_manage_tab_description'] = 'All created portal blocks are listed here. To add an additional block, use the corresponding button.'; -$txt['lp_blocks_add'] = 'Add block'; -$txt['lp_blocks_add_title'] = 'Adding block'; -$txt['lp_blocks_add_tab_description'] = 'There are not many blocks yet, but the most universal ones are exist - play with them :)'; -$txt['lp_blocks_add_instruction'] = 'Select the desired block by clicking on it.'; -$txt['lp_blocks_edit_title'] = 'Editing block'; -$txt['lp_blocks_edit_tab_description'] = $txt['lp_blocks_add_tab_description']; -$txt['lp_block_content'] = 'Content'; -$txt['lp_block_icon_cheatsheet'] = ''; -$txt['lp_block_type'] = 'Block type'; -$txt['lp_block_priority'] = 'Priority'; -$txt['lp_block_placement'] = 'Placement'; - -$txt['lp_block_placement_set'] = array( - 'header' => 'Header', - 'top' => 'Center (top)', - 'left' => 'Left side', - 'right' => 'Right side', - 'bottom' => 'Center (bottom)', - 'footer' => 'Footer' -); - -$txt['lp_block_areas'] = 'Actions'; -$txt['lp_block_areas_subtext'] = '
Specify one or more areas (separate by comma) to display the block in:
-
    -
  • all — display everywhere
  • -
  • forum — display only on the forum area
  • -
  • portal — display only on the portal area (including pages)
  • -
  • custom_action — display on area index.php?action=custom_action
  • -
  • page=alias — display on page index.php?page=alias
  • -
'; -$txt['lp_block_title_class'] = 'CSS title class'; -$txt['lp_block_title_style'] = 'CSS title style'; -$txt['lp_block_content_class'] = 'CSS content class'; -$txt['lp_block_content_style'] = 'CSS content class'; - -$txt['lp_block_types'] = array( - 'bbc' => 'Custom BBC', - 'html' => 'Custom HTML', - 'php' => 'Custom PHP' -); -$txt['lp_block_types_descriptions'] = array( - 'bbc' => 'In this block, any BB tags of the forum can be used as content.', - 'html' => 'In this block, you can use any HTML tags as content.', - 'php' => 'In this block, you can use any PHP code as content.' -); - -// Pages -$txt['lp_pages'] = 'Pages'; -$txt['lp_pages_main'] = 'The main page'; -$txt['lp_pages_manage'] = 'Manage pages'; -$txt['lp_pages_manage_tab_description'] = 'All created portal pages are listed here. To add a new page, use the corresponding button.'; -$txt['lp_pages_add'] = 'Add page'; -$txt['lp_pages_add_title'] = 'Adding page'; -$txt['lp_pages_add_tab_description'] = 'Pay special attention to thepage alias — it is used in the address bar and can only contain Latin characters and numbers!
The main page always has an alias equal to "/".'; -$txt['lp_pages_edit_title'] = 'Editing page'; -$txt['lp_pages_edit_tab_description'] = $txt['lp_pages_add_tab_description']; -$txt['lp_extra_pages'] = 'Additional pages'; -$txt['lp_page_types'] = array('bbc' => 'BBC', 'html' => 'HTML', 'php' => 'PHP'); -$txt['lp_page_alias'] = 'Alias'; -$txt['lp_page_content'] = $txt['lp_block_content']; -$txt['lp_page_type'] = 'Page type'; -$txt['lp_page_description'] = 'Description'; -$txt['lp_page_keywords'] = 'Keywords'; -$txt['lp_permissions'] = array('Show to admins', 'Show to guests', 'Show to members', 'Show to everybody'); -$txt['lp_no_items'] = 'There is nothing yet. Let\'s add?'; - -// Errors -$txt['lp_page_not_found'] = 'Page not found!'; -$txt['lp_block_not_found'] = 'Block not found!'; -$txt['lp_post_error_no_title'] = 'The title field was not filled out. It is required.'; -$txt['lp_post_error_no_alias'] = 'The alias field was not filled out. It is required.'; -$txt['lp_post_error_no_valid_alias'] = 'The specified alias is not correct!'; -$txt['lp_post_error_no_unique_alias'] = 'A page with this alias already exists!'; -$txt['lp_post_error_no_content'] = 'The content not specified! It is required.'; -$txt['lp_post_error_no_areas'] = 'The areas field was not filled out. It is required.'; - -// Who -$txt['lp_who_main'] = 'Viewing the main portal page.'; -$txt['lp_who_page'] = 'Viewing the portal page.'; - -// Permissions -$txt['permissiongroup_light_portal'] = LP_NAME; -$txt['permissionname_light_portal_view'] = $txt['group_perms_name_light_portal_view'] = 'View the portal'; -$txt['permissionname_light_portal_manage'] = $txt['group_perms_name_light_portal_manage'] = 'Manage the portal'; -$txt['permissionhelp_light_portal_view'] = 'Ability to view portal pages and blocks.'; -$txt['permissionhelp_light_portal_manage'] = 'Access to manage portal pages and blocks, as well as its settings.'; -$txt['cannot_light_portal_view'] = 'Sorry, you are not allowed to view the portal!'; -$txt['cannot_light_portal_manage'] = 'Sorry, you are not allowed to manage the portal!'; -$txt['cannot_light_portal_view_page'] = 'Sorry, you are not allowed to view this page!'; +%1$s, PHP version: %2$s, %3$s version: %4$s.'; +$txt['lp_main_page_title'] = 'The main page title'; +$txt['lp_main_page_disable'] = 'Disable the main page'; +$txt['lp_standalone'] = 'Standalone mode'; +$txt['lp_standalone_help'] = 'Everything except portal pages and ignored areas will be disabled.'; +$txt['lp_standalone_excluded_actions'] = 'Ignored actions'; +$txt['lp_standalone_excluded_actions_subtext'] = 'Specify the areas that should remain available offline.'; +$txt['lp_page_editor_type_default'] = 'The type of page editor by default'; +$txt['lp_num_per_page'] = 'Maximum number of items in the page list (for pagination)'; +$txt['lp_page_og_image'] = 'Use an image within the page content for the og-image metatag'; +$txt['lp_page_og_image_set'] = array('None', 'First found', 'Last found'); +$txt['groups_light_portal_view'] = 'Who can view the portal elements'; +$txt['groups_light_portal_manage'] = 'Who can manage the portal'; + +// Actions +$txt['lp_title'] = 'Title'; +$txt['lp_actions'] = 'Actions'; +$txt['lp_action_on'] = 'Enable'; +$txt['lp_action_off'] = 'Disable'; +$txt['lp_action_move'] = 'Move'; + +// Blocks +$txt['lp_blocks'] = 'Blocks'; +$txt['lp_blocks_manage'] = 'Manage blocks'; +$txt['lp_blocks_manage_tab_description'] = 'All created portal blocks are listed here. To add an additional block, use the corresponding button.'; +$txt['lp_blocks_add'] = 'Add block'; +$txt['lp_blocks_add_title'] = 'Adding block'; +$txt['lp_blocks_add_tab_description'] = 'There are not many blocks yet, but the most universal ones are exist - play with them :)'; +$txt['lp_blocks_add_instruction'] = 'Select the desired block by clicking on it.'; +$txt['lp_blocks_edit_title'] = 'Editing block'; +$txt['lp_blocks_edit_tab_description'] = $txt['lp_blocks_add_tab_description']; +$txt['lp_block_content'] = 'Content'; +$txt['lp_block_icon_cheatsheet'] = ''; +$txt['lp_block_type'] = 'Block type'; +$txt['lp_block_priority'] = 'Priority'; +$txt['lp_block_placement'] = 'Placement'; + +$txt['lp_block_placement_set'] = array( + 'header' => 'Header', + 'top' => 'Center (top)', + 'left' => 'Left side', + 'right' => 'Right side', + 'bottom' => 'Center (bottom)', + 'footer' => 'Footer' +); + +$txt['lp_block_areas'] = 'Actions'; +$txt['lp_block_areas_subtext'] = '
Specify one or more areas (separate by comma) to display the block in:
+
    +
  • all — display everywhere
  • +
  • forum — display only on the forum area
  • +
  • portal — display only on the portal area (including pages)
  • +
  • custom_action — display on area index.php?action=custom_action
  • +
  • page=alias — display on page index.php?page=alias
  • +
'; +$txt['lp_block_title_class'] = 'CSS title class'; +$txt['lp_block_title_style'] = 'CSS title style'; +$txt['lp_block_content_class'] = 'CSS content class'; +$txt['lp_block_content_style'] = 'CSS content class'; + +$txt['lp_block_types'] = array( + 'bbc' => 'Custom BBC', + 'html' => 'Custom HTML', + 'php' => 'Custom PHP' +); +$txt['lp_block_types_descriptions'] = array( + 'bbc' => 'In this block, any BB tags of the forum can be used as content.', + 'html' => 'In this block, you can use any HTML tags as content.', + 'php' => 'In this block, you can use any PHP code as content.' +); + +// Pages +$txt['lp_pages'] = 'Pages'; +$txt['lp_pages_main'] = 'The main page'; +$txt['lp_pages_manage'] = 'Manage pages'; +$txt['lp_pages_manage_tab_description'] = 'All created portal pages are listed here. To add a new page, use the corresponding button.'; +$txt['lp_pages_add'] = 'Add page'; +$txt['lp_pages_add_title'] = 'Adding page'; +$txt['lp_pages_add_tab_description'] = 'Pay special attention to the page alias — it is used in the address bar and can only contain Latin characters and numbers!
The main page always has an alias equal to "/".'; +$txt['lp_pages_edit_title'] = 'Editing page'; +$txt['lp_pages_edit_tab_description'] = $txt['lp_pages_add_tab_description']; +$txt['lp_extra_pages'] = 'Additional pages'; +$txt['lp_page_types'] = array('bbc' => 'BBC', 'html' => 'HTML', 'php' => 'PHP'); +$txt['lp_page_alias'] = 'Alias'; +$txt['lp_page_content'] = $txt['lp_block_content']; +$txt['lp_page_type'] = 'Page type'; +$txt['lp_page_description'] = 'Description'; +$txt['lp_page_keywords'] = 'Keywords'; +$txt['lp_permissions'] = array('Show to admins', 'Show to guests', 'Show to members', 'Show to everybody'); +$txt['lp_no_items'] = 'There is nothing yet. Let\'s add?'; + +// Errors +$txt['lp_page_not_found'] = 'Page not found!'; +$txt['lp_block_not_found'] = 'Block not found!'; +$txt['lp_post_error_no_title'] = 'The title field was not filled out. It is required.'; +$txt['lp_post_error_no_alias'] = 'The alias field was not filled out. It is required.'; +$txt['lp_post_error_no_valid_alias'] = 'The specified alias is not correct!'; +$txt['lp_post_error_no_unique_alias'] = 'A page with this alias already exists!'; +$txt['lp_post_error_no_content'] = 'The content not specified! It is required.'; +$txt['lp_post_error_no_areas'] = 'The areas field was not filled out. It is required.'; +$txt['lp_page_not_editable'] = 'You are not allowed to edit this page!'; + +// Who +$txt['lp_who_main'] = 'Viewing the main portal page.'; +$txt['lp_who_page'] = 'Viewing the portal page.'; + +// Permissions +$txt['permissiongroup_light_portal'] = LP_NAME; +$txt['permissionname_light_portal_view'] = $txt['group_perms_name_light_portal_view'] = 'View the portal'; +$txt['permissionname_light_portal_manage'] = $txt['group_perms_name_light_portal_manage'] = 'Manage the portal'; +$txt['permissionhelp_light_portal_view'] = 'Ability to view portal pages and blocks.'; +$txt['permissionhelp_light_portal_manage'] = 'Access to manage portal pages and blocks.'; +$txt['cannot_light_portal_view'] = 'Sorry, you are not allowed to view the portal!'; +$txt['cannot_light_portal_manage'] = 'Sorry, you are not allowed to manage the portal!'; +$txt['cannot_light_portal_view_page'] = 'Sorry, you are not allowed to view this page!'; diff --git a/Themes/default/languages/LightPortal/.russian.php b/Themes/default/languages/LightPortal/.russian.php index 72fb28348..a5e2dc59b 100644 --- a/Themes/default/languages/LightPortal/.russian.php +++ b/Themes/default/languages/LightPortal/.russian.php @@ -1,126 +1,129 @@ -%1$s, версия PHP: %2$s, версия %3$s: %4$s.'; -$txt['lp_main_page_title'] = 'Заголовок главной страницы'; -$txt['lp_main_page_disable'] = 'Отключить главную страницу'; -$txt['lp_standalone'] = 'Автономный режим'; -$txt['lp_standalone_help'] = 'Будет отключено всё, кроме страниц портала и игнорируемых областей.'; -$txt['lp_standalone_excluded_actions'] = 'Игнорируемые области'; -$txt['lp_standalone_excluded_actions_subtext'] = 'Укажите области, которые должны оставаться доступными в автономном режиме.'; -$txt['lp_page_editor_type_default'] = 'Тип редактора страниц по умолчанию'; -$txt['lp_num_per_page'] = 'Максимальное количество элементов в списке страниц (для пагинации)'; -$txt['groups_light_portal_view'] = 'Кто может просматривать элементы портала'; -$txt['groups_light_portal_manage'] = 'Кто может управлять порталом'; - -// Actions -$txt['lp_title'] = 'Заголовок'; -$txt['lp_actions'] = 'Действия'; -$txt['lp_action_on'] = 'Включить'; -$txt['lp_action_off'] = 'Отключить'; -$txt['lp_action_move'] = 'Переместить'; - -// Blocks -$txt['lp_blocks'] = 'Блоки'; -$txt['lp_blocks_manage'] = 'Управление блоками'; -$txt['lp_blocks_manage_tab_description'] = 'Здесь перечислены все используемые блоки портала. Для добавления дополнительного блока воспользуйтесь соответствующей кнопкой.'; -$txt['lp_blocks_add'] = 'Добавить блок'; -$txt['lp_blocks_add_title'] = 'Добавление блока'; -$txt['lp_blocks_add_tab_description'] = 'Блоков пока немного, но самые универсальные есть — играйтесь :)'; -$txt['lp_blocks_add_instruction'] = 'Выберите нужный блок, нажав на него.'; -$txt['lp_blocks_edit_title'] = 'Редактирование блока'; -$txt['lp_blocks_edit_tab_description'] = $txt['lp_blocks_add_tab_description']; -$txt['lp_block_content'] = 'Содержимое'; -$txt['lp_block_icon_cheatsheet'] = ''; -$txt['lp_block_type'] = 'Тип блока'; -$txt['lp_block_priority'] = 'Приоритет'; -$txt['lp_block_placement'] = 'Расположение'; - -$txt['lp_block_placement_set'] = array( - 'header' => 'Шапка', - 'top' => 'Центральная часть (верх)', - 'left' => 'Левая панель', - 'right' => 'Правая панель', - 'bottom' => 'Центральная часть (низ)', - 'footer' => 'Подвал' -); - -$txt['lp_block_areas'] = 'Области'; -$txt['lp_block_areas_subtext'] = '
Укажите одну или несколько областей (через запятую) для отображения в них блока:
-
    -
  • all — отображать везде
  • -
  • forum — отображать только на форуме
  • -
  • portal — отображать только на портале (включая страницы)
  • -
  • custom_action — отображать в области index.php?action=custom_action
  • -
  • page=alias — отображать на странице index.php?page=alias
  • -
'; -$txt['lp_block_title_class'] = 'CSS класс заголовка'; -$txt['lp_block_title_style'] = 'CSS стили заголовка'; -$txt['lp_block_content_class'] = 'CSS класс содержимого'; -$txt['lp_block_content_style'] = 'CSS стили содержимого'; - -$txt['lp_block_types'] = array( - 'bbc' => 'Блок с ББ-кодом', - 'html' => 'Блок с HTML-кодом', - 'php' => 'Блок с PHP-кодом' -); -$txt['lp_block_types_descriptions'] = array( - 'bbc' => 'В этом блоке в качестве контента можно использовать любые ББ-теги форума.', - 'html' => 'В этом блоке в качестве контента можно использовать любые теги HTML.', - 'php' => 'В этом блоке в качестве контента можно использовать произвольный код PHP.' -); - -// Pages -$txt['lp_pages'] = 'Страницы'; -$txt['lp_pages_main'] = 'Главная страница'; -$txt['lp_pages_manage'] = 'Управление страницами'; -$txt['lp_pages_manage_tab_description'] = 'Здесь перечислены все страницы портала. Для добавления новой страницы воспользуйтесь соответствующей кнопкой.'; -$txt['lp_pages_add'] = 'Добавить страницу'; -$txt['lp_pages_add_title'] = 'Добавление страницы'; -$txt['lp_pages_add_tab_description'] = 'Обратите особое внимание на алиас страницы — он используется в адресной строке и может содержать только латинские символы и цифры!
У главной страницы алиас всегда равен "/".'; -$txt['lp_pages_edit_title'] = 'Редактирование страницы'; -$txt['lp_pages_edit_tab_description'] = $txt['lp_pages_add_tab_description']; -$txt['lp_extra_pages'] = 'Дополнительные страницы'; -$txt['lp_page_types'] = array('bbc' => 'ББ-код', 'html' => 'HTML', 'php' => 'PHP'); -$txt['lp_page_alias'] = 'Алиас'; -$txt['lp_page_content'] = $txt['lp_block_content']; -$txt['lp_page_type'] = 'Тип страницы'; -$txt['lp_page_description'] = 'Описание'; -$txt['lp_page_keywords'] = 'Ключевые слова'; -$txt['lp_permissions'] = array('Показывать админам', 'Показывать гостям', 'Показывать пользователям', 'Показывать всем'); -$txt['lp_no_items'] = 'Пока ничего нет. Давайте добавим?'; - -// Errors -$txt['lp_page_not_found'] = 'Страница не найдена!'; -$txt['lp_block_not_found'] = 'Блок не найден!'; -$txt['lp_post_error_no_title'] = 'Не указан заголовок!'; -$txt['lp_post_error_no_alias'] = 'Не указан алиас!'; -$txt['lp_post_error_no_valid_alias'] = 'Указанный алиас не правильный!'; -$txt['lp_post_error_no_unique_alias'] = 'Страница с таким алиасом уже существует!'; -$txt['lp_post_error_no_content'] = 'Не указано содержание!'; -$txt['lp_post_error_no_areas'] = 'Не указана область размещения!'; - -// Who -$txt['lp_who_main'] = 'Просматривает главную страницу портала.'; -$txt['lp_who_page'] = 'Просматривает страницу портала.'; - -// Permissions -$txt['permissiongroup_light_portal'] = LP_NAME; -$txt['permissionname_light_portal_view'] = $txt['group_perms_name_light_portal_view'] = 'Просмотр портала'; -$txt['permissionname_light_portal_manage'] = $txt['group_perms_name_light_portal_manage'] = 'Управление порталом'; -$txt['permissionhelp_light_portal_view'] = 'Возможность просматривать страницы и блоки портала.'; -$txt['permissionhelp_light_portal_manage'] = 'Доступ к управлению страницами и блоками портала, а также к его настройкам.'; -$txt['cannot_light_portal_view'] = 'Извините, вам запрещен просмотр портала!'; -$txt['cannot_light_portal_manage'] = 'Извините, вам запрещено управление порталом!'; -$txt['cannot_light_portal_view_page'] = 'Извините, вам не разрешен просмотр этой страницы!'; +%1$s, версия PHP: %2$s, версия %3$s: %4$s.'; +$txt['lp_main_page_title'] = 'Заголовок главной страницы'; +$txt['lp_main_page_disable'] = 'Отключить главную страницу'; +$txt['lp_standalone'] = 'Автономный режим'; +$txt['lp_standalone_help'] = 'Будет отключено всё, кроме страниц портала и игнорируемых областей.'; +$txt['lp_standalone_excluded_actions'] = 'Игнорируемые области'; +$txt['lp_standalone_excluded_actions_subtext'] = 'Укажите области, которые должны оставаться доступными в автономном режиме.'; +$txt['lp_page_editor_type_default'] = 'Тип редактора страниц по умолчанию'; +$txt['lp_num_per_page'] = 'Максимальное количество элементов в списке страниц (для пагинации)'; +$txt['lp_page_og_image'] = 'Использовать изображение в тексте статьи для мета-тега og-image'; +$txt['lp_page_og_image_set'] = array('Нет', 'Первое найденное', 'Последнее найденное'); +$txt['groups_light_portal_view'] = 'Кто может просматривать элементы портала'; +$txt['groups_light_portal_manage'] = 'Кто может управлять порталом'; + +// Actions +$txt['lp_title'] = 'Заголовок'; +$txt['lp_actions'] = 'Действия'; +$txt['lp_action_on'] = 'Включить'; +$txt['lp_action_off'] = 'Отключить'; +$txt['lp_action_move'] = 'Переместить'; + +// Blocks +$txt['lp_blocks'] = 'Блоки'; +$txt['lp_blocks_manage'] = 'Управление блоками'; +$txt['lp_blocks_manage_tab_description'] = 'Здесь перечислены все используемые блоки портала. Для добавления дополнительного блока воспользуйтесь соответствующей кнопкой.'; +$txt['lp_blocks_add'] = 'Добавить блок'; +$txt['lp_blocks_add_title'] = 'Добавление блока'; +$txt['lp_blocks_add_tab_description'] = 'Блоков пока немного, но самые универсальные есть — играйтесь :)'; +$txt['lp_blocks_add_instruction'] = 'Выберите нужный блок, нажав на него.'; +$txt['lp_blocks_edit_title'] = 'Редактирование блока'; +$txt['lp_blocks_edit_tab_description'] = $txt['lp_blocks_add_tab_description']; +$txt['lp_block_content'] = 'Содержимое'; +$txt['lp_block_icon_cheatsheet'] = ''; +$txt['lp_block_type'] = 'Тип блока'; +$txt['lp_block_priority'] = 'Приоритет'; +$txt['lp_block_placement'] = 'Расположение'; + +$txt['lp_block_placement_set'] = array( + 'header' => 'Шапка', + 'top' => 'Центральная часть (верх)', + 'left' => 'Левая панель', + 'right' => 'Правая панель', + 'bottom' => 'Центральная часть (низ)', + 'footer' => 'Подвал' +); + +$txt['lp_block_areas'] = 'Области'; +$txt['lp_block_areas_subtext'] = '
Укажите одну или несколько областей (через запятую) для отображения в них блока:
+
    +
  • all — отображать везде
  • +
  • forum — отображать только на форуме
  • +
  • portal — отображать только на портале (включая страницы)
  • +
  • custom_action — отображать в области index.php?action=custom_action
  • +
  • page=alias — отображать на странице index.php?page=alias
  • +
'; +$txt['lp_block_title_class'] = 'CSS класс заголовка'; +$txt['lp_block_title_style'] = 'CSS стили заголовка'; +$txt['lp_block_content_class'] = 'CSS класс содержимого'; +$txt['lp_block_content_style'] = 'CSS стили содержимого'; + +$txt['lp_block_types'] = array( + 'bbc' => 'Блок с ББ-кодом', + 'html' => 'Блок с HTML-кодом', + 'php' => 'Блок с PHP-кодом' +); +$txt['lp_block_types_descriptions'] = array( + 'bbc' => 'В этом блоке в качестве контента можно использовать любые ББ-теги форума.', + 'html' => 'В этом блоке в качестве контента можно использовать любые теги HTML.', + 'php' => 'В этом блоке в качестве контента можно использовать произвольный код PHP.' +); + +// Pages +$txt['lp_pages'] = 'Страницы'; +$txt['lp_pages_main'] = 'Главная страница'; +$txt['lp_pages_manage'] = 'Управление страницами'; +$txt['lp_pages_manage_tab_description'] = 'Здесь перечислены все страницы портала. Для добавления новой страницы воспользуйтесь соответствующей кнопкой.'; +$txt['lp_pages_add'] = 'Добавить страницу'; +$txt['lp_pages_add_title'] = 'Добавление страницы'; +$txt['lp_pages_add_tab_description'] = 'Обратите особое внимание на алиас страницы — он используется в адресной строке и может содержать только латинские символы и цифры!
У главной страницы алиас всегда равен "/".'; +$txt['lp_pages_edit_title'] = 'Редактирование страницы'; +$txt['lp_pages_edit_tab_description'] = $txt['lp_pages_add_tab_description']; +$txt['lp_extra_pages'] = 'Дополнительные страницы'; +$txt['lp_page_types'] = array('bbc' => 'ББ-код', 'html' => 'HTML', 'php' => 'PHP'); +$txt['lp_page_alias'] = 'Алиас'; +$txt['lp_page_content'] = $txt['lp_block_content']; +$txt['lp_page_type'] = 'Тип страницы'; +$txt['lp_page_description'] = 'Описание'; +$txt['lp_page_keywords'] = 'Ключевые слова'; +$txt['lp_permissions'] = array('Показывать админам', 'Показывать гостям', 'Показывать пользователям', 'Показывать всем'); +$txt['lp_no_items'] = 'Пока ничего нет. Давайте добавим?'; + +// Errors +$txt['lp_page_not_found'] = 'Страница не найдена!'; +$txt['lp_block_not_found'] = 'Блок не найден!'; +$txt['lp_post_error_no_title'] = 'Не указан заголовок!'; +$txt['lp_post_error_no_alias'] = 'Не указан алиас!'; +$txt['lp_post_error_no_valid_alias'] = 'Указанный алиас не правильный!'; +$txt['lp_post_error_no_unique_alias'] = 'Страница с таким алиасом уже существует!'; +$txt['lp_post_error_no_content'] = 'Не указано содержание!'; +$txt['lp_post_error_no_areas'] = 'Не указана область размещения!'; +$txt['lp_page_not_editable'] = 'Вам запрещено редактирование этой страницы!'; + +// Who +$txt['lp_who_main'] = 'Просматривает главную страницу портала.'; +$txt['lp_who_page'] = 'Просматривает страницу портала.'; + +// Permissions +$txt['permissiongroup_light_portal'] = LP_NAME; +$txt['permissionname_light_portal_view'] = $txt['group_perms_name_light_portal_view'] = 'Просмотр портала'; +$txt['permissionname_light_portal_manage'] = $txt['group_perms_name_light_portal_manage'] = 'Управление порталом'; +$txt['permissionhelp_light_portal_view'] = 'Возможность просматривать страницы и блоки портала.'; +$txt['permissionhelp_light_portal_manage'] = 'Доступ к управлению страницами и блоками портала.'; +$txt['cannot_light_portal_view'] = 'Извините, вам запрещен просмотр портала!'; +$txt['cannot_light_portal_manage'] = 'Извините, вам запрещено управление порталом!'; +$txt['cannot_light_portal_view_page'] = 'Извините, вам не разрешен просмотр этой страницы!'; diff --git a/Themes/default/languages/LightPortal/.ukrainian.php b/Themes/default/languages/LightPortal/.ukrainian.php index 569a2bb30..57e61c42b 100644 --- a/Themes/default/languages/LightPortal/.ukrainian.php +++ b/Themes/default/languages/LightPortal/.ukrainian.php @@ -110,6 +110,7 @@ $txt['lp_post_error_no_unique_alias'] = 'Сторінка з таким аліасом вже існує!'; $txt['lp_post_error_no_content'] = 'Не вказано зміст!'; $txt['lp_post_error_no_areas'] = 'Не вказана область разташування!'; +$txt['lp_page_not_editable'] = 'Вам заборонено редагування цієї сторінки!'; // Who $txt['lp_who_main'] = 'Переглядає головну сторінку порталу.'; @@ -120,7 +121,7 @@ $txt['permissionname_light_portal_view'] = $txt['group_perms_name_light_portal_view'] = 'Перегляд порталу'; $txt['permissionname_light_portal_manage'] = $txt['group_perms_name_light_portal_manage'] = 'Керування порталом'; $txt['permissionhelp_light_portal_view'] = 'Можливість переглядати сторінки і блоки порталу'; -$txt['permissionhelp_light_portal_manage'] = 'Доступ до керування сторінками і блоками порталу, а також до його налаштувань.'; +$txt['permissionhelp_light_portal_manage'] = 'Доступ до керування сторінками і блоками порталу.'; $txt['cannot_light_portal_view'] = 'Вибачте, вам заборонений перегляд порталу!'; $txt['cannot_light_portal_manage'] = 'Вибачте, вам заборонено керування порталом!'; $txt['cannot_light_portal_view_page'] = 'Вибачте, вам заборонений перегляд цієї сторінки!'; diff --git a/database.php b/database.php index 6f3652315..e84181e02 100644 --- a/database.php +++ b/database.php @@ -8,11 +8,11 @@ if (version_compare(PHP_VERSION, '7.2', '<')) die('This mod needs PHP 7.2 or greater. You will not be able to install/use this mod, contact your host and ask for a php upgrade.'); +global $user_info, $mbname; + if ((SMF == 'SSI') && !$user_info['is_admin']) die('Admin privileges required.'); -global $mbname; - $tables[] = array( 'name' => 'lp_blocks', 'columns' => array( @@ -171,6 +171,13 @@ 'unsigned' => true, 'auto' => true ), + array( + 'name' => 'author_id', + 'type' => 'mediumint', + 'size' => 8, + 'unsigned' => true, + 'default' => 0 + ), array( 'name' => 'title', 'type' => 'varchar', @@ -252,6 +259,7 @@ 'default' => array( 'columns' => array( 'page_id' => 'int', + 'author_id' => 'int', 'title' => 'string-255', 'alias' => 'string-255', 'content' => 'string', @@ -260,7 +268,7 @@ 'created_at' => 'int' ), 'values' => array( - array(1, $mbname, '/', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc porttitor posuere accumsan. Aliquam erat volutpat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus vel blandit dui. Aliquam nunc est, vehicula sit amet eleifend in, scelerisque quis sem. In aliquam nec lorem nec volutpat. Sed eu blandit erat. Suspendisse elementum lectus a ligula commodo, at lobortis justo accumsan. Aliquam mollis lectus ultricies, semper urna eu, fermentum eros. Sed a interdum odio. Quisque sit amet feugiat enim. Curabitur aliquam lectus at metus tristique tempus. Sed vitae nisi ultricies, tincidunt lacus non, ultrices ante. + array(1, $user_info['id'], $mbname, '/', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc porttitor posuere accumsan. Aliquam erat volutpat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus vel blandit dui. Aliquam nunc est, vehicula sit amet eleifend in, scelerisque quis sem. In aliquam nec lorem nec volutpat. Sed eu blandit erat. Suspendisse elementum lectus a ligula commodo, at lobortis justo accumsan. Aliquam mollis lectus ultricies, semper urna eu, fermentum eros. Sed a interdum odio. Quisque sit amet feugiat enim. Curabitur aliquam lectus at metus tristique tempus. Sed vitae nisi ultricies, tincidunt lacus non, ultrices ante. Duis ac ex sed dolor suscipit vulputate at eu ligula. Aliquam efficitur ac ante convallis ultricies. Nullam pretium vitae purus dapibus tempor. Aenean vel fringilla eros. Proin lectus velit, tristique ut condimentum eu, semper sed ipsum. Duis venenatis dolor lectus, et ullamcorper tortor varius eu. Vestibulum quis nisi ut nunc mollis fringilla. Sed consectetur semper magna, eget blandit nulla commodo sed. Aenean sem ipsum, auctor eget enim id, scelerisque malesuada nibh. Nulla ornare pharetra laoreet. Phasellus dignissim nisl nec arcu cursus luctus. diff --git a/package-info.xml b/package-info.xml index 2a6d3761e..ea31dd916 100644 --- a/package-info.xml +++ b/package-info.xml @@ -3,10 +3,10 @@ Bugo:LightPortal Light Portal - 0.2 + 0.3 modification - + readme/english.txt readme/russian.txt readme/ukrainian.txt @@ -18,7 +18,7 @@ - +