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

[2.1.x]php to html 2.1


urisoft

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

Есть. В том числе и в этой теме, читайте.
Перечитал всю тему, не нашел для 2.3.6, пробовал поставить то, что есть, SQL запрос непроходит.

Не верю. Довольно сложно не заметить пост от автора мода с новым запросом на пять строк. На последних четырёх страницах смотрите.

Благодарю, нашел.

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

  • Ответы 231
  • Создана
  • Последний ответ

Лучшие авторы в этой теме

Лучшие авторы в этой теме

  • 4 недели спустя...
Если в теме больше одной страницы, появляется картнка http://www.ibresource.ru/forums/style_images/ibr/pages_icon.gif при клике по которой идет запрос сценария "Введите номер страницы на которую хотите перейти", так вот, при выборе любой страницы ошибка 404. возможно ли как то это исправить?
Ссылка на комментарий
Поделиться на других сайтах

скорее всего проблема в переменной яваскрипт

посмотрите в html код страницы в районе

 var ipb_var_base_url	  = "http://www.site.ru/index.html?&";

у меня проблемы с переходом нет, но возможно амперсанд я добавил интуитивно сам в ходе модификации

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

1. НЕ НАДО ЕГО УБРАТЬ

2. У МЕНЯ НЕТ ЭТОЙ ПРОБЛЕМЫ, А У ВАС ЕСТЬ

ну кто будет слушать! или читать внимательно!

 

вообще можно попробовать сделать в файле ipsclass.php

$buffer = preg_replace("/var ipb_var_base_url(.+?);/i","var ipb_var_base_url	  = \"".$this->vars['board_url']."/index.php?\";",$buffer);

в самом конце функции, отвечающей за мод

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

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

Вот рабочий для ipb 2.3.5 ;) переделал только запрос под ipb 2.3.5 :D

Настоящий владелец (с) UriSoft 2005

 

// *******************************************************
// PHP to HTML convertor v2.2 for IPB2.3.5
// (с) UriSoft 2005
// *******************************************************


// Изменяемые файлы:
// sources/classes/class_display.php
// sources/ipsclass.php
// sources/action_public/misc/print_page.php


// -----------------------------------------------------------------------------
// В файле 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_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', '1'
FROM ibf_conf_settings_titles WHERE conf_title_keyword LIKE ('general')



// -----------------------------
// Создать в корне форума файл .htaccess:
// -----------------------------
RewriteEngine On
RewriteRule ^index.htm index.php?%{QUERY_STRING}
RewriteRule ^index.html index.php?%{QUERY_STRING}
RewriteRule ^main.html index.php?act=idx&%{QUERY_STRING}
RewriteRule ^ipb.html index.php?%{QUERY_STRING}
RewriteRule ^topic([0-9]+)\.html$ index.php?showtopic=$1&%{QUERY_STRING}
RewriteRule ^topic([0-9]+)s([0-9]+)\.html$ index.php?showtopic=$1&st=$2&%{QUERY_STRING}
RewriteRule ^topic([0-9]+)\.html&st=([0-9]+)$ index.php?showtopic=$1&st=$2&%{QUERY_STRING}
RewriteRule ^forum([0-9]+)\.html$ index.php?showforum=$1&%{QUERY_STRING}
RewriteRule ^cat([0-9]+)\.html$ index.php?act=SC&c=$1&%{QUERY_STRING}
RewriteRule ^ptopic([0-9]+)\.html$ index.php?act=Print&client=printer&f=1&t=$1&%{QUERY_STRING}
RewriteRule ^user([0-9]+)\.html$ index.php?showuser=$1&%{QUERY_STRING}



// -----------------------------
// Включить конвертор в панели администрирования:
// -----------------------------

Tools & Settings -> General Configuration -> Converter Settings -> Enable PHP to HTML conversion ?

// -----------------------------
// Для запрета индексации "ненужной" части форума добавить в robots.txt
// -----------------------------

User-Agent: *
Disallow: /ipb

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

проверил у себя, точно такая же ссылка

проблема, стало быть, в настройках сервера, но решаемо след. способом

./jscripts/ipb_global.js

найти

window.location = url_bit + "&st=" + start;

заменить на

window.location = url_bit + "?st=" + start;

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

Оффтоп..

 

Меня все время интересовало, как сказывается на времени генерации страницы циклопических размеров preg_replace по всему output'у на каждой странице.

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

проверил у себя, точно такая же ссылка

проблема, стало быть, в настройках сервера, но решаемо след. способом

./jscripts/ipb_global.js

найти

window.location = url_bit + "&st=" + start;

заменить на

window.location = url_bit + "?st=" + start;

У меня нет такой строчки, есть похожая
window.location = url_bit + "&" + st_type + "=" + start;

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

  • 2 недели спустя...
Вот рабочий для ipb 2.3.5 ;) переделал только запрос под ipb 2.3.5 :D

Настоящий владелец (с) UriSoft 2005

 

// *******************************************************
// PHP to HTML convertor v2.2 for IPB2.3.5
// (с) UriSoft 2005
// *******************************************************

когда пользователь заблокирован, у него урл виду index.phpact вместо index.php?act
Ссылка на комментарий
Поделиться на других сайтах

  • 3 недели спустя...
  • 6 месяцев спустя...
  • 1 месяц спустя...
дайте готовое решение для 2.3.6 - заплачу 10wmz

 

Ещё два доплачу я за готовое решение :D

 

Такое, которое вберет в себя все недочеты и замены

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

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

×
×
  • Создать...

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

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