Jump to content
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.

Запрет удаления аттачей (2.3.6.)

Вопрос такой, можно ли штатными средствами (или модификациями) запретить пользователю удалять загруженные на форум аттачи через личное меню пользователя?

В админке таких настроек не нашел.

Featured Replies

Зачем такое извращение?

 

Открыть

/sources/classes/attach/plugin_post.php

 

Найти

 

	if ( $this->ipsclass->member['id'] == $attachment['attach_member_id'] )
	{
		$ok_to_remove = TRUE;
	}
	else if ( $this->ipsclass->member['g_is_supmod'] )

Заменить на

 

	if ( $this->ipsclass->member['g_is_supmod'] )

 

Удалять будут иметь право только администраторы и модераторы.

  • Author

Что бы юзеры с дури не тёрли аттачи.

Спасибо !

Edited by PaulZibert

  • Author

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

 

Кусок кода сейчас выглядит так.

Прописал...но всё равно из профиля осталась возможность удалять прикрепления ((

 

/sources/action_public/usercp.php

 

Найти

		$ids = $this->ipsclass->clean_int_array( $ids );

Выше добавить

	if( ! $this->ipsclass->member['g_is_supmod'] )
	{
		$ids = array();
	}

 

Форма останется в профиле, но удаляться аттачи будут только у пользователей супермодераторов.

Кусок кода сейчас выглядит так.

За удаления из личного кабинета отвечает другой код.

  • Author

Спасибо ! Всё получилось !

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.