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

Переделать код для 2,1 под 2,3,4


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

Собственно вот это:

 

 

This adds the ability to see the teams the poster belongs to, and/or see the teams they belong to in their profile. These instructions are divided into TWO sections: one for seeing the team in post, another for seeing in profile, so you can choose to do one, or both...it is up to you.

 

Member Teams v1.1 for IPBv2.1 REQUIRED

 

 

Part One: View Teams in POST

 

 

Open /sources/lib/func_topic_linear.php

 

Find:

			//-----------------------------------------
		// Print post row
		//-----------------------------------------

		$this->output .= $this->ipsclass->compiled_templates['skin_topic']->RenderRow( $row, $poster );

ADD ABOVE THAT:

			//START MEMBER TEAMS ADD-ON
  $team_data = array();
  $team_data_by_tid = array();
  $team_mem_data = array();
  $array = array();
  $this->ipsclass->DB->simple_select( "*", "teams" );
  $this->ipsclass->DB->simple_exec();
  while ( $a = $this->ipsclass->DB->fetch_row() ){
$team_data[] = $a;
$team_data_by_tid[ $a['tid'] ] = $a;
  }
  $this->ipsclass->DB->simple_select( "*", "team_members" );
  $this->ipsclass->DB->simple_exec();
  while( $b = $this->ipsclass->DB->fetch_row() ){
$team_mem_data[] = $b;
  }

  foreach( $team_data as $teams ){
  if ($teams['leader_mid'] == $poster['id'] ){
$array[]	=	$teams['tname'];
  }	
}
  foreach( $team_mem_data as $team_mem ){
  if( $team_mem['mid'] == $poster['id'] && $team_mem['approved'] == "1"){
$array[] = $team_data_by_tid[ $team_mem['tid'] ]['tname'];	
  }
  }
  if (count($array) > 1){
  $poster['teams'] = "Teams: " . implode(", " , $array ) . "<br />";
 }elseif (count($array) == 1 ){
  $poster['teams'] = "Team: " . implode(", " , $array ) . "<br />";

 }
 //END MEMBER TEAMS ADD-ON

 

Save and upload /sources/lib/func_topic_linear.php

 

Next, open your ACP.

 

ACP=>Skin Manager=>(choose skin)=>Edit Root Skin Template HTML=>Topic View=>RenderRow

 

In the white box, FIND:

{$author['member_group']}<br />

ADD ABOVE THAT:

{$author['teams']}

 

That should work...it is right now set up to display more than one team(comma-seperated) if the postee is a member of more than one teams. Will not output anything if not a member of a team.

 

Part Two: View Teams in Profile

 

Open /sources/action_public/profile.php

 

Find:

		//-----------------------------------------
	// Email
	//-----------------------------------------

 

 

Add ABOVE:

		//--------------------------------------------
	// Member Teams Add-ON
	//--------------------------------------------

$team_data = array();
$team_data_by_tid = array();
$team_mem_data = array();
$array = array();
$this->ipsclass->DB->simple_select( "*", "teams" );
$this->ipsclass->DB->simple_exec();
while ( $a = $this->ipsclass->DB->fetch_row() ){
$team_data[] = $a;
$team_data_by_tid[ $a['tid'] ] = $a;
}
$this->ipsclass->DB->simple_select( "*", "team_members" );
$this->ipsclass->DB->simple_exec();
while( $b = $this->ipsclass->DB->fetch_row() ){
$team_mem_data[] = $b;
}

foreach( $team_data as $teams ){
if ($teams['leader_mid'] == $member['id'] ){
$array[] = $teams['tname'];
}
}
foreach( $team_mem_data as $team_mem ){
if( $team_mem['mid'] == $member['id'] && $team_mem['approved'] == "1" ){
$array[] = $team_data_by_tid[ $team_mem['tid'] ]['tname'];
}
}

if (count($array) > 0){
$mt2 = implode(", " , $array );
if( count($array) > 1 ){
	$mt_s = "s";
}else{
	$mt_s = "";
}

$info['interests'] .= "<tr>
				<td class='row2' valign='top'><b>Member of Team{$mt_s}</b></td>
				<td class='row1'>{$mt2}</td>
			</tr>";

}
//END MEMBER TEAMS ADD-ON

 

Save and upload /sources/action_public/profile.php.

 

Let me know of any problems or issues with this modification.

 

 

как будет выглядеть для 2,3,4 версии?=)

суть в том, что "клан" выводиться в инфу юзера (в теме и в профиле)

 

заранее Данкэ

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

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

это"хак" с оффсайта кланом, чтобы можно было выводить в Просмотрах темы (ну в инфе юзера) в каком клане он состоит.

на 2.3 версии не пашет

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

А зачем в тему лишнюю инфу ставить, тем более чем плохо когда просто в профиле пользователя это есть? post-61516-1205684316_thumb.jpg

В крайнем случае можно посмотреть, какая переменная за это отвечает и как-нибудь прописать её в окошке пользователся в темах.

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

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

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

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

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

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

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

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

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

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

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

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