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

Помогите разобраться с тегами


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

Я вот не могу разобраться с раскрывающимся меню.

Ну вот что получилось

 

$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Звания:</b>" , 
$this->ipsclass->adskin->form_dropdown("zvanija", array( 0 => array( 'local' , 'Галерея' ),
1 => array( 'url' , 'Ссылка (URL)' ),
2 => array( 'upload' , 'Загрузить аватар' ),
), $r['zvanija']),
) );

 

У меня в раскрывающимся меню видно Галерея, Ссылка, Загрузить аватор… ну это понятно, и понятно что в ДБ zvanija будет добавлено в место Галерея-local,Ссылка-url,Загрузка аватора-upoad. А вот проблема в отображение

 

$this->output .= $this->ipsclass->compiled_templates['skin_help']->display( $this->ipsclass->text_tidy( $topic['zvanija'] ) );

 

Он отображает local,url,upload... а что мне изменить что бы это было по русски точнее в место local-Галерея,url-Ссылка,upload-Загрузка аватар

 

 

--------------------------------------------

 

 

Мне подсказали вот этот код:

 

$zvanija = array('local' => 'Галерея',  'url' => 'Ссылка (URL)',  'upload' => 'Загрузить аватар');foreach($topic['zvanija'] as $id=>$value) {	 $tmpArray[$id] = $zvanija[$value];}$topic['zvanija'] = $tmpArray;

 

--------------------------------------------

 

 

Вот только не пойму куда вставлять ?

 

<?php


if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Некорректный адрес</h1>Вы не имеете доступа к этому файлу напрямую. Если вы недавно обновляли форум, вы должны обновить все соответствующие файлы.";
exit();
}

class help
{
# Classes
var $ipsclass;

# Others
var $output	 = "";
var $page_title = "";
var $nav		= array();
var $html	   = "";

/*-------------------------------------------------------------------------*/
// Auto run
/*-------------------------------------------------------------------------*/

function auto_run()
{
	//-----------------------------------------
	// Require the HTML and language modules
	//-----------------------------------------

	$this->ipsclass->load_language('lang_help');
	$this->ipsclass->load_template('skin_help');

	$this->base_url  = $this->ipsclass->base_url;

	//-----------------------------------------
	// What to do?
	//-----------------------------------------

	switch($this->ipsclass->input['CODE'])
	{
		case '01':
			$this->show_section();
			break;
		case '02':
			$this->do_search();
			break;
		default:
			$this->show_titles();
			break;
	}

	//-----------------------------------------
	// If we have any HTML to print, do so...
	//-----------------------------------------

	$this->ipsclass->print->add_output("$this->output");
	$this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
}

/*-------------------------------------------------------------------------*/
// Show Titles
/*-------------------------------------------------------------------------*/

function show_titles()
{
	$seen = array();

	$this->output = $this->ipsclass->compiled_templates['skin_help']->start( $this->ipsclass->lang['page_title'], $this->ipsclass->lang['help_txt'], $this->ipsclass->lang['choose_file'] );

	$this->ipsclass->DB->simple_construct( array( 'select' => 'id, title, description',
								  'from'   => 'faq',
								  'order'  => 'title ASC'
						 )	  );
	$this->ipsclass->DB->simple_exec();

	$cnt = 0;

	while ($row = $this->ipsclass->DB->fetch_row() )
	{

		if (isset($seen[ $row['title'] ]) )
		{
			continue;
		}
		else
		{
			$seen[ $row['title'] ] = 1;
		}

		$row['CELL_COLOUR'] = $cnt % 2 ? 'row1' : 'row2';

		$cnt++;

		$this->output .= $this->ipsclass->compiled_templates['skin_help']->row($row);

	}

	$this->output .= $this->ipsclass->compiled_templates['skin_help']->help_end();

	$this->page_title = $this->ipsclass->lang['page_title'];
	$this->nav		= array( $this->ipsclass->lang['page_title'] );
}

/*-------------------------------------------------------------------------*/
// Show section
/*-------------------------------------------------------------------------*/

function show_section()
{
	$id = $this->ipsclass->input['HID'];

	if (! preg_match( "/^(\d+)$/" , $id ) )
	{
		$this->show_titles();
		return;
	}

	$this->ipsclass->DB->simple_construct( array( 'select' => 'id, title, zvanija, dolzhnost, fio, icq, email, data, mestozhilja, vrez, text',
								  'from'   => 'faq',
								  'where'  => "ID='$id'"
						 )	  );
	$this->ipsclass->DB->simple_exec();

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

	$this->output  = $this->ipsclass->compiled_templates['skin_help']->start( $this->ipsclass->lang['help_topic'], $this->ipsclass->lang['topic_text'], $topic['title'] );		
  $this->output .= $this->ipsclass->compiled_templates['skin_help']->display( $this->ipsclass->text_tidy( $topic['zvanija'] ) );

	$this->output .= $this->ipsclass->compiled_templates['skin_help']->display( $this->ipsclass->text_tidy( $topic['dolzhnost'] ) );
	$this->output .= $this->ipsclass->compiled_templates['skin_help']->display( $this->ipsclass->text_tidy( $topic['fio'] ) );
	$this->output .= $this->ipsclass->compiled_templates['skin_help']->display( $this->ipsclass->text_tidy( $topic['icq'] ) );
	$this->output .= $this->ipsclass->compiled_templates['skin_help']->display( $this->ipsclass->text_tidy( $topic['email'] ) );
	$this->output .= $this->ipsclass->compiled_templates['skin_help']->display( $this->ipsclass->text_tidy( $topic['data'] ) );
	$this->output .= $this->ipsclass->compiled_templates['skin_help']->display( $this->ipsclass->text_tidy( $topic['mestozhilja'] ) );
	$this->output .= $this->ipsclass->compiled_templates['skin_help']->display( $this->ipsclass->text_tidy( $topic['vrez'] ) );
	$this->output .= $this->ipsclass->compiled_templates['skin_help']->display( $this->ipsclass->text_tidy( $topic['text'] ) );
	$this->output .= $this->ipsclass->compiled_templates['skin_help']->help_end();

	$this->page_title = $this->ipsclass->lang['help_topic'];
	$this->nav		= array( "<a href='{$this->base_url}&act=Help'>{$this->ipsclass->lang['help_topics']}</a>", $this->ipsclass->lang['help_topic'] );
}		

/*-------------------------------------------------------------------------*/
// Do search
/*-------------------------------------------------------------------------*/

function do_search()
{
	if (empty( $this->ipsclass->input['search_q'] ) )
	{
		$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_help_file') );
	}

	$search_string = strtolower( str_replace( "*" , "%", $this->ipsclass->input['search_q'] ) );
	$search_string = preg_replace( "/[<>\!\@Ј\$\^&\+\=\=\[\]\{\}\(\)\"':;\.,\/]/", "", $search_string );

	$seen = array();

	$this->output = $this->ipsclass->compiled_templates['skin_help']->start( $this->ipsclass->lang['page_title'], $this->ipsclass->lang['results_txt'], $this->ipsclass->lang['search_results'] );

	$this->ipsclass->DB->cache_add_query( 'help_search', array( 'search_string' => $search_string ) );
	$this->ipsclass->DB->cache_exec_query();

	$cnt = 0;

	while ($row = $this->ipsclass->DB->fetch_row() )
	{

		if (isset($seen[ $row['title'] ]) )
		{
			continue;
		}
		else
		{
			$seen[ $row['title'] ] = 1;
		}

		$row['CELL_COLOUR'] = $cnt % 2 ? 'row1' : 'row2';

		$cnt++;

		$this->output .= $this->ipsclass->compiled_templates['skin_help']->row($row);

	}

	if ($cnt == 0)
	{
		$this->output .= $this->ipsclass->compiled_templates['skin_help']->no_results();
	}

	$this->output .= $this->ipsclass->compiled_templates['skin_help']->help_end();

	$this->page_title = $this->ipsclass->lang['page_title'];
	$this->nav		= array( "<a href='{$this->base_url}&act=Help'>{$this->ipsclass->lang['help_topics']}</a>", $this->ipsclass->lang['results_title'] );
}


}

?>

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

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

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

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

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

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

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

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

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

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

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

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