Перейти к публикации
View in the app

A better way to browse. Learn more.

Дизайн и модификация 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.

Как сделать IP.Content "корневым" приложением

Опубликовано:

Чтобы сделать IP.Content первым, что открывается по заходу на ваш IP.Board-форум, нужно выполнить 2 шага:

 

1. Поднять форум и все его страницы из корня в виртуальную подпапку "forums" с помощью правки ЧПУ-шаблонов

 

Заменяем содержимое файла /admin/applications/forums/extensions/furlTemplates.php на:

 

<?php
/**
* <pre>
* Invision Power Services
* IP.Board vVERSION_NUMBER
* Sets up SEO templates
* Last Updated: $Date: 2011-08-02 15:53:39 -0400 (Tue, 02 Aug 2011) $
* </pre>
*
* @author 		$Author: bfarber $
* @copyright	(c) 2001 - 2009 Invision Power Services, Inc.
* @license		http://www.invisionpower.com/community/board/license.html
* @package		IP.Board
* @subpackage	Forums
* @link		http://www.invisionpower.com
* @since		20th February 2002
* @version		$Rev: 9351 $
*
*/

if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}

/**
* SEO templates
*
* 'allowRedirect' is a flag to tell IP.Board whether to check the incoming link and if not formatted correctly, redirect the correct one
*
* OUT FORMAT REGEX:
* First array element is a regex to run to see if we've a match for the URL
* The second array element is the template to use the results of the parenthesis capture
*
* Special variable #{__title__} is replaced with the $title data passed to output->formatUrl( $url, $title)
*
* IMPORTANT: Remember that when these regex are used, the output has not been fully parsed so you will get:
* showuser={$data['member_id']} NOT showuser=1 so do not try and match numerics only!
*
* IN FORMAT REGEX
*
* This allows the registry to piece back together a URL based on the template regex
* So, for example: "/user/(\d+?)/", 'matches' => array(  array( 'showuser' => '$1' ) )tells IP.Board to populate 'showuser' with the result
* of the parenthesis capture #1
*/
$_SEOTEMPLATES = array(

'showannouncement'     => array( 'app'		     => 'forums',
								 'allowRedirect' => 1,
								 'out'           => array( '#showannouncement=(.+?)((?:&|&)f=(.+?))?(&|$)#i', 'forums/forum-$3/announcement-$1-#{__title__}/$4' ),
						  		 'in'            => array( 'regex'   => '#/forums/forum-(\d+?)?/announcement-(\d+?)-#i',
												 		   'matches' => array( array( 'showannouncement', '$2' ), array( 'f', '$1' ) ) ) ),

'showforum'     => array( 'app'		      => 'forums',
						  'allowRedirect' => 1,
						  'isPagesMode'   => 1,
						  'out'           => array( '#showforum=(.+?)(&|$)#i', 'forums/forum/$1-#{__title__}/$2' ),
						  'in'            => array( 'regex'   => '#^/forums/forum/(\d+?)-#i',
												    'matches' => array( array( 'showforum', '$1' ) ) ) ),

'showtopicunread'=> array( 'app'		      => 'forums',
						   'allowRedirect'    => 1,
						   'out'              => array( '#showtopic=(.+?)(?:&|&)view=getnewpost(&|$)#i', 'forums/topic/$1-#{__title__}/unread/$2' ),
						   'in'               => array( 'regex'   => '#^/forums/topic/(\d+?)-([^/]+?)/unread(/|$)#i',
											            'matches' => array( array( 'showtopic', '$1' ),
																			array( 'view', 'getnewpost' ) ) ) ),

'showtopicnextunread'=> array( 'app'		      => 'forums',
							   'allowRedirect'    => 1,
							   'out'              => array( '#showtopic=(.+?)(?:&|&)view=getnextunread(&|$)#i', 'forums/topic/$1-#{__title__}/nextunread/$2' ),
							   'in'               => array( 'regex'   => '#^/forums/topic/(\d+?)-([^/]+?)/nextunread(/|$)#i',
												            'matches' => array( array( 'showtopic', '$1' ),
																				array( 'view', 'getnextunread' ) ) ) ),

'showtopic'     => array( 'app'		      => 'forums',
						  'allowRedirect' => 1,
						  'isPagesMode'   => 1,
						  'out'           => array( '#showtopic=(.+?)(\#|&|$)#i', 'forums/topic/$1-#{__title__}/$2' ),
						  'in'            => array( 'regex'   => '#^/forums/topic/(\d+?)-#i',
											        'matches' => array( array( 'showtopic', '$1' ) ) ) ),

'acteqst'       => array( 'app'		      => 'forums',
						  'allowRedirect' => 1,
						  'out'           => array( '#act=ST(.*?)&t=(.+?)(&|$)#i', 'forums/topic/$2-#{__title__}/$3' ),
						  'in'            => array( 'regex'   => '#^notavalidrequest$#i',
											        'matches' => array( array( 'showtopic', '0' ) ) ) ),

'act=idx'       => array( 'app'		      => 'forums',
						  'allowRedirect' => 0,
						  'out'           => array( '#act=idx(&|$)#i', 'forums/$1' ),
						  'in'            => array( 'regex'   => '#^/forums(/|$|\?)#i',
											        'matches' => array( array( 'act', 'idx' ) ) ) ),
);

 

 

2. Назначать IP.Content основным приложением

 

Заменяем в /initdata.php это:

 

/**
* Default app name
* You can set this in your own scripts before 'initdata.php' is required.
*/
if ( ! defined( 'IPS_DEFAULT_PUBLIC_APP' ) )
{
define( 'IPS_DEFAULT_PUBLIC_APP', 'forums' );
}

 

 

на это:

 

/**
* Default app name
* You can set this in your own scripts before 'initdata.php' is required.
*/
if ( ! defined( 'IPS_DEFAULT_PUBLIC_APP' ) )
{
define( 'IPS_DEFAULT_PUBLIC_APP', 'ccs' );
}

 

 

3. Сбрасываем кэш ЧПУ (одноименная кнопка в админке)

 

4. Делаем первой вкладкой в меню наш сайт на IP.Content (опционально)

 

В шаблоне Global Templates > globalTemplate находим:

 

						<if test="showhomeurl:|:$this->settings['home_url'] AND $this->settings['home_name']">
						<li id='nav_home' class='left'><a href='{$this->settings['home_url']}' title='{$this->lang->words['homepage_title']}' rel="home">{$this->settings['home_name']}</a></li>
					</if>

 

 

Заменяем на:

 

						{parse variable="ccsActive" default="" oncondition="IPS_APP_COMPONENT == 'ccs'" value="active"}
					<li id='nav_ccs' class='left {parse variable="ccsActive"}'><a href='{$this->settings['home_url']}' title='{$this->lang->words['homepage_title']}' rel="home">{$this->settings['home_name']}</a></li>

 

 

Адрес и текст этой ссылки задаются в настройках, в группе "General Configuration", поля Website name и Website address. В принципе, если скинов не много, можно сразу написать:

 

						{parse variable="ccsActive" default="" oncondition="IPS_APP_COMPONENT == 'ccs'" value="active"}
					<li id='nav_ccs' class='left {parse variable="ccsActive"}'><a href='/' title='На главную' rel="home">Сайт</a></li>

 

 

В настройках IP.Content выставляем "Show 'Pages' navigation bar entry" на "No".

 

Результат

 

Теперь у вас все несуществующие адреса будут передаваться в IP.Content, который будет либо выдавать текстовую ошибку 404, либо показывать с тем же 404-заголовком любую назначенную вами страницу IP.Content. Главная страница IP.Content (по-умолчанию - index.html, меняется в настройках) станет главной страницей всего форума. Список форумов уйдет на подпапку "/forums/", все остальные приложения останутся в своих подпапках.

 

Итоговая структура:

/ - IP.Content
/forums/ - Форум
/blogs/ - Блоги
/gallery/ - Галерея
и т.д.

 

Примечание! Если вам нужно только назначить IP.Content как приложение по умолчанию, достаточно выполнить только второй пункт.

Статья рассказывает о именно том, как создать эффект "корневого" приложения, когда форум визуально находится в виртуальную папку /forums/

 

Это сообщение было вынесено в статью

Рекомендованные сообщения

Опубликовано:

Как убрать вот это /page/ post-57291-0-08741400-1422777110_thumb.jpg

Проделал все что тут написано не понял только как Поднять форум и все его страницы из корня в виртуальную папку "forum" с помощью правки ЧПУ-шаблонов, папку форум создал что в нее копировать то? да и этого В настройках IP.Content выставляем "Show 'Pages' navigation bar entry" на "No", нет в настройках такого, сейчас главная открывается с таким видом домена /page/index.html все остальное как обычно.

Опубликовано:

А есть у кого код страницы? а то стандартная тоскливо смотрится.

Что нибудь вроде этого хотелось бы

post-57291-0-95522200-1422815068_thumb.jpg

или любой другой )

Опубликовано:

Помогите разобраться, никто не может добавить комментарий к новости кроме гостей, хотя у всех в правах групп и категориях разрешено?

Опубликовано:

Попробуйте пересохранить права, возможно проблема в кеше.

Опубликовано:

Пересохранял, непомогает.

Опубликовано:

Слетают права только у пользователей и у модераторов иногда, вот лог ошибок.

 

 Date: Mon, 02 Feb 2015 21:27:49 +0000
Error: 1064 - 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 ') ORDER BY p.company_add_date desc LIMIT 0,5' at line 7
IP Address: хх.хх.ххх.хх - /
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
mySQL query error: SELECT p.*,m.*, m.member_id as mid,pp.*,pf.*,s.*,country.*,state.*,city.* FROM sd_cd_companies p  LEFT JOIN members m ON ( m.member_id=p.member_id )   LEFT JOIN profile_portal pp ON ( pp.pp_member_id=m.member_id )   LEFT JOIN pfields_content pf ON ( pf.member_id=m.member_id )   LEFT JOIN sessions s ON ( s.member_id=m.member_id AND s.running_time > 1422908869 )   LEFT JOIN sd_cd_country country ON ( country.country_id=p.country_id )   LEFT JOIN sd_cd_states state ON ( state.state_id=p.state_id )   LEFT JOIN sd_cd_cities city ON ( city.city_id=p.city_id )   WHERE p.company_approved=1 AND p.category_id IN ( ) ORDER BY p.company_add_date desc LIMIT 0,5
.--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.
| File                                                                       | Function                                                                      | Line No.          |
|----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------|
| admin/applications_addon/ips/ccs/sources/blocks/feed/admin.php             | [feed_companydirectory].executeFeed                                           | 523               |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/applications_addon/ips/ccs/sources/blocks/adminInterface.php         | [adminBlockHelper_feed].recacheBlock                                          | 185               |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/applications_addon/ips/ccs/sources/pages.php                         | [adminBlockHelper].getBlockContent                                            | 551               |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/applications_addon/ips/ccs/sources/pages.php                         | [pageBuilder].getBlock                                                        | 336               |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/applications_addon/ips/ccs/modules_public/pages/pages.php            | [pageBuilder].recachePage                                                     | 843               |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/applications_addon/ips/ccs/modules_public/pages/pages.php            | [public_ccs_pages_pages]._getPageContent                                      | 540               |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/applications_addon/ips/ccs/modules_public/pages/pages.php            | [public_ccs_pages_pages]._view                                                | 120               |
'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
| admin/sources/base/ipsController.php                                       | [public_ccs_pages_pages].doExecute                                            | 306               |
'-------

Опубликовано:
вот лог ошибок.
Это sql-ошибок. У Вас при сохранении выдается ошибка БД? Да и приведенный лог совсем не связан с правами юзеров.

 

Слетают права только у пользователей и у модераторов иногда
Не применяются права на разделы через редактирование масок
Опубликовано:

Это sql-ошибок. У Вас при сохранении выдается ошибка БД? Да и приведенный лог совсем не связан с правами юзеров.

нет вроде

В PHP.INI все по максимуму выставлено

  • 1 год спустя...
Опубликовано:

Пожалуйста подскажите, как сделай IP.Content первичным приложением, а за ним уже Форум.

IPS 4.1

Создайте аккаунт или войдите в него для комментирования

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу.

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.