Перейти к контенту

"Куратор темы" и "Прикрепленное сообщение в теме"


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

"Куратор темы"

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

 

"Прикрепленное сообщение в теме"

Возможность прикреплять сверху темы не только первое сообщение, но и асболютно любое из этой же темы.

 

Такие моды для 2.0 есть

Для 2.1 не нашел.

 

Может кто подскажет, где найти? Желательно со ссылками.

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

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

Мужики это какой-то ппц уже.

Скажите мне как вы ищите так что не находите то что под носом лежит?

Вот оно:

Куратор темы

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

Мдя... ты по мое ссылке прошел?

там прочел что написано? Прошел по той ссылке что там отсавлена?

ЕСТЬ и ДЛЯ 2.1х вы блин читать уже разучились тоже? (см. туже тему что и для 2.0.х 14 постов ниже первого сообещиния)

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

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

Вот мод прикрепления 1 сообщения к теме:

 

+---------------------------------------------------------------------
|   Invision Power Board v2.1.x
|  =================================================================
|   [url="http://www.invisionpower.com"]http://www.invisionpower.com[/url]
|   [url="http://www.ibresource.ru"]http://www.ibresource.ru[/url]
|  =================================================================
+---------------------------------------------------------------------
|
|   > First pinned post mod
|   > by Alex/AT
|
|   > Version: 1.0
|   > Date: 03.12.2006
|   > Last Update: 03.12.2006
|
+---------------------------------------------------------------------
|
|   > Version 1.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] Alex/AT Mod: Pinning first post in the topics
	case 'pinpost':
		$this->pin_post();
		break;
	case 'unpinpost':
		$this->unpin_post();
		break;
	// [END] Alex/AT Mod: Pinning first post in the topics
----------------------------------------------------------------------
FIND
----------------------------------------------------------------------
?>
----------------------------------------------------------------------
ABOVE, FIND
----------------------------------------------------------------------
}
----------------------------------------------------------------------
ABOVE, ADD
----------------------------------------------------------------------
// [bEGIN] Alex/AT 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] Alex/AT 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] Alex/AT 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] Alex/AT 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
----------------------------------------------------------------------
	// Alex/AT 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] Alex/AT 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] Alex/AT 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] Alex/AT 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] Alex/AT 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] Alex/AT Mod: Pinning first post in the topics
							   'PIN_POST' => 'pinpost',
							   'UNPIN_POST' => 'unpinpost',
// [END] Alex/AT Mod: Pinning first post in the topics
======================================================================

######################################################################
./sources/lib/func_mod.php
======================================================================
FIND
----------------------------------------------------------------------
?>
----------------------------------------------------------------------
ABOVE, FIND
----------------------------------------------------------------------
}
----------------------------------------------------------------------
ABOVE, ADD
----------------------------------------------------------------------
// [bEGIN] Alex/AT 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] Alex/AT 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] Alex/AT Mod: Pinning first post in the topics
		if ($this->topic['pinned_post'] and $first > 0)
		{
			$this->pids = array( 0 => $this->topic['topic_firstpost'] );
		}
		// [END] Alex/AT 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] Alex/AT 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] Alex/AT Mod: Pinning first post in the topics
======================================================================

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

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

 

Блин... как бы свой ник на форуме поменять... здесь запрещено :D

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

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

Alex/AT, установил твой долгожданный всеми мод pinned post, но в теме после прикрипленного первого сообщения дублируется navstrip и правила раздела.

Где копать?

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

Ага, уже исправил. Сейчас выложу обновленную версию.

 

Версия 1.1.

 

- Поправлены некоторые баги с правами на поднятие сообщения (теперь 100% будут подниматься везде, где разрешено закрытие/открытие тем).

 

- Поправлен баг с дублированием правил раздела и голосования в темах с поднятым сообщением.

 

Извините, инструкций по апгрейду не дам - забыл уже точно, что и где правил. Только полный вариант (его собирал по ходу правок).

 

+---------------------------------------------------------------------
|   Invision Power Board v2.1.x
|  =================================================================
|   http://www.invisionpower.com
|   http://www.ibresource.ru
|  =================================================================
+---------------------------------------------------------------------
|
|   > First pinned post mod
|   > by Alex/AT
|
|   > Version: 1.1
|   > Date: 03.12.2006
|   > Last Update: 10.01.2007
|
+---------------------------------------------------------------------
|
|   > Version 1.1
|   > - Fixed issues with user rights
|   > - Fixed issues with votes and forum rules (a bit hacky, but it
|	   is quite fast and works as expected)
|   > Version 1.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] Alex/AT Mod: Pinning first post in the topics
	case 'pinpost':
		$this->pin_post();
		break;
	case 'unpinpost':
		$this->unpin_post();
		break;
	// [END] Alex/AT Mod: Pinning first post in the topics
----------------------------------------------------------------------
FIND
----------------------------------------------------------------------
?>
----------------------------------------------------------------------
ABOVE, FIND
----------------------------------------------------------------------
}
----------------------------------------------------------------------
ABOVE, ADD
----------------------------------------------------------------------
// [BEGIN] Alex/AT 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] Alex/AT 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] Alex/AT 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] Alex/AT 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
----------------------------------------------------------------------
	// Alex/AT 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
----------------------------------------------------------------------
			if ($key == 'MERGE_TOPIC' or $key == 'SPLIT_TOPIC')
			{
				if ($this->moderator['split_merge'] == 1)
				{
					$mod_links .= $this->append_link($key);
				}
			}
----------------------------------------------------------------------
BELOW, ADD
----------------------------------------------------------------------
// [BEGIN] Alex/AT 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] Alex/AT Mod: Pinning first post in the topics
----------------------------------------------------------------------
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] Alex/AT 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] Alex/AT 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] Alex/AT 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] Alex/AT 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] Alex/AT Mod: Pinning first post in the topics
							   'PIN_POST' => 'pinpost',
							   'UNPIN_POST' => 'unpinpost',
// [END] Alex/AT Mod: Pinning first post in the topics
======================================================================

######################################################################
./sources/lib/func_mod.php
======================================================================
FIND
----------------------------------------------------------------------
?>
----------------------------------------------------------------------
ABOVE, FIND
----------------------------------------------------------------------
}
----------------------------------------------------------------------
ABOVE, ADD
----------------------------------------------------------------------
// [BEGIN] Alex/AT 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] Alex/AT 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] Alex/AT Mod: Pinning first post in the topics
		if ($this->topic['pinned_post'] and $first > 0)
		{
			$this->pids = array( 0 => $this->topic['topic_firstpost'] );
		}
		// [END] Alex/AT 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] Alex/AT 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 ) );
			# A little hack to exclude rules/post
			$this->output .= strtr( $this->ipsclass->compiled_templates['skin_topic']->topic_page_top( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ), 1 ) , array( '<!--IBF.FORUM_RULES-->' => '', '<!--{IBF.POLL}-->' => '') );
		}
		// [END] Alex/AT Mod: Pinning first post in the topics
======================================================================

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

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

Изменено пользователем Alex/AT
Ссылка на комментарий
Поделиться на других сайтах

  • 3 недели спустя...
а как бы тему куратора доработать? может есть умельцы? нужно всего-то добавить отображение куратора (если он есть) в строке топика, ну и подпись под аватаром в самом топике
Ссылка на комментарий
Поделиться на других сайтах

  • 1 месяц спустя...
Кто-нибудь поставил этот мод(закрепленное сообщение)? дайте плиз полуну инструкцию, начинающему сложно сразу въехать в коды....
Ссылка на комментарий
Поделиться на других сайтах

Кно Нибудь может выложить модифицированные файлы, или хотяб topics.php, а то что-то наделал, что темы вообще нельзя просмотреть Белый Экран и все!
Ссылка на комментарий
Поделиться на других сайтах

Ага, уже исправил. Сейчас выложу обновленную версию.

Обнаружилась такая ошибка:

"Если в закрепленых сообщения используется тэг , где X - номер загруженного файла.

Т.е. вместо него по тексту сообщения отображатся ссылка на скачивание файла, если же убрать какой-либо тэг, то в конце сообщения появится строка "Прикреплённые файлы" там будет ссылки на скачивание файлов, для которых не использовался тэг "

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

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

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

данный мод (закрепление первого поста) конфликтует с репутацией XT Reputation System! не знаю что делать. не отображаются кнопки плюса и минуса

кто поможет?

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

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

Поставил на 2.3.1 , на первый взгляд вроде работает. Первое сообщение в теме закрепляется и выводится надпись красным цветом " Закрепленое сообщение" . В админке вроде негде не настраивается. Вот попробовал создать несколько сообщений в теме , указал в настройках по 2 на страницу, а получилось только на первой странице 2, на всех остальных по 3 :D

 

Вот какбы странички сделать чтоб везде по 2 было или так неполучится?

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

  • 5 месяцев спустя...
установил, всё хорошо стало, спасибо :D но есть такой вопрос, а можно ли сделать что бы 1 пост был по умолчанию всегда прикреплен, а не каждый раз прикреплять его?!
Ссылка на комментарий
Поделиться на других сайтах

  • 1 год спустя...

Пля че за к*йня? все сделал как написано прям точь в точь, и на форуме когда ставишь "закрепить первый пост", то появляется ошибка-Вам запрещено использование этой функции. (главный админ)

 

Че делать? ipb 2.3.5

Изменено пользователем Stop-TussiN
Ссылка на комментарий
Поделиться на других сайтах

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

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

Гость
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Ответить в этой теме...

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

  Допустимо не более 75 смайлов.

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

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

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

Зарузка...
×
×
  • Создать...

Важная информация

Находясь на нашем сайте, вы соглашаетесь на использование файлов cookie, а также с нашим положением о конфиденциальности Политика конфиденциальности и пользовательским соглашением Условия использования.