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

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

Кто может помочь переделать вот этот мод под версию 2.3.1?

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

Спасибо.

// -----------------------------------------------------------------------------
// В файле sources/classes/class_display.php
// -----------------------------------------------------------------------------
// Найти:
// -----------------------------

/*-------------------------------------------------------------------------*/
//
// Parses all the information and prints it.
//
/*-------------------------------------------------------------------------*/

function do_output($output_array)
{

// -----------------------------
// Вставить выше:
// -----------------------------

//-------------------------------------------
// Hack. Convert php to html (class display)
//-------------------------------------------
function do_php_to_html($buffer)
{
	if ($this->ipsclass->vars['php_to_html'] == 1)
	{
		$forum_url = str_replace("/","\/",$this->ipsclass->vars['board_url']);
		$forum_url = str_replace(":","\:",$forum_url);
		$forum_url = str_replace(".","\.",$forum_url);
		$s_search = array("'(\?|\&|\&)s=[0-9a-zA-Z]{32}(?:\&|\&)'i",
				  "'(?:\&|\&)s=[0-9a-zA-Z]{32}'i",
				  "'\?s=[0-9a-zA-Z]{32}'i");
		$s_replace = array("\\1",
				   "",
				   "");
		$search = array("'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=idx(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=idx([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=home(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=home([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=portal(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=portal([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showforum=([0-9]{1,5})(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showforum=([0-9]{1,5})([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=SF(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=SF(?:\&|\&)f=([0-9]{1,5})([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showtopic=([0-9]{1,5})(?:\&|\&)st=([0-9]{1,5})(?:\&|\&)hl=([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showtopic=([0-9]{1,5})(?:\&|\&)st=([0-9]{1,5})(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showtopic=([0-9]{1,5})(?:\&|\&)st=([0-9]{1,5})([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showtopic=([0-9]{1,5})(?:\&|\&)hl=([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showtopic=([0-9]{1,5})(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showtopic=([0-9]{1,5})([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?(?:\&|\&)*?act=ST(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)t=([0-9]{1,5})(?:\&|\&)st=([0-9]{1,5})(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?(?:\&|\&)*?act=ST(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)t=([0-9]{1,5})(?:\&|\&)st=([0-9]{1,5})([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?(?:\&|\&)*?act=ST(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)t=([0-9]{1,5})(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?(?:\&|\&)*?act=ST(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)t=([0-9]{1,5})([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=SC(?:\&|\&)c=([0-9]{1,5})(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=SC(?:\&|\&)c=([0-9]{1,5})([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?c=([0-9]{1,5})(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?c=([0-9]{1,5})([\"\'])'i",

						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=Print(?:\&|\&)client=printer(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)t=([0-9]{1,5})([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showuser=([0-9]{1,5})(?:\&|\&)(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showuser=([0-9]{1,5})([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?(?:\&|\&)*?act=Profile(?:\&|\&)CODE=03(?:\&|\&)MID=([0-9]{1,5})([\"\'])'i",

						"'".$forum_url."\/index\.php\?s=([\"\'])'i",
						"'".$forum_url."\/index\.php(\?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=(\S*?)([\"\'])'i",
						"'".$forum_url."\/index\.php\?(\S*?)([\"\'])'i");
		$replace = array($this->ipsclass->vars['board_url']."/main.html?\\1\\2",
						$this->ipsclass->vars['board_url']."/main.html\\1",
						$this->ipsclass->vars['board_url']."/index.html?\\1\\2",
						$this->ipsclass->vars['board_url']."/index.html\\1",
						$this->ipsclass->vars['board_url']."/index.html?\\1\\2",
						$this->ipsclass->vars['board_url']."/index.html\\1",
						$this->ipsclass->vars['board_url']."/forum\\1.html?\\2\\3",
						$this->ipsclass->vars['board_url']."/forum\\1.html\\2",
						$this->ipsclass->vars['board_url']."/forum\\1.html?\\2\\3",
						$this->ipsclass->vars['board_url']."/forum\\1.html\\2",
						$this->ipsclass->vars['board_url']."/topic\\1s\\2.html\\3",
						$this->ipsclass->vars['board_url']."/topic\\1s\\2.html?\\3\\4",
						$this->ipsclass->vars['board_url']."/topic\\1s\\2.html\\3",
						$this->ipsclass->vars['board_url']."/topic\\1.html\\2",
						$this->ipsclass->vars['board_url']."/topic\\1.html?\\2\\3",
						$this->ipsclass->vars['board_url']."/topic\\1.html\\2",
						$this->ipsclass->vars['board_url']."/topic\\2s\\3.html?\\4\\5",
						$this->ipsclass->vars['board_url']."/topic\\2s\\3.html\\4",
						$this->ipsclass->vars['board_url']."/topic\\2.html?\\3\\4",
						$this->ipsclass->vars['board_url']."/topic\\2.html\\3",
						$this->ipsclass->vars['board_url']."/cat\\1.html?\\2\\3",
						$this->ipsclass->vars['board_url']."/cat\\1.html\\2",
						$this->ipsclass->vars['board_url']."/cat\\1.html?\\2\\3",
						$this->ipsclass->vars['board_url']."/cat\\1.html\\2",

						$this->ipsclass->vars['board_url']."/ptopic\\2.html\\3",
						$this->ipsclass->vars['board_url']."/user\\1.html?\\2\\3",
						$this->ipsclass->vars['board_url']."/user\\1.html\\2",
						$this->ipsclass->vars['board_url']."/user\\1.html\\2",

						$this->ipsclass->vars['board_url']."/index.html\\1",
						$this->ipsclass->vars['board_url']."/index.html\\1\\2",
						$this->ipsclass->vars['board_url']."/ipb.html?act=\\1\\2",
						$this->ipsclass->vars['board_url']."/ipb.html?\\1\\2");
		$buffer = preg_replace($s_search,$s_replace,$buffer);
		$buffer = preg_replace($search,$replace,$buffer);
	}
	return $buffer;
}


// -----------------------------
// Найти:
// -----------------------------

	print $this->ipsclass->skin['_wrapper'];

// -----------------------------
// Вставить выше:
// -----------------------------

	$this->ipsclass->skin['_wrapper'] = $this->do_php_to_html($this->ipsclass->skin['_wrapper']);

// -----------------------------
// Найти (2 раза):
// -----------------------------

	echo ($html);
	exit;

// -----------------------------
// Вставить выше:
// -----------------------------

	$html = $this->do_php_to_html($html);




// -----------------------------------------------------------------------------
// В файле sources/ipsclass.php
// -----------------------------------------------------------------------------
// Найти:
// -----------------------------


/*-------------------------------------------------------------------------*/
//
// Redirect using HTTP commands, not a page meta tag.
//
/*-------------------------------------------------------------------------*/

/**
* HTTP redirect with out message screen
*
* @param	string	URL to load
* @return	void
* @since	2.0
*/
function boink_it($url)
{


// -----------------------------
// Вставить выше:
// -----------------------------

//-------------------------------------------
// Hack. Convert php to html (class FUNC)
//-------------------------------------------
function do_php_to_html($buffer)
{
	if ($this->vars['php_to_html'] == 1)
	{
		$forum_url = str_replace("/","\/",$this->vars['board_url']);
		$forum_url = str_replace(":","\:",$forum_url);
		$forum_url = str_replace(".","\.",$forum_url);
		$s_search = array("'(\?|\&|\&)s=[0-9a-zA-Z]{32}(?:\&|\&)'i",
				  "'(?:\&|\&)s=[0-9a-zA-Z]{32}'i",
				  "'\?s=[0-9a-zA-Z]{32}'i");
		$s_replace = array("\\1",
				   "",
				   "");
		$search = array("'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=idx(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=idx'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=home(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=home'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=portal(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=portal'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showforum=([0-9]{1,5})(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showforum=([0-9]{1,5})'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=SF(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=SF(?:\&|\&)f=([0-9]{1,5})'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showtopic=([0-9]{1,5})(?:\&|\&)st=([0-9]{1,5})(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showtopic=([0-9]{1,5})(?:\&|\&)st=([0-9]{1,5})'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showtopic=([0-9]{1,5})(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showtopic=([0-9]{1,5})'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=ST(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)t=([0-9]{1,5})(?:\&|\&)st=([0-9]{1,5})(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=ST(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)t=([0-9]{1,5})(?:\&|\&)st=([0-9]{1,5})'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=ST(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)t=([0-9]{1,5})(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=ST(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)t=([0-9]{1,5})'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=SC(?:\&|\&)c=([0-9]{1,5})(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=SC(?:\&|\&)c=([0-9]{1,5})'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?c=([0-9]{1,5})(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?c=([0-9]{1,5})'i",

						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=Print(?:\&|\&)client=printer(?:\&|\&)f=([0-9]{1,5})(?:\&|\&)t=([0-9]{1,5})'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showuser=([0-9]{1,5})(?:\&|\&)(\S*?)'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?showuser=([0-9]{1,5})'i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?(?:\&|\&)*?act=Profile(?:\&|\&)CODE=03(?:\&|\&)MID=([0-9]{1,5})'i",

						"'".$forum_url."\/index\.php\?s='i",
						"'".$forum_url."\/index\.php\?(?:s=(?:\&|\&))*?act=(\S*?)'i",
						"'".$forum_url."\/index\.php\?(\S*?)'i",
  							"'".$forum_url."\/index\.php'i");
		$replace = array($this->vars['board_url']."/main.html?\\1",
						$this->vars['board_url']."/main.html",
						$this->vars['board_url']."/index.html?\\1",
						$this->vars['board_url']."/index.html",
						$this->vars['board_url']."/index.html?\\1",
						$this->vars['board_url']."/index.html",
						$this->vars['board_url']."/forum\\1.html?\\2",
						$this->vars['board_url']."/forum\\1.html",
						$this->vars['board_url']."/forum\\1.html?\\2",
						$this->vars['board_url']."/forum\\1.html",
						$this->vars['board_url']."/topic\\1s\\2.html?\\3",
						$this->vars['board_url']."/topic\\1s\\2.html",
						$this->vars['board_url']."/topic\\1.html?\\2",
						$this->vars['board_url']."/topic\\1.html",
						$this->vars['board_url']."/topic\\2s\\3.html?\\4",
						$this->vars['board_url']."/topic\\2s\\3.html",
						$this->vars['board_url']."/topic\\2.html?\\3",
						$this->vars['board_url']."/topic\\2.html",
						$this->vars['board_url']."/cat\\1.html?\\2",
						$this->vars['board_url']."/cat\\1.html",
						$this->vars['board_url']."/cat\\1.html?\\2",
						$this->vars['board_url']."/cat\\1.html",

						$this->vars['board_url']."/ptopic\\2.html",
						$this->vars['board_url']."/user\\1.html?\\2",
						$this->vars['board_url']."/user\\1.html",
						$this->vars['board_url']."/user\\1.html",

						$this->vars['board_url']."/index.html",
						$this->vars['board_url']."/ipb.html?act=\\1",
						$this->vars['board_url']."/ipb.html?\\1",
						$this->vars['board_url']."/index.html");
		$buffer = preg_replace($s_search,$s_replace,$buffer);
		$buffer = preg_replace($search,$replace,$buffer);
	}
	return $buffer;
}


// -----------------------------
// Найти:
// -----------------------------

function boink_it($url)
{

// -----------------------------
// Вставить ниже:
// -----------------------------

	$url = $this->do_php_to_html($url);






// -----------------------------------------------------------------------------
// В файле sources/action_public/misc/print_page.php
// -----------------------------------------------------------------------------
// Найти:
// -----------------------------

	return $posts_html;

// -----------------------------
// Вставить выше:
// -----------------------------

	$posts_html = $this->ipsclass->print->do_php_to_html($posts_html);




// -----------------------------
// В MySQL выполнить запрос:
// ВНИМАНИЕ! Заменить ibf_ на ваш префикс
// -----------------------------
// Это ОДИН запрос

INSERT INTO `ibf_conf_settings` ( `conf_title` , `conf_description` , `conf_group` , `conf_type` , `conf_key` , `conf_value` , `conf_default` , `conf_extra` , `conf_evalphp` , `conf_protected` , `conf_position` , `conf_start_group` , `conf_end_group` , `conf_help_key` , `conf_add_cache` )
SELECT  'Enable PHP to HTML conversion ?', 'Before enable this features you must right set .htaccess file.', conf_title_id, 'yes_no', 'php_to_html', '', '0', '', '', '1', '127', 'Converter Settings', '1', '0', '1'
FROM ibf_conf_settings_titles WHERE conf_title_keyword LIKE ('general')
Изменено пользователем Soontir Fel
Ссылка на комментарий
Поделиться на других сайтах

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

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

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

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

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

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

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

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

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

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

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