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

Нужна помощь в установке мода репутации


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

Нужна помощь в установке мода репутации Reputation_System_4.5.4_(Build_10008)

После установки выдаёт ошибку Fatal error: Call to undefined method ad_member::rep_rank_start() in "путь до папки/sources/action_admin/member.php" on line 165

после того как в админке в разделе управление в категории Пользователи и группы жмёшь на настройку "Управление модом репутации"

 

изменяемый кусок в файле member.php вот такой:

Open /sources/action_admin/member.php

 

Find:

case 'rank_delete':
			$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':title-remove' );
			$this->titles_delete_rank();
			break;

Заменить на:

//-----------------------------------------
		// reputation ranks / titles
		//-----------------------------------------
		case 'rep_rank':
			$this->rep_rank_start();
			break;
		case 'rep_rank_edit':
			$this->rep_rank_setup('edit');
			break;
		case 'rep_rank_add':
			$this->rep_rank_setup('add');
			break;
		case 'do_add_rep_rank':
			$this->rep_rank_add_rank();
			break;
		case 'do_edit_rep_rank':
			$this->rep_rank_edit_rank();
			break;
		case 'rep_rank_delete':
			$this->rep_rank_delete_rank();
			break;

Find:

//-----------------------------------------

function member_prune_confirm($ids=array(), $query)
{

Заменить на:

	//-----------------------------------------
// REPUTATION RANKS...
//-----------------------------------------

function rep_rank_recache()
{
	$this->ipsclass->cache['reputation_ranks'] = array();

	$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'reput_ranks', ) );
	$this->ipsclass->DB->simple_exec();

	while ($i = $this->ipsclass->DB->fetch_row())
	{
		$this->ipsclass->cache['reputation_ranks'][ $i['id'] ] = array( 'TITLE'  => $i['title'],
																		'PIPS'   => $i['pips'],
																		'AMOUNT' => $i['amount'],
																		'CODE'   => $i['code'],
																	   );
	}

	if (is_array ($this->ipsclass->cache['reputation_ranks']))
	{
		usort ($this->ipsclass->cache['reputation_ranks'], array( 'ad_member', 'rep_sort_special' ));
	}

	$this->ipsclass->update_cache( array( 'name' => 'reputation_ranks', 'array' => 1, 'deletefirst' => 1 ) );
	}

	function rep_sort_special ($a, $b)
	{
		if ($a['AMOUNT'] == $b['AMOUNT']) return 0;
		if ($a['AMOUNT'] * $b['AMOUNT'] <= 0)
		{
			return ($a['AMOUNT'] > $b['AMOUNT']) ? -1 : 1;
		}
		elseif ( $a['AMOUNT'] >= 0 and $b['AMOUNT'] >= 0 )
		{
			return ($a['AMOUNT'] > $b['AMOUNT']) ? -1 : 1;
		}
		elseif ( $a['AMOUNT'] < 0 and $b['AMOUNT'] < 0 )
		{
			return ($a['AMOUNT'] < $b['AMOUNT']) ? -1 : 1;
		}
	}

	function rep_rank_start()
	{
		$this->ipsclass->admin->page_title = "Member Reputation Ranking Set Up";

		$this->ipsclass->admin->page_detail = "This section allows you to modify, delete or add extra reputation ranks.<br />If you wish to display pips below the members name, enter the number of pips. If you wish to use a custom image, simply enter the image name in the pips box. Note, these custom images must reside in the 'style_images/{img_dir}/folder_team_icons' directory of your installation";

		//-----------------------------------------

		$this->ipsclass->adskin->td_header[] = array( "Title"	  , "30%" );
		$this->ipsclass->adskin->td_header[] = array( "Min Posts"  , "10%" );
		$this->ipsclass->adskin->td_header[] = array( "Pips"	   , "10%" );
		$this->ipsclass->adskin->td_header[] = array( "Type"	   , "10%" );
		$this->ipsclass->adskin->td_header[] = array( " "	 , "20%" );
		$this->ipsclass->adskin->td_header[] = array( " "	 , "20%" );

		//-----------------------------------------
		// Parse macro
		//-----------------------------------------

		$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'skin_sets', 'where' => "set_default=1" ) );
		$this->ipsclass->DB->simple_exec();

		$mid = $this->ipsclass->DB->fetch_row();

		$this->ipsclass->DB->simple_construct( array( 'select' => 'macro_value, macro_replace', 'from' => 'skin_macro', 'where' => "macro_set=1 AND macro_value='R_STAR_GOOD' OR macro_value='R_STAR_BAD'" ) );
		$this->ipsclass->DB->simple_exec();

		while ( $row = $this->ipsclass->DB->fetch_row() )
		{
			$star[ $row['macro_value'] ] = str_replace( "<#IMG_DIR#>", $mid['set_image_dir'], $row['macro_replace'] );
			$star[ $row['macro_value'] ] = preg_replace( "#style_images#", $this->ipsclass->vars['board_url'].'/style_images', $row['macro_replace'] );
		}

		$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Reputation Titles/Ranks" );

		//-----------------------------------------
		// Lets get on with it...
		//-----------------------------------------

		$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'reput_ranks', 'order' => "amount" ) );
		$this->ipsclass->DB->simple_exec();

		while ( $r = $this->ipsclass->DB->fetch_row() )
		{
			$img = "";

			if ( preg_match( "/^\d+$/", $r['pips'] ) )
			{
				$star['R_STAR'] = $r['code'] == '01' ? $star['R_STAR_GOOD'] : $star['R_STAR_BAD'];

				for ($i = 1; $i <= $r['pips']; $i++)
				{
					$img .= $star['R_STAR'];
				}
			}
			else
			{
				$img = "<img src='style_images/{$mid['set_image_dir']}/folder_team_icons/{$r['pips']}' border='0'>";
			}

			 $r_type = $r['code'] == '01' ? 'Good' : 'Bad';

			$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>".$r['title']."</b>" ,
																				 $r['amount'],
																				 $img,
																				 $r_type,
																				 "<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=rep_rank_edit&id={$r['id']}'>Edit</a>",
																				 "<a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=rep_rank_delete&id={$r['id']}'>Delete</a>",
																	   )	  );
		}

		$this->ipsclass->html .= $this->ipsclass->adskin->end_table();

		//-----------------------------------------

		$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code'  , 'do_add_rep_rank' ),
																				 2 => array( 'act'   , 'mem' ),
																				 3 => array( 'section', $this->ipsclass->section_code ),
																	)	  );

		//-----------------------------------------

		$this->ipsclass->adskin->td_header[] = array( " "  , "40%" );
		$this->ipsclass->adskin->td_header[] = array( " "  , "60%" );

		//-----------------------------------------

		$code = array( 0 => array( '01', 'Good' ), 1 => array( '02', 'Bad' ) );

		$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Add a Reputation Rank" );
		$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Rank Title</b>" ,
																			 $this->ipsclass->adskin->form_input( "title" )
																	)	  );

		$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Minimum number of reputation points needed</b>" ,
																			 $this->ipsclass->adskin->form_input( "amount" )
																	)	  );

		$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Number of pips</b><div class='graytext'>Or pip image - image must be uploaded into 'style_images/{img_dir}/folder_team_icons'</div>" ,
																			 $this->ipsclass->adskin->form_input( "pips" )
																	 )	  );

		$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Use for what reputation</b><div class='graytext'>Allows usage of 2 different types of pips for both good and bad reputation</div>" ,
																			 $this->ipsclass->adskin->form_dropdown( "rtype", $code, "01" )
																	)	  );

		$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Add this rank");

		$this->ipsclass->html .= $this->ipsclass->adskin->end_table();

		$this->ipsclass->admin->output();
	}

	//-----------------------------------------

	function rep_rank_add_rank()
	{
		//-----------------------------------------
		// check for input
		//-----------------------------------------

		foreach( array( 'rtype', 'amount', 'title', 'pips' ) as $field )
		{
			if ($this->ipsclass->input[ $field ] == "")
			{
				$this->ipsclass->admin->error("You must complete the form fully");
			}
		}

		//-----------------------------------------
		// Add it to the DB
		//-----------------------------------------

		$this->ipsclass->DB->force_data_type = array( 'code'  => 'string' );

		$this->ipsclass->DB->do_insert( 'reput_ranks', array( 'amount'  => trim($this->ipsclass->input['amount']),
															  'title'   => trim($this->ipsclass->input['title']),
															  'pips'	=> trim($this->ipsclass->input['pips']),
															  'code'	=> trim($this->ipsclass->input['rtype']),
													 )	   );
		$this->rep_rank_recache();

		$this->ipsclass->admin->done_screen("Reputation Rank Added", "Member Reputation Ranking Control", "{$this->ipsclass->form_code}&code=rep_rank", 'redirect' );
	}

	//-----------------------------------------

	function rep_rank_delete_rank()
	{
		//-----------------------------------------
		// check for input
		//-----------------------------------------

		if ($this->ipsclass->input['id'] == "")
		{
			$this->ipsclass->admin->error("We could not match that ID");
		}

		$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'reput_ranks', 'where' => "id='".$this->ipsclass->input['id']."'" ) );

		$this->rep_rank_recache();

		$this->ipsclass->admin->save_log("Removed Reputation Rank Setting");

		$this->ipsclass->admin->done_screen("Rank Removed", "Reputation Ranking Control", "{$this->ipsclass->form_code}&code=rep_rank", 'redirect' );
	}

	//-----------------------------------------

	function rep_rank_edit_rank()
	{
		//-----------------------------------------
		// check for input
		//-----------------------------------------

		if ($this->ipsclass->input['id'] == "")
		{
			$this->ipsclass->admin->error("We could not match that ID");
		}

		//-----------------------------------------

		foreach( array( 'rtype', 'amount', 'title', 'pips' ) as $field )
		{
			if ($this->ipsclass->input[ $field ] == "")
			{
				$this->ipsclass->admin->error("You must complete the form fully");
			}
		}

		//-----------------------------------------
		// Add it to the DB
		//-----------------------------------------

		$this->ipsclass->DB->force_data_type = array( 'code'  => 'string' );

		$this->ipsclass->DB->do_update( 'reput_ranks', array ( 'amount' => trim($this->ipsclass->input['amount']),
															   'title'  => trim($this->ipsclass->input['title']),
															   'pips'   => trim($this->ipsclass->input['pips']),
															   'code'   => trim($this->ipsclass->input['rtype']),
									   ), "id='".$this->ipsclass->input['id']."'"  );

		$this->rep_rank_recache();

		$this->ipsclass->admin->save_log("Edited Rank Setting");

		$this->ipsclass->admin->done_screen("Reputation Rank Edited", "Reputation Ranking Control", "{$this->ipsclass->form_code}&code=rep_rank", 'redirect' );
	}

	//-----------------------------------------

	function rep_rank_setup($mode='edit')
	{
		$this->ipsclass->admin->page_title = "Reputation Rank Set Up";

		$this->ipsclass->admin->page_detail = "If you wish to display pips below the members name, enter the number of pips. If you wish to use a custom image, simply enter the image name in the pips box. Note, these custom images must reside in the 'style_images/{img_dir}/folder_team_icons' directory of your installation";

		if ($mode == 'edit')
		{
			$form_code = 'do_edit_rep_rank';

			if ($this->ipsclass->input['id'] == "")
			{
				$this->ipsclass->admin->error("No rank ID was set, please try again");
			}

			$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'reput_ranks', 'where' => "id='".$this->ipsclass->input['id']."'" ) );
			$this->ipsclass->DB->simple_exec();

			$rank = $this->ipsclass->DB->fetch_row();
			$button = "Complete Edit";
		}
		else
		{
			$form_code = 'do_add_rep_rank';
			$rank = array( 'posts' => "", 'title' => "", 'pips' => "");
			$button = "Add this rank";
		}

		//-----------------------------------------

		$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code'  , $form_code  ),
																	  2 => array( 'act'   , 'mem'	   ),
																	  3 => array( 'id'	, $rank['id'] ),
																	  4 => array( 'section', $this->ipsclass->section_code ),
																	)	  );

		//-----------------------------------------

		$this->ipsclass->adskin->td_header[] = array( " "  , "40%" );
		$this->ipsclass->adskin->td_header[] = array( " "  , "60%" );

		//-----------------------------------------

		$code = array( 0 => array( '01', 'Good' ), 1 => array( '02', 'Bad' ) );

		$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Reputation Ranks" );

		$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Rank Title</b>" ,
																			 $this->ipsclass->adskin->form_input( "title", $rank['title'] )
																	)	  );

		$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Minimum number of reputation points needed</b>" ,
																			 $this->ipsclass->adskin->form_input( "amount", $rank['amount'] )
																	)	  );

		$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Number of pips</b><div class='graytext'>Or pip image - image must be uploaded into 'style_images/{img_dir}/folder_team_icons'</div>" ,
																			 $this->ipsclass->adskin->form_input( "pips", $rank['pips'] )
																	)	  );

		$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Use for what reputation</b><div class='graytext'>Allows usage of 2 different types of pips for both good and bad reputation</div>" ,
																			 $this->ipsclass->adskin->form_dropdown( "rtype", $code, $rank['code'] )
																	 )	  );

		$this->ipsclass->html .= $this->ipsclass->adskin->end_form($button);

		$this->ipsclass->html .= $this->ipsclass->adskin->end_table();

		$this->ipsclass->admin->output();
}

 

 

Что не так делаю? Всё сделал правильно но не работает нифига, резервная копия файла есть. Прошу помочь разобраться.

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

Выдаёт ошибку в папке cache при заходе в сообщении на форуме

 

Время: Thu, 26 Jul 2007 15:35:48 +0400

Код ошибки: 1054

Сообщение сервера: Unknown column 'm.rep' in 'field list'

IP Адрес клиента: мой

Запрос: SELECT p.*, pp.*,

m.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn, m.rep, m.rep_all, m.allow_anon, m.allow_rep,

me.msnname,me.aim_name,me.icq_number,me.signature, me.website,me.yahoo,me.location, me.avatar_location, me.avatar_type, me.avatar_size, m.members_display_name

FROM ibf_posts p

LEFT JOIN ibf_members m ON (m.id=p.author_id)

LEFT JOIN ibf_profile_portal pp ON (m.id=pp.pp_member_id)

LEFT JOIN ibf_member_extra me ON (me.id=m.id)

WHERE p.pid IN(16)

ORDER BY pid asc

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

  • 6 месяцев спустя...
Ставьте себе 4.6.1 или .4.6.2.,смогу помогу,но для форума 2.3.х
Ссылка на комментарий
Поделиться на других сайтах

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

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

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

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

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

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

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

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

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

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

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