- Автор темы
- #1
как известно статичные страницы лучше индексируются поисковиками и следовательно даст большею посещаемость вашего форума, данный мод для движка форума ipb 2.1.3 поможет это сотворить
// *******************************************************
// PHP to HTML convertor v2.1 for IPB2.1F
// *******************************************************
// Изменяемые файлы:
// 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_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')
// -----------------------------
// Создать в корне форума файл .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 ^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
// *******************************************************
// PHP to HTML convertor v2.1 for IPB2.1F
// *******************************************************
// Изменяемые файлы:
// 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_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')
// -----------------------------
// Создать в корне форума файл .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 ^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