Перейти к содержанию

Another home page for logged in users


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

Hi, I am using the landing page plugin as main home page, and I want to redirect users to forums instead of the index page (if they are logged in).

I tried to add this code in globaltemplate before header:

{{$member = \IPS\Member::loggedIn();}}
{{if app == 'landingpage'}}
{{header("Location: http://localhost/test.com/forums/");}}
{{endif}}

But nothing happened, pls any suggestions?

Ссылка на комментарий
Поделиться на другие сайты

34 минуты назад, odin777 сказал:

You cannot specify a header in the template, it will already be sent before this line is executed

You can easily google the redirect on JS

Ссылка на комментарий
Поделиться на другие сайты

Thank you man, I tried

Not working
{{$member = \IPS\Member::loggedIn();}}
{{if app == 'landingpage'}}
<script>
jQuery(location).attr('href', 'http://localhost/test.com/forums/');
</script>
{{endif}}

Not working
{{$member = \IPS\Member::loggedIn();}}
{{if app == 'landingpage'}}
<script>
function myFunction() {
  window.location.href("http://localhost/test.com/forums/")
}
</script>
{{endif}}

Not working

Ссылка на комментарий
Поделиться на другие сайты

This plugin enables IPS to redirect the user to a URL specified by referer= after login. 

Referer.xml

 

 

Referer.xml

Ссылка на комментарий
Поделиться на другие сайты

Thank you, but not working for Invision Community v4.5.4 (installed version)

Ссылка на комментарий
Поделиться на другие сайты

system/Login/Login.php

/**
	 * @brief Force a URL to send to post-login
	 * @note Useful when you need to redirect the user to another URL that is not local to this installation
	 */
	public static $forcedRedirectUrl = NULL;

	/**
	 * Fetch the URL to redirect to
	 *
	 * @return	\IPS\Http\Url
	 */
	public static function getDestination()
	{
		/* Try and get a referrer... */
		try
		{
			/* Are we forcing the user to be sent to a specific URL? */
			if( static::$forcedRedirectUrl !== NULL )
			{
				return static::$forcedRedirectUrl;
			}

If you're dev you should know what to do

Ссылка на комментарий
Поделиться на другие сайты

{{$member = \IPS\Member::loggedIn();}}
{{if request.app == 'forums' and request.module == 'forums'}}
<script>
jQuery(location).attr('href','http://localhost/test.com/forums/');
</script>
{{endif}}

The code above working for (forums), but how to do it for landingpage plugin?

Ссылка на комментарий
Поделиться на другие сайты

Присоединяйтесь к обсуждению

Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.
Примечание: Ваш пост будет проверен модератором, прежде чем станет видимым.

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Вставить как обычный текст

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

  • Последние посетители   0 пользователей онлайн

    • Ни одного зарегистрированного пользователя не просматривает данную страницу
×
×
  • Создать...