#
# Aktualizacja dla for phpBB modified by Przemo
#

#
# Usu pliki:
#  cache/rewrite.post_topic.php
#  cache/rewrite.post_topic_count.php
#  includes/wanime_ad.php
#

#
#-----[ COPY ]------------------------------------------
#
copy  root/admin/*                    to admin/
copy  root/includes/*                 to includes/
copy  root/language/*                 to language/
copy  root/templates/*                to templates/
copy  root/.htaccess                  to .htaccess
copy  root/sitemap.php                to sitemap.php

#
#-----[ SQL ]------------------------------------------
#
DELETE FROM phpbb_config WHERE config_name = 'sf_cache_refresh_on_post' LIMIT 1;
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sf_rewrite_index', 1);
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sf_cache_read_mode', 'file-direct');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sf_cache_refresh_mode', 'post');

#
#-----[ OPEN ]------------------------------------------
#
incluses/sessions.php

#
#-----[ FIND ]------------------------------------------
#
	if ( user_is_spider() )

#
#-----[ REPLACE WITH ]------------------------------------------
#
	if ( user_is_spider() && !defined('MRW_SPIDER_FORCED') )

#
#-----[ FIND ]------------------------------------------
#
# i jeszcze raz to samo...
#
	if ( user_is_spider() )

#
#-----[ REPLACE WITH ]------------------------------------------
#
	if ( user_is_spider() && !defined('MRW_SPIDER_FORCED') )

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php

#
#-----[ FIND ]------------------------------------------
#
	global $board_config, $lang, $db, $phpbb_root_path, $phpEx;

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$board_config

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $sfc

#
#-----[ FIND ]------------------------------------------
#
		add_search_words(0, $post_id, stripslashes($post_message), stripslashes($post_subject . ' ' . $post_subject));
	}

#
#-----[ AFTER, ADD ]------------------------------------------
#
	// Spider Fiendly Post > Topic cache
	if( $sfc['postlink_rewrite'] && $sfc['cache_refresh_mode'] == 'post' && $mode != 'editpost' )
	{
		build_post_topic_cache('post', $topic_id);
	}

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_remove.php

#
#-----[ FIND ]------------------------------------------
#
		delete_this_post($post_id);

#
#-----[ REPLACE WITH ]------------------------------------------
#
		delete_this_post($post_id, $topic_id);

#
#-----[ FIND ]------------------------------------------
#
function delete_this_post($post_id)
{
	global $db, $phpbb_root_path, $phpEx, $board_config, $table_prefix;

#
#-----[ REPLACE WITH ]------------------------------------------
#
function delete_this_post($post_id, $topic_id)
{
	global $db, $phpbb_root_path, $sfc, $phpEx, $board_config, $table_prefix;

#
#-----[ FIND ]------------------------------------------
#
	delete_attachment(explode(', ', $post_id));

#
#-----[ AFTER, ADD ]------------------------------------------
#
	// Spider Fiendly Post > Topic cache
	if( $sfc['postlink_rewrite'] && $sfc['cache_refresh_mode'] == 'post' )
	{
		build_post_topic_cache('post', $topic_id);
	}

#
#-----[ FIND ]------------------------------------------
#
		delete_this_post($post_id_sql);

#
#-----[ REPLACE WITH ]------------------------------------------
#
		delete_this_post($post_id_sql, $topics_id);

#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#
	$u_index_portal = append_sid(get_board_url());

#
#-----[ REPLACE WITH ]------------------------------------------
#
	$u_index_portal = append_sid(get_board_index());

#
#-----[ FIND ]------------------------------------------
#
	'U_INDEX' => append_sid(get_board_url()),

#
#-----[ REPLACE WITH ]------------------------------------------
#
	'U_INDEX' => append_sid(get_board_index()),
