<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
<!--NOTICE: Please open this file in your web browser. If presented with a security warning, you may safely tell it to allow the blocked content.-->
<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD.\nAlthough MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD.\nNo support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
	<header>
		<meta name="generator" content="MODX file generated with PP MODX Creator by tumba25 (online version)"/>
		<license><![CDATA[http://opensource.org/licenses/gpl-license.php GNU General Public License v2]]></license>
		<title lang="en"><![CDATA[RAnon forum (Anonymous forum)]]></title>
		<description lang="en"><![CDATA[Update 0.1a to 0.2]]></description>
		<author-group>
			<author>
				<realname><![CDATA[Dmitry]]></realname>
				<username phpbbcom="no"><![CDATA[MIT]]></username>
				<homepage><![CDATA[http://mitblog.ru]]></homepage>
			</author>
		</author-group>
		<mod-version>1.0.0</mod-version>
		<installation>
			<level>easy</level>
			<time>120</time>
			<target-version>3.0.7-PL1</target-version>
		</installation>
	</header>
	<action-group>
		<open src="includes\functions_posting.php">
			<edit>
				<find><![CDATA[	$username2 = $username;]]></find>
				<action type="replace-with"><![CDATA[	$post_username = $username2 = $username;]]></action>
			</edit>
			<edit>
				<find><![CDATA[		$data['poster_id'] = (int) $user->data['user_id'];]]></find>
				<action type="replace-with"><![CDATA[		$data['poster_id'] = $data['ranon_poster_id'] = (int) $user->data['user_id'];]]></action>
			</edit>
			<edit>
				<find><![CDATA[						$sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape(($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']) . "'";]]></find>
				<action type="replace-with"><![CDATA[						$sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape($post_username) . "'";]]></action>
			</edit>
		</open>
		<open src="includes\session.php">
			<edit>
				<find><![CDATA[			'forum'				=> (isset($_REQUEST['f']) && $_REQUEST['f'] > 0) ? (int) $_REQUEST['f'] : 0,
		);]]></find>
				<action type="after-add"><![CDATA[		if ($page_array['forum'] > 0)
		{
			global $db;
			
			$sql = 'SELECT forum_ranon_flags FROM ' . FORUMS_TABLE . ' WHERE forum_id = ' . (int)$page_array['forum'];
			$result = $db->sql_query($sql);
			$forum_ranon_flags = (int)$db->sql_fetchfield('forum_ranon_flags');
			$db->sql_freeresult($result);
			if (!empty($forum_ranon_flags) && $forum_ranon_flags && ($forum_ranon_flags & FORUM_RANON_FLAG_ENABLE))
			{				
				$page_array['page_name'] = '';
				$page_array['page_dir'] = '';
				
				$page_array['query_string'] = '';
				$page_array['script_path'] = '';
				$page_array['root_script_path'] = '';
				
				$page_array['page'] = '';
				$page_array['forum'] = 0;
				
				$page_array['forum_ranon_flags'] = $forum_ranon_flags;
			}
		}]]></action>
			</edit>
			<edit>
				<find><![CDATA[		$this->page					= $this->extract_current_page($phpbb_root_path);]]></find>
				<action type="after-add"><![CDATA[		if (!empty($this->page['forum_ranon_flags']) && $this->page['forum_ranon_flags'] & FORUM_RANON_FLAG_ENABLE)
		{
			$this->update_session_page = $update_session_page = false;
		}]]></action>
			</edit>
		</open>
	</action-group>
</mod>
