Перейти к содержимому
Открыть в приложении

Удобный способ просмотра. Узнать больше.

Дизайн и модификация Invision Community

Полноэкранное приложение на главном экране с push-уведомлениями, медалями и многим другим.

Чтобы установить это приложение на iOS и iPadOS
  1. Нажмите иконку «Поделиться» в Safari
  2. Прокрутите меню и нажмите На экран «Домой».
  3. Нажмите Добавить в правом верхнем углу.
Чтобы установить это приложение на Android
  1. Нажмите меню из трёх точек (⋮) в правом верхнем углу браузера.
  2. Нажмите Добавить на главный экран или Установить приложение.
  3. Подтвердите, нажав Установить.

Мод "Закрепленное сообщение"

Имя файла: Мод "Закрепленное сообщение"

Владелец файла: andaril

Файл размещен: 16 апр 2007

Файл обновлен: 14 фев 2011

Категория файла: Mods/Моды

 

Эта модификация позволяет добавлять способность модераторов закреплять и откреплять первое сообщение темы, чтобы оно показавалось на каждой странице темы.

+---------------------------------------------------------------------

| Invision Power Board v2.2.x

| =================================================================

| При поддержке ipbskins.ru

| =================================================================

+---------------------------------------------------------------------

|

| > Мод "Закрепленное сообщение"

| > Автор fr0z3n aka andar!l

|

| > Автор оригинального мода для версий 2.1.х Alex

| > Версия: 1.1

| > Дата: 26.05.2007

|

+---------------------------------------------------------------------

|

| > Эта модификация позволяет добавлять способность модераторов

| > закреплять и откреплять первое сообщение темы, чтобы оно

| > показавалось на каждой странице темы.

|

| > This mod adds moderators possibility to pin and unpin

| > first post in any thread they have open/close rights.

|

+---------------------------------------------------------------------

|

| > Автор не несет ответственности за проблемы в связи с

| > использованием этой модификации

| > Используйте мод на свой страх и риск.

|

| > Author is not responsible for any consequences of using this

| > forum modification, including those caused by this module

| > Use at your own risk

|

+---------------------------------------------------------------------

Закрепить и открепить сообщение могут модераторы имеющие права закреплять и откреплять темы, соответственно.

 

Нажмите сюда, чтобы скачать этот файл

Изменено пользователем andaril

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

  • Автор
+---------------------------------------------------------------------
|   Invision Power Board v2.1.x
|  =================================================================
|   [url="http://www.invisionpower.com"]http://www.invisionpower.com[/url]
|  =================================================================
+---------------------------------------------------------------------
|
|   > First pinned post mod
|   > by Alex
|
|   > Version: 1.0
|   > Date: 01.06.2006
|   > Last Update: 07.07.2006
|
+---------------------------------------------------------------------
|
|   > Version 1.0.0
|   > - Initial release
|
+---------------------------------------------------------------------
|
|   > This mod adds users and moderators possibility to pin and unpin
|   > first post in any thread they have open/close rights.
|
+---------------------------------------------------------------------
|
|   > Author is not responsible for any consequences of using this
|   > forum modification, including those caused by this module
|   > Use at your own risk
|
+---------------------------------------------------------------------

######################################################################
Execute the following SQL query on the database
======================================================================
ALTER TABLE `ibf_topics` ADD `pinned_post` TINYINT( 1 ) DEFAULT '0';
======================================================================

######################################################################
./sources/action_public/moderate.php
======================================================================
FIND
----------------------------------------------------------------------
	   //-----------------------------------------
	   // Edit member
	   //-----------------------------------------
	   case 'editmember':
		   $this->edit_member();
		   break;
----------------------------------------------------------------------
BELOW, ADD
----------------------------------------------------------------------
   // [bEGIN] PIN Mod: Pinning first post in the topics
   case 'pinpost':
	   $this->pin_post();
	   break;
   case 'unpinpost':
	   $this->unpin_post();
	   break;
   // [END] PIN Mod: Pinning first post in the topics
----------------------------------------------------------------------
FIND
----------------------------------------------------------------------
?>
----------------------------------------------------------------------
ABOVE, FIND
----------------------------------------------------------------------
}
----------------------------------------------------------------------
ABOVE, ADD
----------------------------------------------------------------------
  // [bEGIN] PIN Mod: Pinning first post in the topics

  /*-------------------------------------------------------------------------*/
  // PIN POST:
  /*-------------------------------------------------------------------------*/

  function pin_post()
  {
   if ($this->topic['pinned_post'])
   {
	   $this->moderate_error();
   }

   $passed = 0;

   if ($this->ipsclass->member['g_is_supmod'] == 1)
   {
	   $passed = 1;
   }
   else if ($this->moderator['pin_topic'] == 1)
   {
	   $passed = 1;
   }
   else if ($this->topic['starter_id'] == $this->ipsclass->member['id'])
   {
	   $passed = 1;
   }
   else
   {
	   $passed = 0;
   }

   if ($passed != 1) $this->moderate_error();

   $this->modfunc->post_pin($this->topic['tid']);

   $this->moderate_log("Первое сообщение темы «закреплено»");

   $this->ipsclass->print->redirect_screen( $this->ipsclass->lang['p_pinned_post'], "showtopic=".$this->topic['tid']."&st=".$this->ipsclass->input['st'] );

  }

  /*-------------------------------------------------------------------------*/
  // UNPIN POST:
  /*-------------------------------------------------------------------------*/

  function unpin_post()
  {
   if (! $this->topic['pinned_post'])
   {
	   $this->moderate_error();
   }

   $passed = 0;

   if ($this->ipsclass->member['g_is_supmod'] == 1)
   {
	   $passed = 1;
   }
   else if ($this->moderator['unpin_topic'] == 1)
   {
	   $passed = 1;
   }
   else if ($this->topic['starter_id'] == $this->ipsclass->member['id'])
   {
	   $passed = 1;
   }
   else
   {
	   $passed = 0;
   }

   if ($passed != 1) $this->moderate_error();

   $this->modfunc->post_unpin($this->topic['tid']);

   $this->moderate_log("Первое сообщение темы «откреплено»");

   $this->ipsclass->print->redirect_screen( $this->ipsclass->lang['p_unpinned_post'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$this->ipsclass->input['st'] );
  }

  // [END] PIN Mod: Pinning first post in the topics
======================================================================

######################################################################
./sources/action_public/topics.php
======================================================================
FIND
----------------------------------------------------------------------
   //-----------------------------------------
   // Post number
   //-----------------------------------------

   if ( $this->topic_view_mode == 'linearplus' and $this->topic['topic_firstpost'] == $row['pid'])
   {
	   $row['post_count'] = 1;

	   if ( ! $this->first )
	   {
		   $this->post_count++;
	   }
   }
----------------------------------------------------------------------
BELOW, ADD
----------------------------------------------------------------------
   // [bEGIN] PIN Mod: Pinning first post in the topics
   elseif ($this->topic_view_mode == 'linear' and $this->topic['pinned_post'] and $this->topic['topic_firstpost'] == $row['pid'])
   {
	   $row['post_count'] = '1 '.$this->ipsclass->lang['post_pinned'];

	   if ( $this->first < 1 )
	   {
		   $this->post_count++;
	   }
   }
   // [END] PIN Mod: Pinning first post in the topics
----------------------------------------------------------------------
FIND
----------------------------------------------------------------------
   $actions = array( 'MOVE_TOPIC', 'CLOSE_TOPIC', 'OPEN_TOPIC', 'DELETE_TOPIC', 'EDIT_TOPIC', 'PIN_TOPIC', 'UNPIN_TOPIC', 'MERGE_TOPIC', 'UNSUBBIT' );
----------------------------------------------------------------------
REPLACE WITH
----------------------------------------------------------------------
   // PIN Mod: Pinning first post in the topics
   $actions = array( 'MOVE_TOPIC', 'CLOSE_TOPIC', 'OPEN_TOPIC', 'DELETE_TOPIC', 'EDIT_TOPIC', 'PIN_TOPIC', 'UNPIN_TOPIC', 'MERGE_TOPIC', 'PIN_POST', 'UNPIN_POST', 'UNSUBBIT' );
----------------------------------------------------------------------
FIND
----------------------------------------------------------------------
	   elseif ($key == 'OPEN_TOPIC' or $key == 'CLOSE_TOPIC')
	   {
		   if ($this->ipsclass->member['g_open_close_posts'])
		   {
			   $mod_links .= $this->append_link($key);
		   }
	   }
----------------------------------------------------------------------
BELOW, ADD
----------------------------------------------------------------------
// [bEGIN] PIN Mod: Pinning first post in the topics
	   elseif ($key == 'PIN_POST' or $key == 'UNPIN_POST')
	   {
		   if ($this->ipsclass->member['g_open_close_posts'])
		   {
			   $mod_links .= $this->append_link($key);
		   }
	   }
// [END] PIN Mod: Pinning first post in the topics
----------------------------------------------------------------------
FIND
----------------------------------------------------------------------
   if ($this->topic['pinned'] == 1 and $key == 'PIN_TOPIC')   return "";
   if ($this->topic['pinned'] == 0 and $key == 'UNPIN_TOPIC') return "";
----------------------------------------------------------------------
BELOW, ADD
----------------------------------------------------------------------
   // [bEGIN] PIN Mod: Pinning first post in the topics
   if (($key == 'PIN_POST' or $key == 'UNPIN_POST') and $this->topic['state'] != 'open') return "";
   if ($this->topic['pinned_post'] == 1 and $key == 'PIN_POST')   return "";
   if ($this->topic['pinned_post'] == 0 and $key == 'UNPIN_POST') return "";
   // [END] PIN Mod: Pinning first post in the topics
----------------------------------------------------------------------
FIND
----------------------------------------------------------------------
							  'PIN_TOPIC'	 => '15',
							  'UNPIN_TOPIC'   => '16',
							  'UNSUBBIT'	  => '30',
							  'MERGE_TOPIC'   => '60',
							  'TOPIC_HISTORY' => '90',
----------------------------------------------------------------------
BELOW, ADD
----------------------------------------------------------------------
// [bEGIN] PIN Mod: Pinning first post in the topics
							  'PIN_POST' => 'pinpost',
							  'UNPIN_POST' => 'unpinpost',
// [END] PIN Mod: Pinning first post in the topics
======================================================================

######################################################################
./sources/lib/func_mod.php
======================================================================
FIND
----------------------------------------------------------------------
?>
----------------------------------------------------------------------
ABOVE, FIND
----------------------------------------------------------------------
}
----------------------------------------------------------------------
ABOVE, ADD
----------------------------------------------------------------------
  // [bEGIN] PIN Mod: Pinning first post in the topics

  //-----------------------------------------
  // @post_pin: pin topic first post
  // -----------
  // Accepts: Array ID's | Single ID
  // Returns: NOTHING (TRUE/FALSE)
  //-----------------------------------------

  function post_pin($id)
  {
   $this->stm_init();
   $this->stm_add_post_pin();
   $this->stm_exec($id);
   return TRUE;
  }

  //-----------------------------------------
  // @post_unpin: unpin topic first post
  // -----------
  // Accepts: Array ID's | Single ID
  // Returns: NOTHING (TRUE/FALSE)
  //-----------------------------------------

  function post_unpin($id)
  {
   $this->stm_init();
   $this->stm_add_post_unpin();
   $this->stm_exec($id);
   return TRUE;
  }

  //-----------------------------------------
  // @stm_add_post_pin: add post pin command to statement
  // -----------
  // Accepts: NOTHING
  // Returns: NOTHING (TRUE/FALSE)
  //-----------------------------------------

  function stm_add_post_pin()
  {
   $this->stm[] = array( 'pinned_post' => 1 );

   return TRUE;
  }

  //-----------------------------------------
  // @stm_add_post_unpin: add post unpin command to statement
  // -----------
  // Accepts: NOTHING
  // Returns: NOTHING (TRUE/FALSE)
  //-----------------------------------------

  function stm_add_post_unpin()
  {
   $this->stm[] = array( 'pinned_post' => 0 );

   return TRUE;
  }

  // [END] PIN Mod: Pinning first post in the topics
======================================================================

######################################################################
./sources/lib/func_topic_linear.php
======================================================================
FIND
----------------------------------------------------------------------
	   //-----------------------------------------
	   // Run query
	   //-----------------------------------------

	   $this->lib->topic_view_mode = 'linear';
----------------------------------------------------------------------
BELOW, ADD
----------------------------------------------------------------------
	   // [bEGIN] PIN Mod: Pinning first post in the topics
	   if ($this->topic['pinned_post'] and $first > 0)
	   {
		   $this->pids = array( 0 => $this->topic['topic_firstpost'] );
	   }
	   // [END] PIN Mod: Pinning first post in the topics
----------------------------------------------------------------------
FIND
----------------------------------------------------------------------
	   //-----------------------------------------
	   // Show end first post
	   //-----------------------------------------

	   if ( $this->lib->topic_view_mode == 'linearplus' and $this->first_printed == 0 and $row['pid'] == $this->topic['topic_firstpost'] and $this->topic['posts'] > 0)
	   {
		   $this->output .= $this->ipsclass->compiled_templates['skin_topic']->topic_end_first_post( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ) );
	   }
----------------------------------------------------------------------
BELOW, ADD
----------------------------------------------------------------------
	   // [bEGIN] PIN Mod: Pinning first post in the topics
	   if ( $this->lib->topic_view_mode == 'linear' and $this->first_printed == 0 and $row['pid'] == $this->topic['topic_firstpost'] and $first > 0)
	   {
		   $this->output .= $this->ipsclass->compiled_templates['skin_topic']->topic_end_outline( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ) );
		   $this->output .= $this->ipsclass->compiled_templates['skin_topic']->topic_page_top( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ), 1 );
	   }
	   // [END] PIN Mod: Pinning first post in the topics
======================================================================

######################################################################
./cache/lang_cache/*/lang_mod.php
======================================================================
FIND
----------------------------------------------------------------------
$lang = array (
----------------------------------------------------------------------
BELOW, ADD
----------------------------------------------------------------------
// [bEGIN] PIN Mod: Pinning first post in the topics
'p_pinned_post' => 'Первое сообщение закреплено',
'p_unpinned_post' => 'Первое сообщение откреплено',
// [END] PIN Mod: Pinning first post in the topics
----------------------------------------------------------------------
======================================================================

######################################################################
./cache/lang_cache/*/lang_topic.php
======================================================================
FIND
----------------------------------------------------------------------
$lang = array (
----------------------------------------------------------------------
BELOW, ADD
----------------------------------------------------------------------
// [bEGIN] PIN Mod: Pinning first post in the topics
'PIN_POST' => 'Закрепить первое сообщение',
'UNPIN_POST' => 'Открепить первое сообщение',
'post_pinned' => '(закреплено)',
// [END] PIN Mod: Pinning first post in the topics
----------------------------------------------------------------------
======================================================================

Спасибо большое. :)

  • 1 месяц спустя...

У меня на 2.3 глючит просмотр страниц с сообщениями.

  • Автор

если мне не изменяет память, он создан только под 2.2.х

Да, но:

А есть вариант для 2.3.х?

 

этот должен работать. Не проверяли?

 

Я провирил. Не работает.

Изменено пользователем Fisana

  • 3 месяца спустя...

Установил, мод работает, НО вот после установки в логах мускула постоянно пишет такие вот ошибки:

 Date: Fri, 23 Oct 2009 02:32:06 +0400
Error Number: 1064
Error: 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 'USE INDEX (id_approved_forum)
				WHERE p.queued=0 AND t.forum_id IN(3,2,5,6,7' at line 7
IP Address: 94.41.122.39
mySQL query error: SELECT p.*, t.*, t.posts as topic_posts, t.title as topic_title, m.*, me.*, pp.*
				FROM ibf_posts p
			 		LEFT JOIN ibf_topics t ON (t.tid=p.topic_id AND t.approved=1)
			 		LEFT JOIN ibf_members m ON (m.id=p.author_id)
			 		LEFT JOIN ibf_member_extra me ON (me.id=p.author_id)
			 		LEFT JOIN ibf_profile_portal pp ON (m.id=pp.pp_member_id)
				USE INDEX (id_approved_forum)
				WHERE p.queued=0 AND t.forum_id IN(3,2,5,6,7,8,16,9,10,17,20,188,15,18,19,113,115,95,96,97,116,117,25,26,27,28,
29,30,31,32,110,33,111,34,35,36,37,38,39,40,186,41,42,43,44,45,109,46,101,94,47,
1
12,48,49,50,51,52,53,54,55,198,57,58,72,59,60,73,114,74,63,199,64,65,66,67,68,69
,
70,71,56,22,23,24,100,217,76,77,78,79,89,90,118,121,13,14,93,107,98,99,82,83,84,
2
1,75,80,81,192,193,194,128,129,130,131,132,133,134,135,136,137,138,139,140,141,1
4
2,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,16
3
,164,167,168,169,170,171,202,172,173,174,175,162,165,166,191,176,127,195,177,102
,
108,126,183,184,178,179,180,181,182,119,120,123,124,125,187,189,190,200,201,206,
2
07,208,210,211,212,213,214,216,220,219,218) AND p.author_id=8
				ORDER BY post_date DESC LIMIT 0,25

 

Форум 2.2.1

 

Не поделитесь мыслями, в чем может быть проблема?

  • 4 месяца спустя...

Под 3.0.4 будет?

  • 2 недели спустя...

на 3.0 не пойдет ?

  • 1 месяц спустя...

сегодня чисто случайно заметил что мод не работает, нажатие на кнопку и вылетает: Fatal error: Call to undefined method moderate::pin_post() in /home/www/samsungomania.com/sources/action_public/moderate.php on line 335, проверил moderate.php - там нормально. Причем ранее поднятые посты так и отображаются вверху, а вот открепить уже немогу. Недавно переносил форум из папки в корень хоста - может в этом проблема? Помогите кто знает, что могло произойти

Изменено пользователем Майор

  • 2 недели спустя...
Я провирил. Не работает.

Сегодня установил на 2.3.6

Все работает!

http://forums.ibresource.ru/index.php?showtopic=46544

 

Более удобный (на мой взгляд) мод. Кторы к тому-же не запрещает совершать любые действия с темами на 2.3.2

http://forums.ibresource.ru/index.php?showtopic=46544

 

Более удобный (на мой взгляд) мод. Кторы к тому-же не запрещает совершать любые действия с темами на 2.3.2

Ну это уже дело вкуса, а как известно о вкусах не спорят.

Меня и этот мод вполне устраивает.

Спасибо автору.

  • 10 месяцев спустя...

для 3.1.4 версии есть такой мод?

 

нашел аналогичный для 3.1.4 ТУТ

Изменено пользователем User7

  • 6 месяцев спустя...

для 3,2 кто нибудь нашел?

  • 1 месяц спустя...

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

IPS Driver Error

There appears to be an error with the database.

You can try to refresh the page by clicking here

.

 

Версия форума IP.Board 2.2.2

Помогите пожалуйста, заранее спасибо.

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

Аккаунт

Навигация

Поиск

Поиск

Настроить push-уведомления браузера

Chrome (Android)
  1. Нажмите на иконку замка рядом с адресной строкой.
  2. Нажмите Права доступа → Уведомления.
  3. Измените свои настройки.
Chrome (компьютер)
  1. Нажмите на иконку замка в адресной строке.
  2. Выберите Настройки сайта.
  3. Найдите Уведомления и измените свои настройки.