diff -x .svn -aruN 3.0.5.src/adm/index.php 3.0.6.src/adm/index.php
--- 3.0.5.src/adm/index.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/index.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: index.php 9369 2009-03-16 12:08:38Z acydburn $
+* @version $Id: index.php 10200 2009-09-30 15:07:40Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -263,6 +263,12 @@
 	$tpl = '';
 	$name = 'config[' . $config_key . ']';
 
+	// Make sure there is no notice printed out for non-existent config options (we simply set them)
+	if (!isset($new[$config_key]))
+	{
+		$new[$config_key] = '';
+	}
+
 	switch ($tpl_type[0])
 	{
 		case 'text':
@@ -301,7 +307,6 @@
 		break;
 
 		case 'select':
-		case 'select_multiple':
 		case 'custom':
 
 			$return = '';
@@ -340,21 +345,12 @@
 			}
 			else
 			{
-				if ($tpl_type[0] == 'select_multiple')
-				{
-					$new[$config_key] = @unserialize(trim($new[$config_key]));
-				}
-
 				$args = array($new[$config_key], $key);
 			}
 
 			$return = call_user_func_array($call, $args);
 
-			if ($tpl_type[0] == 'select_multiple')
-			{
-				$tpl = '<select id="' . $key . '" name="' . $name . '[]" multiple="multiple">' . $return . '</select>';
-			}
-			else if ($tpl_type[0] == 'select')
+			if ($tpl_type[0] == 'select')
 			{
 				$tpl = '<select id="' . $key . '" name="' . $name . '">' . $return . '</select>';
 			}
diff -x .svn -aruN 3.0.5.src/adm/style/acp_captcha.html 3.0.6.src/adm/style/acp_captcha.html
--- 3.0.5.src/adm/style/acp_captcha.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_captcha.html	2009-11-16 11:10:10.000000000 -0600
@@ -18,6 +18,10 @@
 		<label><input type="radio" class="radio" name="enable_confirm" value="0"<!-- IF not REG_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
 </dl>
 <dl>
+	<dt><label for="max_reg_attempts">{L_REG_LIMIT}:</label><br /><span>{L_REG_LIMIT_EXPLAIN}</span></dt>
+	<dd><input id="max_reg_attempts" type="text" size="4" maxlength="4" name="max_reg_attempts" value="{REG_LIMIT}" /></dd>
+</dl>
+<dl>
 	<dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}:</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt>
 	<dd><label><input type="radio" class="radio" id="enable_post_confirm" name="enable_post_confirm" value="1"<!-- IF POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
 		<label><input type="radio" class="radio" name="enable_post_confirm" value="0"<!-- IF not POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
@@ -25,69 +29,37 @@
 <dl>
 	<dt><label for="confirm_refresh">{L_VISUAL_CONFIRM_REFRESH}:</label><br /><span>{L_VISUAL_CONFIRM_REFRESH_EXPLAIN}</span></dt>
 	<dd><label><input type="radio" class="radio" id="confirm_refresh" name="confirm_refresh" value="1"<!-- IF CONFIRM_REFRESH --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
-	<label><input type="radio" class="radio" name="confirm_refresh" value="0"<!-- IF not CONFIRM_REFRESH --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
-</dl>
-<!-- IF GD -->
-<dl>
-	<dt><label for="captcha_gd">{L_CAPTCHA_GD}:</label><br /><span>{L_CAPTCHA_GD_EXPLAIN}</span></dt>
-	<dd><label><input id="captcha_gd" name="captcha_gd" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
-		<label><input name="captcha_gd" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
-</dl>
-<dl>
-	<dt><label for="captcha_gd_foreground_noise">{L_CAPTCHA_GD_FOREGROUND_NOISE}:</label><br /><span>{L_CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN}</span></dt>
-	<dd><label><input id="captcha_gd_foreground_noise" name="captcha_gd_foreground_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
-		<label><input name="captcha_gd_foreground_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
-</dl>
-<dl>
-	<dt><label for="captcha_gd_x_grid">{L_CAPTCHA_GD_X_GRID}:</label><br /><span>{L_CAPTCHA_GD_X_GRID_EXPLAIN}</span></dt>
-	<dd><input id="captcha_gd_x_grid" name="captcha_gd_x_grid" value="{CAPTCHA_GD_X_GRID}" type="text" /></dd>
-</dl>
-<dl>
-	<dt><label for="captcha_gd_y_grid">{L_CAPTCHA_GD_Y_GRID}:</label><br /><span>{L_CAPTCHA_GD_Y_GRID_EXPLAIN}</span></dt>
-	<dd><input id="captcha_gd_y_grid" name="captcha_gd_y_grid" value="{CAPTCHA_GD_Y_GRID}" type="text" /></dd>
-</dl>
-<dl>
-	<dt><label for="captcha_gd_wave">{L_CAPTCHA_GD_WAVE}:</label><br /><span>{L_CAPTCHA_GD_WAVE_EXPLAIN}</span></dt>
-	<dd><label><input id="captcha_gd_wave" name="captcha_gd_wave" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_WAVE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
-		<label><input name="captcha_gd_wave" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_WAVE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
-</dd>
+		<label><input type="radio" class="radio" name="confirm_refresh" value="0"<!-- IF not CONFIRM_REFRESH --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
 </dl>
+</fieldset>
+
+<fieldset>
+<legend>{L_AVAILABLE_CAPTCHAS}</legend>
 <dl>
-	<dt><label for="captcha_gd_3d_noise">{L_CAPTCHA_GD_3D_NOISE}:</label><br /><span>{L_CAPTCHA_GD_3D_NOISE_EXPLAIN}</span></dt>
-	<dd><label><input id="captcha_gd_3d_noise" name="captcha_gd_3d_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_3D_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
-		<label><input name="captcha_gd_3d_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_3D_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
-</dd>
+	<dt><label for="captcha_select">{L_CAPTCHA_SELECT}:</label><br /><span>{L_CAPTCHA_SELECT_EXPLAIN}</span></dt>
+	<dd><select id="captcha_select" name="select_captcha" onchange="(document.getElementById('acp_captcha')).submit()" >{CAPTCHA_SELECT}</select></dd>
 </dl>
+ <!-- IF S_CAPTCHA_HAS_CONFIG -->
 <dl>
-	<dt><label for="captcha_gd_fonts">{L_CAPTCHA_GD_FONTS}:</label><br /><span>{L_CAPTCHA_GD_FONTS_EXPLAIN}</span></dt>
-	<dd><label><input id="captcha_gd_fonts" name="captcha_gd_fonts" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 1 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_DEFAULT}</label>
-		<label><input name="captcha_gd_fonts" value="2" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 2 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_NEW}</label>
-		<label><input name="captcha_gd_fonts" value="3" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 3 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_LOWER}</label>
-
-</dd>
+	<dt><label for="configure">{L_CAPTCHA_CONFIGURE}:</label><br /><span>{L_CAPTCHA_CONFIGURE_EXPLAIN}</span></dt>
+	<dd><input class="button2" type="submit" id="configure" name="configure" value="{L_CONFIGURE}" /></dd>
 </dl>
 <!-- ENDIF -->
-
 </fieldset>
+
+<!-- IF CAPTCHA_PREVIEW_TPL -->
 <fieldset>
 	<legend>{L_PREVIEW}</legend>
-<!-- IF PREVIEW -->
-	<div class="successbox">
-		<h3>{L_WARNING}</h3>
-		<p>{L_CAPTCHA_PREVIEW_MSG}</p>
-	</div>
-<!-- ENDIF -->
-<dl>
-	<dt><label for="captcha_preview">{L_PREVIEW}:</label><br /><span>{L_CAPTCHA_PREVIEW_EXPLAIN}</span></dt>
-	<dd><img src="{CAPTCHA_PREVIEW}" alt="{L_PREVIEW}" <!-- IF CAPTCHA_GD_PREVIEWED -->width="360" height="96"<!-- ELSE --> width="320" height="50"<!-- ENDIF --> id="captcha_preview" /></dd>
-</dl>
+<!-- INCLUDE {CAPTCHA_PREVIEW_TPL} -->
 </fieldset>
+<!-- ENDIF -->
 
-<fieldset class="submit-buttons">
-	<legend>{L_SUBMIT}</legend>
-	<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
-	<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />&nbsp;
-	<input class="button2" type="submit" id="preview" name="preview" value="{L_PREVIEW}" />
+<fieldset>
+	<legend>{L_ACP_SUBMIT_CHANGES}</legend>
+	<p class="submit-buttons">
+		<input class="button1" type="submit" id="main_submit" name="main_submit" value="{L_SUBMIT}" />&nbsp;
+		<input class="button2" type="reset" id="form_reset" name="reset" value="{L_RESET}" />&nbsp;
+	</p>
 	{S_FORM_TOKEN}
 </fieldset>
 </form>
diff -x .svn -aruN 3.0.5.src/adm/style/acp_database.html 3.0.6.src/adm/style/acp_database.html
--- 3.0.5.src/adm/style/acp_database.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_database.html	2009-11-16 11:10:10.000000000 -0600
@@ -71,8 +71,9 @@
 	<dl>
 		<dt><label for="where">{L_ACTION}:</label></dt>
 		<dd>
-			<label><input type="radio" class="radio" name="where" value="store" checked="checked" /> {L_STORE_LOCAL}</label>
-			<label><input type="radio" class="radio" name="where" value="download" /> {L_DOWNLOAD}</label></dd>
+			<label><input id="where" type="radio" class="radio" name="where" value="store" checked="checked" /> {L_STORE_LOCAL}</label>
+			<label><input type="radio" class="radio" name="where" value="download" /> {L_DOWNLOAD}</label>
+		</dd>
 	</dl>
 	<dl>
 		<dt><label for="table">{L_TABLE_SELECT}:</label></dt>
diff -x .svn -aruN 3.0.5.src/adm/style/acp_forums_copy_perm.html 3.0.6.src/adm/style/acp_forums_copy_perm.html
--- 3.0.5.src/adm/style/acp_forums_copy_perm.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/adm/style/acp_forums_copy_perm.html	2009-11-16 11:10:11.000000000 -0600
@@ -0,0 +1,22 @@
+<!-- INCLUDE overall_header.html -->
+
+<h1>{L_COPY_PERMISSIONS}</h1>
+
+<p>{L_COPY_PERMISSIONS_EXPLAIN}</p>
+<p>{L_ACL_LINK}</p>
+
+<form id="confirm" method="post" action="{S_COPY_ACTION}">
+
+<fieldset>
+	<dl>
+		<dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt>
+		<dd><select id="forum_perm_from" name="forum_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_FORUM_OPTIONS}</select></dd>
+	</dl>
+	<div style="text-align: center;">{S_FORM_TOKEN}{S_HIDDEN_FIELDS}
+		<input type="submit" name="update" value="{L_CONTINUE}" class="button2" />&nbsp;
+	</div>
+</fieldset>
+
+</form>
+
+<!-- INCLUDE overall_footer.html -->
diff -x .svn -aruN 3.0.5.src/adm/style/acp_forums.html 3.0.6.src/adm/style/acp_forums.html
--- 3.0.5.src/adm/style/acp_forums.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_forums.html	2009-11-16 11:10:11.000000000 -0600
@@ -218,6 +218,11 @@
 				<label><input type="radio" class="radio" name="enable_post_review" value="0"<!-- IF not S_ENABLE_POST_REVIEW --> id="enable_post_review" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
 		</dl>
 		<dl>
+			<dt><label for="enable_quick_reply">{L_ENABLE_QUICK_REPLY}:</label><br /><span>{L_ENABLE_QUICK_REPLY_EXPLAIN}</span></dt>
+			<dd><label><input type="radio" class="radio" name="enable_quick_reply" value="1"<!-- IF S_ENABLE_QUICK_REPLY --> id="enable_quick_reply" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+				<label><input type="radio" class="radio" name="enable_quick_reply" value="0"<!-- IF not S_ENABLE_QUICK_REPLY --> id="enable_quick_reply" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+		</dl>
+		<dl>
 			<dt><label for="enable_indexing">{L_ENABLE_INDEXING}:</label><br /><span>{L_ENABLE_INDEXING_EXPLAIN}</span></dt>
 			<dd><label><input type="radio" class="radio" name="enable_indexing" value="1"<!-- IF S_ENABLE_INDEXING --> id="enable_indexing" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
 				<label><input type="radio" class="radio" name="enable_indexing" value="0"<!-- IF not S_ENABLE_INDEXING --> id="enable_indexing" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
diff -x .svn -aruN 3.0.5.src/adm/style/acp_groups.html 3.0.6.src/adm/style/acp_groups.html
--- 3.0.5.src/adm/style/acp_groups.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_groups.html	2009-11-16 11:10:10.000000000 -0600
@@ -55,21 +55,29 @@
 	</fieldset>
 
 	<fieldset>
-		<legend>{L_GROUP_SETTINGS_SAVE}</legend>
+		<legend>{L_GROUP_OPTIONS_SAVE}</legend>
 	<!-- IF S_USER_FOUNDER -->
 	<dl>
 		<dt><label for="group_founder_manage">{L_GROUP_FOUNDER_MANAGE}:</label><br /><span>{L_GROUP_FOUNDER_MANAGE_EXPLAIN}</span></dt>
-		<dd><input name="group_founder_manage" type="checkbox" class="radio" id="group_founder_manage"{GROUP_FOUNDER_MANAGE} /></dd>
+		<dd><input name="group_founder_manage" type="checkbox" value="1" class="radio" id="group_founder_manage"{GROUP_FOUNDER_MANAGE} /></dd>
 	</dl>
 	<!-- ENDIF -->
 	<dl>
+		<dt><label for="group_skip_auth">{L_GROUP_SKIP_AUTH}:</label><br /><span>{L_GROUP_SKIP_AUTH_EXPLAIN}</span></dt>
+		<dd><input name="group_skip_auth" type="checkbox" value="1" class="radio" id="group_skip_auth"{GROUP_SKIP_AUTH} /></dd>
+	</dl>
+	<dl>
 		<dt><label for="group_legend">{L_GROUP_LEGEND}:</label></dt>
-		<dd><input name="group_legend" type="checkbox" class="radio" id="group_legend"{GROUP_LEGEND} /></dd>
+		<dd><input name="group_legend" type="checkbox" value="1" class="radio" id="group_legend"{GROUP_LEGEND} /></dd>
 	</dl>
 	<dl>
 		<dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}:</label><br /><span>{L_GROUP_RECEIVE_PM_EXPLAIN}</span></dt>
-		<dd><input name="group_receive_pm" type="checkbox" class="radio" id="group_receive_pm"{GROUP_RECEIVE_PM} /></dd>
+		<dd><input name="group_receive_pm" type="checkbox" value="1" class="radio" id="group_receive_pm"{GROUP_RECEIVE_PM} /></dd>
 	</dl>
+	</fieldset>
+
+	<fieldset>
+		<legend>{L_GROUP_SETTINGS_SAVE}</legend>
 	<dl>
 		<dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}:</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt>
 		<dd><input name="group_message_limit" type="text" id="group_message_limit" maxlength="4" size="4" value="{GROUP_MESSAGE_LIMIT}" /></dd>
@@ -80,7 +88,7 @@
 	</dl>
 	<dl>
 		<dt><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt>
-		<dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" />&nbsp;&nbsp;<span>[ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd>
+		<dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" /><!-- IF GROUP_COLOUR -->&nbsp;<span style="background-color: #{GROUP_COLOUR}">&nbsp; &nbsp;</span><!-- ENDIF -->&nbsp;&nbsp;<span>[ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd>
 	</dl>
 	<dl>
 		<dt><label for="group_rank">{L_GROUP_RANK}:</label></dt>
@@ -97,7 +105,7 @@
 	</dl>
 	<!-- IF not S_IN_AVATAR_GALLERY -->
 		<!-- IF S_CAN_UPLOAD -->
-			<dl> 
+			<dl>
 				<dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt>
 				<dd><input type="file" id="uploadfile" name="uploadfile" /></dd>
 			</dl>
@@ -115,7 +123,7 @@
 			<dd><input name="width" type="text" id="width" size="3" value="{AVATAR_WIDTH}" /> <span>px X </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>px</span></dd>
 		</dl>
 		<!-- IF S_DISPLAY_GALLERY -->
-			<dl> 
+			<dl>
 				<dt><label>{L_AVATAR_GALLERY}:</label></dt>
 				<dd><input class="button2" type="submit" name="display_gallery" value="{L_DISPLAY_GALLERY}" /></dd>
 			</dl>
@@ -132,7 +140,7 @@
 		<dl>
 			<table cellspacing="1">
 			<!-- BEGIN avatar_row -->
-			<tr> 
+			<tr>
 				<!-- BEGIN avatar_column -->
 					<td class="row1" style="text-align: center;"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="{avatar_row.avatar_column.AVATAR_NAME}" title="{avatar_row.avatar_column.AVATAR_NAME}" /></td>
 				<!-- END avatar_column -->
@@ -146,11 +154,11 @@
 			</table>
 		</dl>
 		</fieldset>
-		
+
 		<fieldset class="quick" style="margin-top: -15px;">
 			<input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
 		</fieldset>
-	
+
 	<!-- ENDIF -->
 	</fieldset>
 
@@ -192,7 +200,7 @@
 	</tr>
 	<!-- BEGIN leader -->
 		<!-- IF leader.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-			<td><a href="{leader.U_USER_EDIT}">{leader.USERNAME}</a></td>
+			<td><!-- IF leader.USERNAME_COLOUR --><a href="{leader.U_USER_EDIT}" style="color: #{leader.USERNAME_COLOUR};" class="username-coloured">{leader.USERNAME}</a><!-- ELSE --><a href="{leader.U_USER_EDIT}">{leader.USERNAME}</a><!-- ENDIF --></td>
 			<td style="text-align: center;"><!-- IF leader.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
 			<td style="text-align: center;">{leader.JOINED}</td>
 			<td style="text-align: center;">{leader.USER_POSTS}</td>
@@ -213,7 +221,7 @@
 		</tr>
 		<!-- ELSE -->
 			<!-- IF member.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-			<td><a href="{member.U_USER_EDIT}">{member.USERNAME}</a></td>
+			<td><!-- IF member.USERNAME_COLOUR --><a href="{member.U_USER_EDIT}" style="color: #{member.USERNAME_COLOUR};" class="username-coloured">{member.USERNAME}</a><!-- ELSE --><a href="{member.U_USER_EDIT}">{member.USERNAME}</a><!-- ENDIF --></td>
 			<td style="text-align: center;"><!-- IF member.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
 			<td style="text-align: center;">{member.JOINED}</td>
 			<td style="text-align: center;">{member.USER_POSTS}</td>
@@ -231,12 +239,12 @@
 	<div class="pagination">
 			<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
 	</div>
-	<!-- ENDIF -->	
+	<!-- ENDIF -->
 
 	<fieldset class="quick">
 		<select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select>
 		<input class="button2" type="submit" name="update" value="{L_SUBMIT}" />
-		<p class="small"><a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>		
+		<p class="small"><a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>
 	</fieldset>
 
 	<h1>{L_ADD_USERS}</h1>
diff -x .svn -aruN 3.0.5.src/adm/style/acp_icons.html 3.0.6.src/adm/style/acp_icons.html
--- 3.0.5.src/adm/style/acp_icons.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_icons.html	2009-11-16 11:10:11.000000000 -0600
@@ -243,8 +243,8 @@
 				<td style="text-align: center;">{items.EMOTION}</td>
 			<!-- ENDIF -->
 			<td style="text-align: right; white-space: nowrap;">
-				<!-- IF items.S_FIRST_ROW -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->&nbsp;
-				<!-- IF items.S_LAST_ROW -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
+				<!-- IF items.S_FIRST_ROW and not PREVIOUS_PAGE -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->&nbsp;
+				<!-- IF items.S_LAST_ROW and not NEXT_PAGE -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
 				&nbsp;<a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}">{ICON_DELETE}</a>
 			</td>
 		</tr>
@@ -255,7 +255,7 @@
 	<!-- END items -->
 	</tbody>
 	</table>
-
+	<div>{PAGINATION}</div>
 	<p class="quick">
 		<input class="button2" name="add" type="submit" value="{L_ICON_ADD}" />&nbsp; &nbsp;<input class="button2" type="submit" name="edit" value="{L_ICON_EDIT}" />
 	</p>
diff -x .svn -aruN 3.0.5.src/adm/style/acp_inactive.html 3.0.6.src/adm/style/acp_inactive.html
--- 3.0.5.src/adm/style/acp_inactive.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_inactive.html	2009-11-16 11:10:11.000000000 -0600
@@ -12,7 +12,7 @@
 
 <!-- IF PAGINATION -->
 <div class="pagination">
-		<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
+	<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
 </div>
 <!-- ENDIF -->
 
@@ -22,8 +22,8 @@
 	<th>{L_USERNAME}</th>
 	<th>{L_JOINED}</th>
 	<th>{L_INACTIVE_DATE}</th>
-	<th>{L_INACTIVE_REASON}</th>
 	<th>{L_LAST_VISIT}</th>
+	<th>{L_INACTIVE_REASON}</th>
 	<th>{L_MARK}</th>
 </tr>
 </thead>
@@ -31,11 +31,17 @@
 <!-- BEGIN inactive -->
 	<!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
 
-		<td><a href="{inactive.U_USER_ADMIN}">{inactive.USERNAME}</a></td>
-		<td>{inactive.JOINED}</td>
-		<td>{inactive.INACTIVE_DATE}</td>
-		<td>{inactive.REASON}</td>
-		<td>{inactive.LAST_VISIT}</td>
+		<td style="vertical-align: top;">
+			{inactive.USERNAME_FULL}
+			<!-- IF inactive.POSTS --><br />{L_POSTS}: <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF -->
+		</td>
+		<td style="vertical-align: top;">{inactive.JOINED}</td>
+		<td style="vertical-align: top;">{inactive.INACTIVE_DATE}</td>
+		<td style="vertical-align: top;">{inactive.LAST_VISIT}</td>
+		<td style="vertical-align: top;">
+			{inactive.REASON}
+			<!-- IF inactive.REMINDED --><br />{inactive.REMINDED_EXPLAIN}<!-- ENDIF -->
+		</td>
 		<td>&nbsp;<input type="checkbox" class="radio" name="mark[]" value="{inactive.USER_ID}" />&nbsp;</td>
 	</tr>
 <!-- BEGINELSE -->
@@ -46,25 +52,25 @@
 </tbody>
 </table>
 
-	<fieldset class="display-options">
-		{L_DISPLAY_LOG}: &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}
-		<input class="button2" type="submit" value="{L_GO}" name="sort" />
-	</fieldset>
-	<hr />
-	<!-- IF PAGINATION -->
-	<div class="pagination">
-			<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
-	</div>
-	<!-- ENDIF -->
+<fieldset class="display-options">
+	{L_DISPLAY_LOG}: &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}<!-- IF PAGINATION -->&nbsp;Users per page: <input class="inputbox autowidth" type="text" name="users_per_page" id="users_per_page" size="3" value="{USERS_PER_PAGE}" /><!-- ENDIF -->
+	<input class="button2" type="submit" value="{L_GO}" name="sort" />
+</fieldset>
 
-	<fieldset class="quick">
-		<select name="action">{S_INACTIVE_OPTIONS}</select>
-		<input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
-		<p class="small"><a href="#" onclick="marklist('inactive', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('inactive', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>		
-		{S_FORM_TOKEN}
-	</fieldset>
+<hr />
 
+<!-- IF PAGINATION -->
+	<div class="pagination">
+		<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
+	</div>
+<!-- ENDIF -->
 
+<fieldset class="quick">
+	<select name="action">{S_INACTIVE_OPTIONS}</select>
+	<input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
+	<p class="small"><a href="#" onclick="marklist('inactive', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('inactive', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>
+	{S_FORM_TOKEN}
+</fieldset>
 
 </form>
 
diff -x .svn -aruN 3.0.5.src/adm/style/acp_logs.html 3.0.6.src/adm/style/acp_logs.html
--- 3.0.5.src/adm/style/acp_logs.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_logs.html	2009-11-16 11:10:10.000000000 -0600
@@ -8,12 +8,19 @@
 
 <form id="list" method="post" action="{U_ACTION}">
 
+<fieldset class="display-options" style="float: left">
+	{L_SEARCH_KEYWORDS}: <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
+</fieldset>
+
 <!-- IF PAGINATION -->
-<div class="pagination">
-		<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
+<div class="pagination" style="float: right; margin: 15px 0 2px 0">
+	<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
 </div>
 <!-- ENDIF -->
 
+<div class="clearfix">&nbsp;</div>
+<div><br style="clear: both;" /></div>
+
 <!-- IF .log -->
 	<table cellspacing="1">
 	<thead>
@@ -22,13 +29,14 @@
 		<th>{L_IP}</th>
 		<th>{L_TIME}</th>
 		<th>{L_ACTION}</th>
-		<th>{L_MARK}</th>
+		<!-- IF S_CLEARLOGS -->
+			<th>{L_MARK}</th>
+		<!-- ENDIF -->
 	</tr>
 	</thead>
 	<tbody>
 	<!-- BEGIN log -->
 		<!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
 			<td>
 				{log.USERNAME}
 				<!-- IF log.REPORTEE_USERNAME -->
@@ -38,32 +46,33 @@
 			<td style="text-align: center;">{log.IP}</td>
 			<td style="text-align: center;">{log.DATE}</td>
 			<td>{log.ACTION}<!-- IF log.DATA --><br /><span>{log.DATA}</span><!-- ENDIF --></td>
-			<td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" value="{log.ID}" /></td>
+			<!-- IF S_CLEARLOGS -->
+				<td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" value="{log.ID}" /></td>
+			<!-- ENDIF -->
 		</tr>
 	<!-- END log -->
 	</tbody>
 	</table>
 
-<!-- ELSE -->
+<!-- IF PAGINATION -->
+	<div class="pagination">
+		<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
+	</div>
+<!-- ENDIF -->
 
+<!-- ELSE -->
 	<div class="errorbox">
 		<p>{L_NO_ENTRIES}</p>
 	</div>
-
 <!-- ENDIF -->
 
-
 <fieldset class="display-options">
 	{L_DISPLAY_LOG}: &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}
 	<input class="button2" type="submit" value="{L_GO}" name="sort" />
 	{S_FORM_TOKEN}
 </fieldset>
 <hr />
-<!-- IF PAGINATION -->
-<div class="pagination">
-	<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
-</div>
-<!-- ENDIF -->
+
 <!-- IF S_SHOW_FORUMS -->
 	<fieldset class="quick">
 		{L_SELECT_FORUM}: <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{S_FORUM_BOX}</select>
@@ -71,7 +80,7 @@
 	</fieldset>
 <!-- ENDIF -->
 
-<!-- IF S_CLEARLOGS -->
+<!-- IF .log and S_CLEARLOGS -->
 	<fieldset class="quick">
 		<input class="button2" type="submit" name="delall" value="{L_DELETE_ALL}" />&nbsp;
 		<input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" /><br />
@@ -79,7 +88,6 @@
 	</fieldset>
 <!-- ENDIF -->
 
-
 </form>
 
-<!-- INCLUDE overall_footer.html -->
\ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff -x .svn -aruN 3.0.5.src/adm/style/acp_main.html 3.0.6.src/adm/style/acp_main.html
--- 3.0.5.src/adm/style/acp_main.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_main.html	2009-11-16 11:10:10.000000000 -0600
@@ -14,6 +14,19 @@
 
 	<p>{L_ADMIN_INTRO}</p>
 
+	<!-- IF S_VERSIONCHECK_FAIL -->
+		<div class="errorbox notice">
+			<p>{L_VERSIONCHECK_FAIL}</p>
+			<p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> &middot; <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p>
+		</div>
+	<!-- ELSEIF not S_VERSION_UP_TO_DATE -->
+		<div class="errorbox">
+			<p>{L_VERSION_NOT_UP_TO_DATE_TITLE}</p>
+			<p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> &middot; <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p>
+		</div>
+	<!-- ENDIF -->
+
+
 	<!-- IF S_REMOVE_INSTALL -->
 		<div class="errorbox">
 			<h3>{L_WARNING}</h3>
@@ -85,7 +98,9 @@
 	</tr>
 	<tr>
 		<td>{L_BOARD_VERSION}: </td>
-		<td><strong>{BOARD_VERSION}</strong></td>
+		<td>
+			<strong><a href="{U_VERSIONCHECK}" <!-- IF S_VERSION_UP_TO_DATE -->style="color: #228822;"<!-- ELSE -->style="color: #BC2A4D;"<!-- ENDIF --> title="{L_MORE_INFORMATION}">{BOARD_VERSION}</a></strong> [&nbsp;<a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a>&nbsp;]
+		</td>
 	<!-- IF S_TOTAL_ORPHAN -->
 		<td>{L_NUMBER_ORPHAN}: </td>
 		<td><strong>{TOTAL_ORPHAN}</strong></td>
@@ -137,6 +152,12 @@
 			</form>
 
 			<!-- IF S_FOUNDER -->
+			<form id="action_purge_sessions_form" method="post" action="{U_ACTION}">
+				<dl>
+					<dt><label for="action_purge_sessions">{L_PURGE_SESSIONS}</label><br /><span>{L_PURGE_SESSIONS_EXPLAIN}</span></dt>
+					<dd><input type="hidden" name="action" value="purge_sessions" /><input class="button2" type="submit" id="action_purge_sessions" name="action_purge_sessions" value="{L_RUN}" /></dd>
+				</dl>
+			</form>
 			<form id="action_purge_cache_form" method="post" action="{U_ACTION}">
 				<dl>
 					<dt><label for="action_purge_cache">{L_PURGE_CACHE}</label><br /><span>{L_PURGE_CACHE_EXPLAIN}</span></dt>
@@ -193,19 +214,25 @@
 			<th>{L_USERNAME}</th>
 			<th>{L_JOINED}</th>
 			<th>{L_INACTIVE_DATE}</th>
-			<th>{L_INACTIVE_REASON}</th>
 			<th>{L_LAST_VISIT}</th>
+			<th>{L_INACTIVE_REASON}</th>
 		</tr>
 		</thead>
 		<tbody>
 		<!-- BEGIN inactive -->
 			<!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
 
-				<td><a href="{inactive.U_USER_ADMIN}">{inactive.USERNAME}</a></td>
-				<td>{inactive.JOINED}</td>
-				<td>{inactive.INACTIVE_DATE}</td>
-				<td>{inactive.REASON}</td>
-				<td>{inactive.LAST_VISIT}</td>
+				<td style="vertical-align: top;">
+					{inactive.USERNAME_FULL}
+					<!-- IF inactive.POSTS --><br />{L_POSTS}: <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF -->
+				</td>
+				<td style="vertical-align: top;">{inactive.JOINED}</td>
+				<td style="vertical-align: top;">{inactive.INACTIVE_DATE}</td>
+				<td style="vertical-align: top;">{inactive.LAST_VISIT}</td>
+				<td style="vertical-align: top;">
+					{inactive.REASON}
+					<!-- IF inactive.REMINDED --><br />{inactive.REMINDED_EXPLAIN}<!-- ENDIF -->
+				</td>
 			</tr>
 		<!-- BEGINELSE -->
 			<tr>
diff -x .svn -aruN 3.0.5.src/adm/style/acp_profile.html 3.0.6.src/adm/style/acp_profile.html
--- 3.0.5.src/adm/style/acp_profile.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_profile.html	2009-11-16 11:10:11.000000000 -0600
@@ -56,6 +56,10 @@
 			<dd><input type="checkbox" class="radio" id="field_show_on_reg" name="field_show_on_reg" value="1"<!-- IF S_SHOW_ON_REG --> checked="checked"<!-- ENDIF --> /></dd>
 		</dl>
 		<dl>
+			<dt><label for="field_show_on_vt">{L_DISPLAY_ON_VT}:</label><br /><span>{L_DISPLAY_ON_VT_EXPLAIN}</span></dt>
+			<dd><input type="checkbox" class="radio" id="field_show_on_vt" name="field_show_on_vt" value="1"<!-- IF S_SHOW_ON_VT --> checked="checked"<!-- ENDIF --> /></dd>
+		</dl>
+		<dl>
 			<dt><label for="field_required">{L_REQUIRED_FIELD}:</label><br /><span>{L_REQUIRED_FIELD_EXPLAIN}</span></dt>
 			<dd><input type="checkbox" class="radio" id="field_required" name="field_required" value="1"<!-- IF S_FIELD_REQUIRED --> checked="checked"<!-- ENDIF --> /></dd>
 		</dl>
@@ -127,7 +131,7 @@
 		<fieldset class="quick" style="float: {S_CONTENT_FLOW_BEGIN};">
 			<input class="button1" type="submit" name="prev" value="{L_PROFILE_BASIC_OPTIONS}" />
 		</fieldset>
-		
+
 		<fieldset class="quick" style="float: {S_CONTENT_FLOW_END};">
 			{S_HIDDEN_FIELDS}
 			{S_FORM_TOKEN}
@@ -151,15 +155,15 @@
 		<fieldset class="quick" style="float: {S_CONTENT_FLOW_BEGIN};">
 			<input class="button1" type="submit" name="prev" value="{L_PROFILE_TYPE_OPTIONS}" />
 		</fieldset>
-		
+
 		<fieldset class="quick" style="float: {S_CONTENT_FLOW_END};">
 			{S_HIDDEN_FIELDS}
 			<input class="button1" type="submit" name="save" value="{L_SAVE}" />
 			{S_FORM_TOKEN}
 		</fieldset>
-	
+
 	<!-- ENDIF -->
-	
+
 	</form>
 
 <!-- ELSE -->
@@ -194,14 +198,14 @@
 				{ICON_MOVE_UP_DISABLED}
 				<a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
 			<!-- ELSEIF not fields.S_FIRST_ROW && not fields.S_LAST_ROW-->
-				<a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a> 
-				<a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> 
+				<a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a>
+				<a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
 			<!-- ELSEIF fields.S_LAST_ROW && not fields.S_FIRST_ROW -->
 				<a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a>
-				{ICON_MOVE_DOWN_DISABLED}	
+				{ICON_MOVE_DOWN_DISABLED}
 			<!-- ENDIF -->
 			<!-- IF not fields.S_NEED_EDIT -->
-				<a href="{fields.U_EDIT}">{ICON_EDIT}</a> 
+				<a href="{fields.U_EDIT}">{ICON_EDIT}</a>
 			<!-- ELSE -->
 				{ICON_EDIT_DISABLED}
 			<!-- ENDIF -->
@@ -209,12 +213,16 @@
 		</td>
 
 	</tr>
+	<!-- BEGINELSE -->
+	<tr class="row3">
+		<td colspan="4">{L_ACP_NO_ITEMS}</td>
+	</tr>
 	<!-- END fields -->
 	</tbody>
 	</table>
 
 	<form id="profile_fields" method="post" action="{U_ACTION}">
-	
+
 	<fieldset class="quick">
 		<input class="text small" type="text" name="field_ident" /> <select name="field_type">{S_TYPE_OPTIONS}</select>
 		<input class="button1" type="submit" name="submit" value="{L_CREATE_NEW_FIELD}" />
diff -x .svn -aruN 3.0.5.src/adm/style/acp_send_statistics.html 3.0.6.src/adm/style/acp_send_statistics.html
--- 3.0.5.src/adm/style/acp_send_statistics.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/adm/style/acp_send_statistics.html	2009-11-16 11:10:11.000000000 -0600
@@ -0,0 +1,71 @@
+<!-- INCLUDE overall_header.html -->
+
+<a name="maincontent"></a>
+
+<h1>{L_SEND_STATISTICS}</h1>
+
+<p>{L_EXPLAIN_SEND_STATISTICS}</p>
+
+<script type="text/javascript">
+//<![CDATA[
+var iframect = 0;
+
+function iframe_updated()
+{
+	if (iframect++ == 0)
+	{
+		return;
+	}
+
+	dE('questionnaire-form', -1);
+	dE('questionnaire-thanks', 1);
+}
+//]]>
+</script>
+
+<iframe onload="iframe_updated();" name="questionaire_result" style="display: none;"></iframe>
+
+<form action="{U_COLLECT_STATS}" method="post" target="questionaire_result" id="questionnaire-form">
+
+	<p><a href="{U_ACP_MAIN}">{L_DONT_SEND_STATISTICS}</a></p>
+
+	<p>{L_EXPLAIN_SHOW_STATISTICS}</p>
+
+	<p id="show-button"><input type="button" class="button2" onclick="dE('configlist', 1); dE('show-button', -1);" value="{L_SHOW_STATISTICS}" /></p>
+
+	<div id="configlist">
+		<input type="button" class="button2" onclick="dE('show-button', 1); dE('configlist', -1);" value="{L_HIDE_STATISTICS}" />
+		<p class="submit-buttons">
+			<input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_STATISTICS}" />
+		</p>
+
+		<!-- BEGIN providers -->
+		<fieldset>
+			<legend>{providers.NAME}</legend>
+			<!-- BEGIN values -->
+			<dl>
+				<dt>{providers.values.KEY}</dt>
+				<dd>{providers.values.VALUE}</dd>
+			</dl>
+			<!-- END values -->
+		</fieldset>
+		<!-- END providers -->
+	</div>
+	<p class="submit-buttons">
+		<input type="hidden" name="systemdata" value="{RAW_DATA}" />
+		<input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_STATISTICS}" />
+	</p>
+</form>
+
+<div id="questionnaire-thanks" class="successbox">
+	<p><strong>{L_THANKS_SEND_STATISTICS}</strong><br /><br /><a href="{U_ACP_MAIN}">&laquo; {L_GO_ACP_MAIN}</a></p>
+</div>
+
+<script type="text/javascript">
+//<![CDATA[
+	dE('configlist', -1);
+	dE('questionnaire-thanks', -1);
+//]]>
+</script>
+
+<!-- INCLUDE overall_footer.html -->
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/adm/style/acp_styles.html 3.0.6.src/adm/style/acp_styles.html
--- 3.0.5.src/adm/style/acp_styles.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_styles.html	2009-11-16 11:10:11.000000000 -0600
@@ -20,7 +20,7 @@
 	</dl>
 	<dl>
 		<dt><label for="new_id">{L_REPLACE}:</label><br /><span>{L_REPLACE_EXPLAIN}</span></dt>
-		<dd><select name="new_id">{S_REPLACE_OPTIONS}</select></dd>
+		<dd><select id="new_id" name="new_id">{S_REPLACE_OPTIONS}</select></dd>
 	</dl>
 
 	<p class="quick">
@@ -135,11 +135,11 @@
 	<div id="img_dimensions">
 		<dl>
 			<dt><label for="imgwidth">{L_IMAGE_WIDTH}:</label><br /><span>{L_AUTOMATIC_EXPLAIN}</span></dt>
-			<dd><input type="text" name="imgwidth" value="{IMAGE_SIZE}" /></dd>
+			<dd><input id="imgwidth" type="text" name="imgwidth" value="{IMAGE_SIZE}" /></dd>
 		</dl>
 		<dl>
 			<dt><label for="imgheight">{L_IMAGE_HEIGHT}:</label><br /><span>{L_AUTOMATIC_EXPLAIN}</span></dt>
-			<dd><input type="text" name="imgheight" value="{IMAGE_HEIGHT}" /></dd>
+			<dd><input id="imgheight" type="text" name="imgheight" value="{IMAGE_HEIGHT}" /></dd>
 		</dl>
 	</div>
 	</fieldset>
@@ -266,7 +266,7 @@
 
 	<p>{L_TEMPLATE_CACHE_EXPLAIN}</p>
 
-	<form name="acp_styles" method="post" action="{U_ACTION}">
+	<form id="acp_styles" method="post" action="{U_ACTION}">
 	<fieldset class="tabulated">
 	<legend>{L_TEMPLATE_CACHE}</legend>
 
diff -x .svn -aruN 3.0.5.src/adm/style/acp_update.html 3.0.6.src/adm/style/acp_update.html
--- 3.0.5.src/adm/style/acp_update.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_update.html	2009-11-16 11:10:10.000000000 -0600
@@ -10,11 +10,11 @@
 
 	<!-- IF S_UP_TO_DATE and S_UP_TO_DATE_AUTO -->
 		<div class="successbox">
-			<p>{L_VERSION_UP_TO_DATE_ACP}</p>
+			<p>{L_VERSION_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
 		</div>
 	<!-- ELSE -->
 		<div class="errorbox">
-			<p>{L_VERSION_NOT_UP_TO_DATE_ACP}</p>
+			<p>{L_VERSION_NOT_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
 		</div>
 	<!-- ENDIF -->
 
diff -x .svn -aruN 3.0.5.src/adm/style/acp_users_avatar.html 3.0.6.src/adm/style/acp_users_avatar.html
--- 3.0.5.src/adm/style/acp_users_avatar.html	2008-06-10 02:55:57.000000000 -0500
+++ 3.0.6.src/adm/style/acp_users_avatar.html	2009-11-09 10:31:21.000000000 -0600
@@ -8,11 +8,13 @@
 		<dd><label><input type="checkbox" class="radio" name="delete" /> {L_DELETE_AVATAR}</label></dd>
 	</dl>
 	<!-- IF not S_IN_AVATAR_GALLERY -->
-		<!-- IF S_CAN_UPLOAD -->
+		<!-- IF S_UPLOAD_FILE -->
 			<dl> 
 				<dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt>
 				<dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_MAX_FILESIZE}" /><input type="file" id="uploadfile" name="uploadfile" /></dd>
 			</dl>
+		<!-- ENDIF -->
+		<!-- IF S_REMOTE_UPLOAD -->
 			<dl>
 				<dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt>
 				<dd><input name="uploadurl" type="text" id="uploadurl" value="" /></dd>
diff -x .svn -aruN 3.0.5.src/adm/style/acp_users.html 3.0.6.src/adm/style/acp_users.html
--- 3.0.5.src/adm/style/acp_users.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_users.html	2009-11-16 11:10:11.000000000 -0600
@@ -83,6 +83,10 @@
 
 <!-- INCLUDE acp_users_feedback.html -->
 
+<!-- ELSEIF S_WARNINGS -->
+
+<!-- INCLUDE acp_users_warnings.html -->
+
 <!-- ELSEIF S_PROFILE -->
 
 <!-- INCLUDE acp_users_profile.html -->
@@ -131,8 +135,8 @@
 		<!-- ELSE -->
 			<!-- IF group.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
 				<td><a href="{group.U_EDIT_GROUP}">{group.GROUP_NAME}</a></td>
-				<td><!-- IF group.S_NO_DEFAULT --><a href="{group.U_DEFAULT}">{L_GROUP_DEFAULT}</a><!-- ELSE --><strong>{L_GROUP_DEFAULT}</strong><!-- ENDIF --></td>
-				<td><!-- IF not group.S_SPECIAL_GROUP --><a href="{group.U_DEMOTE_PROMOTE}">{group.L_DEMOTE_PROMOTE}</a><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
+				<td><!-- IF group.S_IS_MEMBER --><!-- IF group.S_NO_DEFAULT --><a href="{group.U_DEFAULT}">{L_GROUP_DEFAULT}</a><!-- ELSE --><strong>{L_GROUP_DEFAULT}</strong><!-- ENDIF --><!-- ELSEIF not group.S_IS_MEMBER and group.U_APPROVE --><a href="{group.U_APPROVE}">{L_GROUP_APPROVE}</a><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
+				<td><!-- IF group.S_IS_MEMBER and not group.S_SPECIAL_GROUP --><a href="{group.U_DEMOTE_PROMOTE}">{group.L_DEMOTE_PROMOTE}</a><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
 				<td><a href="{group.U_DELETE}">{L_GROUP_DELETE}</a></td>
 			</tr>
 		<!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/adm/style/acp_users_signature.html 3.0.6.src/adm/style/acp_users_signature.html
--- 3.0.5.src/adm/style/acp_users_signature.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/acp_users_signature.html	2009-11-16 11:10:11.000000000 -0600
@@ -93,7 +93,7 @@
 				// ]]>
 				</script>
 			</dt>
-			<dd style="margin-left: 90px;"><textarea name="signature" rows="10" cols="60" style="width: 95%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></dd>
+			<dd style="margin-left: 90px;"><textarea name="signature" rows="10" cols="60" style="width: 95%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();">{SIGNATURE}</textarea></dd>
 			<dd style="margin-left: 90px; margin-top: 5px;">
 			<!-- IF S_BBCODE_ALLOWED -->
 				<label><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE}</label>
diff -x .svn -aruN 3.0.5.src/adm/style/acp_users_warnings.html 3.0.6.src/adm/style/acp_users_warnings.html
--- 3.0.5.src/adm/style/acp_users_warnings.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/adm/style/acp_users_warnings.html	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,36 @@
+	<form id="list" method="post" action="{U_ACTION}">
+
+	<!-- IF .warn -->
+	<table cellspacing="1">
+	<thead>
+	<tr>
+		<th>{L_REPORT_BY}</th>
+		<th>{L_TIME}</th>
+		<th>{L_FEEDBACK}</th>
+		<th>{L_MARK}</th>
+	</tr>
+	</thead>
+	<tbody>
+	<!-- BEGIN warn -->
+		<!-- IF warn.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+			<td>{warn.USERNAME}</td>
+			<td style="text-align: center; nowrap: nowrap;">{warn.DATE}</td>
+			<td>{warn.ACTION}</td>
+			<td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" value="{warn.ID}" /></td>
+		</tr>
+	<!-- END warn -->
+	</tbody>
+	</table>
+	<!-- ELSE -->
+		<div class="errorbox">
+			<p>{L_NO_WARNINGS}</p>
+		</div>
+	<!-- ENDIF -->
+
+	<fieldset class="quick">
+		<input class="button2" type="submit" name="delall" value="{L_DELETE_ALL}" />&nbsp;
+		<input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" />
+		<p class="small"><a href="#" onclick="marklist('list', 'mark', true);">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'mark', false);">{L_UNMARK_ALL}</a></p>
+	</fieldset>
+	{S_FORM_TOKEN}
+	</form>
diff -x .svn -aruN 3.0.5.src/adm/style/admin.css 3.0.6.src/adm/style/admin.css
--- 3.0.5.src/adm/style/admin.css	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/admin.css	2009-11-16 11:10:11.000000000 -0600
@@ -69,8 +69,8 @@
 h3, h4 {
 	font-family: "Trebuchet MS", Helvetica, sans-serif;
 	font-size: 1.20em;
-	text-decoration: none; 
-	line-height: 1.20em; 
+	text-decoration: none;
+	line-height: 1.20em;
 	margin-top: 25px;
 }
 
@@ -97,8 +97,8 @@
 	height: 1px;
 }
 
-.small { 
-	font-size: 0.85em; 
+.small {
+	font-size: 0.85em;
 }
 
 /* General links  */
@@ -121,6 +121,17 @@
 	font-weight: bold;
 }
 
+/* List items */
+ul, ol {
+	list-style-position: inside;
+	margin-left: 1em;
+}
+
+li {
+	display: list-item;
+	list-style-type: inherit;
+}
+
 /* Main blocks
 ---------------------------------------- */
 #wrap {
@@ -191,8 +202,8 @@
 	margin: 0 3% 0 0;
 }
 
-* html #main { 
-	height: 350px; 
+* html #main {
+	height: 350px;
 }
 
 #page-body.simple-page-body {
@@ -304,7 +315,7 @@
 	padding: 0;
 }
 
-span.corners-top, span.corners-bottom, 
+span.corners-top, span.corners-bottom,
 span.corners-top span, span.corners-bottom span {
 	font-size: 1px;
 	line-height: 1px;
@@ -783,7 +794,7 @@
 
 fieldset.quick, p.quick {
 	margin: 0 0 5px;
-	padding: 5px 0 0; 
+	padding: 5px 0 0;
 	border: none;
 	background-color: transparent;
 	text-align: right;
@@ -836,7 +847,7 @@
 }
 
 /* Special case inputs */
-select#board_timezone, 
+select#board_timezone,
 select#full_folder_action {
 	width: 95%;
 }
@@ -1233,12 +1244,12 @@
 }
 
 /* Nice method for clearing floated blocks without having to insert any extra markup
-	From http://www.positioniseverything.net/easyclearing.html 
+	From http://www.positioniseverything.net/easyclearing.html
 .clearfix:after, #tabs:after, .row:after, #content:after, fieldset dl:after, #page-body:after {
-	content: "."; 
-	display: block; 
-	height: 0; 
-	clear: both; 
+	content: ".";
+	display: block;
+	height: 0;
+	clear: both;
 	visibility: hidden;
 }*/
 
@@ -1305,7 +1316,7 @@
 	height: 1.1em;
 }
 
-/* Permission sections */ 
+/* Permission sections */
 fieldset.permissions .permissions-simple {
 	text-align: left;
 	padding-top: 3px;
@@ -1516,7 +1527,7 @@
 	background-image: url("../images/corners_right2.gif");
 }
 
-.permissions-panel span.corners-top, .permissions-panel span.corners-bottom, 
+.permissions-panel span.corners-top, .permissions-panel span.corners-bottom,
 .permissions-panel span.corners-top span, .permissions-panel span.corners-bottom span {
 	font-size: 1px;
 	line-height: 1px;
@@ -1594,7 +1605,7 @@
 }
 
 .permissions-panel th.row4 {
-	background-image: none;	
+	background-image: none;
 	background-color: #E4E8EB;
 	color: #536482;
 	border: none;
@@ -1602,8 +1613,8 @@
 
 .permissions-panel th a:link, .permissions-panel th a:hover, .permissions-panel th a:visited {
 	display: block;
-	color: #FFFFFF; 
-	text-decoration: underline; 
+	color: #FFFFFF;
+	text-decoration: underline;
 }
 
 .permissions-panel td.permissions-yes label:hover {
diff -x .svn -aruN 3.0.5.src/adm/style/captcha_default_acp_demo.html 3.0.6.src/adm/style/captcha_default_acp_demo.html
--- 3.0.5.src/adm/style/captcha_default_acp_demo.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/adm/style/captcha_default_acp_demo.html	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,4 @@
+<dl>
+	<dt><label for="captcha_preview">{L_PREVIEW}:</label><br /><span>{L_CAPTCHA_PREVIEW_EXPLAIN}</span></dt>
+	<dd><img src="{CONFIRM_IMAGE}" alt="{L_PREVIEW}" width="360" height="96" id="captcha_preview" /></dd>
+</dl>
diff -x .svn -aruN 3.0.5.src/adm/style/captcha_gd_acp.html 3.0.6.src/adm/style/captcha_gd_acp.html
--- 3.0.5.src/adm/style/captcha_gd_acp.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/adm/style/captcha_gd_acp.html	2009-11-16 11:10:11.000000000 -0600
@@ -0,0 +1,74 @@
+<!-- INCLUDE overall_header.html -->
+
+<a name="maincontent"></a>
+	<a href="{U_ACTION}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
+
+<h1>{L_ACP_VC_SETTINGS}</h1>
+
+<p>{L_ACP_VC_SETTINGS_EXPLAIN}</p>
+
+
+<form id="acp_captcha" method="post" action="{U_ACTION}">
+
+<fieldset>
+<legend>{L_GENERAL_OPTIONS}</legend>
+
+<dl>
+	<dt><label for="captcha_gd_foreground_noise">{L_CAPTCHA_GD_FOREGROUND_NOISE}:</label><br /><span>{L_CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN}</span></dt>
+	<dd><label><input id="captcha_gd_foreground_noise" name="captcha_gd_foreground_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+		<label><input name="captcha_gd_foreground_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+</dl>
+<dl>
+	<dt><label for="captcha_gd_x_grid">{L_CAPTCHA_GD_X_GRID}:</label><br /><span>{L_CAPTCHA_GD_X_GRID_EXPLAIN}</span></dt>
+	<dd><input id="captcha_gd_x_grid" name="captcha_gd_x_grid" value="{CAPTCHA_GD_X_GRID}" type="text" /></dd>
+</dl>
+<dl>
+	<dt><label for="captcha_gd_y_grid">{L_CAPTCHA_GD_Y_GRID}:</label><br /><span>{L_CAPTCHA_GD_Y_GRID_EXPLAIN}</span></dt>
+	<dd><input id="captcha_gd_y_grid" name="captcha_gd_y_grid" value="{CAPTCHA_GD_Y_GRID}" type="text" /></dd>
+</dl>
+<dl>
+	<dt><label for="captcha_gd_wave">{L_CAPTCHA_GD_WAVE}:</label><br /><span>{L_CAPTCHA_GD_WAVE_EXPLAIN}</span></dt>
+	<dd><label><input id="captcha_gd_wave" name="captcha_gd_wave" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_WAVE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+		<label><input name="captcha_gd_wave" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_WAVE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
+</dd>
+</dl>
+<dl>
+	<dt><label for="captcha_gd_3d_noise">{L_CAPTCHA_GD_3D_NOISE}:</label><br /><span>{L_CAPTCHA_GD_3D_NOISE_EXPLAIN}</span></dt>
+	<dd><label><input id="captcha_gd_3d_noise" name="captcha_gd_3d_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_3D_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+		<label><input name="captcha_gd_3d_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_3D_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
+</dd>
+</dl>
+<dl>
+	<dt><label for="captcha_gd_fonts">{L_CAPTCHA_GD_FONTS}:</label><br /><span>{L_CAPTCHA_GD_FONTS_EXPLAIN}</span></dt>
+	<dd><label><input id="captcha_gd_fonts" name="captcha_gd_fonts" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 1 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_DEFAULT}</label>
+		<label><input name="captcha_gd_fonts" value="2" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 2 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_NEW}</label>
+		<label><input name="captcha_gd_fonts" value="3" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 3 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_LOWER}</label>
+
+</dd>
+</dl>
+
+</fieldset>
+<fieldset>
+	<legend>{L_PREVIEW}</legend>
+	<!-- IF CAPTCHA_PREVIEW -->
+	<!-- INCLUDE {CAPTCHA_PREVIEW} -->
+	<!-- ENDIF -->
+
+</fieldset>
+
+<fieldset>
+	<legend>{L_ACP_SUBMIT_CHANGES}</legend>
+	<p class="submit-buttons">
+		<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
+		<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />&nbsp;
+		<input class="button2" type="submit" id="preview" name="preview" value="{L_PREVIEW}" />&nbsp;
+	</p>
+
+	<input type="hidden" name="select_captcha" value="{CAPTCHA_NAME}" />
+	<input type="hidden" name="configure" value="1" />
+
+	{S_FORM_TOKEN}
+</fieldset>
+</form>
+
+<!-- INCLUDE overall_footer.html -->
diff -x .svn -aruN 3.0.5.src/adm/style/captcha_qa_acp_demo.html 3.0.6.src/adm/style/captcha_qa_acp_demo.html
--- 3.0.5.src/adm/style/captcha_qa_acp_demo.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/adm/style/captcha_qa_acp_demo.html	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,7 @@
+<dl>
+	<dt><label for="answer">{L_CONFIRM_QUESTION}:</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
+
+	<dd>
+		<input type="text" tabindex="10" name="answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}"  />
+	</dd>
+</dl>
diff -x .svn -aruN 3.0.5.src/adm/style/captcha_qa_acp.html 3.0.6.src/adm/style/captcha_qa_acp.html
--- 3.0.5.src/adm/style/captcha_qa_acp.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/adm/style/captcha_qa_acp.html	2009-11-16 11:10:11.000000000 -0600
@@ -0,0 +1,92 @@
+<!-- INCLUDE overall_header.html -->
+
+<a name="maincontent"></a>
+
+
+	<a href="<!-- IF U_LIST -->{U_LIST}<!-- ELSE -->{U_ACTION}<!-- ENDIF -->" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
+
+	<h1>{L_QUESTIONS}</h1>
+
+	<p>{L_QUESTIONS_EXPLAIN}</p>
+<!-- IF S_LIST -->
+	<form id="captcha_qa" method="post" action="{U_ACTION}">
+
+	<fieldset class="tabulated">
+	<legend>{L_QUESTIONS}</legend>
+
+	<table cellspacing="1">
+	<thead>
+	<tr>
+		<th colspan="3">{L_QUESTIONS}</th>
+	</tr>
+	<tr class="row3">
+		<td style="text-align: center;">{L_QUESTION_TEXT}</td>
+		<td style="width: 5%; text-align: center;">{L_QUESTION_LANG}</td>
+		<td style="vertical-align: top; width: 50px; text-align: center; white-space: nowrap;">{L_ACTION}</td>
+	</tr>
+	</thead>
+	<tbody>
+	<!-- BEGIN questions -->
+
+		<!-- IF questions.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+
+		<td style="text-align: left;">{questions.QUESTION_TEXT}</td>
+		<td style="text-align: center;">{questions.QUESTION_LANG}</td>
+		<td style="text-align: center;"><a href="{questions.U_EDIT}">{ICON_EDIT}</a>&nbsp;<a href="{questions.U_DELETE}">{ICON_DELETE}</a></td>
+		</tr>
+		<!-- END questions -->
+	</tbody>
+	</table>
+	<fieldset class="quick">
+		<input class="button1" type="submit" name="add" value="{L_ADD}" />
+		<input  type="hidden" name="action" value="add" />
+		<input  type="hidden" name="configure" value="1" />
+		<input  type="hidden" name="select_captcha" value="{CLASS}" />
+
+		{S_FORM_TOKEN}
+	</fieldset>
+	{S_FORM_TOKEN}
+	</fieldset>
+	</form>
+<!-- ELSE -->
+	<!-- IF S_ERROR -->
+		<div class="errorbox">
+			<h3>{L_WARNING}</h3>
+			<p>{L_QA_ERROR_MSG}</p>
+		</div>
+	<!-- ENDIF -->
+	<form id="captcha_qa" method="post" action="{U_ACTION}">
+	<fieldset>
+		<legend>{L_EDIT_QUESTION}</legend>
+	<dl>
+		<dt><label for="strict">{L_QUESTION_STRICT}:</label><br /><span>{L_QUESTION_STRICT_EXPLAIN}</span></dt>
+		<dd><label><input type="radio" class="radio" name="strict" value="1"<!-- IF STRICT --> id="strict" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+			<label><input type="radio" class="radio" name="strict" value="0"<!-- IF not STRICT --> id="strict" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+	</dl>
+
+	<dl>
+		<dt><label for="lang_iso">{L_QUESTION_LANG}</label><br /><span>{L_QUESTION_LANG_EXPLAIN}</span></dt>
+		<dd><select id="lang_iso" name="lang_iso"><!-- BEGIN langs --><option value="{langs.ISO}" <!-- IF langs.ISO == LANG_ISO --> selected="selected" <!-- ENDIF -->>{langs.NAME}</option><!-- END langs --></select></dd>
+	</dl>
+	<dl>
+		<dt><label for="question_text">{L_QUESTION_TEXT}</label><br /><span>{L_QUESTION_TEXT_EXPLAIN}</span></dt>
+		<dd><input id="question_text" maxlength="255" size="60" name="question_text" type="text" value="{QUESTION_TEXT}" /></dd>
+	</dl>
+	<dl>
+		<dt><label for="answers">{L_QUESTION_ANSWERS}</label><br /><span>{L_ANSWERS_EXPLAIN}</span></dt>
+		<dd><textarea id="answers" style="word-wrap: normal; overflow-x: scroll;" name="answers" rows="15" cols="800" >{ANSWERS}</textarea></dd>
+	</dl>
+	</fieldset>
+	<fieldset class="quick">
+		<input class="button1" type="submit" name="submit" value="{L_SUBMIT}" />
+		<input type="hidden" name="question_id" value="{QUESTION_ID}" />
+		<input type="hidden" name="action" value="add" />
+		<input  type="hidden" name="configure" value="1" />
+		<input  type="hidden" name="select_captcha" value="{CLASS}" />
+
+		{S_FORM_TOKEN}
+	</fieldset>
+	</form>
+<!-- ENDIF -->
+
+<!-- INCLUDE overall_footer.html -->
diff -x .svn -aruN 3.0.5.src/adm/style/captcha_recaptcha_acp.html 3.0.6.src/adm/style/captcha_recaptcha_acp.html
--- 3.0.5.src/adm/style/captcha_recaptcha_acp.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/adm/style/captcha_recaptcha_acp.html	2009-11-16 11:10:11.000000000 -0600
@@ -0,0 +1,50 @@
+<!-- INCLUDE overall_header.html -->
+
+<a name="maincontent"></a>
+
+<h1>{L_ACP_VC_SETTINGS}</h1>
+
+<p>{L_ACP_VC_SETTINGS_EXPLAIN}</p>
+
+
+<form id="acp_captcha" method="post" action="{U_ACTION}">
+
+<fieldset>
+<legend>{L_GENERAL_OPTIONS}</legend>
+
+<dl>
+	<dt><label for="recaptcha_pubkey">{L_RECAPTCHA_PUBLIC}:</label><br /><span>{L_RECAPTCHA_PUBLIC_EXPLAIN}</span></dt>
+	<dd><input id="recaptcha_pubkey" name="recaptcha_pubkey" value="{RECAPTCHA_PUBKEY}" size="50" type="text" /></dd>
+</dl>
+<dl>
+	<dt><label for="recaptcha_privkey">{L_RECAPTCHA_PRIVATE}:</label><br /><span>{L_RECAPTCHA_PRIVATE_EXPLAIN}</span></dt>
+	<dd><input id="recaptcha_privkey" name="recaptcha_privkey" value="{RECAPTCHA_PRIVKEY}" size="50" type="text" /></dd>
+</dl>
+
+
+</fieldset>
+<fieldset>
+	<legend>{L_PREVIEW}</legend>
+<!-- IF PREVIEW -->
+	<div class="successbox">
+		<h3>{L_WARNING}</h3>
+		<p>{L_CAPTCHA_PREVIEW_MSG}</p>
+	</div>
+<!-- ENDIF -->
+<!-- INCLUDE {CAPTCHA_PREVIEW} -->
+</fieldset>
+
+<fieldset>
+	<legend>{L_ACP_SUBMIT_CHANGES}</legend>
+	<p class="submit-buttons">
+		<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
+		<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />&nbsp;
+	</p>
+	<input type="hidden" name="select_captcha" value="{CAPTCHA_NAME}" />
+	<input type="hidden" name="configure" value="1" />
+
+	{S_FORM_TOKEN}
+</fieldset>
+</form>
+
+<!-- INCLUDE overall_footer.html -->
diff -x .svn -aruN 3.0.5.src/adm/style/captcha_recaptcha.html 3.0.6.src/adm/style/captcha_recaptcha.html
--- 3.0.5.src/adm/style/captcha_recaptcha.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/adm/style/captcha_recaptcha.html	2009-11-16 11:10:11.000000000 -0600
@@ -0,0 +1,33 @@
+<!-- IF S_RECAPTCHA_AVAILABLE -->
+	<dl>
+	<dd>
+		<script type="text/javascript">
+		// <![CDATA[
+		var RecaptchaOptions = {
+			lang : '{L_RECAPTCHA_LANG}',
+		};
+		// ]]>
+		</script>
+		<script type="text/javascript" src="{RECAPTCHA_SERVER}/challenge?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}"></script>
+		<script type="text/javascript">
+		// <![CDATA[
+		<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
+			document.getElementById('recaptcha_table').style.direction = 'ltr';
+		<!-- ENDIF -->
+		// ]]>
+		</script>
+
+
+	<noscript>
+	<div>
+		<object data="{RECAPTCHA_SERVER}/noscript?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}" type="text/html" height="300" width="500"></object><br />
+		<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
+		<input type="hidden" name="recaptcha_response_field" value="manual_challenge" />
+	</div>
+	</noscript>
+
+	</dd>
+	</dl>
+<!-- ELSE -->
+{L_RECAPTCHA_NOT_AVAILABLE}
+<!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/adm/style/editor.js 3.0.6.src/adm/style/editor.js
--- 3.0.5.src/adm/style/editor.js	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/editor.js	2009-11-16 11:10:11.000000000 -0600
@@ -16,7 +16,6 @@
 var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
 
 var baseHeight;
-window.onload = initInsertions;
 
 /**
 * Shows the help messages in the helpline window
@@ -259,7 +258,7 @@
 */
 function mozWrap(txtarea, open, close)
 {
-	var selLength = txtarea.textLength;
+	var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;
 	var selStart = txtarea.selectionStart;
 	var selEnd = txtarea.selectionEnd;
 	var scrollTop = txtarea.scrollTop;
diff -x .svn -aruN 3.0.5.src/adm/style/install_footer.html 3.0.6.src/adm/style/install_footer.html
--- 3.0.5.src/adm/style/install_footer.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/install_footer.html	2009-11-16 11:10:11.000000000 -0600
@@ -2,6 +2,7 @@
 					</div>
 				</div>
 			<span class="corners-bottom"><span></span></span>
+			<div class="clear"></div>
 		</div>
 		</div>
 	</div>
diff -x .svn -aruN 3.0.5.src/adm/style/install_update_diff.html 3.0.6.src/adm/style/install_update_diff.html
--- 3.0.5.src/adm/style/install_update_diff.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/install_update_diff.html	2009-11-16 11:10:10.000000000 -0600
@@ -15,9 +15,9 @@
 // <![CDATA[
 function resize_panel()
 {
-	var block = document.getElementById('codepanel');	
+	var block = document.getElementById('codepanel');
 	var height;
-	
+
 	if (window.innerHeight)
 	{
 		height = window.innerHeight - 150;
@@ -26,8 +26,11 @@
 	else
 	{
 		//whatever IE needs to do this
-	}	
+	}
 }
+
+window.onresize = resize_panel;
+
 // ]]>
 </script>
 
@@ -48,23 +51,30 @@
 
 <!-- IF DIFF_MODE neq 'side_by_side' and DIFF_MODE neq 'raw' -->
 div#codepanel {
-	overflow: auto;
 	width: 100%;
-	height: 350px;
-	display: inline-block;
 }
 <!-- ELSE -->
-div#codepanel {	
+div#codepanel {
 	background-color: #eee;
 }
 <!-- ENDIF -->
 
+<!-- IF DIFF_MODE neq 'unified' and DIFF_MODE neq 'side_by_side'  -->
+div#diff_content pre {
+	overflow: auto;
+	height: 414px;
+	width: 100% !important;
+}
+<!-- ENDIF -->
+
 <!-- IF not S_DIFF_NEW_FILE -->
 /**
 * Unified Diff
 */
 .file {
 	line-height: .7em;
+	overflow: auto;
+	height: 414px;
 }
 
 .diff {
@@ -139,10 +149,10 @@
 
 table.hrdiff tbody td.old {
 	border-left: 1px solid #999;
-	border-right: 1px solid #999;	
+	border-right: 1px solid #999;
 }
 table.hrdiff tbody td.new {
-	border-right: 1px solid #999;	
+	border-right: 1px solid #999;
 }
 
 table.hrdiff td pre {
@@ -203,9 +213,8 @@
 
 </head>
 
-
 <!-- IF DIFF_MODE neq 'side_by_side' and DIFF_MODE neq 'raw' -->
-<body onresize="resize_panel();" onload="resize_panel();">
+<body onload="resize_panel();">
 <!-- ELSE -->
 <body>
 <!-- ENDIF -->
@@ -220,7 +229,7 @@
 <!-- ENDIF -->
 <!-- IF not S_DIFF_NEW_FILE -->
 		<p id="skip"><a href="#acp">{L_SKIP}</a></p>
-		<form method="post">
+		<form method="post" action="">
 		<fieldset class="quick">
 			<label for="diff_mode">{L_SELECT_DIFF_MODE}:</label>
 			<select name="diff_mode" id="diff_mode">{S_DIFF_MODE_OPTIONS}</select>
@@ -229,18 +238,18 @@
 		</fieldset>
 		</form>
 <!-- ENDIF -->
+<!-- IF S_DIFF_CONFLICT_FILE -->
+		<div style="float: {S_CONTENT_FLOW_BEGIN};"><strong>{L_NUM_CONFLICTS}: {NUM_CONFLICTS}</strong></div>
+		<br style="clear: both;" />
+<!-- ENDIF -->
 	</div>
-	
+
 	<div id="page-body">
 		<div id="acp">
 		<div class="panel" id="codepanel">
 			<span class="corners-top"><span></span></span>
 				<div id="diff_content">
 					<div id="main">
-
-<!-- IF S_DIFF_CONFLICT_FILE -->
-		<div style="float: {S_CONTENT_FLOW_END};"><strong>{L_NUM_CONFLICTS}: {NUM_CONFLICTS}</strong></div>
-<!-- ENDIF -->
 						{DIFF_CONTENT}
 					</div>
 				</div>
@@ -248,6 +257,6 @@
 		</div>
 		</div>
 	</div>
-	
+
 
 <!-- INCLUDE simple_footer.html -->
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/adm/style/install_update.html 3.0.6.src/adm/style/install_update.html
--- 3.0.5.src/adm/style/install_update.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/install_update.html	2009-11-16 11:10:11.000000000 -0600
@@ -219,8 +219,7 @@
 					<!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
 				</dt>
 				<dd style="margin-left: 60%;">
-					<!-- IF not new.S_BINARY -->[ <a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>
-					<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
+					<!-- IF not new.S_BINARY -->[<a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
 				</dd>
 				<!-- IF new.S_CUSTOM -->
 					<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
@@ -243,7 +242,7 @@
 					<dt style="width: 60%;"><strong><!-- IF not_modified.DIR_PART -->{not_modified.DIR_PART}<br /><!-- ENDIF -->{not_modified.FILE_PART}</strong>
 						<!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
 					</dt>
-					<dd style="margin-left: 60%;"><!-- IF not not_modified.S_BINARY -->[ <a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
+					<dd style="margin-left: 60%;"><!-- IF not not_modified.S_BINARY -->[<a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
 					<!-- IF not_modified.S_CUSTOM -->
 						<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
 					<!-- ENDIF -->
@@ -271,7 +270,7 @@
 				</dl>
 				<dl>
 					<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="0" checked="checked" /> {L_MERGE_MODIFICATIONS_OPTION}</label></dt>
-					<dd style="margin-left: 60%;"><!-- IF not modified.S_BINARY -->[ <a href="{modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{modified.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
+					<dd style="margin-left: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
 				</dl>
 				<dl>
 					<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
@@ -298,8 +297,7 @@
 					<!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
 				</dt>
 				<dd style="margin-left: 60%;">
-					<!-- IF not new_conflict.S_BINARY -->[ <a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>
-					<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
+					<!-- IF not new_conflict.S_BINARY -->[<a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
 				</dd>
 				<!-- IF new_conflict.S_CUSTOM -->
 					<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
@@ -323,7 +321,7 @@
 						<!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}: {conflict.NUM_CONFLICTS}</span><!-- ENDIF -->
 					</dt>
 					<dd style="margin-left: 60%;">
-						<!-- IF not conflict.S_BINARY -->[ <a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a> ]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN}
+						<!-- IF not conflict.S_BINARY -->[<a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a>]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN}
 						<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
 					</dd>
 					<!-- IF conflict.S_CUSTOM -->
@@ -396,7 +394,7 @@
 
 	<fieldset class="submit-buttons">
 		{S_HIDDEN_FIELDS}
-		<input type="submit" class="button2" value="{L_CHECK_FILES_AGAIN}" name="check_again" />&nbsp; &nbsp;<input type="submit" class="button1" value="{L_DOWNLOAD}" name="download" />
+		<input type="submit" class="button2" value="{L_CONTINUE_UPDATE}" name="check_again" />&nbsp; &nbsp;<input type="submit" class="button1" value="{L_DOWNLOAD}" name="download" />
 	</fieldset>
 
 	</form>
@@ -462,7 +460,7 @@
 	</dl>
 	<!-- END data -->
 	</fieldset>
-	
+
 	<fieldset class="submit-buttons">
 		{S_HIDDEN_FIELDS}
 		<input class="button2" type="submit" name="check_again" value="{L_BACK}" />
diff -x .svn -aruN 3.0.5.src/adm/style/overall_footer.html 3.0.6.src/adm/style/overall_footer.html
--- 3.0.5.src/adm/style/overall_footer.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/overall_footer.html	2009-11-16 11:10:11.000000000 -0600
@@ -2,6 +2,7 @@
 					</div>
 				</div>
 			<span class="corners-bottom"><span></span></span>
+			<div class="clear"></div>
 		</div>
 		</div>
 	</div>
diff -x .svn -aruN 3.0.5.src/adm/style/overall_header.html 3.0.6.src/adm/style/overall_header.html
--- 3.0.5.src/adm/style/overall_header.html	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/adm/style/overall_header.html	2009-11-16 11:10:11.000000000 -0600
@@ -194,21 +194,27 @@
 					<div id="menu">
 						<p>{L_LOGGED_IN_AS}<br /><strong>{USERNAME}</strong> [&nbsp;<a href="{U_LOGOUT}">{L_LOGOUT}</a>&nbsp;][&nbsp;<a href="{U_ADM_LOGOUT}">{L_ADM_LOGOUT}</a>&nbsp;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
 						<ul>
+						<!-- DEFINE $LI_USED = 0 -->
 						<!-- BEGIN l_block1 -->
 							<!-- IF l_block1.S_SELECTED -->
 	
 						<!-- BEGIN l_block2 -->
 							<!-- IF .l_block1.l_block2.l_block3 -->
 							<li class="header">{l_block1.l_block2.L_TITLE}</li>
+							<!-- DEFINE $LI_USED = 1 -->
 							<!-- ENDIF -->
 	
 							<!-- BEGIN l_block3 -->
 								<li<!-- IF l_block1.l_block2.l_block3.S_SELECTED --> id="activemenu"<!-- ENDIF -->><a href="{l_block1.l_block2.l_block3.U_TITLE}"><span>{l_block1.l_block2.l_block3.L_TITLE}</span></a></li>
+								<!-- DEFINE $LI_USED = 1 -->
 							<!-- END l_block3 -->
 						<!-- END l_block2 -->
 						
 							<!-- ENDIF -->
 						<!-- END l_block1 -->
+						<!-- IF not $LI_USED -->
+							<li></li>
+						<!-- ENDIF -->
 						</ul>
 					</div>
 	
diff -x .svn -aruN 3.0.5.src/adm/style/permission_forum_copy.html 3.0.6.src/adm/style/permission_forum_copy.html
--- 3.0.5.src/adm/style/permission_forum_copy.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/adm/style/permission_forum_copy.html	2009-11-16 11:10:11.000000000 -0600
@@ -0,0 +1,40 @@
+<!-- INCLUDE overall_header.html -->
+
+<a name="maincontent"></a>
+
+	<h1>{L_ACP_FORUM_PERMISSIONS_COPY}</h1>
+
+	{L_ACP_FORUM_PERMISSIONS_COPY_EXPLAIN}
+
+	<form id="forum_perm_copy" method="post" action="{U_ACTION}">
+
+	<fieldset>
+		<legend>{L_LOOK_UP_FORUM}</legend>
+
+		<dl>
+			<dt><label for="src_forum">{L_COPY_PERMISSIONS_FROM}:</label><br /><span>{L_COPY_PERMISSIONS_FORUM_FROM_EXPLAIN}</span></dt>
+			<dd><select id="src_forum" name="src_forum_id"><option value="0">{L_SELECT_FORUM}</option><option value="-1">------------------</option>{S_FORUM_OPTIONS}</select></dd>
+		</dl>
+	</fieldset>
+
+	<fieldset>
+		<legend>{L_LOOK_UP_FORUM}</legend>
+		<p>{L_LOOK_UP_FORUMS_EXPLAIN}</p>
+
+		<dl>
+			<dt><label for="dest_forums">{L_COPY_PERMISSIONS_TO}:</label><br /><span>{L_COPY_PERMISSIONS_FORUM_TO_EXPLAIN}</span></dt>
+			<dd><select id="dest_forums" name="dest_forum_ids[]" multiple="multiple" size="10">{S_FORUM_OPTIONS}</select></dd>
+		</dl>
+	</fieldset>
+
+	<fieldset class="submit-buttons">
+		<legend>{L_SUBMIT}</legend>
+		<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
+		<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
+		{S_HIDDEN_FIELDS}
+		{S_FORM_TOKEN}
+	</fieldset>
+
+	</form>
+
+<!-- INCLUDE overall_footer.html -->
diff -x .svn -aruN 3.0.5.src/docs/auth_api.html 3.0.6.src/docs/auth_api.html
--- 3.0.5.src/docs/auth_api.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/docs/auth_api.html	2009-11-16 11:10:10.000000000 -0600
@@ -241,7 +241,7 @@
 <!-- END DOCUMENT -->
 
 	<div id="page-footer">
-		<div class="version"> $Id: auth_api.html 8479 2008-03-29 00:22:48Z naderman $ </div>
+		<div class="version"> $Id: auth_api.html 8887 2008-09-19 10:25:27Z acydburn $ </div>
 	</div>
 </div></div>
 
diff -x .svn -aruN 3.0.5.src/docs/AUTHORS 3.0.6.src/docs/AUTHORS
--- 3.0.5.src/docs/AUTHORS	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/docs/AUTHORS	2009-11-16 11:10:10.000000000 -0600
@@ -20,32 +20,39 @@
 Please see: http://www.phpbb.com/about/team/ for a list of all the people currently
 involved in phpBB.
 
-phpBB Lead Developer  : Acyd Burn (Meik Sievertsen)
+phpBB Lead Developer	:	Acyd Burn (Meik Sievertsen)
 
-phpBB Developers      : APTX (Marek A. R.)
-                        DavidMJ (David M.)
-                        dhn (Dominik Drscher)
-                        kellanved (Henry Sudhof)
-                        naderman (Nils Adermann)
-                        ToonArmy (Chris Smith)
-                        Vic D'Elfant (Vic D'Elfant)
+phpBB Developers	:	APTX (Marek A. R.)
+				bantu (Andreas Fischer)
+				DavidMJ (David M.)
+				dhn (Dominik Drscher)
+				kellanved (Henry Sudhof)
+				naderman (Nils Adermann)
+				Terrafrost (Jim Wigginton)
+				ToonArmy (Chris Smith)
+
+Contributions by	:	leviatan21 (Gabriel Vazquez)
+				nickvergessen (Joas Schilling)
+				Raimon (Raimon Meuldijk)
+				rxu (Ruslan Uzdenov)
+				Xore (Robert Hetzler)
 
 
 -- Previous Contributors --
 
-phpBB Project Manager : theFinn (James Atkinson) [Founder - 04/2007]
-			SHS` (Jonathan Stanley)
+phpBB Project Manager	:	theFinn (James Atkinson) [Founder - 04/2007]
+				SHS` (Jonathan Stanley)
 
-phpBB Lead Developer  : psoTFX (Paul S. Owen) [2001 - 09/2005]
-
-phpBB Developers      : Ashe (Ludovic Arnaud)   [10/2002 - 11/2003, 06/2006 - 10/2006]
-                        BartVB (Bart van Bragt) [11/2000 - 03/2006]
-                        GrahamJE (Graham Eames) [09/2005 - 11/2006]
+phpBB Lead Developer	:	psoTFX (Paul S. Owen) [2001 - 09/2005]
 
+phpBB Developers	:	Ashe (Ludovic Arnaud)       [10/2002 - 11/2003, 06/2006 - 10/2006]
+				BartVB (Bart van Bragt)     [11/2000 - 03/2006]
+				GrahamJE (Graham Eames)     [09/2005 - 11/2006]
+				Vic D'Elfant (Vic D'Elfant) [04/2007 - 04/2009]
 
 -- Copyrights --
 
-Visual Confirmation   : Xore (Robert Hetzler)
+Visual Confirmation	:	Xore (Robert Hetzler)
 
 Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Group
 prosilver by subBlue Design, Tom Beddard, (c) 2004 phpBB Group
diff -x .svn -aruN 3.0.5.src/docs/CHANGELOG.html 3.0.6.src/docs/CHANGELOG.html
--- 3.0.5.src/docs/CHANGELOG.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/docs/CHANGELOG.html	2009-11-16 11:10:10.000000000 -0600
@@ -53,6 +53,7 @@
 <ol>
 	<li><a href="#changelog">Changelog</a>
 	<ol style="list-style-type: lower-roman;">
+		<li><a href="#v305">Changes since 3.0.5</a></li>
 		<li><a href="#v304">Changes since 3.0.4</a></li>
 		<li><a href="#v303">Changes since 3.0.3</a></li>
 		<li><a href="#v302">Changes since 3.0.2</a></li>
@@ -84,7 +85,229 @@
 		<div class="inner"><span class="corners-top"><span></span></span>
 
 		<div class="content">
-	<a name="v304"></a><h3>1.i. Changes since 3.0.4</h3>
+	<a name="v305"></a><h3>1.i. Changes since 3.0.5</h3>
+
+	<ul>
+		<li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li>
+		<li>[Fix] Sorting by author or subject on viewtopic now preserves the order. (Bug #44875)</li>
+		<li>[Fix] Correctly determine writable status of files on Windows operating systems. (Bug #39035)</li>
+		<li>[Fix] Show report button in prosilver for guests who are allowed to report posts. (Bug #45695)</li>
+		<li>[Fix] Correctly show private message history. (Bug #46065)</li>
+		<li>[Fix] Various XHTML mistakes in prosilver, subsilver2 and the ACP. (Bugs #25545, #26315, #38555, #45505 - Patch by Raimon, #45785, #45865, #47085 - Patch by Raimon)</li>
+		<li>[Fix] Fix some ACP style issues. (Bug #16109 - Patch by prototech)</li>
+		<li>[Fix] Move post bump information markup to the template. (Bug #34295)</li>
+		<li>[Fix] Show error in the ACP when template folder is not readable. (Bug #45705)</li>
+		<li>[Fix] Adjust viewonline filename regular expression to be less strict. (Bug #46215)</li>
+		<li>[Fix] Correctly apply the &quot;can change vote&quot; permission again. Regression introduced in r9470. (Bug #45895)</li>
+		<li>[Fix] Remove data from friend/foe table when deleting user. (Bug #45345)</li>
+		<li>[Fix] Correctly hide skiplink in prosilver right-to-left mode. (Bug #45765 - Patch by prototech and bantu)</li>
+		<li>[Fix] Fix dynamic config update routine error if firebird is used. (Bug #46315)</li>
+		<li>[Fix] Allow friends/foes to be added and removed at the same time. (Bug #46255)</li>
+		<li>[Fix] Only change topic/post icon on edit if icons are enabled and user is allowed to use icons. (Bug #46355)</li>
+		<li>[Fix] Fix saving custom profile fields in ACP if Oracle is used. (Bug #46015)</li>
+		<li>[Fix] Make view_log() more resilient to corrupt serialized data. (Bug #46545)</li>
+		<li>[Fix] Show error if hostname lookup doesn't return a valid IP address when banning. (Bug #45585)</li>
+		<li>[Fix] Fix incorrect layout when loading private message draft. (Bug #38435 - Patch by nickvergessen)</li>
+		<li>[Fix] Show proper error message when trying to add bots to friends/foes list. (Bug #40205)</li>
+		<li>[Fix] Fixed database backup and restore with Oracle DBMS. (Bug #46715)</li>
+		<li>[Fix] Update attachments table when deleting user and retaining his posts. (Bug #40245)</li>
+		<li>[Fix] Correctly detect files in subfolders when viewing cached template files. (Bug #46145)</li>
+		<li>[Fix] Display user's jabber address in popup if jabber functionality is disabled. (Bug #20775)</li>
+		<li>[Fix] Correctly exclude forums from active topics list. (Bug #19135)</li>
+		<li>[Fix] Do not display banned users in birthday list. (Bug #20625)</li>
+		<li>[Fix] Fix function to recalculate nested sets. (Bug #41555 - Patch by EXreaction)</li>
+		<li>[Fix] Display but also highlight already used rank images while assigning new ranks. (Bug #22665)</li>
+		<li>[Fix] Correctly orientate quoted text image on RTL languages. (Bug #33745)</li>
+		<li>[Fix] Do not display &quot;View user notes&quot; and &quot;Warn user&quot; links in user profile if corresponding MCP modules are disabled. (Bug #10519)</li>
+		<li>[Fix] Show proper error message when trying to create a private messages folder with an empty name. (Bug #39875)</li>
+		<li>[Fix] No longer state that it is possible to manage group leaders from the UCP. (Bug #19945)</li>
+		<li>[Fix] Do not throw an error when PDO is a shared module and not loaded preventing SQLite from being loaded.</li>
+		<li>[Fix] Fix censoring of unicode words. (Bug #16555)</li>
+		<li>[Fix] Display coloured usernames in ACP groups management screens.</li>
+		<li>[Fix] Correctly describe founder permissions on trace-information. (Bug #37235)</li>
+		<li>[Fix] Correct the width value for poll_center.gif omitted in imageset.cfg for subsilver2. (Bug #43005)</li>
+		<li>[Fix] Correctly load complex language variable using acp_language. (Bug #45735 - Patch by leviatan21)</li>
+		<li>[Fix] Fix reapply_sid() to correctly strip session id in certain circumstances. (Bug #43125 - Patch by leviatan21)</li>
+		<li>[Fix] Correctly state why one language pack is marked with an asterisk in the ACP. (Bug #37565)</li>
+		<li>[Fix] Correctly check if install directory is still present. (Bug #46965)</li>
+		<li>[Fix] Correct banned user behaviour when &quot;force password change&quot; is enabled. (Bug #47145 - Patch by nickvergessen and leviatan21)</li>
+		<li>[Fix] Correctly display ACP logs options, without permission to clear logs. (Bug #24155 - Patch by leviatan21)</li>
+		<li>[Fix] Display topic icons in MCP forum view again (only prosilver).</li>
+		<li>[Fix] Properly display post status messages in topic when post is reported and unapproved (Bug #44455 - Patch by leviatan21)</li>
+		<li>[Fix] Do not remove recipients when loading private message draft. (Bug #38395)</li>
+		<li>[Fix] Add author name to moderator log when deleting post/topic. (Bug #46225)</li>
+		<li>[Fix] Fix broken &quot;Report details&quot; link in the MCP. (Bug #46975)</li>
+		<li>[Fix] Resolve accesskey conflicts in prosilver. (Bug #44685)</li>
+		<li>[Fix] Check if template file is empty before trying to read from it. (Bug #47345)</li>
+		<li>[Fix] More descriptive descriptions for permissions to use BBCode, smilies, images and flash. (Bug #36065)</li>
+		<li>[Fix] Fix style issues in print mode. (Bug #26375 - Patch by leviatan21)</li>
+		<li>[Fix] Fix minor issue with L_QUOTE language string missing in several PM composing modes. (Bug #39625)</li>
+		<li>[Fix] Also fetch posts of guests and deleted or deactivated users while searching for author names. (Bug #36565, #47765)</li>
+		<li>[Fix] Show end of ban in MCP and ACP when user is banned by duration. (Bug #47815 - Patch by Pyramide)</li>
+		<li>[Fix] Correctly count posts awaiting approval in the MCP. (Bug #47685)</li>
+		<li>[Fix] Display user's posts count in private message when it is equal to 0 (prosilver). (Bug #40155)</li>
+		<li>[Fix] Only allow users to disable word censor if globally allowed. (Bug #47575 - Patch by 00mohgta7)</li>
+		<li>[Fix] Fix database updater and db tools to support multiple column changes/additions/removals with SQLite.</li>
+		<li>[Fix] Correctly detect GZIP status in debug mode. (Bug #24075)</li>
+		<li>[Fix] Posting smilies in view more smilies screen now works again in IE. (Bug #46025 - Patch by leviatan21)</li>
+		<li>[Fix] Properly convert and show filesize information. (Bug #47775)</li>
+		<li>[Fix] Add ability to prune users who never logged in. (Bug #44295)</li>
+		<li>[Fix] Show smilies and images in topic print view. (Bug #47265)</li>
+		<li>[Fix] Force full date in private message print view.</li>
+		<li>[Fix] Fix &quot;Always show a scrollbar for short pages&quot; for IE8 and Firefox 3.5. (Bug #47865 - Patch by stokerpiller)</li>
+		<li>[Fix] Do not allow setting group as default group for pending users. (Bug #45675)</li>
+		<li>[Fix] Fail gracefully if store folder is not writable during update. (Bugs #46615, #46945)</li>
+		<li>[Fix] Hide profile-icon from viewtopic page if user has no permissions (subsilver2 only). (Bug #37635 - Patch by leviatan21)</li>
+		<li>[Fix] Correct escaping/unescaping in the LDAP authentication plugin. (Bug #48175)</li>
+		<li>[Fix] Add hard limit for smilies.</li>
+		<li>[Fix] Remove redundant SQL query from ucp.php. (Bug #40305)</li>
+		<li>[Fix] Reorder frame order of animated subsilver2 topic icons to be useful when animations are disabled. (Bug #29385 - Patch by prototech)</li>
+		<li>[Fix] Ensure user errors are displayed regardless of PHP settings. (Bug #47505)</li>
+		<li>[Fix] Permit null values for non-required integer custom profile fields and ensure zero complies with the range limits. (Bug #40925)</li>
+		<li>[Fix] Allow changing forum from select box under certain circumstances. (Bug #37525)</li>
+		<li>[Fix] Display required fields notice on registration above the custom profile fields. (Bug #39665)</li>
+		<li>[Fix] Copy poll options properly when copying topic. (Bug #39065)</li>
+		<li>[Fix] Fix error with disapproval of topics having several queued posts only. (Bug #47705)</li>
+		<li>[Fix] Preserve newlines in template files (one newline had been always dropped after a template variable due to PHP's handling of closing tags).</li>
+		<li>[Fix] Be less strict with FTP daemons for getting directory filelists. (Bug #46295)</li>
+		<li>[Fix] Fix set_custom_template for database-stored styles. (Bug #40515)</li>
+		<li>[Fix] Banning an already banned user states to be successful, but has no effect. (Bug #47825 - Patch by Pyramide)</li>
+		<li>[Fix] Do not add style parameter again to URL after admin re-authentification. (Bug #18005 - Patch by leviatan21)</li>
+		<li>[Fix] Do not cut post-message in between HTML-Entities on search.php. (Bug #31505 - Patch by leviatan21)</li>
+		<li>[Fix] Correctly set attachment flag for topics, posts and pms after deleting attachments. (Bug #48265 - Patch by MarcoDM and nickvergessen)</li>
+		<li>[Fix] Display &quot;Locked&quot; button instead of &quot;Reply&quot; one for locked forum in viewtopic (prosilver). (Bug #38055 - Patch by Raimon)</li>
+		<li>[Fix] Correctly propagate umlauts over search result pages. (Bug #33755)</li>
+		<li>[Fix] Preserve post options when refusing to save the post as a draft. (Bug #39115)</li>
+		<li>[Fix] Do not send private message back to sender if sender is in the same group the private message was sent to.</li>
+		<li>[Fix] Correctly add user to a group making it a default one. (Bug #48345)</li>
+		<li>[Fix] Add log entry when copying forum permissions.</li>
+		<li>[Fix] Min/max characters per posts no longer affects poll options. (Bug #47295)</li>
+		<li>[Fix] Correctly log action when users request to join a group. (Bug #37585)</li>
+		<li>[Fix] Do not try to create thumbnails for images we cannot open properly. (Bug #48695)</li>
+		<li>[Fix] Apply locale-independent basename() to attachment filenames. New function added: utf8_basename(). (Bug #43335 - Patch by ocean=Yohsuke)</li>
+		<li>[Fix] Adjust build_url() to not prepend $phpbb_root_path if path returned from redirect() is an URL. This fixes redirect issues with some installations and bridges. (Bug #47535)</li>
+		<li>[Fix] Do not mark global announcements as read if all topics in a forum become read (Bug #15729).</li>
+		<li>[Fix] Fix general error in registration, caused by an undefined $config variable in validate_referer(). (Bug #49035 - Patch by wjvriend)</li>
+		<li>[Fix] Correctly extract column default value when exporting PostgreSQL tables. (Bug #48955)</li>
+		<li>[Fix] Allow updater to work correctly with PHP filename extensions other than &quot;.php&quot;. (Bugs #15809, #49215)</li>
+		<li>[Fix] Update search index if only post subject changed. (Bug #49435)</li>
+		<li>[Fix] Fix who is online displaying incorrect data. (Bug #49485, thanks Brainy)</li>
+		<li>[Fix] Fixed incorrect &quot;topic does not exist&quot; if unapproved posts were visited without global moderator permissions. (Bug #47795)</li>
+		<li>[Fix] Prevent style switcher from blocking the tab key. (Bug #49335)</li>
+		<li>[Fix] Correctly redirect back to MCP main page after posts approval/disapproval from it. (Bug #49625)</li>
+		<li>[Fix] Do not display topic approval status image for shadow topic if a user is not a moderator in the forum the topic has been moved to. (Bug #43295)</li>
+		<li>[Fix] Fix email problems on servers with PHP installations not accepting RFC-compliant subject string passed to the mail()-function. (Bug #46725)</li>
+		<li>[Fix] Correctly orientate control panel navigation background-image on RTL languages. (Bug #49945)</li>
+		<li>[Fix] Sort private messages by message time and not message id. (Bug #50015)</li>
+		<li>[Fix] Make sure only logs for existing users are displayed and user-specific logs removed on user deletion. (Bug #49855)</li>
+		<li>[Fix] Only show &quot;Add friend&quot; and &quot;Add foe&quot; links if the specific module is enabled. (Bug #50475)</li>
+		<li>[Fix] Correctly display list items in forum description in prosilver and administration. (Bug #48055 - Patch by leviatan21)</li>
+		<li>[Fix] Only embed cron.php if there is no cron lock present to reduce overhead. (Bug #45725 - Patch by TerryE)</li>
+		<li>[Fix] Add header gradient back into subsilver2 but keep site logo easily replaceable with smaller and bigger ones. (Bug #11142 - Patch by dark/Rain and Raimon)</li>
+		<li>[Fix] Send activation email when activating user from user settings. (Bug #43145)</li>
+		<li>[Fix] Do not show resend activation email link when using admin activation. (Bug #44375 - Patch by bbrunnrman)</li>
+		<li>[Fix] Do not display links to user/post search if search is disabled. (Bug #50685 - Patch by HardStyle)</li>
+		<li>[Fix] Fix icon alignment for forums with large descriptions in subsilver2. (Bug #50445)</li>
+		<li>[Fix] Correctly display underlined links placed in last line in viewtopic. (Bug #14811 - Patch by primehalo)</li>
+		<li>[Fix] Only check whether forum image exists if forum image is specified. (Bug #51905)</li>
+		<li>[Fix] Fixed database updater for changes to columns having default value in MSSQL (adding/dropping constraints).</li>
+		<li>[Fix] Jabber SASL PLAIN authentication failures. (Bug #52995)</li>
+		<li>[Fix] Check sort options on memberlist to avoid a general error. (Bug #53655)</li>
+		<li>[Fix] Fix sql error in cache_moderators() if using postgresql. (Bug #53765)</li>
+		<li>[Change] Database updater now supports checking for existing/missing indexes.</li>
+		<li>[Change] submit_post() now accepts force_approved_state key passed to $data to indicate new posts being approved (true) or unapproved (false).</li>
+		<li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li>
+		<li>[Change] Template engine now permits variable includes to a limited extent.</li>
+		<li>[Change] Quote BBCode no longer requires the f_reply permission. (Bug #16079)</li>
+		<li>[Change] Banning/unbanning users now generates an entry in their user notes. (Bug #21825)</li>
+		<li>[Change] Smilies no longer require the f_bbcode permission. (Bug #26545)</li>
+		<li>[Change] Ability to define column split in FAQ/BBCode help. (Bug #31405)</li>
+		<li>[Change] Changed behaviour of group_create() function to support specifying additional group columns.</li>
+		<li>[Change] Hide avatar when avatar-type is not allowed. (Bug #46785 - Patch by cYbercOsmOnauT and nickvergessen)</li>
+		<li>[Change] INCLUDEPHP paths are now relative to $phpbb_root_path. (Bug #45805)</li>
+		<li>[Change] Ability to fetch moderators with get_moderators() even if load_moderators setting is off. (Bug #35955)</li>
+		<li>[Change] &quot;Post details&quot; links with image in MCP. (Bug #39845 - Patch by leviatan21)</li>
+		<li>[Change] PM history now only shows PMs of users you currently reply to. (Bug #39505)</li>
+		<li>[Change] Show quote button for own PMs in PM history. (Bug #37285)</li>
+		<li>[Change] Fetch requested cookie variables directly from cookie super global. (Bug #47785)</li>
+		<li>[Change] Add confirmation for deactivating styles. (Bug #14304 - Patch by leviatan21)</li>
+		<li>[Change] Add confirmation for deactivating language packs. (Patch by leviatan21)</li>
+		<li>[Change] Add confirmation for deleting permissions. (Bug #13673)</li>
+		<li>[Change] Add pagination for icons and smilies in the ACP and smilies in the smiley popup.</li>
+		<li>[Change] Cache get_username_string() function calls on viewtopic.</li>
+		<li>[Change] Cache version check.</li>
+		<li>[Change] When creating a new forum without copying permissions, ask again.</li>
+		<li>[Change] Introduce new parameter to page_header() for forum specific who is online listings.</li>
+		<li>[Change] Changed minimum requirement for Firebird DBMS from 2.0+ to 2.1+.</li>
+		<li>[Change] Unapproved topics can no longer be replied to. (Bug #44005, #47675, #23605)</li>
+		<li>[Change] Require user to be registered and logged in to search for unread posts if topic read tracking is disabled for guests. (Bug #49525)</li>
+		<li>[Change] Allow three-digit hex notation in color BBcode. (Bug #39965 - Patch by m0rpha)</li>
+		<li>[Change] Simplified login_box() and redirection after login. S_LOGIN_ACTION can now be used on every page. (Bug #50285)</li>
+		<li>[Change] Do not take edit post time into account for determining permission to delete last post in topic. (Bug #48615)</li>
+		<li>[Change] Resize oversized topic icons. (Bug #44415)</li>
+		<li>[Change] Banned IPs are now sorted. (Bug #43045 - Patch by DavidIQ)</li>
+		<li>[Change] phpBB updater now skips sole whitespace/tab changes while computing differences. This reduces the chance of conflicts tremendously.</li>
+		<li>[Change] phpBB updater now solves common conflicts on its own. This further reduces the chance of conflicts.</li>
+		<li>[Feature] Add language selection to the registration terms page. (Bug #15085 - Patch by leviatan21)</li>
+		<li>[Feature] Backported 3.2 captcha plugins:
+			<ul>
+				<li>Classic and GD CAPTCHA</li>
+				<li>reCaptcha (based on API from recaptcha.net by Mike Crawford and Ben Maurer)</li>
+				<li>Q&amp;A CAPTCHA</li>
+				<li>3D Wave (by Robert &quot;Xore&quot; Hetzler)</li>
+			</ul>
+		</li>
+		<li>[Feature] Introduced new ACM (Cache) plugins:
+			<ul>
+				<li>null (to disable caching completely)</li>
+				<li><a href="http://pecl.php.net/package/memcache">memcache</a></li>
+				<li><a href="http://pecl.php.net/package/APC">APC</a></li>
+				<li><a href="http://xcache.lighttpd.net/">XCache</a></li>
+				<li><a href="http://eaccelerator.net/">eAccelerator</a></li>
+			</ul>
+		</li>
+		<li>[Feature] ATOM Feeds (Idea from RSS Feed 2.0 MOD (Version 1.0.8/9) by leviatan21)</li>
+		<li>[Feature] New groups option to excempt group leaders from group permissions.</li>
+		<li>[Feature] New &quot;Newly Registered Users&quot; group for assigning permissions to newly registered users. They will be removed from this group once they reach a defineable amount of posts.</li>
+		<li>[Feature] Ability to define if the &quot;Newly Registered Users&quot; group will be assigned as the default group to newly registered users.</li>
+		<li>[Feature] Add new option to disable avatars board-wide. (Bug #46785 - Patch by cYbercOsmOnauT and nickvergessen)</li>
+		<li>[Feature] Enhance obtain_users_online_string to be able to return user-lists for other session items. (Bug #31975)</li>
+		<li>[Feature] Add unapproved topic icon for moderators on forum list. (Bug #46865)</li>
+		<li>[Feature] Ability to define minimum number of characters for posts/pms.</li>
+		<li>[Feature] Store signature configuration options in database. (Bug #45115)</li>
+		<li>[Feature] Add bare-bones quick-reply editor to viewtopic.</li>
+		<li>[Feature] Detect if a post has been altered by someone else while editing.</li>
+		<li>[Feature] Add unread posts quick search option. (Bug #46765)</li>
+		<li>[Feature] Add option to disable avatar uploads from remote locations. (Bug #45375)</li>
+		<li>[Feature] Ability to delete warnings and keep warnings permanently. (Bug #43375)</li>
+		<li>[Feature] Ability to empty a user's outbox from the user ACP quick tools.</li>
+		<li>[Feature] Ability to search ACP/MCP logs.</li>
+		<li>[Feature] Users can report PMs to moderators which are then visible in a new MCP module.</li>
+		<li>[Feature] Parse email text files with the template engine.</li>
+		<li>[Feature] Use email-style quoting when bbcodes are disabled.</li>
+		<li>[Feature] Added new functionality to inactive users module:
+			<ul>
+				<li>Ability to set users per page.</li>
+				<li>Ability to sort by posts/number of reminders/last reminded date.</li>
+				<li>Show number of posts and ability to search posts.</li>
+				<li>Show number of reminders sent to user.</li>
+				<li>Show date of last reminder sent to user.</li>
+			</ul>
+		</li>
+		<li>[Feature] Display version check on ACP main page.</li>
+		<li>[Feature] Ability to copy permissions from one forum to several other forums.</li>
+		<li>[Feature] Ability to control the display of custom profile fields on viewtopic. (Bug #48985)</li>
+		<li>[Feature] Fallback options for missing language files. (Bug #38575 - Patch by EXreaction)</li>
+		<li>[Feature] Separate &quot;PM Reply&quot; and &quot;PM Reply to all&quot; in prosilver.</li>
+		<li>[Feature] Place debug notices during captcha rendering in the error log - useful for debugging output already started errors.</li>
+		<li>[Feature] Ability to define constant PHPBB_USE_BOARD_URL_PATH to use board url for images/avatars/ranks/imageset (useful for bridges and applications using phpBB).</li>
+		<li>[Feature] Added function to generate email hash. (Bug #49195)</li>
+		<li>[Feature] Style authors are now able to define the default submit button used for form submission on ENTER keypress on forms using more than one submit button. Prosilver uses this for the posting page(s) and registration screen.</li>
+		<li>[Feature] Ability to specify amount of time user is able to delete his last post in topic.</li>
+		<li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>
+	</ul>
+
+	<a name="v304"></a><h3>1.ii. Changes since 3.0.4</h3>
 
 	<ul>
 		<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
@@ -101,7 +324,7 @@
 		<li>[Fix] Changed the success message when requesting a new password to be more accurate. (Bug #41405)</li>
 		<li>[Fix] Add missing anti-abuse email headers to acp_inactive.php and ucp_resend.php.</li>
 		<li>[Fix] Only remind users in the correct inactive states depending on the board account activation level.</li>
-		<li>[Fix] Various XHTML mistakes in prosilver, subsilver2 and the ACP. (Bugs #41745, #42265 - Patch by nickvergessen, #38465, #43015)</li>
+		<li>[Fix] Various XHTML mistakes in prosilver, subsilver2 and the ACP. (Bugs #41745, #42265 - Patch by nickvergessen, #38465, #43015, #46585 - Patch by Raimon)</li>
 		<li>[Fix] Log password changes via password reset function. (Bug #41365)</li>
 		<li>[Fix] Poll, negative durations generate error (Bug #41295 - Patch by TerraFrost)</li>
 		<li>[Fix] Visibility of custom field on registration is incorrectly controlled by setting &quot;display&quot; (Bug #41385 - Patch by Eelke and fade2gray)</li>
@@ -173,7 +396,7 @@
 		<li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li>
 	</ul>
 
-	<a name="v303"></a><h3>1.ii. Changes since 3.0.3</h3>
+	<a name="v303"></a><h3>1.iii. Changes since 3.0.3</h3>
 
 	<ul>
 		<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li>
@@ -205,7 +428,7 @@
 		<li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li>
 	</ul>
 
-	<a name="v302"></a><h3>1.iii. Changes since 3.0.2</h3>
+	<a name="v302"></a><h3>1.iv. Changes since 3.0.2</h3>
 
 	<ul>
 		<li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li>
@@ -304,7 +527,7 @@
 		<li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li>
 	</ul>
 
-	<a name="v301"></a><h3>1.iv. Changes since 3.0.1</h3>
+	<a name="v301"></a><h3>1.v. Changes since 3.0.1</h3>
 
 	<ul>
 		<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li>
@@ -352,7 +575,7 @@
 		<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>
 	</ul>
 
-	<a name="v300"></a><h3>1.v. Changes since 3.0.0</h3>
+	<a name="v300"></a><h3>1.vi Changes since 3.0.0</h3>
 
 	<ul>
 		<li>[Change] Validate birthdays (Bug #15004)</li>
@@ -423,7 +646,7 @@
 		<li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li>
 	</ul>
 
-	<a name="v30rc8"></a><h3>1.vi. Changes since 3.0.RC8</h3>
+	<a name="v30rc8"></a><h3>1.vii. Changes since 3.0.RC8</h3>
 
 	<ul>
 		<li>[Fix] Cleaned usernames contain only single spaces, so &quot;a_name&quot; and &quot;a__name&quot; are treated as the same name (Bug #15634)</li>
@@ -432,7 +655,7 @@
 		<li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li>
 	</ul>
 
-	<a name="v30rc7"></a><h3>1.vii. Changes since 3.0.RC7</h3>
+	<a name="v30rc7"></a><h3>1.viii. Changes since 3.0.RC7</h3>
 
 	<ul>
 		<li>[Fix] Fixed MSSQL related bug in the update system</li>
@@ -467,7 +690,7 @@
 		<li>[Fix] No duplication of active topics (Bug #15474)</li>
 	</ul>
 
-	<a name="v30rc6"></a><h3>1.viii. Changes since 3.0.RC6</h3>
+	<a name="v30rc6"></a><h3>1.ix. Changes since 3.0.RC6</h3>
 
 	<ul>
 		<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
@@ -477,7 +700,7 @@
 		<li>[Fix] Able to request new password (Bug #14743)</li>
 	</ul>
 
-	<a name="v30rc5"></a><h3>1.ix. Changes since 3.0.RC5</h3>
+	<a name="v30rc5"></a><h3>1.x. Changes since 3.0.RC5</h3>
 
 	<ul>
 		<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li>
@@ -540,7 +763,7 @@
 		<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
 	</ul>
 
-	<a name="v30rc4"></a><h3>1.x. Changes since 3.0.RC4</h3>
+	<a name="v30rc4"></a><h3>1.xi. Changes since 3.0.RC4</h3>
 
 	<ul>
 		<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
@@ -591,7 +814,7 @@
 		<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
 	</ul>
 
-	<a name="v30rc3"></a><h3>1.xi. Changes since 3.0.RC3</h3>
+	<a name="v30rc3"></a><h3>1.xii. Changes since 3.0.RC3</h3>
 
 	<ul>
 		<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
@@ -700,7 +923,7 @@
 
 	</ul>
 
-	<a name="v30rc2"></a><h3>1.xii. Changes since 3.0.RC2</h3>
+	<a name="v30rc2"></a><h3>1.xiii. Changes since 3.0.RC2</h3>
 
 	<ul>
 		<li>[Fix] Re-allow searching within the memberlist</li>
@@ -746,7 +969,7 @@
 
 	</ul>
 
-	<a name="v30rc1"></a><h3>1.xiii. Changes since 3.0.RC1</h3>
+	<a name="v30rc1"></a><h3>1.xiv. Changes since 3.0.RC1</h3>
 
 	<ul>
 		<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li>
@@ -902,4 +1125,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff -x .svn -aruN 3.0.5.src/docs/coding-guidelines.html 3.0.6.src/docs/coding-guidelines.html
--- 3.0.5.src/docs/coding-guidelines.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/docs/coding-guidelines.html	2009-11-16 11:10:10.000000000 -0600
@@ -57,6 +57,7 @@
 		<li><a href="#editorsettings">Editor Settings</a></li>
 		<li><a href="#fileheader">File Header</a></li>
 		<li><a href="#locations">File Locations</a></li>
+		<li><a href="#constants">Special Constants</a></li>
 	</ol>
 	</li>
 	<li><a href="#code">Code Layout/Guidelines</a>
@@ -86,6 +87,12 @@
 		<li><a href="#writingstyle">Writing Style</a></li>
 	</ol>
 	</li>
+	<li><a href="#vcs">VCS Guidelines</a>
+	<ol style="list-style-type: lower-roman;">
+		<li><a href="#repostruct">Repository structure</a></li>
+		<li><a href="#commitmessage">Commit messages</a></li>
+	</ol>
+	</li>
 	<li><a href="#changes">Guidelines Changelog</a></li>
 	<li><a href="#disclaimer">Copyright and disclaimer</a></li>
 </ol>
@@ -217,6 +224,54 @@
 		<li><strong>styles</strong><br /><code>/styles</code>, <code>style.php</code><br />phpBB Styles/Templates/Themes/Imagesets</li>
 	</ul>
 
+	<a name="constants"></a></h3>1.iv. Special Constants</h3>
+
+	<p>There are some special constants application developers are able to utilize to bend some of phpBB's internal functionality to suit their needs.</p>
+
+	<div class="codebox"><pre>
+PHPBB_MSG_HANDLER          (overwrite message handler)
+PHPBB_DB_NEW_LINK          (overwrite new_link parameter for sql_connect)
+PHPBB_ROOT_PATH            (overwrite $phpbb_root_path)
+PHPBB_ADMIN_PATH           (overwrite $phpbb_admin_path)
+PHPBB_USE_BOARD_URL_PATH   (use generate_board_url() for image paths instead of $phpbb_root_path)
+PHPBB_DISABLE_ACP_EDITOR   (disable ACP style editor for templates)
+PHPBB_DISABLE_CONFIG_CHECK (disable ACP config.php writeable check)
+
+PHPBB_ACM_MEMCACHE_PORT     (overwrite memcached port, default is 11211)
+PHPBB_ACM_MEMCACHE_COMPRESS (overwrite memcached compress setting, default is disabled)
+PHPBB_ACM_MEMCACHE_HOST     (overwrite memcached host name, default is localhost)
+
+PHPBB_QA                   (Set board to QA-Mode, which means the updater also checks for RC-releases)
+</pre></div>
+
+<h4>PHPBB_USE_BOARD_URL_PATH</h4>
+
+<p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p>
+
+<ul>
+	<li>/includes/session.php - user::img()</li>
+	<li>/includes/functions_content.php - smiley_text()</li>
+</ul>
+
+<p>Path locations for the following template variables are affected by this too:</p>
+
+<ul>
+	<li>{T_THEME_PATH} - styles/xxx/theme</li>
+	<li>{T_TEMPLATE_PATH} - styles/xxx/template</li>
+	<li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li>
+	<li>{T_IMAGESET_PATH} - styles/xxx/imageset</li>
+	<li>{T_IMAGESET_LANG_PATH} - styles/xxx/imageset/yy</li>
+	<li>{T_IMAGES_PATH} - images/</li>
+	<li>{T_SMILIES_PATH} - $config['smilies_path']/</li>
+	<li>{T_AVATAR_PATH} - $config['avatar_path']/</li>
+	<li>{T_AVATAR_GALLERY_PATH} - $config['avatar_gallery_path']/</li>
+	<li>{T_ICONS_PATH} - $config['icons_path']/</li>
+	<li>{T_RANKS_PATH} - $config['ranks_path']/</li>
+	<li>{T_UPLOAD_PATH} - $config['upload_path']/</li>
+	<li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css (or link to style.php if css is parsed dynamically)</li>
+	<li>New template variable {BOARD_URL} for the board url + script path.</li>
+</ul>
+
 		</div>
 
 		<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
@@ -1110,6 +1165,29 @@
 
 <p>You will note in the 3.0 templates the major sources start with <code>&lt;!-- INCLUDE overall_header.html --&gt;</code> or <code>&lt;!-- INCLUDE simple_header.html --&gt;</code>, etc. In 2.0.x control of &quot;which&quot; header to use was defined entirely within the code. In 3.0.x the template designer can output what they like. Note that you can introduce new templates (i.e. other than those in the default set) using this system and include them as you wish ... perhaps useful for a common &quot;menu&quot; bar or some such. No need to modify loads of files as with 2.0.x.</p>
 
+<p>Added in <strong>3.0.6</strong> is the ability to include a file using a template variable to specify the file, this functionality only works for root variables (i.e. not block variables).</p>
+<div class="codebox"><pre>
+<span class="comment">&lt;!-- INCLUDE {FILE_VAR} --&gt;</span>
+</pre></div>
+
+<p>Template defined variables can also be utilised.
+
+<div class="codebox"><pre>
+<span class="comment">&lt;!-- DEFINE $SOME_VAR = 'my_file.html' --&gt;</span>
+<span class="comment">&lt;!-- INCLUDE {$SOME_VAR} --&gt;</span>
+</pre></div>
+<!-- no longer added in 3.0.6
+<p>Also added in <strong>3.0.6</strong> is the ability to increment or decrement a variable on use. This can be used for instances like tabindexes, where the amount of entries is not statically known.
+The INC (for incrementing) and DEC (for decrementing) commands will print the <strong>current</strong> state of a defined var and then increment/decrement it by one (postincrement/postdecrement).</p>
+
+<div class="codebox"><pre>
+<span class="comment">&lt;!-- DEFINE $SOME_VAR = 1 --&gt;</span>
+<span class="comment">&lt;!-- INC $SOME_VAR --&gt;</span>
+Result: 1<br />
+<span class="comment">{$SOME_VAR}</span>
+Result: 2<br />
+</pre></div>
+//-->
 <h4>PHP</h4>
 <p>A contentious decision has seen the ability to include PHP within the template introduced. This is achieved by enclosing the PHP within relevant tags:</p>
 
@@ -2252,12 +2330,71 @@
 
 	<hr />
 
-<a name="changes"></a><h2>7. Guidelines Changelog</h2>
+<a name="vcs"></a><h2>7. VCS Guidelines</h2>
+
+	<div class="paragraph">
+		<div class="inner"><span class="corners-top"><span></span></span>
+
+		<div class="content">
+
+	<p>The version control system for phpBB3 is subversion. The repository is available at <a href="http://code.phpbb.com/svn/phpbb" title="repository">http://code.phpbb.com/svn/phpbb</a>.
+
+	<a name="repostruct"></a><h3>7.i. Repository Structure</h3>
+
+	<ul>
+		<li><strong>trunk</strong><br />The latest unstable development version with new features etc. Contains the actual board in <code>/trunk/phpBB</code></li>
+		<li><strong>branches</strong><br />Development branches of stable phpBB releases. Copied from <code>/trunk</code> at the time of release.
+			<ul>
+				<li><strong>phpBB3.0</strong><code>/branches/phpBB-3_0_0/phpBB</code><br />Development branch of the stable 3.0 line. Bug fixes are applied here.</li>
+				<li><strong>phpBB2</strong><code>/branches/phpBB-2_0_0/phpBB</code><br />Old phpBB2 development branch.</li>
+			</ul>
+		</li>
+		<li><strong>tags</strong><br />Released versions. Copies of trunk or the respective branch, made at the time of release.
+			<ul>
+				<li><code>/tags/release_3_0_BX</code><br />Beta release X of the 3.0 line.</li>
+				<li><code>/tags/release_3_0_RCX</code><br />Release candidate X of the 3.0 line.</li>
+				<li><code>/tags/release_3_0_X-RCY</code><br />Release candidate Y of the stable 3.0.X release.</li>
+				<li><code>/tags/release_3_0_X</code><br />Stable <strong>3.0.X</strong> release.</li>
+				<li><code>/tags/release_2_0_X</code><br />Old stable 2.0.X release.</li>
+			</ul>
+		</li>
+	</ul>
+
+	<a name="commitmessage"></a><h3>7.ii. Commit Messages</h3>
+
+	<p>The commit message should contain a brief explanation of all changes made within the commit. Often identical to the changelog entry. A bug ticket can be referenced by specifying the ticket ID with a hash, e.g. #12345. A reference to another revision should simply be prefixed with r, e.g. r12345.</p>
+
+	<p>Junior Developers need to have their patches approved by a development team member first. The commit message must end in a line with the following format:</p>
+
+	<div class="codebox"><pre>
+Authorised by: developer1[, developer2[, ...]]
+	</pre></div>
+
+		</div>
+
+		<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
+
+		<span class="corners-bottom"><span></span></span></div>
+	</div>
+
+	<hr />
+
+<a name="changes"></a><h2>8. Guidelines Changelog</h2>
 	<div class="paragraph">
 		<div class="inner"><span class="corners-top"><span></span></span>
 
 		<div class="content">
+<h3>Revision 10007</h3>
+
+<ul>
+	<li>Added <a href="#constants">Special Constants</a> section.</li>
+</ul>
+
+<h3>Revision 9817</h3>
 
+<ul>
+	<li>Added VCS section.</li>
+</ul>
 
 <h3>Revision 8732</h3>
 
@@ -2330,7 +2467,7 @@
 
 	<hr />
 
-<a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2>
+<a name="disclaimer"></a><h2>9. Copyright and disclaimer</h2>
 
 	<div class="paragraph">
 		<div class="inner"><span class="corners-top"><span></span></span>
@@ -2349,7 +2486,7 @@
 <!-- END DOCUMENT -->
 
 	<div id="page-footer">
-		<div class="version"> $Id: coding-guidelines.html 9036 2008-10-25 14:16:17Z acydburn $ </div>
+		<div class="version"> $Id: coding-guidelines.html 10064 2009-08-30 11:15:24Z acydburn $ </div>
 	</div>
 </div></div>
 
diff -x .svn -aruN 3.0.5.src/docs/hook_system.html 3.0.6.src/docs/hook_system.html
--- 3.0.5.src/docs/hook_system.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/docs/hook_system.html	2009-11-16 11:10:10.000000000 -0600
@@ -104,14 +104,14 @@
 	border-top: 1px solid #ccc;
 }
 
-code { 
-	color: #006600; 
-	font-weight: normal; 
-	font-family: 'Courier New', monospace; 
-	border-color: #D1D7DC; 
-	border-width: 1px; 
-	border-style: solid; 
-	background-color: #FAFAFA; 
+code {
+	color: #006600;
+	font-weight: normal;
+	font-family: 'Courier New', monospace;
+	border-color: #D1D7DC;
+	border-width: 1px;
+	border-style: solid;
+	background-color: #FAFAFA;
 }
 
 #wrap {
@@ -387,8 +387,36 @@
 PHPBB_DB_NEW_LINK (overwrite new_link parameter for sql_connect)
 PHPBB_ROOT_PATH   (overwrite $phpbb_root_path)
 PHPBB_ADMIN_PATH  (overwrite $phpbb_admin_path)
+PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of $phpbb_root_path)
 </pre></div>
 
+<p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p>
+
+<ul>
+	<li>/includes/session.php - user::img()</li>
+	<li>/includes/functions_content.php - smiley_text()</li>
+</ul>
+
+<p>Path locations for the following template variables are affected by this too:</p>
+
+<ul>
+	<li>{T_THEME_PATH} - styles/xxx/theme</li>
+	<li>{T_TEMPLATE_PATH} - styles/xxx/template</li>
+	<li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li>
+	<li>{T_IMAGESET_PATH} - styles/xxx/imageset</li>
+	<li>{T_IMAGESET_LANG_PATH} - styles/xxx/imageset/yy</li>
+	<li>{T_IMAGES_PATH} - images/</li>
+	<li>{T_SMILIES_PATH} - $config['smilies_path']/</li>
+	<li>{T_AVATAR_PATH} - $config['avatar_path']/</li>
+	<li>{T_AVATAR_GALLERY_PATH} - $config['avatar_gallery_path']/</li>
+	<li>{T_ICONS_PATH} - $config['icons_path']/</li>
+	<li>{T_RANKS_PATH} - $config['ranks_path']/</li>
+	<li>{T_UPLOAD_PATH} - $config['upload_path']/</li>
+	<li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css (or link to style.php if css is parsed dynamically)</li>
+	<li>New template variable {BOARD_URL} for the board url + script path.</li>
+</ul>
+
+
 		</div>
 
 		<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
@@ -616,7 +644,7 @@
 
 <div class="codebox"><pre>
 not hooked
-hooked 
+hooked
 </pre></div>
 
 		<p>A different possibility would be using a function variable (which could be left out on passing the function variables to the hook):</p>
@@ -670,7 +698,7 @@
 
 		<div class="codebox"><pre>
 not hooked
-hooked 
+hooked
 		</pre></div>
 
 		</div>
@@ -847,7 +875,7 @@
 	</div>
 
 	<div id="page-footer">
-		<div class="version">$Id: hook_system.html 8479 2008-03-29 00:22:48Z naderman $</div>
+		<div class="version">$Id: hook_system.html 10007 2009-08-17 14:42:27Z acydburn $</div>
 	</div>
 </div></div>
 
diff -x .svn -aruN 3.0.5.src/docs/INSTALL.html 3.0.6.src/docs/INSTALL.html
--- 3.0.5.src/docs/INSTALL.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/docs/INSTALL.html	2009-11-16 11:10:10.000000000 -0600
@@ -139,7 +139,7 @@
 			<li>MySQL 3.23 or above (MySQLi supported)</li>
 			<li>PostgreSQL 7.3+</li>
 			<li>SQLite 2.8.2+</li>
-			<li>Firebird 2.0+</li>
+			<li>Firebird 2.1+</li>
 			<li>MS SQL Server 2000 or above (directly or via ODBC)</li>
 			<li>Oracle</li>
 		</ul>
@@ -273,7 +273,7 @@
 
 	<p>This package is meant for those wanting to only replace changed files from a previous version to the latest version. This package normally contains the changed files from up to five previous versions.</p>
 
-	<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.4</samp> you should select the phpBB-3.0.4_to_3.0.5.zip/tar.gz file.</p>
+	<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.5</samp> you should select the phpBB-3.0.5_to_3.0.6.zip/tar.gz file.</p>
 
 	<p>The directory structure has been preserved enabling you (if you wish) to simply upload the contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any MODs these files will overwrite the originals possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p>
 
@@ -283,9 +283,9 @@
 
 	<p>The patch file package is for those wanting to update through the patch application, and being comfortable with it.</p>
 
-	<p>The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the preferred update method.</p>
+	<p>The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the recommended update method.</p>
 
-	<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.4 you need the phpBB-3.0.4_to_3.0.5.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
+	<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.5 you need the phpBB-3.0.5_to_3.0.6.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
 
 	<p>If you do get failures you should look at using the <a href="#update_files">Changed files only</a> package to replace the files which failed to patch, please note that you will need to manually re-add any Modifications (MODs) to these particular files. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p>
 
@@ -293,7 +293,7 @@
 
 <a name="update_auto"></a><h3>4.iv. Automatic update package</h3>
 
-	<p>This update method is the preferred method for updating. This package allows detecting changed files automatically and merges changes if needed.</p>
+	<p>This update method is the recommended method for updating. This package allows detecting changed files automatically and merges changes if needed.</p>
 
 	<p>The automatic update package contains - contrary to the others - only the information required to update the previous release version to the latest available version. These packages are meant for use with the automatic update tool.</p>
 
diff -x .svn -aruN 3.0.5.src/download/file.php 3.0.6.src/download/file.php
--- 3.0.5.src/download/file.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/download/file.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: file.php 9460 2009-04-17 15:18:03Z acydburn $
+* @version $Id: file.php 9905 2009-08-01 12:28:50Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -249,7 +249,7 @@
 	trigger_error('ERROR_NO_ATTACHMENT');
 }
 
-$attachment['physical_filename'] = basename($attachment['physical_filename']);
+$attachment['physical_filename'] = utf8_basename($attachment['physical_filename']);
 $display_cat = $extensions[$attachment['extension']]['display_cat'];
 
 if (($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$user->optionget('viewimg'))
diff -x .svn -aruN 3.0.5.src/faq.php 3.0.6.src/faq.php
--- 3.0.5.src/faq.php	2009-05-31 05:58:33.000000000 -0500
+++ 3.0.6.src/faq.php	2009-11-16 11:10:09.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: faq.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: faq.php 9961 2009-08-12 10:30:37Z Kellanved $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -38,15 +38,28 @@
 }
 
 // Pull the array data from the lang pack
+$switch_column = $found_switch = false;
 $help_blocks = array();
 foreach ($user->help as $help_ary)
 {
 	if ($help_ary[0] == '--')
 	{
-		$template->assign_block_vars('faq_block', array(
-			'BLOCK_TITLE'		=> $help_ary[1])
-		);
+		if ($help_ary[1] == '--')
+		{
+			$switch_column = true;
+			$found_switch = true;
+			continue;
+		}
 
+		$template->assign_block_vars('faq_block', array(
+			'BLOCK_TITLE'		=> $help_ary[1],
+			'SWITCH_COLUMN'		=> $switch_column,
+		));
+
+		if ($switch_column)
+		{
+			$switch_column = false;
+		}
 		continue;
 	}
 
@@ -58,11 +71,13 @@
 
 // Lets build a page ...
 $template->assign_vars(array(
-	'L_FAQ_TITLE'	=> $l_title,
-	'L_BACK_TO_TOP'	=> $user->lang['BACK_TO_TOP'])
-);
+	'L_FAQ_TITLE'				=> $l_title,
+	'L_BACK_TO_TOP'				=> $user->lang['BACK_TO_TOP'],
+
+	'SWITCH_COLUMN_MANUALLY'	=> (!$found_switch) ? true : false,
+));
 
-page_header($l_title);
+page_header($l_title, false);
 
 $template->set_filenames(array(
 	'body' => 'faq_body.html')
diff -x .svn -aruN 3.0.5.src/feed.php 3.0.6.src/feed.php
--- 3.0.5.src/feed.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/feed.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,1054 @@
+<?php
+/**
+* @package phpBB3
+* @version $Id: feed.php 10244 2009-10-29 14:00:43Z acydburn $
+* @copyright (c) 2009 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+* Idea and original RSS Feed 2.0 MOD (Version 1.0.8/9) by leviatan21
+* Original MOD: http://www.phpbb.com/community/viewtopic.php?f=69&t=1214645
+* MOD Author Profile: http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=345763
+* MOD Author Homepage: http://www.mssti.com/phpbb3/
+*
+**/
+
+/**
+* @ignore
+**/
+define('IN_PHPBB', true);
+$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+include($phpbb_root_path . 'common.' . $phpEx);
+
+if (!$config['feed_enable'])
+{
+	trigger_error('NO_FEED_ENABLED');
+}
+
+// Start session
+$user->session_begin();
+$auth->acl($user->data);
+$user->setup();
+
+// Initial var setup
+$forum_id	= request_var('f', 0);
+$topic_id	= request_var('t', 0);
+$mode		= request_var('mode', '');
+
+// Feed date format for PHP > 5 and PHP4
+$feed_date_format = (PHP_VERSION >= 5) ? 'c' : "Y-m-d\TH:i:sO";
+$params = false;
+
+// We do not use a template, therefore we simply define the global template variables here
+$global_vars = $item_vars = array();
+
+// Generate params array for use in append_sid() to correctly link back to this page
+if ($forum_id || $topic_id || $mode)
+{
+	$params = array(
+		'f'		=> ($forum_id) ? $forum_id : NULL,
+		't'		=> ($topic_id) ? $topic_id : NULL,
+		'mode'	=> ($mode) ? $mode : NULL,
+	);
+}
+
+// This boards URL
+$board_url = generate_board_url();
+
+// Get correct feed object
+$feed = phpbb_feed_factory::init($mode, $forum_id, $topic_id);
+
+// No feed found
+if ($feed === false)
+{
+	trigger_error('NO_FEED');
+}
+
+// Open Feed
+$feed->open();
+
+// Some default assignments
+// FEED_IMAGE is not used (atom)
+$global_vars = array(
+	'FEED_IMAGE'			=> ($user->img('site_logo', '', false, '', 'src')) ? $board_url . '/' . substr($user->img('site_logo', '', false, '', 'src'), strlen($phpbb_root_path)) : '',
+	'SELF_LINK'				=> feed_append_sid('/feed.' . $phpEx, $params),
+	'FEED_LINK'				=> $board_url . '/index.' . $phpEx,
+	'FEED_TITLE'			=> $config['sitename'],
+	'FEED_SUBTITLE'			=> $config['site_desc'],
+	'FEED_UPDATED'			=> $user->format_date(time(), $feed_date_format, true),
+	'FEED_LANG'				=> $user->lang['USER_LANG'],
+	'FEED_AUTHOR'			=> $config['sitename'],
+);
+
+// Iterate through items
+while ($row = $feed->get_item())
+{
+	// BBCode options to correctly disable urls, smilies, bbcode...
+	if ($feed->get('options') === NULL)
+	{
+		// Allow all combinations
+		$options = 7;
+
+		if ($feed->get('enable_bbcode') !== NULL && $feed->get('enable_smilies') !== NULL && $feed->get('enable_magic_url') !== NULL)
+		{
+			$options = (($row[$feed->get('enable_bbcode')]) ? OPTION_FLAG_BBCODE : 0) + (($row[$feed->get('enable_smilies')]) ? OPTION_FLAG_SMILIES : 0) + (($row[$feed->get('enable_magic_url')]) ? OPTION_FLAG_LINKS : 0);
+		}
+	}
+	else
+	{
+		$options = $row[$feed->get('options')];
+	}
+
+	$title = ($row[$feed->get('title')]) ? $row[$feed->get('title')] : ((isset($row[$feed->get('title2')])) ? $row[$feed->get('title2')] : '');
+	$title = censor_text($title);
+
+	$item_row = array(
+		'author'		=> ($feed->get('creator') !== NULL) ? $row[$feed->get('creator')] : '',
+		'pubdate'		=> $user->format_date($row[$feed->get('date')], $feed_date_format, true),
+		'link'			=> '',
+		'title'			=> censor_text($title),
+		'category'		=> ($config['feed_item_statistics']) ? $board_url . '/viewforum.' . $phpEx . '?f=' . $row['forum_id'] : '',
+		'category_name'	=> ($config['feed_item_statistics']) ? utf8_htmlspecialchars($row['forum_name']) : '',
+		'description'	=> censor_text(feed_generate_content($row[$feed->get('text')], $row[$feed->get('bbcode_uid')], $row[$feed->get('bitfield')], $options)),
+		'statistics'	=> '',
+	);
+
+	// Adjust items, fill link, etc.
+	$feed->adjust_item($item_row, $row);
+
+	$item_vars[] = $item_row;
+}
+
+$feed->close();
+
+// Output page
+
+// gzip_compression
+if ($config['gzip_compress'])
+{
+	if (@extension_loaded('zlib') && !headers_sent())
+	{
+		ob_start('ob_gzhandler');
+	}
+}
+
+// IF debug extra is enabled and admin want to "explain" the page we need to set other headers...
+if (!defined('DEBUG_EXTRA') || !request_var('explain', 0) || !$auth->acl_get('a_'))
+{
+	header("Content-Type: application/atom+xml; charset=UTF-8");
+	header("Last-Modified: " . gmdate('D, d M Y H:i:s', time()) . ' GMT');
+}
+else
+{
+	header('Content-type: text/html; charset=UTF-8');
+	header('Cache-Control: private, no-cache="set-cookie"');
+	header('Expires: 0');
+	header('Pragma: no-cache');
+
+	$mtime = explode(' ', microtime());
+	$totaltime = $mtime[0] + $mtime[1] - $starttime;
+
+	if (method_exists($db, 'sql_report'))
+	{
+		$db->sql_report('display');
+	}
+
+	garbage_collection();
+	exit_handler();
+}
+
+echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
+echo '<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="' . $global_vars['FEED_LANG'] . '">' . "\n";
+echo '<link rel="self" type="application/atom+xml" href="' . $global_vars['SELF_LINK'] . '" />' . "\n\n";
+
+echo (!empty($global_vars['FEED_TITLE'])) ? '<title>' . $global_vars['FEED_TITLE'] . '</title>' . "\n" : '';
+echo (!empty($global_vars['FEED_SUBTITLE'])) ? '<subtitle>' . $global_vars['FEED_SUBTITLE'] . '</subtitle>' . "\n" : '';
+echo (!empty($global_vars['FEED_LINK'])) ? '<link href="' . $global_vars['FEED_LINK'] .'" />' . "\n" : '';
+echo '<updated>' . $global_vars['FEED_UPDATED'] . '</updated>' . "\n\n";
+
+echo '<author><name><![CDATA[' . $global_vars['FEED_AUTHOR'] . ']]></name></author>' . "\n";
+echo '<id>' . $global_vars['SELF_LINK'] . '</id>' . "\n";
+
+foreach ($item_vars as $row)
+{
+	echo '<entry>' . "\n";
+
+	if (!empty($row['author']))
+	{
+		echo '<author><name><![CDATA[' . $row['author'] . ']]></name></author>' . "\n";
+	}
+
+	echo '<updated>' . $row['pubdate'] . '</updated>' . "\n";
+	echo '<id>' . $row['link'] . '</id>' . "\n";
+	echo '<link href="' . $row['link'] . '"/>' . "\n";
+	echo '<title type="html"><![CDATA[' . $row['title'] . ']]></title>' . "\n\n";
+
+	if (!empty($row['category']))
+	{
+		echo '<category term="' . $row['category_name'] . '" scheme="' . $row['category'] . '" label="' . $row['category_name'] . '"/>' . "\n";
+	}
+
+	echo '<content type="html" xml:base="' . $row['link'] . '"><![CDATA[' . "\n";
+	echo $row['description'];
+
+	if (!empty($row['statistics']))
+	{
+		echo '<p>' . $user->lang['STATISTICS'] . ': ' . $row['statistics'] . '</p>';
+	}
+
+	echo '<hr />' . "\n" . ']]></content>' . "\n";
+	echo '</entry>' . "\n";
+}
+
+echo '</feed>';
+
+garbage_collection();
+exit_handler();
+
+/**
+* Run links through append_sid(), prepend generate_board_url() and remove session id
+**/
+function feed_append_sid($url, $params)
+{
+	global $board_url;
+
+	return append_sid($board_url . $url, $params, true, '');
+}
+
+/**
+* Generate text content
+**/
+function feed_generate_content($content, $uid, $bitfield, $options)
+{
+	global $user, $config, $phpbb_root_path, $phpEx, $board_url;
+
+	if (empty($content))
+	{
+		return '';
+	}
+
+	// Prepare some bbcodes for better parsing
+	$content	= preg_replace("#\[quote(=&quot;.*?&quot;)?:$uid\]\s*(.*?)\s*\[/quote:$uid\]#si", "[quote$1:$uid]<br />$2<br />[/quote:$uid]", $content);
+
+	$content = generate_text_for_display($content, $uid, $bitfield, $options);
+
+	// Add newlines
+	$content = str_replace('<br />', '<br />' . "\n", $content);
+
+	// Relative Path to Absolute path, Windows style
+	$content = str_replace('./', $board_url . '/', $content);
+
+	// Remove "Select all" link and mouse events
+	$content = str_replace('<a href="#" onclick="selectCode(this); return false;">' . $user->lang['SELECT_ALL_CODE'] . '</a>', '', $content);
+	$content = preg_replace('#(onkeypress|onclick)="(.*?)"#si', '', $content);
+
+	// Firefox does not support CSS for feeds, though
+
+	// Remove font sizes
+//	$content = preg_replace('#<span style="font-size: [0-9]+%; line-height: [0-9]+%;">([^>]+)</span>#iU', '\1', $content);
+
+	// Make text strong :P
+//	$content = preg_replace('#<span style="font-weight: bold?">(.*?)</span>#iU', '<strong>\1</strong>', $content);
+
+	// Italic
+//	$content = preg_replace('#<span style="font-style: italic?">([^<]+)</span>#iU', '<em>\1</em>', $content);
+
+	// Underline
+//	$content = preg_replace('#<span style="text-decoration: underline?">([^<]+)</span>#iU', '<u>\1</u>', $content);
+
+	// Remove embed Windows Media Streams
+	$content	= preg_replace( '#<\!--\[if \!IE\]>-->([^[]+)<\!--<!\[endif\]-->#si', '', $content);
+
+	// Do not use &lt; and &gt;, because we want to retain code contained in [code][/code]
+
+	// Remove embed and objects
+	$content	= preg_replace( '#<(object|embed)(.*?) (value|src)=(.*?) ([^[]+)(object|embed)>#si',' <a href=$4 target="_blank"><strong>$1</strong></a> ',$content);
+
+	// Remove some specials html tag, because somewhere there are a mod to allow html tags ;)
+	$content	= preg_replace( '#<(script|iframe)([^[]+)\1>#siU', ' <strong>$1</strong> ', $content);
+
+	// Remove Comments from inline attachments [ia]
+	$content	= preg_replace('#<div class="(inline-attachment|attachtitle)">(.*?)<!-- ia(.*?) -->(.*?)<!-- ia(.*?) -->(.*?)</div>#si','$4',$content);
+
+	// Replace some entities with their unicode counterpart
+	$entities = array(
+		'&nbsp;'	=> "\xC2\xA0",
+		'&bull;'	=> "\xE2\x80\xA2",
+		'&middot;'	=> "\xC2\xB7",
+		'&copy;'	=> "\xC2\xA9",
+	);
+
+	$content = str_replace(array_keys($entities), array_values($entities), $content);
+
+	// Remove CDATA blocks. ;)
+	$content = preg_replace('#\<\!\[CDATA\[(.*?)\]\]\>#s', '', $content);
+
+	// Other control characters
+	// $content = preg_replace('#(?:[\x00-\x1F\x7F]+|(?:\xC2[\x80-\x9F])+)#', '', $content);
+
+	return $content;
+}
+
+/**
+* Factory class to return correct object
+* @package phpBB3
+*/
+class phpbb_feed_factory
+{
+	/**
+	* Return correct object for specified mode
+	*
+	* @param string	$mode		The feeds mode.
+	* @param int	$forum_id	Forum id specified by the script if forum feed provided.
+	* @param int	$topic_id	Topic id specified by the script if topic feed provided.
+	*
+	* @return object	Returns correct feeds object for specified mode.
+	*/
+	function init($mode, $forum_id, $topic_id)
+	{
+		global $config;
+
+		switch ($mode)
+		{
+			case 'forums':
+				if (!$config['feed_overall_forums'])
+				{
+					return false;
+				}
+
+				return new phpbb_feed_forums();
+			break;
+
+			case 'topics':
+				if (!$config['feed_overall_topics'])
+				{
+					return false;
+				}
+
+				return new phpbb_feed_topics();
+			break;
+
+			case 'news':
+				global $db;
+
+				// Get at least one news forum
+				$sql = 'SELECT forum_id
+					FROM ' . FORUMS_TABLE . '
+					WHERE ' . $db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
+				$result = $db->sql_query_limit($sql, 1, 0, 600);
+				$s_feed_news = (int) $db->sql_fetchfield('forum_id');
+				$db->sql_freeresult($result);
+
+				if (!$s_feed_news)
+				{
+					return false;
+				}
+
+				return new phpbb_feed_news();
+			break;
+
+			default:
+				// Forum and/or topic specified?
+				if ($topic_id && !$config['feed_topic'])
+				{
+					return false;
+				}
+
+				if ($forum_id && !$topic_id && !$config['feed_forum'])
+				{
+					return false;
+				}
+
+				return new phpbb_feed($forum_id, $topic_id);
+			break;
+		}
+	}
+}
+
+/**
+* Base/default Feed class if no mode is specified.
+* This can be the overall site feed or a forum/topic feed.
+* @package phpBB3
+*/
+class phpbb_feed
+{
+	/**
+	* Forum id specified for forum feed.
+	*/
+	var $forum_id = 0;
+
+	/**
+	* Topic id specified for topic feed.
+	*/
+	var $topic_id = 0;
+
+	/**
+	* SQL Query to be executed to get feed items
+	*/
+	var $sql;
+
+	/**
+	* Keys specified for retrieval of title, content, etc.
+	*/
+	var $keys = array();
+
+	/**
+	* An array of excluded forum ids.
+	*/
+	var $excluded_forums_ary = NULL;
+
+	/**
+	* Number of items to fetch
+	*/
+	var $num_items;
+
+	/**
+	* boolean to determine if items array is filled or not
+	*/
+	var $items_filled = false;
+
+	/**
+	* array holding items
+	*/
+	var $items = array();
+
+	/**
+	* Default setting for last x days
+	*/
+	var $sort_days = 30;
+
+	/**
+	* Default cache time of entries in seconds
+	*/
+	var $cache_time = 0;
+
+	/**
+	* Separator for title elements to separate items (for example forum / topic)
+	*/
+	var $separator = "\xE2\x80\xA2"; // &bull;
+
+	/**
+	* Constructor. Set standard keys.
+	*/
+	function phpbb_feed($forum_id = 0, $topic_id = 0)
+	{
+		global $config;
+
+		$this->forum_id = $forum_id;
+		$this->topic_id = $topic_id;
+
+		$this->sql = array();
+
+		// Set some values for pagination
+		$this->num_items = (int) $config['feed_limit'];
+		$this->set_keys();
+	}
+
+	function set_keys()
+	{
+		// Set keys for items...
+		$this->set('title',		'post_subject');
+		$this->set('title2',	'topic_title');
+		$this->set('author_id',	'user_id');
+		$this->set('creator',	'username');
+		$this->set('text',		'post_text');
+		$this->set('bitfield',	'bbcode_bitfield');
+		$this->set('bbcode_uid','bbcode_uid');
+		$this->set('date',		'post_time');
+
+		$this->set('enable_bbcode',		'enable_bbcode');
+		$this->set('enable_smilies',	'enable_smilies');
+		$this->set('enable_magic_url',	'enable_magic_url');
+	}
+
+	function open()
+	{
+		if (!$this->forum_id && !$this->topic_id)
+		{
+			return;
+		}
+		else if ($this->forum_id && !$this->topic_id)
+		{
+			global $db, $user, $global_vars;
+
+			$sql = 'SELECT forum_name
+				FROM ' . FORUMS_TABLE . '
+				WHERE forum_id = ' . $this->forum_id;
+			$result = $db->sql_query($sql);
+
+			$global_vars['FEED_MODE'] = $user->lang['FORUM'] . ': ' . $db->sql_fetchfield('forum_name');
+
+			$db->sql_freeresult($result);
+		}
+		else if ($this->topic_id)
+		{
+			global $db, $user, $global_vars;
+
+			$sql = 'SELECT topic_title
+				FROM ' . TOPICS_TABLE . '
+				WHERE topic_id = ' . $this->topic_id;
+			$result = $db->sql_query($sql);
+
+			$global_vars['FEED_MODE'] = $user->lang['TOPIC'] . ': ' . $db->sql_fetchfield('topic_title');
+
+			$db->sql_freeresult($result);
+		}
+	}
+
+	function close()
+	{
+		if (!empty($this->result))
+		{
+			global $db;
+
+			$db->sql_freeresult($this->result);
+		}
+	}
+
+	/**
+	* Set key
+	*/
+	function set($key, $value)
+	{
+		$this->keys[$key] = $value;
+	}
+
+	/**
+	* Get key
+	*/
+	function get($key)
+	{
+		return (isset($this->keys[$key])) ? $this->keys[$key] : NULL;
+	}
+
+	/**
+	* Return array of excluded forums
+	*/
+	function excluded_forums()
+	{
+		if ($this->excluded_forums_ary !== NULL)
+		{
+			return $this->excluded_forums_ary;
+		}
+
+		global $auth, $db, $config, $phpbb_root_path, $phpEx, $user;
+
+		// Which forums should not be searched ?
+		$exclude_forums = array();
+
+		$sql = 'SELECT forum_id
+			FROM ' . FORUMS_TABLE . '
+			WHERE ' . $db->sql_bit_and('forum_options', FORUM_OPTION_FEED_EXCLUDE, '<> 0');
+		$result = $db->sql_query($sql);
+
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$exclude_forums[] = (int) $row['forum_id'];
+		}
+		$db->sql_freeresult($result);
+
+		// Exclude forums the user is not able to read
+		$this->excluded_forums_ary = array_keys($auth->acl_getf('!f_read', true));
+		$this->excluded_forums_ary = (sizeof($exclude_forums)) ? array_merge($exclude_forums, $this->excluded_forums_ary) : $this->excluded_forums_ary;
+
+		$not_in_fid = (sizeof($this->excluded_forums_ary)) ? 'WHERE (' . $db->sql_in_set('f.forum_id', $this->excluded_forums_ary, true) . ' AND ' . $db->sql_in_set('f.parent_id', $this->excluded_forums_ary, true) . ") OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')' : '';
+
+		$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id
+			FROM ' . FORUMS_TABLE . ' f
+			LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
+				AND fa.session_id = '" . $db->sql_escape($user->session_id) . "')
+			$not_in_fid
+			ORDER BY f.left_id";
+		$result = $db->sql_query($sql);
+
+		$right_id = 0;
+		while ($row = $db->sql_fetchrow($result))
+		{
+			// Exclude passworded forum completely
+			if ($row['forum_password'] && $row['user_id'] != $user->data['user_id'])
+			{
+				$this->excluded_forums_ary[] = (int) $row['forum_id'];
+				continue;
+			}
+
+			if ($row['right_id'] > $right_id)
+			{
+				$right_id = (int) $row['right_id'];
+			}
+			else if ($row['right_id'] < $right_id)
+			{
+				continue;
+			}
+		}
+		$db->sql_freeresult($result);
+
+		return $this->excluded_forums_ary;
+	}
+
+	/**
+	* Get SQL query for fetching items
+	*/
+	function get_sql()
+	{
+		global $db;
+
+		$post_ids = array();
+
+		// Search for topics in last X days
+		$last_post_time_sql = ($this->sort_days) ? ' AND t.topic_last_post_time > ' . (time() - ($this->sort_days * 24 * 3600)) : '';
+
+		// Fetch latest post, grouped by topic...
+		if (!$this->forum_id && !$this->topic_id)
+		{
+			// First of all, the post ids...
+			$not_in_fid = (sizeof($this->excluded_forums())) ? ' AND ' . $db->sql_in_set('t.forum_id', $this->excluded_forums(), true) : '';
+
+			$sql = 'SELECT t.topic_last_post_id
+				FROM ' . TOPICS_TABLE . ' t
+				WHERE t.topic_approved = 1
+					AND t.topic_moved_id = 0' .
+					$not_in_fid .
+					$last_post_time_sql . '
+				ORDER BY t.topic_last_post_time DESC';
+			$result = $db->sql_query_limit($sql, $this->num_items);
+
+			while ($row = $db->sql_fetchrow($result))
+			{
+				$post_ids[] = (int) $row['topic_last_post_id'];
+			}
+			$db->sql_freeresult($result);
+		}
+		// Fetch latest posts from forum
+		else if (!$this->topic_id && $this->forum_id)
+		{
+			// Make sure the forum is not listed within the forbidden ones. ;)
+			if (in_array($this->forum_id, $this->excluded_forums()))
+			{
+				return false;
+			}
+
+			// Determine which forums to fetch
+			$not_in_fid = (sizeof($this->excluded_forums())) ? ' AND ' . $db->sql_in_set('f1.forum_id', $this->excluded_forums(), true) : '';
+
+			// Determine forum childs...
+			$sql = 'SELECT f2.forum_id
+				FROM ' . FORUMS_TABLE . ' f1, ' . FORUMS_TABLE . ' f2
+				WHERE f1.forum_id = ' . $this->forum_id . '
+					AND (f2.left_id BETWEEN f1.left_id AND f1.right_id' . $not_in_fid . ')';
+			$result = $db->sql_query($sql);
+
+			$forum_ids = array();
+			while ($row = $db->sql_fetchrow($result))
+			{
+				$forum_ids[] = (int) $row['forum_id'];
+			}
+			$db->sql_freeresult($result);
+
+			// Now select from forums...
+			$sql = 'SELECT t.topic_last_post_id
+				FROM ' . TOPICS_TABLE . ' t
+				WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
+					AND t.topic_approved = 1
+					AND t.topic_moved_id = 0' .
+					$last_post_time_sql . '
+				ORDER BY t.topic_last_post_time DESC';
+			$result = $db->sql_query_limit($sql, $this->num_items);
+
+			while ($row = $db->sql_fetchrow($result))
+			{
+				$post_ids[] = (int) $row['topic_last_post_id'];
+			}
+			$db->sql_freeresult($result);
+		}
+		// Fetch last posts from specified topic...
+		else if ($this->topic_id)
+		{
+			// First of all, determine the forum...
+			$sql = 'SELECT forum_id
+				FROM ' . TOPICS_TABLE . '
+				WHERE topic_id = ' . $this->topic_id;
+			$result = $db->sql_query_limit($sql, 1);
+			$this->forum_id = (int) $db->sql_fetchfield('forum_id');
+			$db->sql_freeresult($result);
+
+			// non-global announcement
+			if ($this->forum_id && in_array($this->forum_id, $this->excluded_forums()))
+			{
+				return false;
+			}
+
+			$sql = 'SELECT post_id
+				FROM ' . POSTS_TABLE . '
+				WHERE topic_id = ' . $this->topic_id . '
+					AND post_approved = 1
+				ORDER BY post_time DESC';
+			$result = $db->sql_query_limit($sql, $this->num_items);
+
+			while ($row = $db->sql_fetchrow($result))
+			{
+				$post_ids[] = (int) $row['post_id'];
+			}
+			$db->sql_freeresult($result);
+		}
+
+		if (!sizeof($post_ids))
+		{
+			return false;
+		}
+
+		// Now build sql query for obtaining items
+		$this->sql = array(
+			'SELECT'	=>	'f.forum_id, f.forum_name, f.forum_desc_options, ' .
+							't.topic_last_post_time, t.topic_id, t.topic_title, t.topic_time, t.topic_replies, t.topic_views, ' .
+							'p.post_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
+							'u.username, u.user_id, u.user_email, u.user_colour',
+			'FROM'		=> array(
+				POSTS_TABLE		=> 'p',
+				TOPICS_TABLE	=> 't',
+				FORUMS_TABLE	=> 'f',
+				USERS_TABLE		=> 'u',
+			),
+			'WHERE'		=> $db->sql_in_set('p.post_id', $post_ids) . '
+								AND f.forum_id = p.forum_id
+								AND t.topic_id = p.topic_id
+								AND u.user_id = p.poster_id',
+			'ORDER_BY'	=> 'p.post_time DESC',
+		);
+
+		return true;
+	}
+
+	function get_item()
+	{
+		global $db, $cache;
+
+		// Disable cache if it is not a guest or a bot but a registered user
+		if ($this->cache_time)
+		{
+			global $user;
+
+			// We check this here because we call get_item() quite often
+			if (!empty($user) && $user->data['is_registered'])
+			{
+				$this->cache_time = 0;
+			}
+		}
+
+		if (!$this->cache_time)
+		{
+			if (empty($this->result))
+			{
+				if (!$this->get_sql())
+				{
+					return false;
+				}
+
+				// Query database
+				$sql = $db->sql_build_query('SELECT', $this->sql);
+				$this->result = $db->sql_query_limit($sql, $this->num_items);
+			}
+
+			return $db->sql_fetchrow($this->result);
+		}
+		else
+		{
+			if (empty($this->items_filled))
+			{
+				// Try to load result set...
+				$cache_filename = substr(get_class($this), strlen('phpbb_'));
+
+				if (($this->items = $cache->get('_' . $cache_filename)) === false)
+				{
+					$this->items = array();
+
+					if ($this->get_sql())
+					{
+						// Query database
+						$sql = $db->sql_build_query('SELECT', $this->sql);
+						$result = $db->sql_query_limit($sql, $this->num_items);
+
+						while ($row = $db->sql_fetchrow($result))
+						{
+							$this->items[] = $row;
+						}
+						$db->sql_freeresult($result);
+					}
+
+					$cache->put('_' . $cache_filename, $this->items, $this->cache_time);
+				}
+
+				$this->items_filled = true;
+			}
+
+			$row = array_shift($this->items);
+			return (!$row) ? false : $row;
+		}
+	}
+
+	function adjust_item(&$item_row, &$row)
+	{
+		global $phpEx, $config;
+
+		$item_row['title'] = (!$this->topic_id) ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
+		$item_row['link'] = feed_append_sid('/viewtopic.' . $phpEx, "t={$row['topic_id']}&amp;p={$row['post_id']}#p{$row['post_id']}");
+
+		if ($config['feed_item_statistics'])
+		{
+			global $user;
+
+			$user_link = '<a href="' . feed_append_sid('/memberlist.' . $phpEx, 'mode=viewprofile&amp;u=' . $row['user_id']) . '">' . $row['username'] . '</a>';
+
+			$time = ($this->topic_id) ? $row['post_time'] : $row['topic_time'];
+
+			$item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $user_link . ' - ' . $user->format_date($time). ' - ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies'] . ' - ' . $user->lang['VIEWS'] . ' ' . $row['topic_views'];
+		}
+	}
+}
+
+class phpbb_feed_forums extends phpbb_feed
+{
+	function set_keys()
+	{
+		global $config;
+
+		$this->set('title',		'forum_name');
+		$this->set('text',		'forum_desc');
+		$this->set('bitfield',	'forum_desc_bitfield');
+		$this->set('bbcode_uid','forum_desc_uid');
+		$this->set('date',		'forum_last_post_time');
+		$this->set('options',	'forum_desc_options');
+
+		$this->num_items = (int) $config['feed_overall_forums_limit'];
+	}
+
+	function open()
+	{
+		global $user, $global_vars;
+
+		$global_vars['FEED_MODE'] = $user->lang['FORUMS'];
+	}
+
+	function get_sql()
+	{
+		global $db;
+
+		$not_in_fid = (sizeof($this->excluded_forums())) ? ' AND ' . $db->sql_in_set('f.forum_id', $this->excluded_forums(), true) : '';
+
+		// Build SQL Query
+		$this->sql = array(
+			'SELECT'	=> 'f.*',
+			'FROM'		=> array(FORUMS_TABLE => 'f'),
+			'WHERE'		=> 'f.forum_type = ' . FORUM_POST . '
+								AND (f.forum_last_post_id > 0' . $not_in_fid . ')',
+			'ORDER_BY'	=> 'f.left_id',
+		);
+
+		return true;
+	}
+
+	function adjust_item(&$item_row, &$row)
+	{
+		global $phpEx, $config;
+
+		$item_row['link'] = feed_append_sid('/viewforum.' . $phpEx, 'f=' . $row['forum_id']);
+
+		if ($config['feed_item_statistics'])
+		{
+			global $user;
+
+			$item_row['statistics'] = sprintf($user->lang['TOTAL_TOPICS_OTHER'], $row['forum_topics']) . ' - ' . sprintf($user->lang['TOTAL_POSTS_OTHER'], $row['forum_posts']);
+		}
+	}
+}
+
+class phpbb_feed_news extends phpbb_feed
+{
+	function set_keys()
+	{
+		global $config;
+
+		$this->set('title',		'topic_title');
+		$this->set('title2',	'forum_name');
+		$this->set('author_id',	'topic_poster');
+		$this->set('creator',	'topic_first_poster_name');
+		$this->set('text',		'post_text');
+		$this->set('bitfield',	'bbcode_bitfield');
+		$this->set('bbcode_uid','bbcode_uid');
+		$this->set('date',		'topic_time');
+
+		$this->set('enable_bbcode',		'enable_bbcode');
+		$this->set('enable_smilies',	'enable_smilies');
+		$this->set('enable_magic_url',	'enable_magic_url');
+
+		$this->num_items = (int) $config['feed_overall_forums_limit'];
+	}
+
+	function open()
+	{
+		global $user, $global_vars;
+
+		$global_vars['FEED_MODE'] = $user->lang['FEED_NEWS'];
+	}
+
+	function get_sql()
+	{
+		global $db, $config;
+
+		// Get news forums...
+		$sql = 'SELECT forum_id
+			FROM ' . FORUMS_TABLE . '
+			WHERE ' . $db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
+		$result = $db->sql_query($sql);
+
+		$in_fid_ary = array();
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$in_fid_ary[] = (int) $row['forum_id'];
+		}
+		$db->sql_freeresult($result);
+
+		if (!sizeof($in_fid_ary))
+		{
+			return false;
+		}
+
+		// Build SQL Query
+		$this->sql = array(
+			'SELECT'	=> 'f.forum_id, f.forum_password, f.forum_name, f.forum_topics, f.forum_posts, f.parent_id, f.left_id, f.right_id,
+							t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time,
+							p.post_id, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url,
+							u.username, u.user_id, u.user_email, u.user_colour',
+			'FROM'		=> array(
+				TOPICS_TABLE	=> 't',
+				FORUMS_TABLE	=> 'f',
+				POSTS_TABLE		=> 'p',
+				USERS_TABLE		=> 'u',
+			),
+			'WHERE'		=> $db->sql_in_set('t.forum_id', $in_fid_ary) . '
+							AND f.forum_id = t.forum_id
+							AND p.post_id = t.topic_first_post_id
+							AND t.topic_poster = u.user_id
+							AND t.topic_moved_id = 0',
+			'ORDER_BY'	=> 't.topic_time DESC',
+		);
+
+		return true;
+	}
+
+	function adjust_item(&$item_row, &$row)
+	{
+		global $phpEx, $config;
+
+		$item_row['link'] = feed_append_sid('/viewtopic.' . $phpEx, 't=' . $row['topic_id'] . '&amp;p=' . $row['post_id'] . '#p' . $row['post_id']);
+
+		if ($config['feed_item_statistics'])
+		{
+			global $user;
+
+			$user_link = '<a href="' . feed_append_sid('/memberlist.' . $phpEx, 'mode=viewprofile&amp;u=' . $row[$this->get('author_id')]) . '">' . $row[$this->get('creator')] . '</a>';
+
+			$item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $user_link . ' - ' . $user->format_date($row['topic_time']). ' - ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies'] . ' - ' . $user->lang['VIEWS'] . ' ' . $row['topic_views'];
+		}
+	}
+}
+
+class phpbb_feed_topics extends phpbb_feed
+{
+	function set_keys()
+	{
+		global $config;
+
+		$this->set('title',		'topic_title');
+		$this->set('title2',	'forum_name');
+		$this->set('author_id',	'topic_poster');
+		$this->set('creator',	'topic_first_poster_name');
+		$this->set('text',		'post_text');
+		$this->set('bitfield',	'bbcode_bitfield');
+		$this->set('bbcode_uid','bbcode_uid');
+		$this->set('date',		'topic_time');
+
+		$this->set('enable_bbcode',		'enable_bbcode');
+		$this->set('enable_smilies',	'enable_smilies');
+		$this->set('enable_magic_url',	'enable_magic_url');
+
+		$this->num_items = (int) $config['feed_overall_topics_limit'];
+	}
+
+	function open()
+	{
+		global $user, $global_vars;
+
+		$global_vars['FEED_MODE'] = $user->lang['TOPICS'];
+	}
+
+	function get_sql()
+	{
+		global $db, $config;
+
+		$post_ids = array();
+		$not_in_fid = (sizeof($this->excluded_forums())) ? ' AND ' . $db->sql_in_set('t.forum_id', $this->excluded_forums(), true) : '';
+
+		// Search for topics in last x days
+		$last_post_time_sql = ($this->sort_days) ? ' AND t.topic_last_post_time > ' . (time() - ($this->sort_days * 24 * 3600)) : '';
+
+		// Last x topics from all forums, with first post from topic...
+		$sql = 'SELECT t.topic_first_post_id
+			FROM ' . TOPICS_TABLE . ' t
+			WHERE t.topic_approved = 1
+				AND t.topic_moved_id = 0' .
+				$not_in_fid .
+				$last_post_time_sql . '
+			ORDER BY t.topic_last_post_time DESC';
+		$result = $db->sql_query_limit($sql, $this->num_items);
+
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$post_ids[] = (int) $row['topic_first_post_id'];
+		}
+		$db->sql_freeresult($result);
+
+		if (!sizeof($post_ids))
+		{
+			return false;
+		}
+
+		$this->sql = array(
+			'SELECT'	=> 'f.forum_id, f.forum_password, f.forum_name, f.forum_topics, f.forum_posts, f.parent_id, f.left_id, f.right_id,
+							t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time,
+							p.post_id, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url,
+							u.username, u.user_id, u.user_email, u.user_colour',
+			'FROM'		=> array(
+				TOPICS_TABLE	=> 't',
+				FORUMS_TABLE	=> 'f',
+				POSTS_TABLE		=> 'p',
+				USERS_TABLE		=> 'u',
+			),
+			'WHERE'		=> $db->sql_in_set('p.post_id', $post_ids) . '
+								AND f.forum_id = p.forum_id
+								AND t.topic_id = p.topic_id
+								AND u.user_id = p.poster_id',
+			'ORDER_BY'	=> 't.topic_last_post_time DESC',
+		);
+
+		return true;
+	}
+
+	function adjust_item(&$item_row, &$row)
+	{
+		global $phpEx, $config;
+
+		$item_row['link'] = feed_append_sid('/viewtopic.' . $phpEx, 't=' . $row['topic_id'] . '&amp;p=' . $row['post_id'] . '#p' . $row['post_id']);
+
+		if ($config['feed_item_statistics'])
+		{
+			global $user;
+
+			$user_link = '<a href="' . feed_append_sid('/memberlist.' . $phpEx, 'mode=viewprofile&amp;u=' . $row[$this->get('author_id')]) . '">' . $row[$this->get('creator')] . '</a>';
+
+			$item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $user_link . ' - ' . $user->format_date($row['topic_time']). ' - ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies'] . ' - ' . $user->lang['VIEWS'] . ' ' . $row['topic_views'];
+		}
+	}
+}
+
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/.htaccess 3.0.6.src/.htaccess
--- 3.0.5.src/.htaccess	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/.htaccess	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,9 @@
+<Files "config.php">
+Order Allow,Deny
+Deny from All
+</Files>
+
+<Files "common.php">
+Order Allow,Deny
+Deny from All
+</Files>
diff -x .svn -aruN 3.0.5.src/includes/acm/acm_apc.php 3.0.6.src/includes/acm/acm_apc.php
--- 3.0.5.src/includes/acm/acm_apc.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/acm/acm_apc.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,84 @@
+<?php
+/**
+*
+* @package acm
+* @version $Id: acm_apc.php 9891 2009-07-29 22:59:51Z bantu $
+* @copyright (c) 2005, 2009 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+// Include the abstract base
+if (!class_exists('acm_memory'))
+{
+	require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
+}
+
+/**
+* ACM for APC
+* @package acm
+*/
+class acm extends acm_memory
+{
+	var $extension = 'apc';
+
+	/**
+	* Purge cache data
+	*
+	* @return void
+	*/
+	function purge()
+	{
+		apc_clear_cache('user');
+
+		parent::purge();
+	}
+
+	/**
+	* Fetch an item from the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return mixed Cached data
+	*/
+	function _read($var)
+	{
+		return apc_fetch($this->key_prefix . $var);
+	}
+
+	/**
+	* Store data in the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @param mixed $data Data to store
+	* @param int $ttl Time-to-live of cached data
+	* @return bool True if the operation succeeded
+	*/
+	function _write($var, $data, $ttl = 2592000)
+	{
+		return apc_store($this->key_prefix . $var, $data, $ttl);
+	}
+
+	/**
+	* Remove an item from the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return bool True if the operation succeeded
+	*/
+	function _delete($var)
+	{
+		return apc_delete($this->key_prefix . $var);
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/acm/acm_eaccelerator.php 3.0.6.src/includes/acm/acm_eaccelerator.php
--- 3.0.5.src/includes/acm/acm_eaccelerator.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/acm/acm_eaccelerator.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,120 @@
+<?php
+/**
+*
+* @package acm
+* @version $Id: acm_eaccelerator.php 10027 2009-08-20 12:14:18Z acydburn $
+* @copyright (c) 2005, 2009 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+// Include the abstract base
+if (!class_exists('acm_memory'))
+{
+	require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
+}
+
+/**
+* ACM for eAccelerator
+* @package acm
+* @todo Missing locks from destroy() talk with David
+*/
+class acm extends acm_memory
+{
+	var $extension = 'eaccelerator';
+
+	var $serialize_header = '#phpbb-serialized#';
+
+	/**
+	* Purge cache data
+	*
+	* @return void
+	*/
+	function purge()
+	{
+		foreach (eaccelerator_list_keys() as $var)
+		{
+			// @todo Check why the substr()
+			// @todo Only unset vars matching $this->key_prefix
+			eaccelerator_rm(substr($var['name'], 1));
+		}
+
+		parent::purge();
+	}
+
+	/**
+	 * Perform cache garbage collection
+	 *
+	 * @return void
+	 */
+	function tidy()
+	{
+		eaccelerator_gc();
+
+		set_config('cache_last_gc', time(), true);
+	}
+
+	/**
+	* Fetch an item from the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return mixed Cached data
+	*/
+	function _read($var)
+	{
+		$result = eaccelerator_get($this->key_prefix . $var);
+
+		if ($result === null)
+		{
+			return false;
+		}
+
+		// Handle serialized objects
+		if (is_string($result) && strpos($result, $this->serialize_header . 'O:') === 0)
+		{
+			$result = unserialize(substr($result, strlen($this->serialize_header)));
+		}
+
+		return $result;
+	}
+
+	/**
+	* Store data in the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @param mixed $data Data to store
+	* @param int $ttl Time-to-live of cached data
+	* @return bool True if the operation succeeded
+	*/
+	function _write($var, $data, $ttl = 2592000)
+	{
+		// Serialize objects and make them easy to detect
+		$data = (is_object($data)) ? $this->serialize_header . serialize($data) : $data;
+
+		return eaccelerator_put($this->key_prefix . $var, $data, $ttl);
+	}
+
+	/**
+	* Remove an item from the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return bool True if the operation succeeded
+	*/
+	function _delete($var)
+	{
+		return eaccelerator_rm($this->key_prefix . $var);
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/acm/acm_file.php 3.0.6.src/includes/acm/acm_file.php
--- 3.0.5.src/includes/acm/acm_file.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acm/acm_file.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,8 +2,8 @@
 /**
 *
 * @package acm
-* @version $Id: acm_file.php 9363 2009-03-11 12:53:54Z acydburn $
-* @copyright (c) 2005 phpBB Group
+* @version $Id: acm_file.php 9543 2009-06-05 14:51:17Z toonarmy $
+* @copyright (c) 2005, 2009 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
 */
@@ -44,17 +44,7 @@
 	*/
 	function load()
 	{
-		global $phpEx;
-		if (file_exists($this->cache_dir . 'data_global.' . $phpEx))
-		{
-			@include($this->cache_dir . 'data_global.' . $phpEx);
-		}
-		else
-		{
-			return false;
-		}
-
-		return true;
+		return $this->_read('data_global');
 	}
 
 	/**
@@ -86,22 +76,7 @@
 
 		global $phpEx;
 
-		if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb'))
-		{
-			@flock($fp, LOCK_EX);
-			fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>");
-			@flock($fp, LOCK_UN);
-			fclose($fp);
-
-			if (!function_exists('phpbb_chmod'))
-			{
-				global $phpbb_root_path;
-				include($phpbb_root_path . 'includes/functions.' . $phpEx);
-			}
-
-			phpbb_chmod($this->cache_dir . 'data_global.' . $phpEx, CHMOD_READ | CHMOD_WRITE);
-		}
-		else
+		if (!$this->_write('data_global'))
 		{
 			// Now, this occurred how often? ... phew, just tell the user then...
 			if (!@is_writable($this->cache_dir))
@@ -132,6 +107,8 @@
 			return;
 		}
 
+		$time = time();
+
 		while (($entry = readdir($dir)) !== false)
 		{
 			if (!preg_match('/^(sql_|data_(?!global))/', $entry))
@@ -139,9 +116,20 @@
 				continue;
 			}
 
-			$expired = true;
-			@include($this->cache_dir . $entry);
-			if ($expired)
+			if (!($handle = @fopen($this->cache_dir . $entry, 'rb')))
+			{
+				continue;
+			}
+
+			// Skip the PHP header
+			fgets($handle);
+
+			// Skip expiration
+			$expires = (int) fgets($handle);
+
+			fclose($handle);
+
+			if ($time >= $expires)
 			{
 				$this->remove_file($this->cache_dir . $entry);
 			}
@@ -157,7 +145,7 @@
 
 			foreach ($this->var_expires as $var_name => $expires)
 			{
-				if (time() > $expires)
+				if ($time >= $expires)
 				{
 					$this->destroy($var_name);
 				}
@@ -181,8 +169,7 @@
 				return false;
 			}
 
-			@include($this->cache_dir . "data{$var_name}.$phpEx");
-			return (isset($data)) ? $data : false;
+			return $this->_read('data' . $var_name);
 		}
 		else
 		{
@@ -197,23 +184,7 @@
 	{
 		if ($var_name[0] == '_')
 		{
-			global $phpEx;
-
-			if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb'))
-			{
-				@flock($fp, LOCK_EX);
-				fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data =  " . (sizeof($var) ? "unserialize(" . var_export(serialize($var), true) . ");" : 'array();') . "\n\n?>");
-				@flock($fp, LOCK_UN);
-				fclose($fp);
-
-				if (!function_exists('phpbb_chmod'))
-				{
-					global $phpbb_root_path;
-					include($phpbb_root_path . 'includes/functions.' . $phpEx);
-				}
-
-				phpbb_chmod($this->cache_dir . "data{$var_name}.$phpEx", CHMOD_READ | CHMOD_WRITE);
-			}
+			$this->_write('data' . $var_name, $var, time() + $ttl);
 		}
 		else
 		{
@@ -288,32 +259,31 @@
 					continue;
 				}
 
-				// The following method is more failproof than simply assuming the query is on line 3 (which it should be)
-				$check_line = @file_get_contents($this->cache_dir . $entry);
-
-				if (empty($check_line))
+				if (!($handle = @fopen($this->cache_dir . $entry, 'rb')))
 				{
 					continue;
 				}
 
-				// Now get the contents between /* and */
-				$check_line = substr($check_line, strpos($check_line, '/* ') + 3, strpos($check_line, ' */') - strpos($check_line, '/* ') - 3);
+				// Skip the PHP header
+				fgets($handle);
+
+				// Skip expiration
+				fgets($handle);
+
+				// Grab the query, remove the LF
+				$query = substr(fgets($handle), 0, -1);
+
+				fclose($handle);
 
-				$found = false;
 				foreach ($table as $check_table)
 				{
 					// Better catch partial table names than no table names. ;)
-					if (strpos($check_line, $check_table) !== false)
+					if (strpos($query, $check_table) !== false)
 					{
-						$found = true;
+						$this->remove_file($this->cache_dir . $entry);
 						break;
 					}
 				}
-
-				if ($found)
-				{
-					$this->remove_file($this->cache_dir . $entry);
-				}
 			}
 			closedir($dir);
 
@@ -371,29 +341,16 @@
 	*/
 	function sql_load($query)
 	{
-		global $phpEx;
-
 		// Remove extra spaces and tabs
 		$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
-		$query_id = sizeof($this->sql_rowset);
-
-		if (!file_exists($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"))
-		{
-			return false;
-		}
-
-		@include($this->cache_dir . 'sql_' . md5($query) . ".$phpEx");
 
-		if (!isset($expired))
-		{
-			return false;
-		}
-		else if ($expired)
+		if (($rowset = $this->_read('sql_' . md5($query))) === false)
 		{
-			$this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx", true);
 			return false;
 		}
 
+		$query_id = sizeof($this->sql_rowset);
+		$this->sql_rowset[$query_id] = $rowset;
 		$this->sql_row_pointer[$query_id] = 0;
 
 		return $query_id;
@@ -404,41 +361,23 @@
 	*/
 	function sql_save($query, &$query_result, $ttl)
 	{
-		global $db, $phpEx;
+		global $db;
 
 		// Remove extra spaces and tabs
 		$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
-		$filename = $this->cache_dir . 'sql_' . md5($query) . '.' . $phpEx;
-
-		if ($fp = @fopen($filename, 'wb'))
-		{
-			@flock($fp, LOCK_EX);
-
-			$query_id = sizeof($this->sql_rowset);
-			$this->sql_rowset[$query_id] = array();
-			$this->sql_row_pointer[$query_id] = 0;
-
-			while ($row = $db->sql_fetchrow($query_result))
-			{
-				$this->sql_rowset[$query_id][] = $row;
-			}
-			$db->sql_freeresult($query_result);
-
-			$file = "<?php\nif (!defined('IN_PHPBB')) exit;\n\n/* " . str_replace('*/', '*\/', $query) . " */\n";
-			$file .= "\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n";
-
-			fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = " . (sizeof($this->sql_rowset[$query_id]) ? "unserialize(" . var_export(serialize($this->sql_rowset[$query_id]), true) . ");" : 'array();') . "\n\n?>");
-			@flock($fp, LOCK_UN);
-			fclose($fp);
 
-			if (!function_exists('phpbb_chmod'))
-			{
-				global $phpbb_root_path;
-				include($phpbb_root_path . 'includes/functions.' . $phpEx);
-			}
+		$query_id = sizeof($this->sql_rowset);
+		$this->sql_rowset[$query_id] = array();
+		$this->sql_row_pointer[$query_id] = 0;
 
-			phpbb_chmod($filename, CHMOD_READ | CHMOD_WRITE);
+		while ($row = $db->sql_fetchrow($query_result))
+		{
+			$this->sql_rowset[$query_id][] = $row;
+		}
+		$db->sql_freeresult($query_result);
 
+		if ($this->_write('sql_' . md5($query), $this->sql_rowset[$query_id], $ttl + time(), $query))
+		{
 			$query_result = $query_id;
 		}
 	}
@@ -508,6 +447,262 @@
 	}
 
 	/**
+	* Read cached data from a specified file
+	*
+	* @access private
+	* @param string $filename Filename to write
+	* @return mixed False if an error was encountered, otherwise the data type of the cached data
+	*/
+	function _read($filename)
+	{
+		global $phpEx;
+
+		$file = "{$this->cache_dir}$filename.$phpEx";
+
+		$type = substr($filename, 0, strpos($filename, '_'));
+
+		if (!file_exists($file))
+		{
+			return false;
+		}
+
+		if (!($handle = @fopen($file, 'rb')))
+		{
+			return false;
+		}
+
+		// Skip the PHP header
+		fgets($handle);
+
+		if ($filename == 'data_global')
+		{
+			$this->vars = $this->var_expires = array();
+
+			$time = time();
+
+			while (($expires = (int) fgets($handle)) && !feof($handle))
+			{
+				// Number of bytes of data
+				$bytes = substr(fgets($handle), 0, -1);
+
+				if (!is_numeric($bytes) || ($bytes = (int) $bytes) === 0)
+				{
+					// We cannot process the file without a valid number of bytes
+					// so we discard it
+					fclose($handle);
+
+					$this->vars = $this->var_expires = array();
+					$this->is_modified = false;
+
+					$this->remove_file($file);
+
+					return false;
+				}
+
+				if ($time >= $expires)
+				{
+					fseek($handle, $bytes, SEEK_CUR);
+
+					continue;
+				}
+
+				$var_name = substr(fgets($handle), 0, -1);
+
+				// Read the length of bytes that consists of data.
+				$data = fread($handle, $bytes - strlen($var_name));
+				$data = @unserialize($data);
+
+				// Don't use the data if it was invalid
+				if ($data !== false)
+				{
+					$this->vars[$var_name] = $data;
+					$this->var_expires[$var_name] = $expires;
+				}
+
+				// Absorb the LF
+				fgets($handle);
+			}
+
+			fclose($handle);
+
+			$this->is_modified = false;
+
+			return true;
+		}
+		else
+		{
+			$data = false;
+			$line = 0;
+
+			while (($buffer = fgets($handle)) && !feof($handle))
+			{
+				$buffer = substr($buffer, 0, -1); // Remove the LF
+
+				// $buffer is only used to read integers
+				// if it is non numeric we have an invalid
+				// cache file, which we will now remove.
+				if (!is_numeric($buffer))
+				{
+					break;
+				}
+
+				if ($line == 0)
+				{
+					$expires = (int) $buffer;
+
+					if (time() >= $expires)
+					{
+						break;
+					}
+
+					if ($type == 'sql')
+					{
+						// Skip the query
+						fgets($handle);
+					}
+				}
+				else if ($line == 1)
+				{
+					$bytes = (int) $buffer;
+
+					// Never should have 0 bytes
+					if (!$bytes)
+					{
+						break;
+					}
+
+					// Grab the serialized data
+					$data = fread($handle, $bytes);
+
+					// Read 1 byte, to trigger EOF
+					fread($handle, 1);
+
+					if (!feof($handle))
+					{
+						// Somebody tampered with our data
+						$data = false;
+					}
+					break;
+				}
+				else
+				{
+					// Something went wrong
+					break;
+				}
+				$line++;
+			}
+			fclose($handle);
+
+			// unserialize if we got some data
+			$data = ($data !== false) ? @unserialize($data) : $data;
+
+			if ($data === false)
+			{
+				$this->remove_file($file);
+				return false;
+			}
+
+			return $data;
+		}
+	}
+
+	/**
+	* Write cache data to a specified file
+	*
+	* 'data_global' is a special case and the generated format is different for this file:
+	* <code>
+	* <?php exit; ?>
+	* (expiration)
+	* (length of var and serialised data)
+	* (var)
+	* (serialised data)
+	* ... (repeat)
+	* </code>
+	*
+	* The other files have a similar format:
+	* <code>
+	* <?php exit; ?>
+	* (expiration)
+	* (query) [SQL files only]
+	* (length of serialised data)
+	* (serialised data)
+	* </code>
+	*
+	* @access private
+	* @param string $filename Filename to write
+	* @param mixed $data Data to store
+	* @param int $expires Timestamp when the data expires
+	* @param string $query Query when caching SQL queries
+	* @return bool True if the file was successfully created, otherwise false
+	*/
+	function _write($filename, $data = null, $expires = 0, $query = '')
+	{
+		global $phpEx;
+
+		$file = "{$this->cache_dir}$filename.$phpEx";
+
+		if ($handle = @fopen($file, 'wb'))
+		{
+			@flock($handle, LOCK_EX);
+
+			// File header
+			fwrite($handle, '<' . '?php exit; ?' . '>');
+
+			if ($filename == 'data_global')
+			{
+				// Global data is a different format
+				foreach ($this->vars as $var => $data)
+				{
+					if (strpos($var, "\r") !== false || strpos($var, "\n") !== false)
+					{
+						// CR/LF would cause fgets() to read the cache file incorrectly
+						// do not cache test entries, they probably won't be read back
+						// the cache keys should really be alphanumeric with a few symbols.
+						continue;
+					}
+					$data = serialize($data);
+
+					// Write out the expiration time
+					fwrite($handle, "\n" . $this->var_expires[$var] . "\n");
+
+					// Length of the remaining data for this var (ignoring two LF's)
+					fwrite($handle, strlen($data . $var) . "\n");
+					fwrite($handle, $var . "\n");
+					fwrite($handle, $data);
+				}
+			}
+			else
+			{
+				fwrite($handle, "\n" . $expires . "\n");
+
+				if (strpos($filename, 'sql_') === 0)
+				{
+					fwrite($handle, $query . "\n");
+				}
+				$data = serialize($data);
+
+				fwrite($handle, strlen($data) . "\n");
+				fwrite($handle, $data);
+			}
+
+			@flock($handle, LOCK_UN);
+			fclose($handle);
+
+			if (!function_exists('phpbb_chmod'))
+			{
+				global $phpbb_root_path;
+				include($phpbb_root_path . 'includes/functions.' . $phpEx);
+			}
+
+			phpbb_chmod($file, CHMOD_READ | CHMOD_WRITE);
+
+			return true;
+		}
+
+		return false;
+	}
+
+	/**
 	* Removes/unlinks file
 	*/
 	function remove_file($filename, $check = false)
diff -x .svn -aruN 3.0.5.src/includes/acm/acm_memcache.php 3.0.6.src/includes/acm/acm_memcache.php
--- 3.0.5.src/includes/acm/acm_memcache.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/acm/acm_memcache.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,124 @@
+<?php
+/**
+*
+* @package acm
+* @version $Id: acm_memcache.php 10027 2009-08-20 12:14:18Z acydburn $
+* @copyright (c) 2005, 2009 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+// Include the abstract base
+if (!class_exists('acm_memory'))
+{
+	require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
+}
+
+if (!defined('PHPBB_ACM_MEMCACHE_PORT'))
+{
+	define('PHPBB_ACM_MEMCACHE_PORT', 11211);
+}
+
+if (!defined('PHPBB_ACM_MEMCACHE_COMPRESS'))
+{
+	define('PHPBB_ACM_MEMCACHE_COMPRESS', false);
+}
+
+if (!defined('PHPBB_ACM_MEMCACHE_HOST'))
+{
+	define('PHPBB_ACM_MEMCACHE_HOST', 'localhost');
+}
+
+/**
+* ACM for Memcached
+* @package acm
+*/
+class acm extends acm_memory
+{
+	var $extension = 'memcache';
+
+	var $memcache;
+	var $flags = 0;
+
+	function acm()
+	{
+		// Call the parent constructor
+		parent::acm_memory();
+
+		$this->memcache = new Memcache;
+		$this->memcache->connect(PHPBB_ACM_MEMCACHE_HOST, PHPBB_ACM_MEMCACHE_PORT);
+		$this->flags = (PHPBB_ACM_MEMCACHE_COMPRESS) ? MEMCACHE_COMPRESSED : 0;
+	}
+
+	/**
+	* Unload the cache resources
+	*
+	* @return void
+	*/
+	function unload()
+	{
+		parent::unload();
+
+		$this->memcache->close();
+	}
+
+	/**
+	* Purge cache data
+	*
+	* @return void
+	*/
+	function purge()
+	{
+		$this->memcache->flush();
+
+		parent::purge();
+	}
+
+	/**
+	* Fetch an item from the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return mixed Cached data
+	*/
+	function _read($var)
+	{
+		return $this->memcache->get($this->key_prefix . $var);
+	}
+
+	/**
+	* Store data in the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @param mixed $data Data to store
+	* @param int $ttl Time-to-live of cached data
+	* @return bool True if the operation succeeded
+	*/
+	function _write($var, $data, $ttl = 2592000)
+	{
+		return $this->memcache->set($this->key_prefix . $var, $data, $this->flags, $ttl);
+	}
+
+	/**
+	* Remove an item from the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return bool True if the operation succeeded
+	*/
+	function _delete($var)
+	{
+		return $this->memcache->delete($this->key_prefix . $var);
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/acm/acm_memory.php 3.0.6.src/includes/acm/acm_memory.php
--- 3.0.5.src/includes/acm/acm_memory.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/acm/acm_memory.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,426 @@
+<?php
+/**
+*
+* @package acm
+* @version $Id: acm_memory.php 10027 2009-08-20 12:14:18Z acydburn $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+/**
+* ACM Abstract Memory Class
+* @package acm
+*/
+class acm_memory
+{
+	var $key_prefix;
+
+	var $vars = array();
+	var $is_modified = false;
+
+	var $sql_rowset = array();
+	var $sql_row_pointer = array();
+	var $cache_dir = '';
+
+	/**
+	* Set cache path
+	*/
+	function acm_memory()
+	{
+		global $phpbb_root_path, $dbname, $table_prefix;
+
+		$this->cache_dir	= $phpbb_root_path . 'cache/';
+		$this->key_prefix	= substr(md5($dbname . $table_prefix), 0, 8) . '_';
+
+		if (!isset($this->extension) || !extension_loaded($this->extension))
+		{
+			global $acm_type;
+
+			trigger_error("Could not find required extension [{$this->extension}] for the ACM module $acm_type.", E_USER_ERROR);
+		}
+	}
+
+	/**
+	* Load global cache
+	*/
+	function load()
+	{
+		// grab the global cache
+		$this->vars = $this->_read('global');
+
+		if ($this->vars !== false)
+		{
+			return true;
+		}
+
+		return false;
+	}
+
+	/**
+	* Unload cache object
+	*/
+	function unload()
+	{
+		$this->save();
+		unset($this->vars);
+		unset($this->sql_rowset);
+		unset($this->sql_row_pointer);
+
+		$this->vars = array();
+		$this->sql_rowset = array();
+		$this->sql_row_pointer = array();
+	}
+
+	/**
+	* Save modified objects
+	*/
+	function save()
+	{
+		if (!$this->is_modified)
+		{
+			return;
+		}
+
+		$this->_write('global', $this->vars, 2592000);
+
+		$this->is_modified = false;
+	}
+
+	/**
+	* Tidy cache
+	*/
+	function tidy()
+	{
+		// cache has auto GC, no need to have any code here :)
+
+		set_config('cache_last_gc', time(), true);
+	}
+
+	/**
+	* Get saved cache object
+	*/
+	function get($var_name)
+	{
+		if ($var_name[0] == '_')
+		{
+			if (!$this->_exists($var_name))
+			{
+				return false;
+			}
+
+			return $this->_read($var_name);
+		}
+		else
+		{
+			return ($this->_exists($var_name)) ? $this->vars[$var_name] : false;
+		}
+	}
+
+	/**
+	* Put data into cache
+	*/
+	function put($var_name, $var, $ttl = 2592000)
+	{
+		if ($var_name[0] == '_')
+		{
+			$this->_write($var_name, $var, $ttl);
+		}
+		else
+		{
+			$this->vars[$var_name] = $var;
+			$this->is_modified = true;
+		}
+	}
+
+	/**
+	* Purge cache data
+	*/
+	function purge()
+	{
+		// Purge all phpbb cache files
+		$dir = @opendir($this->cache_dir);
+
+		if (!$dir)
+		{
+			return;
+		}
+
+		while (($entry = readdir($dir)) !== false)
+		{
+			if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
+			{
+				continue;
+			}
+
+			$this->remove_file($this->cache_dir . $entry);
+		}
+		closedir($dir);
+
+		unset($this->vars);
+		unset($this->sql_rowset);
+		unset($this->sql_row_pointer);
+
+		$this->vars = array();
+		$this->sql_rowset = array();
+		$this->sql_row_pointer = array();
+
+		$this->is_modified = false;
+	}
+
+
+	/**
+	* Destroy cache data
+	*/
+	function destroy($var_name, $table = '')
+	{
+		if ($var_name == 'sql' && !empty($table))
+		{
+			if (!is_array($table))
+			{
+				$table = array($table);
+			}
+
+			foreach ($table as $table_name)
+			{
+				// gives us the md5s that we want
+				$temp = $this->_read('sql_' . $table_name);
+
+				if ($temp === false)
+				{
+					continue;
+				}
+
+				// delete each query ref
+				foreach ($temp as $md5_id => $void)
+				{
+					$this->_delete('sql_' . $md5_id);
+				}
+
+				// delete the table ref
+				$this->_delete('sql_' . $table_name);
+			}
+
+			return;
+		}
+
+		if (!$this->_exists($var_name))
+		{
+			return;
+		}
+
+		if ($var_name[0] == '_')
+		{
+			$this->_delete($var_name);
+		}
+		else if (isset($this->vars[$var_name]))
+		{
+			$this->is_modified = true;
+			unset($this->vars[$var_name]);
+
+			// We save here to let the following cache hits succeed
+			$this->save();
+		}
+	}
+
+	/**
+	* Check if a given cache entry exist
+	*/
+	function _exists($var_name)
+	{
+		if ($var_name[0] == '_')
+		{
+			return $this->_isset($var_name);
+		}
+		else
+		{
+			if (!sizeof($this->vars))
+			{
+				$this->load();
+			}
+
+			return isset($this->vars[$var_name]);
+		}
+	}
+
+	/**
+	* Load cached sql query
+	*/
+	function sql_load($query)
+	{
+		// Remove extra spaces and tabs
+		$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
+		$query_id = sizeof($this->sql_rowset);
+
+		if (($result = $this->_read('sql_' . md5($query))) === false)
+		{
+			return false;
+		}
+
+		$this->sql_rowset[$query_id] = $result;
+		$this->sql_row_pointer[$query_id] = 0;
+
+		return $query_id;
+	}
+
+	/**
+	* Save sql query
+	*/
+	function sql_save($query, &$query_result, $ttl)
+	{
+		global $db;
+
+		// Remove extra spaces and tabs
+		$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
+		$hash = md5($query);
+
+		// determine which tables this query belongs to
+		// Some queries use backticks, namely the get_database_size() query
+		// don't check for conformity, the SQL would error and not reach here.
+		if (!preg_match('/FROM \\(?(`?\\w+`?(?: \\w+)?(?:, ?`?\\w+`?(?: \\w+)?)*)\\)?/', $query, $regs))
+		{
+			// Bail out if the match fails.
+			return;
+		}
+		$tables = array_map('trim', explode(',', $regs[1]));
+
+		foreach ($tables as $table_name)
+		{
+			// Remove backticks
+			$table_name = ($table_name[0] == '`') ? substr($table_name, 1, -1) : $table_name;
+
+			if (($pos = strpos($table_name, ' ')) !== false)
+			{
+				$table_name = substr($table_name, 0, $pos);
+			}
+
+			$temp = $this->_read('sql_' . $table_name);
+
+			if ($temp === false)
+			{
+				$temp = array();
+			}
+
+			$temp[$hash] = true;
+
+			// This must never expire
+			$this->_write('sql_' . $table_name, $temp, 0);
+		}
+
+		// store them in the right place
+		$query_id = sizeof($this->sql_rowset);
+		$this->sql_rowset[$query_id] = array();
+		$this->sql_row_pointer[$query_id] = 0;
+
+		while ($row = $db->sql_fetchrow($query_result))
+		{
+			$this->sql_rowset[$query_id][] = $row;
+		}
+		$db->sql_freeresult($query_result);
+
+		$this->_write('sql_' . $hash, $this->sql_rowset[$query_id], $ttl);
+
+		$query_result = $query_id;
+	}
+
+	/**
+	* Ceck if a given sql query exist in cache
+	*/
+	function sql_exists($query_id)
+	{
+		return isset($this->sql_rowset[$query_id]);
+	}
+
+	/**
+	* Fetch row from cache (database)
+	*/
+	function sql_fetchrow($query_id)
+	{
+		if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
+		{
+			return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++];
+		}
+
+		return false;
+	}
+
+	/**
+	* Fetch a field from the current row of a cached database result (database)
+	*/
+	function sql_fetchfield($query_id, $field)
+	{
+		if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
+		{
+			return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field] : false;
+		}
+
+		return false;
+	}
+
+	/**
+	* Seek a specific row in an a cached database result (database)
+	*/
+	function sql_rowseek($rownum, $query_id)
+	{
+		if ($rownum >= sizeof($this->sql_rowset[$query_id]))
+		{
+			return false;
+		}
+
+		$this->sql_row_pointer[$query_id] = $rownum;
+		return true;
+	}
+
+	/**
+	* Free memory used for a cached database result (database)
+	*/
+	function sql_freeresult($query_id)
+	{
+		if (!isset($this->sql_rowset[$query_id]))
+		{
+			return false;
+		}
+
+		unset($this->sql_rowset[$query_id]);
+		unset($this->sql_row_pointer[$query_id]);
+
+		return true;
+	}
+
+	/**
+	* Removes/unlinks file
+	*/
+	function remove_file($filename, $check = false)
+	{
+		if ($check && !@is_writable($this->cache_dir))
+		{
+			// E_USER_ERROR - not using language entry - intended.
+			trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR);
+		}
+
+		return @unlink($filename);
+	}
+
+	/**
+	* Check if a cache var exists
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return bool True if it exists, otherwise false
+	*/
+	function _isset($var)
+	{
+		// Most caches don't need to check
+		return true;
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/acm/acm_null.php 3.0.6.src/includes/acm/acm_null.php
--- 3.0.5.src/includes/acm/acm_null.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/acm/acm_null.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,156 @@
+<?php
+/**
+*
+* @package acm
+* @version $Id: acm_null.php 9891 2009-07-29 22:59:51Z bantu $
+* @copyright (c) 2005, 2009 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+/**
+* ACM Null Caching
+* @package acm
+*/
+class acm
+{
+	/**
+	* Set cache path
+	*/
+	function acm()
+	{
+	}
+
+	/**
+	* Load global cache
+	*/
+	function load()
+	{
+		return true;
+	}
+
+	/**
+	* Unload cache object
+	*/
+	function unload()
+	{
+	}
+
+	/**
+	* Save modified objects
+	*/
+	function save()
+	{
+	}
+
+	/**
+	* Tidy cache
+	*/
+	function tidy()
+	{
+		// This cache always has a tidy room.
+		set_config('cache_last_gc', time(), true);
+	}
+
+	/**
+	* Get saved cache object
+	*/
+	function get($var_name)
+	{
+		return false;
+	}
+
+	/**
+	* Put data into cache
+	*/
+	function put($var_name, $var, $ttl = 0)
+	{
+	}
+
+	/**
+	* Purge cache data
+	*/
+	function purge()
+	{
+	}
+
+	/**
+	* Destroy cache data
+	*/
+	function destroy($var_name, $table = '')
+	{
+	}
+
+	/**
+	* Check if a given cache entry exist
+	*/
+	function _exists($var_name)
+	{
+		return false;
+	}
+
+	/**
+	* Load cached sql query
+	*/
+	function sql_load($query)
+	{
+		return false;
+	}
+
+	/**
+	* Save sql query
+	*/
+	function sql_save($query, &$query_result, $ttl)
+	{
+	}
+
+	/**
+	* Ceck if a given sql query exist in cache
+	*/
+	function sql_exists($query_id)
+	{
+		return false;
+	}
+
+	/**
+	* Fetch row from cache (database)
+	*/
+	function sql_fetchrow($query_id)
+	{
+		return false;
+	}
+
+	/**
+	* Fetch a field from the current row of a cached database result (database)
+	*/
+	function sql_fetchfield($query_id, $field)
+	{
+		return false;
+	}
+
+	/**
+	* Seek a specific row in an a cached database result (database)
+	*/
+	function sql_rowseek($rownum, $query_id)
+	{
+		return false;
+	}
+
+	/**
+	* Free memory used for a cached database result (database)
+	*/
+	function sql_freeresult($query_id)
+	{
+		return false;
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/acm/acm_xcache.php 3.0.6.src/includes/acm/acm_xcache.php
--- 3.0.5.src/includes/acm/acm_xcache.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/acm/acm_xcache.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,121 @@
+<?php
+/**
+*
+* @package acm
+* @version $Id: acm_xcache.php 10027 2009-08-20 12:14:18Z acydburn $
+* @copyright (c) 2005, 2009 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+// Include the abstract base
+if (!class_exists('acm_memory'))
+{
+	require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
+}
+
+/**
+* ACM for XCache
+* @package acm
+*
+* To use this module you need ini_get() enabled and the following INI settings configured as follows:
+* - xcache.var_size > 0
+* - xcache.admin.enable_auth = off (or xcache.admin.user and xcache.admin.password set)
+*
+*/
+class acm extends acm_memory
+{
+	var $extension = 'XCache';
+
+	function acm()
+	{
+		parent::acm_memory();
+
+		if (!function_exists('ini_get') || (int) ini_get('xcache.var_size') <= 0)
+		{
+			trigger_error('Increase xcache.var_size setting above 0 or enable ini_get() to use this ACM module.', E_USER_ERROR);
+		}
+	}
+
+	/**
+	* Purge cache data
+	*
+	* @return void
+	*/
+	function purge()
+	{
+		// Run before for XCache, if admin functions are disabled it will terminate execution
+		parent::purge();
+
+		// If the admin authentication is enabled but not set up, this will cause a nasty error.
+		// Not much we can do about it though.
+		$n = xcache_count(XC_TYPE_VAR);
+
+		for ($i = 0; $i < $n; $i++)
+		{
+			xcache_clear_cache(XC_TYPE_VAR, $i);
+		}
+	}
+
+	/**
+	* Fetch an item from the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return mixed Cached data
+	*/
+	function _read($var)
+	{
+		$result = xcache_get($this->key_prefix . $var);
+
+		return ($result !== null) ? $result : false;
+	}
+
+	/**
+	* Store data in the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @param mixed $data Data to store
+	* @param int $ttl Time-to-live of cached data
+	* @return bool True if the operation succeeded
+	*/
+	function _write($var, $data, $ttl = 2592000)
+	{
+		return xcache_set($this->key_prefix . $var, $data, $ttl);
+	}
+
+	/**
+	* Remove an item from the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return bool True if the operation succeeded
+	*/
+	function _delete($var)
+	{
+		return xcache_unset($this->key_prefix . $var);
+	}
+
+	/**
+	* Check if a cache var exists
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return bool True if it exists, otherwise false
+	*/	
+	function _isset($var)
+	{
+		return xcache_isset($this->key_prefix . $var);
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_attachments.php 3.0.6.src/includes/acp/acp_attachments.php
--- 3.0.5.src/includes/acp/acp_attachments.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_attachments.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_attachments.php 9398 2009-03-19 17:01:59Z acydburn $
+* @version $Id: acp_attachments.php 9905 2009-08-01 12:28:50Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -684,8 +684,9 @@
 							$ext_group_row['max_filesize'] = (int) $config['max_filesize'];
 						}
 
-						$size_format = ($ext_group_row['max_filesize'] >= 1048576) ? 'mb' : (($ext_group_row['max_filesize'] >= 1024) ? 'kb' : 'b');
-						$ext_group_row['max_filesize'] = get_formatted_filesize($ext_group_row['max_filesize'], false);
+						$max_filesize = get_formatted_filesize($ext_group_row['max_filesize'], false, array('mb', 'kb', 'b'));
+						$size_format = $max_filesize['si_identifier'];
+						$ext_group_row['max_filesize'] = $max_filesize['value'];
 
 						$img_path = $config['upload_icons_path'];
 
@@ -694,7 +695,7 @@
 
 						$imglist = filelist($phpbb_root_path . $img_path);
 
-						if (sizeof($imglist))
+						if (!empty($imglist['']))
 						{
 							$imglist = array_values($imglist);
 							$imglist = $imglist[0];
@@ -1026,8 +1027,8 @@
 					$template->assign_block_vars('orphan', array(
 						'FILESIZE'			=> get_formatted_filesize($row['filesize']),
 						'FILETIME'			=> $user->format_date($row['filetime']),
-						'REAL_FILENAME'		=> basename($row['real_filename']),
-						'PHYSICAL_FILENAME'	=> basename($row['physical_filename']),
+						'REAL_FILENAME'		=> utf8_basename($row['real_filename']),
+						'PHYSICAL_FILENAME'	=> utf8_basename($row['physical_filename']),
 						'ATTACH_ID'			=> $row['attach_id'],
 						'POST_IDS'			=> (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
 						'U_FILE'			=> append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&amp;id=' . $row['attach_id']))
@@ -1429,8 +1430,9 @@
 	function max_filesize($value, $key = '')
 	{
 		// Determine size var and adjust the value accordingly
-		$size_var = ($value >= 1048576) ? 'mb' : (($value >= 1024) ? 'kb' : 'b');
-		$value = get_formatted_filesize($value, false);
+		$filesize = get_formatted_filesize($value, false, array('mb', 'kb', 'b'));
+		$size_var = $filesize['si_identifier'];
+		$value = $filesize['value'];
 
 		return '<input type="text" id="' . $key . '" size="8" maxlength="15" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>';
 	}
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_ban.php 3.0.6.src/includes/acp/acp_ban.php
--- 3.0.5.src/includes/acp/acp_ban.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_ban.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_ban.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: acp_ban.php 10088 2009-09-02 05:12:23Z terrafrost $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -156,7 +156,8 @@
 					FROM ' . BANLIST_TABLE . '
 					WHERE (ban_end >= ' . time() . "
 							OR ban_end = 0)
-						AND ban_ip <> ''";
+						AND ban_ip <> ''
+					ORDER BY ban_ip";
 			break;
 
 			case 'email':
@@ -168,7 +169,8 @@
 					FROM ' . BANLIST_TABLE . '
 					WHERE (ban_end >= ' . time() . "
 							OR ban_end = 0)
-						AND ban_email <> ''";
+						AND ban_email <> ''
+					ORDER BY ban_email";
 			break;
 		}
 		$result = $db->sql_query($sql);
@@ -181,7 +183,22 @@
 			$banned_options .= '<option' . (($row['ban_exclude']) ? ' class="sep"' : '') . ' value="' . $row['ban_id'] . '">' . $row[$field] . '</option>';
 
 			$time_length = ($row['ban_end']) ? ($row['ban_end'] - $row['ban_start']) / 60 : 0;
-			$ban_length[$row['ban_id']] = (isset($ban_end_text[$time_length])) ? $ban_end_text[$time_length] : $user->lang['UNTIL'] . ' -> ' . $user->format_date($row['ban_end']);
+
+			if ($time_length == 0)
+			{
+				// Banned permanently
+				$ban_length[$row['ban_id']] = $user->lang['PERMANENT'];
+			}
+			else if (isset($ban_end_text[$time_length]))
+			{
+				// Banned for a given duration
+				$ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DURATION'], $ban_end_text[$time_length], $user->format_date($row['ban_end'], false, true));
+			}
+			else
+			{
+				// Banned until given date
+				$ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DATE'], $user->format_date($row['ban_end'], false, true));
+			}
 
 			$ban_reasons[$row['ban_id']] = $row['ban_reason'];
 			$ban_give_reasons[$row['ban_id']] = $row['ban_give_reason'];
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_board.php 3.0.6.src/includes/acp/acp_board.php
--- 3.0.5.src/includes/acp/acp_board.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_board.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_board.php 8911 2008-09-23 13:03:33Z acydburn $
+* @version $Id: acp_board.php 10080 2009-08-31 14:57:04Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -64,6 +64,8 @@
 
 						'legend2'				=> 'WARNINGS',
 						'warnings_expire_days'	=> array('lang' => 'WARNINGS_EXPIRE',		'validate' => 'int',	'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
+
+						'legend3'					=> 'ACP_SUBMIT_CHANGES',
 					)
 				);
 			break;
@@ -79,12 +81,14 @@
 						'allow_namechange'		=> array('lang' => 'ALLOW_NAME_CHANGE',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'allow_attachments'		=> array('lang' => 'ALLOW_ATTACHMENTS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'allow_pm_attach'		=> array('lang' => 'ALLOW_PM_ATTACHMENTS',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
+						'allow_pm_report'		=> array('lang' => 'ALLOW_PM_REPORT',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'allow_bbcode'			=> array('lang' => 'ALLOW_BBCODE',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'allow_smilies'			=> array('lang' => 'ALLOW_SMILIES',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'allow_sig'				=> array('lang' => 'ALLOW_SIG',				'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'allow_nocensors'		=> array('lang' => 'ALLOW_NO_CENSORS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'allow_bookmarks'		=> array('lang' => 'ALLOW_BOOKMARKS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'allow_birthdays'		=> array('lang' => 'ALLOW_BIRTHDAYS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
+						'allow_quick_reply'		=> array('lang' => 'ALLOW_QUICK_REPLY',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 
 						'legend2'				=> 'ACP_LOAD_SETTINGS',
 						'load_birthdays'		=> array('lang' => 'YES_BIRTHDAYS',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
@@ -93,6 +97,8 @@
 						'load_cpf_memberlist'	=> array('lang' => 'LOAD_CPF_MEMBERLIST',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'load_cpf_viewprofile'	=> array('lang' => 'LOAD_CPF_VIEWPROFILE',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'load_cpf_viewtopic'	=> array('lang' => 'LOAD_CPF_VIEWTOPIC',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
+
+						'legend3'					=> 'ACP_SUBMIT_CHANGES',
 					)
 				);
 			break;
@@ -108,9 +114,11 @@
 						'avatar_max_width'		=> array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
 						'avatar_max_height'		=> array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
 
+						'allow_avatar'			=> array('lang' => 'ALLOW_AVATARS',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'allow_avatar_local'	=> array('lang' => 'ALLOW_LOCAL',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'allow_avatar_remote'	=> array('lang' => 'ALLOW_REMOTE',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'allow_avatar_upload'	=> array('lang' => 'ALLOW_UPLOAD',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
+						'allow_avatar_remote_upload'=> array('lang' => 'ALLOW_REMOTE_UPLOAD', 'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'avatar_filesize'		=> array('lang' => 'MAX_FILESIZE',			'validate' => 'int:0',	'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
 						'avatar_min'			=> array('lang' => 'MIN_AVATAR_SIZE',		'validate' => 'int:0',	'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
 						'avatar_max'			=> array('lang' => 'MAX_AVATAR_SIZE',		'validate' => 'int:0',	'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
@@ -143,7 +151,9 @@
 						'forward_pm'			=> array('lang' => 'ALLOW_FORWARD_PM',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'auth_img_pm'			=> array('lang' => 'ALLOW_IMG_PM',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'auth_flash_pm'			=> array('lang' => 'ALLOW_FLASH_PM',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
-						'enable_pm_icons'		=> array('lang' => 'ENABLE_PM_ICONS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false)
+						'enable_pm_icons'		=> array('lang' => 'ENABLE_PM_ICONS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
+
+						'legend3'					=> 'ACP_SUBMIT_CHANGES',
 					)
 				);
 			break;
@@ -162,26 +172,30 @@
 						'allow_nocensors'		=> array('lang' => 'ALLOW_NO_CENSORS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'allow_bookmarks'		=> array('lang' => 'ALLOW_BOOKMARKS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'enable_post_confirm'	=> array('lang' => 'VISUAL_CONFIRM_POST',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
+						'allow_quick_reply'		=> array('lang' => 'ALLOW_QUICK_REPLY',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 
 						'legend2'				=> 'POSTING',
-						'enable_queue_trigger'	=> array('lang' => 'ENABLE_QUEUE_TRIGGER',	'validate' => 'bool',		'type' => 'radio:yes_no', 'explain' => true),
-						'queue_trigger_posts'	=> array('lang' => 'QUEUE_TRIGGER_POSTS',	'validate' => 'int:0:250',	'type' => 'text:4:4', 'explain' => true),
 						'bump_type'				=> false,
 						'edit_time'				=> array('lang' => 'EDIT_TIME',				'validate' => 'int:0',		'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
+						'delete_time'			=> array('lang' => 'DELETE_TIME',			'validate' => 'int:0',		'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
 						'display_last_edited'	=> array('lang' => 'DISPLAY_LAST_EDITED',	'validate' => 'bool',		'type' => 'radio:yes_no', 'explain' => true),
 						'flood_interval'		=> array('lang' => 'FLOOD_INTERVAL',		'validate' => 'int:0',		'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
 						'bump_interval'			=> array('lang' => 'BUMP_INTERVAL',			'validate' => 'int:0',		'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
 						'topics_per_page'		=> array('lang' => 'TOPICS_PER_PAGE',		'validate' => 'int:1',		'type' => 'text:3:4', 'explain' => false),
 						'posts_per_page'		=> array('lang' => 'POSTS_PER_PAGE',		'validate' => 'int:1',		'type' => 'text:3:4', 'explain' => false),
+						'smilies_per_page'		=> array('lang' => 'SMILIES_PER_PAGE',		'validate' => 'int:1',		'type' => 'text:3:4', 'explain' => false),
 						'hot_threshold'			=> array('lang' => 'HOT_THRESHOLD',			'validate' => 'int:0',		'type' => 'text:3:4', 'explain' => true),
 						'max_poll_options'		=> array('lang' => 'MAX_POLL_OPTIONS',		'validate' => 'int:2:127',	'type' => 'text:4:4', 'explain' => false),
 						'max_post_chars'		=> array('lang' => 'CHAR_LIMIT',			'validate' => 'int:0',		'type' => 'text:4:6', 'explain' => true),
+						'min_post_chars'		=> array('lang' => 'MIN_CHAR_LIMIT',		'validate' => 'int:0',		'type' => 'text:4:6', 'explain' => true),
 						'max_post_smilies'		=> array('lang' => 'SMILIES_LIMIT',			'validate' => 'int:0',		'type' => 'text:4:4', 'explain' => true),
 						'max_post_urls'			=> array('lang' => 'MAX_POST_URLS',			'validate' => 'int:0',		'type' => 'text:5:4', 'explain' => true),
 						'max_post_font_size'	=> array('lang' => 'MAX_POST_FONT_SIZE',	'validate' => 'int:0',		'type' => 'text:5:4', 'explain' => true, 'append' => ' %'),
 						'max_quote_depth'		=> array('lang' => 'QUOTE_DEPTH_LIMIT',		'validate' => 'int:0',		'type' => 'text:4:4', 'explain' => true),
 						'max_post_img_width'	=> array('lang' => 'MAX_POST_IMG_WIDTH',	'validate' => 'int:0',		'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
 						'max_post_img_height'	=> array('lang' => 'MAX_POST_IMG_HEIGHT',	'validate' => 'int:0',		'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
+
+						'legend3'					=> 'ACP_SUBMIT_CHANGES',
 					)
 				);
 			break;
@@ -205,6 +219,8 @@
 						'max_sig_smilies'		=> array('lang' => 'MAX_SIG_SMILIES',		'validate' => 'int:0',	'type' => 'text:5:4', 'explain' => true),
 						'max_sig_img_width'		=> array('lang' => 'MAX_SIG_IMG_WIDTH',		'validate' => 'int:0',	'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
 						'max_sig_img_height'	=> array('lang' => 'MAX_SIG_IMG_HEIGHT',	'validate' => 'int:0',	'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
+
+						'legend3'					=> 'ACP_SUBMIT_CHANGES',
 					)
 				);
 			break;
@@ -218,6 +234,8 @@
 						'max_pass_chars'		=> array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,),
 
 						'require_activation'	=> array('lang' => 'ACC_ACTIVATION',	'validate' => 'int',	'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true),
+						'new_member_post_limit'	=> array('lang' => 'NEW_MEMBER_POST_LIMIT', 'validate' => 'int:0:255', 'type' => 'text:4:4', 'explain' => true, 'append' => ' ' . $user->lang['POSTS']),
+						'new_member_group_default'=> array('lang' => 'NEW_MEMBER_GROUP_DEFAULT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
 						'min_name_chars'		=> array('lang' => 'USERNAME_LENGTH',	'validate' => 'int:1',	'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true),
 						'min_pass_chars'		=> array('lang' => 'PASSWORD_LENGTH',	'validate' => 'int:1',	'type' => 'custom', 'method' => 'password_length', 'explain' => true),
 						'allow_name_chars'		=> array('lang' => 'USERNAME_CHARS',	'validate' => 'string',	'type' => 'select', 'method' => 'select_username_chars', 'explain' => true),
@@ -235,6 +253,28 @@
 						'coppa_enable'		=> array('lang' => 'ENABLE_COPPA',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'coppa_mail'		=> array('lang' => 'COPPA_MAIL',		'validate' => 'string',	'type' => 'textarea:5:40', 'explain' => true),
 						'coppa_fax'			=> array('lang' => 'COPPA_FAX',			'validate' => 'string',	'type' => 'text:25:100', 'explain' => false),
+
+						'legend4'			=> 'ACP_SUBMIT_CHANGES',
+					)
+				);
+			break;
+
+			case 'feed':
+				$display_vars = array(
+					'title'	=> 'ACP_FEED_MANAGEMENT',
+					'vars'	=> array(
+						'legend1'					=> 'ACP_FEED_GENERAL',
+						'feed_enable'				=> array('lang' => 'ACP_FEED_ENABLE',				'validate' => 'bool',	'type' => 'radio:enabled_disabled',	'explain' => true ),
+						'feed_item_statistics'		=> array('lang' => 'ACP_FEED_ITEM_STATISTICS',		'validate' => 'bool',	'type' => 'radio:enabled_disabled',	'explain' => true),
+						'feed_limit'				=> array('lang' => 'ACP_FEED_LIMIT',				'validate' => 'int:5',	'type' => 'text:3:4',				'explain' => true),
+						'feed_overall_forums'		=> array('lang'	=> 'ACP_FEED_OVERALL_FORUMS',		'validate' => 'bool',	'type' => 'radio:enabled_disabled',	'explain' => true ),
+						'feed_overall_forums_limit'	=> array('lang' => 'ACP_FEED_OVERALL_FORUMS_LIMIT',	'validate' => 'int:5',	'type' => 'text:3:4',				'explain' => false),
+						'feed_overall_topics'		=> array('lang' => 'ACP_FEED_OVERALL_TOPIC',		'validate' => 'bool',	'type' => 'radio:enabled_disabled',	'explain' => true ),
+						'feed_overall_topics_limit'	=> array('lang' => 'ACP_FEED_OVERALL_TOPIC_LIMIT',	'validate' => 'int:5',	'type' => 'text:3:4',				'explain' => false),
+						'feed_forum'				=> array('lang' => 'ACP_FEED_FORUM',				'validate' => 'bool',	'type' => 'radio:enabled_disabled',	'explain' => true ),
+						'feed_topic'				=> array('lang' => 'ACP_FEED_TOPIC',				'validate' => 'bool',	'type' => 'radio:enabled_disabled',	'explain' => true ),
+						'feed_news_id'				=> array('lang' => 'ACP_FEED_NEWS',					'validate' => 'string',	'type' => 'custom', 'method' => 'select_news_forums', 'explain' => true),
+						'feed_exclude_id'			=> array('lang' => 'ACP_FEED_EXCLUDE_ID',			'validate' => 'string',	'type' => 'custom', 'method' => 'select_exclude_forums', 'explain' => true),
 					)
 				);
 			break;
@@ -279,6 +319,8 @@
 						'load_cpf_memberlist'	=> array('lang' => 'LOAD_CPF_MEMBERLIST',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'load_cpf_viewprofile'	=> array('lang' => 'LOAD_CPF_VIEWPROFILE',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'load_cpf_viewtopic'	=> array('lang' => 'LOAD_CPF_VIEWTOPIC',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
+
+						'legend4'					=> 'ACP_SUBMIT_CHANGES',
 					)
 				);
 			break;
@@ -312,6 +354,8 @@
 						'server_name'			=> array('lang' => 'SERVER_NAME',		'validate' => 'string',			'type' => 'text:40:255', 'explain' => true),
 						'server_port'			=> array('lang' => 'SERVER_PORT',		'validate' => 'int:0',			'type' => 'text:5:5', 'explain' => true),
 						'script_path'			=> array('lang' => 'SCRIPT_PATH',		'validate' => 'script_path',	'type' => 'text::255', 'explain' => true),
+
+						'legend4'					=> 'ACP_SUBMIT_CHANGES',
 					)
 				);
 			break;
@@ -360,7 +404,9 @@
 						'smtp_port'				=> array('lang' => 'SMTP_PORT',				'validate' => 'int:0',	'type' => 'text:4:5', 'explain' => true),
 						'smtp_auth_method'		=> array('lang' => 'SMTP_AUTH_METHOD',		'validate' => 'string',	'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
 						'smtp_username'			=> array('lang' => 'SMTP_USERNAME',			'validate' => 'string',	'type' => 'text:25:255', 'explain' => true),
-						'smtp_password'			=> array('lang' => 'SMTP_PASSWORD',			'validate' => 'string',	'type' => 'password:25:255', 'explain' => true)
+						'smtp_password'			=> array('lang' => 'SMTP_PASSWORD',			'validate' => 'string',	'type' => 'password:25:255', 'explain' => true),
+
+						'legend3'					=> 'ACP_SUBMIT_CHANGES',
 					)
 				);
 			break;
@@ -400,7 +446,7 @@
 				continue;
 			}
 
-			if ($config_name == 'auth_method')
+			if ($config_name == 'auth_method' || $config_name == 'feed_news_id' || $config_name == 'feed_exclude_id')
 			{
 				continue;
 			}
@@ -420,6 +466,13 @@
 			}
 		}
 
+		// Store news and exclude ids
+		if ($mode == 'feed' && $submit)
+		{
+			$this->store_feed_forums(FORUM_OPTION_FEED_NEWS, 'feed_news_id');
+			$this->store_feed_forums(FORUM_OPTION_FEED_EXCLUDE, 'feed_exclude_id');
+		}
+
 		if ($mode == 'auth')
 		{
 			// Retrieve a list of auth plugins and check their config values
@@ -830,6 +883,75 @@
 		return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('" . addslashes($key) . "').value = '" . addslashes($value) . "'; } else { document.getElementById('" . addslashes($key) . "').value = this.value; }\">$dateformat_options</select>
 		<input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />";
 	}
+
+	/**
+	* Select multiple forums
+	*/
+	function select_news_forums($value, $key)
+	{
+		global $user, $config;
+
+		$forum_list = make_forum_select(false, false, true, true, true, false, true);
+
+		// Build forum options
+		$s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
+		foreach ($forum_list as $f_id => $f_row)
+		{
+			$f_row['selected'] = phpbb_optionget(FORUM_OPTION_FEED_NEWS, $f_row['forum_options']);
+
+			$s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
+		}
+		$s_forum_options .= '</select>';
+
+		return $s_forum_options;
+	}
+
+	function select_exclude_forums($value, $key)
+	{
+		global $user, $config;
+
+		$forum_list = make_forum_select(false, false, true, false, false, false, true);
+
+		// Build forum options
+		$s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
+		foreach ($forum_list as $f_id => $f_row)
+		{
+			$f_row['selected'] = phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $f_row['forum_options']);
+
+			$s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
+		}
+		$s_forum_options .= '</select>';
+
+		return $s_forum_options;
+	}
+
+	function store_feed_forums($option, $key)
+	{
+		global $db, $cache;
+
+		// Get key
+		$values = request_var($key, array(0 => 0));
+
+		// Empty option bit for all forums
+		$sql = 'UPDATE ' . FORUMS_TABLE . '
+			SET forum_options = forum_options - ' . (1 << $option) . '
+			WHERE ' . $db->sql_bit_and('forum_options', $option, '<> 0');
+		$db->sql_query($sql);
+
+		// Already emptied for all...
+		if (sizeof($values))
+		{
+			// Set for selected forums
+			$sql = 'UPDATE ' . FORUMS_TABLE . '
+				SET forum_options = forum_options + ' . (1 << $option) . '
+				WHERE ' . $db->sql_in_set('forum_id', $values);
+			$db->sql_query($sql);
+		}
+
+		// Empty sql cache for forums table because options changed
+		$cache->destroy('sql', FORUMS_TABLE);
+	}
+
 }
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_captcha.php 3.0.6.src/includes/acp/acp_captcha.php
--- 3.0.5.src/includes/acp/acp_captcha.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_captcha.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_captcha.php 9475 2009-04-18 18:43:31Z acydburn $
+* @version $Id: acp_captcha.php 10177 2009-09-22 10:03:17Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 */
@@ -28,108 +28,120 @@
 		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
 
 		$user->add_lang('acp/board');
-		$captcha_vars = array(
-			'captcha_gd_x_grid'				=> 'CAPTCHA_GD_X_GRID',
-			'captcha_gd_y_grid'				=> 'CAPTCHA_GD_Y_GRID',
-			'captcha_gd_foreground_noise'	=> 'CAPTCHA_GD_FOREGROUND_NOISE',
-			'captcha_gd'					=> 'CAPTCHA_GD_PREVIEWED',
-			'captcha_gd_wave'				=> 'CAPTCHA_GD_WAVE',
-			'captcha_gd_3d_noise'			=> 'CAPTCHA_GD_3D_NOISE',
-			'captcha_gd_fonts'				=> 'CAPTCHA_GD_FONTS',
 
-		);
+		include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
+		$captchas = phpbb_captcha_factory::get_captcha_types();
 
-		if (isset($_GET['demo']))
-		{
-			$captcha_vars = array_keys($captcha_vars);
-
-			foreach ($captcha_vars as $captcha_var)
-			{
-				$config[$captcha_var] = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
-			}
+		$selected = request_var('select_captcha', $config['captcha_plugin']);
+		$selected = (isset($captchas['available'][$selected]) || isset($captchas['unavailable'][$selected])) ? $selected : $config['captcha_plugin'];
+		$configure = request_var('configure', false);
 
-			if ($config['captcha_gd'])
-			{
-				include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
-			}
-			else
-			{
-				include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
-			}
 
-			$captcha = new captcha();
-			$captcha->execute(gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)), time());
-			exit;
+		// Oh, they are just here for the view
+		if (isset($_GET['captcha_demo']))
+		{
+			$this->deliver_demo($selected);
 		}
 
-		$config_vars = array(
-			'enable_confirm'		=> 'REG_ENABLE',
-			'enable_post_confirm'	=> 'POST_ENABLE',
-			'confirm_refresh'		=> 'CONFIRM_REFRESH',
-			'captcha_gd'			=> 'CAPTCHA_GD',
-		);
-
-		$this->tpl_name = 'acp_captcha';
-		$this->page_title = 'ACP_VC_SETTINGS';
-		$form_key = 'acp_captcha';
-		add_form_key($form_key);
+		// Delegate
+		if ($configure)
+		{
+			$config_captcha =& phpbb_captcha_factory::get_instance($selected);
+			$config_captcha->acp_page($id, $this);
+		}
+		else
+		{
+			$config_vars = array(
+				'enable_confirm'		=> array('tpl' => 'REG_ENABLE', 'default' => false),
+				'enable_post_confirm'	=> array('tpl' => 'POST_ENABLE', 'default' => false),
+				'confirm_refresh'		=> array('tpl' => 'CONFIRM_REFRESH', 'default' => false),
+				'max_reg_attempts'		=> array('tpl' => 'REG_LIMIT', 'default' => 0),
+			);
+
+			$this->tpl_name = 'acp_captcha';
+			$this->page_title = 'ACP_VC_SETTINGS';
+			$form_key = 'acp_captcha';
+			add_form_key($form_key);
 
-		$submit = request_var('submit', '');
+			$submit = request_var('main_submit', false);
 
-		if ($submit && check_form_key($form_key))
-		{
-			$config_vars = array_keys($config_vars);
+			if ($submit && check_form_key($form_key))
+			{
+				foreach ($config_vars as $config_var => $options)
+				{
+					set_config($config_var, request_var($config_var, $options['default']));
+				}
 
-			foreach ($config_vars as $config_var)
+				if ($selected !== $config['captcha_plugin'])
+				{
+					// sanity check
+					if (isset($captchas['available'][$selected]))
+					{
+						$old_captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+						$old_captcha->uninstall();
+
+						set_config('captcha_plugin', $selected);
+						$new_captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+						$new_captcha->install();
+
+						add_log('admin', 'LOG_CONFIG_VISUAL');
+					}
+					else
+					{
+						trigger_error($user->lang['CAPTCHA_UNAVAILABLE'] . adm_back_link($this->u_action));
+					}
+				}
+				trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
+			}
+			else if ($submit)
 			{
-				set_config($config_var, request_var($config_var, ''));
+				trigger_error($user->lang['FORM_INVALID'] . adm_back_link());
 			}
-
-			$captcha_vars = array_keys($captcha_vars);
-
-			foreach ($captcha_vars as $captcha_var)
+			else
 			{
-				$value = request_var($captcha_var, 0);
-				if ($value >= 0)
+				$captcha_select = '';
+				foreach ($captchas['available'] as $value => $title)
 				{
-					set_config($captcha_var, $value);
+					$current = ($selected !== false && $value == $selected) ? ' selected="selected"' : '';
+					$captcha_select .= '<option value="' . $value . '"' . $current . '>' . $user->lang[$title] . '</option>';
 				}
-			}
 
-			add_log('admin', 'LOG_CONFIG_VISUAL');
-			trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
-		}
-		else if ($submit)
-		{
-			trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action));
-		}
-		else
-		{
-			$preview_image_src = append_sid(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;demo=demo"));
+				foreach ($captchas['unavailable'] as $value => $title)
+				{
+					$current = ($selected !== false && $value == $selected) ? ' selected="selected"' : '';
+					$captcha_select .= '<option value="' . $value . '"' . $current . ' class="disabled-option">' . $user->lang[$title] . '</option>';
+				}
 
-			if (@extension_loaded('gd'))
-			{
-				$template->assign_var('GD', true);
-			}
+				$demo_captcha =& phpbb_captcha_factory::get_instance($selected);
 
-			foreach ($config_vars as $config_var => $template_var)
-			{
-				$template->assign_var($template_var, (isset($_REQUEST[$config_var])) ? request_var($config_var, '') : $config[$config_var]) ;
-			}
+				foreach ($config_vars as $config_var => $options)
+				{
+					$template->assign_var($options['tpl'], (isset($_POST[$config_var])) ? request_var($config_var, $options['default']) : $config[$config_var]) ;
+				}
 
-			foreach ($captcha_vars as $captcha_var => $template_var)
-			{
-				$var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
-				$template->assign_var($template_var, $var);
-				$preview_image_src .= "&amp;$captcha_var=" . $var;
+				$template->assign_vars(array(
+					'CAPTCHA_PREVIEW_TPL'	=> $demo_captcha->get_demo_template($id),
+					'S_CAPTCHA_HAS_CONFIG'	=> $demo_captcha->has_config(),
+					'CAPTCHA_SELECT'		=> $captcha_select,
+				));
 			}
-
-			$template->assign_vars(array(
-				'CAPTCHA_PREVIEW'	=> $preview_image_src,
-				'PREVIEW'			=> isset($_POST['preview']),
-			));
 		}
 	}
+
+	/**
+	* Entry point for delivering image CAPTCHAs in the ACP.
+	*/
+	function deliver_demo($selected)
+	{
+		global $db, $user, $config;
+
+		$captcha =& phpbb_captcha_factory::get_instance($selected);
+		$captcha->init(CONFIRM_REG);
+		$captcha->execute_demo();
+
+		garbage_collection();
+		exit_handler();
+	}
 }
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_database.php 3.0.6.src/includes/acp/acp_database.php
--- 3.0.5.src/includes/acp/acp_database.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_database.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_database.php 9417 2009-03-30 13:52:58Z acydburn $
+* @version $Id: acp_database.php 10174 2009-09-21 17:59:39Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -142,7 +142,7 @@
 									break;
 
 									case 'oracle':
-										$extractor->flush('TRUNCATE TABLE ' . $table_name . "\\\n");
+										$extractor->flush('TRUNCATE TABLE ' . $table_name . "/\n");
 									break;
 
 									default:
@@ -548,7 +548,7 @@
 
 			if (!$this->fp)
 			{
-				trigger_error('Unable to write temporary file to storage folder', E_USER_ERROR);
+				trigger_error('FILE_WRITE_FAIL', E_USER_ERROR);
 			}
 		}
 	}
@@ -1157,16 +1157,17 @@
 					AND (c.oid = d.adrelid)
 					AND d.adnum = " . $row['attnum'];
 			$def_res = $db->sql_query($sql_get_default);
+			$def_row = $db->sql_fetchrow($def_res);
+			$db->sql_freeresult($def_res);
 
-			if (!$def_res)
+			if (empty($def_row))
 			{
 				unset($row['rowdefault']);
 			}
 			else
 			{
-				$row['rowdefault'] = $db->sql_fetchfield('rowdefault', false, $def_res);
+				$row['rowdefault'] = $def_row['rowdefault'];
 			}
-			$db->sql_freeresult($def_res);
 
 			if ($row['type'] == 'bpchar')
 			{
@@ -1715,8 +1716,7 @@
 	{
 		global $db;
 		$sql_data = '-- Table: ' . $table_name . "\n";
-		$sql_data .= "DROP TABLE $table_name;\n";
-		$sql_data .= '\\' . "\n";
+		$sql_data .= "DROP TABLE $table_name\n/\n";
 		$sql_data .= "\nCREATE TABLE $table_name (\n";
 
 		$sql = "SELECT COLUMN_NAME, DATA_TYPE, DATA_PRECISION, DATA_LENGTH, NULLABLE, DATA_DEFAULT
@@ -1731,7 +1731,7 @@
 
 			if ($row['data_type'] !== 'CLOB')
 			{
-				if ($row['data_type'] !== 'VARCHAR2')
+				if ($row['data_type'] !== 'VARCHAR2' && $row['data_type'] !== 'CHAR')
 				{
 					$line .= '(' . $row['data_precision'] . ')';
 				}
@@ -1761,12 +1761,20 @@
 				AND A.TABLE_NAME = '{$table_name}'";
 		$result = $db->sql_query($sql);
 
+		$primary_key = array();
+		$contraint_name = '';
 		while ($row = $db->sql_fetchrow($result))
 		{
-			$rows[] = "  CONSTRAINT {$row['constraint_name']} PRIMARY KEY ({$row['column_name']})";
+			$constraint_name = '"' . $row['constraint_name'] . '"';
+			$primary_key[] = '"' . $row['column_name'] . '"';
 		}
 		$db->sql_freeresult($result);
 
+		if (sizeof($primary_key))
+		{
+			$rows[] = "  CONSTRAINT {$constraint_name} PRIMARY KEY (" . implode(', ', $primary_key) . ')';
+		}
+
 		$sql = "SELECT A.CONSTRAINT_NAME, A.COLUMN_NAME
 			FROM USER_CONS_COLUMNS A, USER_CONSTRAINTS B
 			WHERE A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
@@ -1774,24 +1782,44 @@
 				AND A.TABLE_NAME = '{$table_name}'";
 		$result = $db->sql_query($sql);
 
+		$unique = array();
+		$contraint_name = '';
 		while ($row = $db->sql_fetchrow($result))
 		{
-			$rows[] = "  CONSTRAINT {$row['constraint_name']} UNIQUE ({$row['column_name']})";
+			$constraint_name = '"' . $row['constraint_name'] . '"';
+			$unique[] = '"' . $row['column_name'] . '"';
 		}
 		$db->sql_freeresult($result);
 
+		if (sizeof($unique))
+		{
+			$rows[] = "  CONSTRAINT {$constraint_name} UNIQUE (" . implode(', ', $unique) . ')';
+		}
+
 		$sql_data .= implode(",\n", $rows);
-		$sql_data .= "\n)\n\\";
+		$sql_data .= "\n)\n/\n";
 
-		$sql = "SELECT A.REFERENCED_NAME
-			FROM USER_DEPENDENCIES A, USER_TRIGGERS B
+		$sql = "SELECT A.REFERENCED_NAME, C.*
+			FROM USER_DEPENDENCIES A, USER_TRIGGERS B, USER_SEQUENCES C
 			WHERE A.REFERENCED_TYPE = 'SEQUENCE'
 				AND A.NAME = B.TRIGGER_NAME
-				AND B. TABLE_NAME = '{$table_name}'";
+				AND B.TABLE_NAME = '{$table_name}'
+				AND C.SEQUENCE_NAME = A.REFERENCED_NAME";
 		$result = $db->sql_query($sql);
+
+		$type = request_var('type', '');
+
 		while ($row = $db->sql_fetchrow($result))
 		{
-			$sql_data .= "\nCREATE SEQUENCE {$row['referenced_name']}\\\n";
+			$sql_data .= "\nDROP SEQUENCE \"{$row['referenced_name']}\"\n/\n";
+			$sql_data .= "\nCREATE SEQUENCE \"{$row['referenced_name']}\"";
+
+			if ($type == 'full')
+			{
+				$sql_data .= ' START WITH ' . $row['last_number'];
+			}
+
+			$sql_data .= "\n/\n";
 		}
 		$db->sql_freeresult($result);
 
@@ -1801,7 +1829,7 @@
 		$result = $db->sql_query($sql);
 		while ($row = $db->sql_fetchrow($result))
 		{
-			$sql_data .= "\nCREATE OR REPLACE TRIGGER {$row['description']}WHEN ({$row['when_clause']})\n{$row['trigger_body']}\\";
+			$sql_data .= "\nCREATE OR REPLACE TRIGGER {$row['description']}WHEN ({$row['when_clause']})\n{$row['trigger_body']}\n/\n";
 		}
 		$db->sql_freeresult($result);
 
@@ -1821,7 +1849,7 @@
 
 		foreach ($index as $index_name => $column_names)
 		{
-			$sql_data .= "\nCREATE INDEX $index_name ON $table_name(" . implode(', ', $column_names) . ")\n\\";
+			$sql_data .= "\nCREATE INDEX $index_name ON $table_name(" . implode(', ', $column_names) . ")\n/\n";
 		}
 		$db->sql_freeresult($result);
 		$this->flush($sql_data);
@@ -1854,9 +1882,10 @@
 			// Build the SQL statement to recreate the data.
 			for ($i = 0; $i < $i_num_fields; $i++)
 			{
-				$str_val = $row[$ary_name[$i]];
+				// Oracle uses uppercase - we use lowercase
+				$str_val = $row[strtolower($ary_name[$i])];
 
-				if (preg_match('#char|text|bool|raw#i', $ary_type[$i]))
+				if (preg_match('#char|text|bool|raw|clob#i', $ary_type[$i]))
 				{
 					$str_quote = '';
 					$str_empty = "''";
@@ -1885,12 +1914,12 @@
 				}
 
 				$schema_vals[$i] = $str_quote . $str_val . $str_quote;
-				$schema_fields[$i] = '"' . $ary_name[$i] . "'";
+				$schema_fields[$i] = '"' . $ary_name[$i] . '"';
 			}
 
 			// Take the ordered fields and their associated data and build it
 			// into a valid sql statement to recreate that field in the data.
-			$sql_data = "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\n";
+			$sql_data = "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ")\n/\n";
 
 			$this->flush($sql_data);
 		}
@@ -2209,8 +2238,10 @@
 
 function sanitize_data_oracle($text)
 {
-	$data = preg_split('/[\0\n\t\r\b\f\'"\\\]/', $text);
-	preg_match_all('/[\0\n\t\r\b\f\'"\\\]/', $text, $matches);
+//	$data = preg_split('/[\0\n\t\r\b\f\'"\/\\\]/', $text);
+//	preg_match_all('/[\0\n\t\r\b\f\'"\/\\\]/', $text, $matches);
+	$data = preg_split('/[\0\b\f\'\/]/', $text);
+	preg_match_all('/[\0\r\b\f\'\/]/', $text, $matches);
 
 	$val = array();
 
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_forums.php 3.0.6.src/includes/acp/acp_forums.php
--- 3.0.5.src/includes/acp/acp_forums.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_forums.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_forums.php 9344 2009-02-27 16:29:29Z toonarmy $
+* @version $Id: acp_forums.php 10258 2009-11-08 11:17:32Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -139,6 +139,7 @@
 						'enable_icons'			=> request_var('enable_icons', false),
 						'enable_prune'			=> request_var('enable_prune', false),
 						'enable_post_review'	=> request_var('enable_post_review', true),
+						'enable_quick_reply'	=> request_var('enable_quick_reply', false),
 						'prune_days'			=> request_var('prune_days', 7),
 						'prune_viewed'			=> request_var('prune_viewed', 7),
 						'prune_freq'			=> request_var('prune_freq', 1),
@@ -150,6 +151,12 @@
 						'forum_password_unset'	=> request_var('forum_password_unset', false),
 					);
 
+					// On add, add empty forum_options... else do not consider it (not updating it)
+					if ($action == 'add')
+					{
+						$forum_data['forum_options'] = 0;
+					}
+
 					// Use link_display_on_index setting if forum type is link
 					if ($forum_data['forum_type'] == FORUM_LINK)
 					{
@@ -162,7 +169,7 @@
 						$forum_data['forum_status'] = ITEM_UNLOCKED;
 					}
 
-					$forum_data['show_active'] = ($forum_data['forum_type'] == FORUM_POST) ? request_var('display_recent', false) : request_var('display_active', false);
+					$forum_data['show_active'] = ($forum_data['forum_type'] == FORUM_POST) ? request_var('display_recent', true) : request_var('display_active', true);
 
 					// Get data for forum rules if specified...
 					if ($forum_data['forum_rules'])
@@ -181,73 +188,23 @@
 					if (!sizeof($errors))
 					{
 						$forum_perm_from = request_var('forum_perm_from', 0);
+						$cache->destroy('sql', FORUMS_TABLE);
 
 						// Copy permissions?
-						if (!empty($forum_perm_from) && $forum_perm_from != $forum_data['forum_id'] &&
-							(($action != 'edit') || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))))
+						if ($forum_perm_from && $forum_perm_from != $forum_data['forum_id'] &&
+							($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))))
 						{
-							// if we edit a forum delete current permissions first
-							if ($action == 'edit')
-							{
-								$sql = 'DELETE FROM ' . ACL_USERS_TABLE . '
-									WHERE forum_id = ' . (int) $forum_data['forum_id'];
-								$db->sql_query($sql);
-
-								$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
-									WHERE forum_id = ' . (int) $forum_data['forum_id'];
-								$db->sql_query($sql);
-							}
-
-							// From the mysql documentation:
-							// Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
-							// Due to this we stay on the safe side if we do the insertion "the manual way"
-
-							// Copy permisisons from/to the acl users table (only forum_id gets changed)
-							$sql = 'SELECT user_id, auth_option_id, auth_role_id, auth_setting
-								FROM ' . ACL_USERS_TABLE . '
-								WHERE forum_id = ' . $forum_perm_from;
-							$result = $db->sql_query($sql);
-
-							$users_sql_ary = array();
-							while ($row = $db->sql_fetchrow($result))
-							{
-								$users_sql_ary[] = array(
-									'user_id'			=> (int) $row['user_id'],
-									'forum_id'			=> (int) $forum_data['forum_id'],
-									'auth_option_id'	=> (int) $row['auth_option_id'],
-									'auth_role_id'		=> (int) $row['auth_role_id'],
-									'auth_setting'		=> (int) $row['auth_setting']
-								);
-							}
-							$db->sql_freeresult($result);
-
-							// Copy permisisons from/to the acl groups table (only forum_id gets changed)
-							$sql = 'SELECT group_id, auth_option_id, auth_role_id, auth_setting
-								FROM ' . ACL_GROUPS_TABLE . '
-								WHERE forum_id = ' . $forum_perm_from;
-							$result = $db->sql_query($sql);
-
-							$groups_sql_ary = array();
-							while ($row = $db->sql_fetchrow($result))
-							{
-								$groups_sql_ary[] = array(
-									'group_id'			=> (int) $row['group_id'],
-									'forum_id'			=> (int) $forum_data['forum_id'],
-									'auth_option_id'	=> (int) $row['auth_option_id'],
-									'auth_role_id'		=> (int) $row['auth_role_id'],
-									'auth_setting'		=> (int) $row['auth_setting']
-								);
-							}
-							$db->sql_freeresult($result);
-
-							// Now insert the data
-							$db->sql_multi_insert(ACL_USERS_TABLE, $users_sql_ary);
-							$db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary);
+							copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], ($action == 'edit') ? true : false);
 							cache_moderators();
 						}
-
+/* Commented out because of questionable UI workflow - re-visit for 3.0.7
+						else if (!$this->parent_id && $action != 'edit' && $auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))
+						{
+							$this->copy_permission_page($forum_data);
+							return;
+						}
+*/
 						$auth->acl_clear_prefetch();
-						$cache->destroy('sql', FORUMS_TABLE);
 
 						$acl_url = '&amp;mode=setting_forum_local&amp;forum_id[]=' . $forum_data['forum_id'];
 
@@ -423,6 +380,7 @@
 					$forum_data['forum_flags'] += (request_var('prune_sticky', false)) ? FORUM_FLAG_PRUNE_STICKY : 0;
 					$forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0;
 					$forum_data['forum_flags'] += (request_var('enable_post_review', true)) ? FORUM_FLAG_POST_REVIEW : 0;
+					$forum_data['forum_flags'] += (request_var('enable_quick_reply', false)) ? FORUM_FLAG_QUICK_REPLY : 0;
 				}
 
 				// Show form to create/modify a forum
@@ -484,7 +442,8 @@
 							'prune_days'			=> 7,
 							'prune_viewed'			=> 7,
 							'prune_freq'			=> 1,
-							'forum_flags'			=> FORUM_FLAG_POST_REVIEW,
+							'forum_flags'			=> FORUM_FLAG_POST_REVIEW + FORUM_FLAG_ACTIVE_TOPICS,
+							'forum_options'			=> 0,
 							'forum_password'		=> '',
 							'forum_password_confirm'=> '',
 						);
@@ -682,6 +641,7 @@
 					'S_PRUNE_STICKY'			=> ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_STICKY) ? true : false,
 					'S_DISPLAY_ACTIVE_TOPICS'	=> ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) ? true : false,
 					'S_ENABLE_POST_REVIEW'		=> ($forum_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) ? true : false,
+					'S_ENABLE_QUICK_REPLY'		=> ($forum_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) ? true : false,
 					'S_CAN_COPY_PERMISSIONS'	=> ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))) ? true : false,
 				));
 
@@ -740,6 +700,32 @@
 
 				return;
 			break;
+
+			case 'copy_perm':
+				$forum_perm_from = request_var('forum_perm_from', 0);
+
+				// Copy permissions?
+				if (!empty($forum_perm_from) && $forum_perm_from != $forum_id)
+				{
+					copy_forum_permissions($forum_perm_from, $forum_id, true);
+					cache_moderators();
+					$auth->acl_clear_prefetch();
+					$cache->destroy('sql', FORUMS_TABLE);
+
+					$acl_url = '&amp;mode=setting_forum_local&amp;forum_id[]=' . $forum_id;
+
+					$message = $user->lang['FORUM_UPDATED'];
+
+					// Redirect to permissions
+					if ($auth->acl_get('a_fauth'))
+					{
+						$message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
+					}
+
+					trigger_error($message . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
+				}
+
+			break;
 		}
 
 		// Default management page
@@ -920,7 +906,7 @@
 			array('lang' => 'FORUM_TOPICS_PAGE', 'value' => $forum_data['forum_topics_per_page'], 'column_type' => 'TINT:0'),
 		);
 
-		if (!file_exists($phpbb_root_path . $forum_data['forum_image']))
+		if (!empty($forum_data['forum_image']) && !file_exists($phpbb_root_path . $forum_data['forum_image']))
 		{
 			$errors[] = $user->lang['FORUM_IMAGE_NO_EXIST'];
 		}
@@ -941,6 +927,7 @@
 		$forum_data['forum_flags'] += ($forum_data['prune_sticky']) ? FORUM_FLAG_PRUNE_STICKY : 0;
 		$forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0;
 		$forum_data['forum_flags'] += ($forum_data['enable_post_review']) ? FORUM_FLAG_POST_REVIEW : 0;
+		$forum_data['forum_flags'] += ($forum_data['enable_quick_reply']) ? FORUM_FLAG_QUICK_REPLY : 0;
 
 		// Unset data that are not database fields
 		$forum_data_sql = $forum_data;
@@ -951,6 +938,7 @@
 		unset($forum_data_sql['prune_sticky']);
 		unset($forum_data_sql['show_active']);
 		unset($forum_data_sql['enable_post_review']);
+		unset($forum_data_sql['enable_quick_reply']);
 		unset($forum_data_sql['forum_password_confirm']);
 
 		// What are we going to do tonight Brain? The same thing we do everynight,
@@ -1927,6 +1915,31 @@
 
 		adm_page_footer();
 	}
+
+	/**
+	* Display copy permission page
+	* Not used at the moment - we will have a look at it for 3.0.7
+	*/
+	function copy_permission_page($forum_data)
+	{
+		global $phpEx, $phpbb_admin_path, $template, $user;
+
+		$acl_url = '&amp;mode=setting_forum_local&amp;forum_id[]=' . $forum_data['forum_id'];
+		$action = append_sid($this->u_action . "&amp;parent_id={$this->parent_id}&amp;f={$forum_data['forum_id']}&amp;action=copy_perm");
+
+		$l_acl = sprintf($user->lang['COPY_TO_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
+
+		$this->tpl_name = 'acp_forums_copy_perm';
+
+		$template->assign_vars(array(
+			'U_ACL'				=> append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url),
+			'L_ACL_LINK'		=> $l_acl,
+			'L_BACK_LINK'		=> adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id),
+			'S_COPY_ACTION'		=> $action,
+			'S_FORUM_OPTIONS'	=> make_forum_select($forum_data['parent_id'], $forum_data['forum_id'], false, false, false),
+		));
+	}
+
 }
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_groups.php 3.0.6.src/includes/acp/acp_groups.php
--- 3.0.5.src/includes/acp/acp_groups.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_groups.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_groups.php 9053 2008-11-09 15:10:40Z acydburn $
+* @version $Id: acp_groups.php 9625 2009-06-19 09:51:50Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -309,6 +309,7 @@
 						'message_limit'		=> request_var('group_message_limit', 0),
 						'max_recipients'	=> request_var('group_max_recipients', 0),
 						'founder_manage'	=> 0,
+						'skip_auth'			=> request_var('group_skip_auth', 0),
 					);
 
 					if ($user->data['user_type'] == USER_FOUNDER)
@@ -400,11 +401,26 @@
 						// were made.
 
 						$group_attributes = array();
-						$test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients', 'founder_manage');
-						foreach ($test_variables as $test)
+						$test_variables = array(
+							'rank'			=> 'int',
+							'colour'		=> 'string',
+							'avatar'		=> 'string',
+							'avatar_type'	=> 'int',
+							'avatar_width'	=> 'int',
+							'avatar_height'	=> 'int',
+							'receive_pm'	=> 'int',
+							'legend'		=> 'int',
+							'message_limit'	=> 'int',
+							'max_recipients'=> 'int',
+							'founder_manage'=> 'int',
+							'skip_auth'		=> 'int',
+						);
+
+						foreach ($test_variables as $test => $type)
 						{
 							if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
 							{
+								settype($submit_ary[$test], $type);
 								$group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test];
 							}
 						}
@@ -562,7 +578,7 @@
 					'GROUP_MESSAGE_LIMIT'	=> (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
 					'GROUP_MAX_RECIPIENTS'	=> (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
 					'GROUP_COLOUR'			=> (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
-
+					'GROUP_SKIP_AUTH'		=> (!empty($group_row['group_skip_auth'])) ? ' checked="checked"' : '',
 
 					'S_DESC_BBCODE_CHECKED'	=> $group_desc_data['allow_bbcode'],
 					'S_DESC_URLS_CHECKED'	=> $group_desc_data['allow_urls'],
@@ -591,8 +607,7 @@
 					'U_SWATCH'			=> append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&amp;name=group_colour'),
 					'U_ACTION'			=> "{$this->u_action}&amp;action=$action&amp;g=$group_id",
 					'L_AVATAR_EXPLAIN'	=> sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),
-					)
-				);
+				));
 
 				return;
 			break;
@@ -607,7 +622,7 @@
 				$this->page_title = 'GROUP_MEMBERS';
 
 				// Grab the leaders - always, on every page...
-				$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
+				$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_colour, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
 					FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug
 					WHERE ug.group_id = $group_id
 						AND u.user_id = ug.user_id
@@ -621,11 +636,12 @@
 						'U_USER_EDIT'		=> append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;action=edit&amp;u={$row['user_id']}"),
 
 						'USERNAME'			=> $row['username'],
+						'USERNAME_COLOUR'	=> $row['user_colour'],
 						'S_GROUP_DEFAULT'	=> ($row['group_id'] == $group_id) ? true : false,
 						'JOINED'			=> ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ',
 						'USER_POSTS'		=> $row['user_posts'],
-						'USER_ID'			=> $row['user_id'])
-					);
+						'USER_ID'			=> $row['user_id'],
+					));
 				}
 				$db->sql_freeresult($result);
 
@@ -662,7 +678,7 @@
 				));
 
 				// Grab the members
-				$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
+				$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_colour, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
 					FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug
 					WHERE ug.group_id = $group_id
 						AND u.user_id = ug.user_id
@@ -687,6 +703,7 @@
 						'U_USER_EDIT'		=> append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;action=edit&amp;u={$row['user_id']}"),
 
 						'USERNAME'			=> $row['username'],
+						'USERNAME_COLOUR'	=> $row['user_colour'],
 						'S_GROUP_DEFAULT'	=> ($row['group_id'] == $group_id) ? true : false,
 						'JOINED'			=> ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ',
 						'USER_POSTS'		=> $row['user_posts'],
@@ -763,8 +780,7 @@
 
 					'GROUP_NAME'	=> $group_name,
 					'TOTAL_MEMBERS'	=> $row['total_members'],
-					)
-				);
+				));
 			}
 		}
 	}
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_icons.php 3.0.6.src/includes/acp/acp_icons.php
--- 3.0.5.src/includes/acp/acp_icons.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_icons.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_icons.php 8974 2008-10-06 13:23:41Z acydburn $
+* @version $Id: acp_icons.php 10234 2009-10-26 13:59:02Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -89,6 +89,21 @@
 						continue;
 					}
 
+					// adjust the width and height to be lower than 128px while perserving the aspect ratio (for icons)
+					if ($mode == 'icons')
+					{
+						if ($img_size[0] > 127 && $img_size[0] > $img_size[1])
+						{
+							$img_size[1] = (int) ($img_size[1] * (127 / $img_size[0]));
+							$img_size[0] = 127;
+						}
+						else if ($img_size[1] > 127)
+						{
+							$img_size[0] = (int) ($img_size[0] * (127 / $img_size[1]));
+							$img_size[1] = 127;
+						}
+					}
+
 					$_images[$path . $img]['file'] = $path . $img;
 					$_images[$path . $img]['width'] = $img_size[0];
 					$_images[$path . $img]['height'] = $img_size[1];
@@ -168,19 +183,19 @@
 						}
 					}
 				}
-				
+
 				$sql = "SELECT *
 					FROM $table
 					ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC');
 				$result = $db->sql_query($sql);
-				
+
 				$data = array();
 				$after = false;
 				$display = 0;
 				$order_lists = array('', '');
 				$add_order_lists = array('', '');
 				$display_count = 0;
-				
+
 				while ($row = $db->sql_fetchrow($result))
 				{
 					if ($action == 'add')
@@ -231,15 +246,15 @@
 					$data = $_images;
 				}
 
-				$colspan = (($mode == 'smilies') ? '7' : '5');
+				$colspan = (($mode == 'smilies') ? 7 : 5);
 				$colspan += ($icon_id) ? 1 : 0;
 				$colspan += ($action == 'add') ? 2 : 0;
-				
+
 				$template->assign_vars(array(
 					'S_EDIT'		=> true,
 					'S_SMILIES'		=> ($mode == 'smilies') ? true : false,
 					'S_ADD'			=> ($action == 'add') ? true : false,
-					
+
 					'S_ORDER_LIST_DISPLAY'		=> $order_list . $order_lists[1],
 					'S_ORDER_LIST_UNDISPLAY'	=> $order_list . $order_lists[0],
 					'S_ORDER_LIST_DISPLAY_COUNT'	=> $display_count + 1,
@@ -286,10 +301,10 @@
 						'S_ADD_CODE'		=> true,
 
 						'S_IMG_OPTIONS'		=> $smiley_options,
-						
+
 						'S_ADD_ORDER_LIST_DISPLAY'		=> $add_order_list . $add_order_lists[1],
 						'S_ADD_ORDER_LIST_UNDISPLAY'	=> $add_order_list . $add_order_lists[0],
-						
+
 						'IMG_SRC'			=> $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'],
 						'IMG_PATH'			=> $img_path,
 						'PHPBB_ROOT_PATH'	=> $phpbb_root_path,
@@ -303,7 +318,7 @@
 				}
 
 				return;
-	
+
 			break;
 
 			case 'create':
@@ -311,7 +326,7 @@
 
 				// Get items to create/modify
 				$images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array();
-				
+
 				// Now really get the items
 				$image_id		= (isset($_POST['id'])) ? request_var('id', array('' => 0)) : array();
 				$image_order	= (isset($_POST['order'])) ? request_var('order', array('' => 0)) : array();
@@ -348,6 +363,25 @@
 					}
 				}
 
+				if ($mode == 'smilies' && $action == 'create')
+				{
+					$smiley_count = $this->item_count($table);
+
+					$addable_smileys_count = sizeof($images);
+					foreach ($images as $image)
+					{
+						if (!isset($image_add[$image]))
+						{
+							--$addable_smileys_count;
+						}
+					}
+
+					if ($smiley_count + $addable_smileys_count > SMILEY_LIMIT)
+					{
+						trigger_error(sprintf($user->lang['TOO_MANY_SMILIES'], SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING);
+					}
+				}
+
 				$icons_updated = 0;
 				$errors = array();
 				foreach ($images as $image)
@@ -369,6 +403,21 @@
 							$image_height[$image] = $img_size[1];
 						}
 
+						// Adjust image width/height for icons
+						if ($mode == 'icons')
+						{
+							if ($image_width[$image] > 127 && $image_width[$image] > $image_height[$image])
+							{
+								$image_height[$image] = (int) ($image_height[$image] * (127 / $image_width[$image]));
+								$image_width[$image] = 127;
+							}
+							else if ($image_height[$image] > 127)
+							{
+								$image_width[$image] = (int) ($image_width[$image] * (127 / $image_height[$image]));
+								$image_height[$image] = 127;
+							}
+						}
+
 						$img_sql = array(
 							$fields . '_url'		=> $image,
 							$fields . '_width'		=> $image_width[$image],
@@ -426,13 +475,13 @@
 							$db->sql_query($sql);
 							$icons_updated++;
 						}
-						
+
  					}
 				}
-				
+
 				$cache->destroy('_icons');
 				$cache->destroy('sql', $table);
-				
+
 				$level = E_USER_NOTICE;
 				switch ($icons_updated)
 				{
@@ -440,11 +489,11 @@
 						$suc_lang = "{$lang}_NONE";
 						$level = E_USER_WARNING;
 						break;
-						
+
 					case 1:
 						$suc_lang = "{$lang}_ONE";
 						break;
-						
+
 					default:
 						$suc_lang = $lang;
 				}
@@ -495,7 +544,6 @@
 						}
 					}
 
-
 					// The user has already selected a smilies_pak file
 					if ($current == 'delete')
 					{
@@ -541,6 +589,15 @@
 						$db->sql_freeresult($result);
 					}
 
+					if ($mode == 'smilies')
+					{
+						$smiley_count = $this->item_count($table);
+						if ($smiley_count + sizeof($pak_ary) > SMILEY_LIMIT)
+						{
+							trigger_error(sprintf($user->lang['TOO_MANY_SMILIES'], SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING);
+						}
+					}
+
 					foreach ($pak_ary as $pak_entry)
 					{
 						$data = array();
@@ -835,11 +892,14 @@
 		);
 
 		$spacer = false;
+		$pagination_start = request_var('start', 0);
+
+		$item_count = $this->item_count($table);
 
 		$sql = "SELECT *
 			FROM $table
 			ORDER BY {$fields}_order ASC";
-		$result = $db->sql_query($sql);
+		$result = $db->sql_query_limit($sql, $config['smilies_per_page'], $pagination_start);
 
 		while ($row = $db->sql_fetchrow($result))
 		{
@@ -855,9 +915,9 @@
 				'EMOTION'		=> (isset($row['emotion'])) ? $row['emotion'] : '',
 				'U_EDIT'		=> $this->u_action . '&amp;action=edit&amp;id=' . $row[$fields . '_id'],
 				'U_DELETE'		=> $this->u_action . '&amp;action=delete&amp;id=' . $row[$fields . '_id'],
-				'U_MOVE_UP'		=> $this->u_action . '&amp;action=move_up&amp;id=' . $row[$fields . '_id'],
-				'U_MOVE_DOWN'	=> $this->u_action . '&amp;action=move_down&amp;id=' . $row[$fields . '_id'])
-			);
+				'U_MOVE_UP'		=> $this->u_action . '&amp;action=move_up&amp;id=' . $row[$fields . '_id'] . '&amp;start=' . $pagination_start,
+				'U_MOVE_DOWN'	=> $this->u_action . '&amp;action=move_down&amp;id=' . $row[$fields . '_id'] . '&amp;start=' . $pagination_start,
+			));
 
 			if (!$spacer && !$row['display_on_posting'])
 			{
@@ -865,6 +925,28 @@
 			}
 		}
 		$db->sql_freeresult($result);
+
+		$template->assign_var('PAGINATION',
+			generate_pagination($this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true)
+		);
+	}
+
+	/**
+	 * Returns the count of smilies or icons in the database
+	 *
+	 * @param string $table The table of items to count.
+	 * @return int number of items
+	 */
+	/* private */ function item_count($table)
+	{
+		global $db;
+
+		$sql = "SELECT COUNT(*) AS count
+			FROM $table";
+		$result = $db->sql_query($sql);
+		$item_count = (int) $db->sql_fetchfield('count');
+		$db->sql_freeresult($result);
+		return $item_count;
 	}
 }
 
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_inactive.php 3.0.6.src/includes/acp/acp_inactive.php
--- 3.0.5.src/includes/acp/acp_inactive.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_inactive.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_inactive.php 9327 2009-02-15 04:52:32Z toonarmy $
+* @version $Id: acp_inactive.php 10124 2009-09-09 09:08:24Z acydburn $
 * @copyright (c) 2006 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -51,6 +51,19 @@
 		$form_key = 'acp_inactive';
 		add_form_key($form_key);
 
+		// We build the sort key and per page settings here, because they may be needed later
+
+		// Number of entries to display
+		$per_page = request_var('users_per_page', (int) $config['topics_per_page']);
+
+		// Sorting
+		$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
+		$sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'd' => $user->lang['SORT_LAST_REMINDER'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME'], 'p' => $user->lang['SORT_POSTS'], 'e' => $user->lang['SORT_REMINDER']);
+		$sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'd' => 'user_reminded_time', 'r' => 'user_inactive_reason', 'u' => 'username_clean', 'p' => 'user_posts', 'e' => 'user_reminded');
+
+		$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
+		gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
+
 		if ($submit && sizeof($mark))
 		{
 			if ($action !== 'delete' && !check_form_key($form_key))
@@ -67,7 +80,7 @@
 						FROM ' . USERS_TABLE . '
 						WHERE ' . $db->sql_in_set('user_id', $mark);
 					$result = $db->sql_query($sql);
-				
+
 					$user_affected = array();
 					while ($row = $db->sql_fetchrow($result))
 					{
@@ -100,7 +113,7 @@
 						{
 							include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
 
-							$messenger = new messenger();
+							$messenger = new messenger(false);
 
 							foreach ($inactive_users as $row)
 							{
@@ -122,6 +135,12 @@
 
 							$messenger->save_queue();
 						}
+
+						// For activate we really need to redirect, else a refresh can result in users being deactivated again
+						$u_action = $this->u_action . "&amp;$u_sort_param&amp;start=$start";
+						$u_action .= ($per_page != $config['topics_per_page']) ? "&amp;users_per_page=$per_page" : '';
+
+						redirect($u_action);
 					}
 					else if ($action == 'delete')
 					{
@@ -175,7 +194,7 @@
 						include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
 
 						$messenger = new messenger();
-						$usernames = array();
+						$usernames = $user_ids = array();
 
 						do
 						{
@@ -198,28 +217,34 @@
 							$messenger->send($row['user_notify_type']);
 
 							$usernames[] = $row['username'];
+							$user_ids[] = (int) $row['user_id'];
 						}
 						while ($row = $db->sql_fetchrow($result));
 
 						$messenger->save_queue();
 
+						// Add the remind state to the database
+						$sql = 'UPDATE ' . USERS_TABLE . '
+							SET user_reminded = user_reminded + 1,
+								user_reminded_time = ' . time() . '
+							WHERE ' . $db->sql_in_set('user_id', $user_ids);
+						$db->sql_query($sql);
+
 						add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames));
 						unset($usernames);
 					}
 					$db->sql_freeresult($result);
-		
+
+					// For remind we really need to redirect, else a refresh can result in more than one reminder
+					$u_action = $this->u_action . "&amp;$u_sort_param&amp;start=$start";
+					$u_action .= ($per_page != $config['topics_per_page']) ? "&amp;users_per_page=$per_page" : '';
+
+					redirect($u_action);
+
 				break;
 			}
 		}
 
-		// Sorting
-		$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
-		$sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME']);
-		$sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username_clean');
-
-		$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
-		gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
-
 		// Define where and sort sql for use in displaying logs
 		$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
 		$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
@@ -227,19 +252,30 @@
 		$inactive = array();
 		$inactive_count = 0;
 
-		$start = view_inactive_users($inactive, $inactive_count, $config['topics_per_page'], $start, $sql_where, $sql_sort);
+		$start = view_inactive_users($inactive, $inactive_count, $per_page, $start, $sql_where, $sql_sort);
 
 		foreach ($inactive as $row)
 		{
 			$template->assign_block_vars('inactive', array(
 				'INACTIVE_DATE'	=> $user->format_date($row['user_inactive_time']),
+				'REMINDED_DATE'	=> $user->format_date($row['user_reminded_time']),
 				'JOINED'		=> $user->format_date($row['user_regdate']),
 				'LAST_VISIT'	=> (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
+
 				'REASON'		=> $row['inactive_reason'],
 				'USER_ID'		=> $row['user_id'],
-				'USERNAME'		=> $row['username'],
-				'U_USER_ADMIN'	=> append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
-			);
+				'POSTS'			=> ($row['user_posts']) ? $row['user_posts'] : 0,
+				'REMINDED'		=> $row['user_reminded'],
+
+				'REMINDED_EXPLAIN'	=> $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])),
+
+				'USERNAME_FULL'		=> get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview')),
+				'USERNAME'			=> get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
+				'USER_COLOR'		=> get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
+
+				'U_USER_ADMIN'	=> append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"),
+				'U_SEARCH_USER'	=> ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&amp;sr=posts") : '',
+			));
 		}
 
 		$option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE');
@@ -255,9 +291,10 @@
 			'S_LIMIT_DAYS'	=> $s_limit_days,
 			'S_SORT_KEY'	=> $s_sort_key,
 			'S_SORT_DIR'	=> $s_sort_dir,
-			'S_ON_PAGE'		=> on_page($inactive_count, $config['topics_per_page'], $start),
-			'PAGINATION'	=> generate_pagination($this->u_action . "&amp;$u_sort_param", $inactive_count, $config['topics_per_page'], $start, true),
-			
+			'S_ON_PAGE'		=> on_page($inactive_count, $per_page, $start),
+			'PAGINATION'	=> generate_pagination($this->u_action . "&amp;$u_sort_param&amp;users_per_page=$per_page", $inactive_count, $per_page, $start, true),
+			'USERS_PER_PAGE'	=> $per_page,
+
 			'U_ACTION'		=> $this->u_action . '&amp;start=' . $start,
 		));
 
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_language.php 3.0.6.src/includes/acp/acp_language.php
--- 3.0.5.src/includes/acp/acp_language.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_language.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_language.php 8780 2008-08-22 12:52:48Z acydburn $
+* @version $Id: acp_language.php 9669 2009-06-24 13:31:04Z leviatan21 $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -766,28 +766,41 @@
 					trigger_error($user->lang['NO_REMOVE_DEFAULT_LANG'] . adm_back_link($this->u_action), E_USER_WARNING);
 				}
 
-				$db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id);
+				if (confirm_box(true))
+				{
+					$db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id);
 
-				$sql = 'UPDATE ' . USERS_TABLE . "
-					SET user_lang = '" . $db->sql_escape($config['default_lang']) . "'
-					WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
-				$db->sql_query($sql);
+					$sql = 'UPDATE ' . USERS_TABLE . "
+						SET user_lang = '" . $db->sql_escape($config['default_lang']) . "'
+						WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
+					$db->sql_query($sql);
 
-				// We also need to remove the translated entries for custom profile fields - we want clean tables, don't we?
-				$sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' WHERE lang_id = ' . $lang_id;
-				$db->sql_query($sql);
+					// We also need to remove the translated entries for custom profile fields - we want clean tables, don't we?
+					$sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' WHERE lang_id = ' . $lang_id;
+					$db->sql_query($sql);
 
-				$sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' WHERE lang_id = ' . $lang_id;
-				$db->sql_query($sql);
+					$sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' WHERE lang_id = ' . $lang_id;
+					$db->sql_query($sql);
 
-				$sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " WHERE image_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
-				$result = $db->sql_query($sql);
+					$sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " WHERE image_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
+					$result = $db->sql_query($sql);
 
-				$cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE);
+					$cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE);
 
-				add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']);
+					add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']);
 
-				trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action));
+					trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action));
+				}
+				else
+				{
+					$s_hidden_fields = array(
+						'i'			=> $id,
+						'mode'		=> $mode,
+						'action'	=> $action,
+						'id'		=> $lang_id,
+					);
+					confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
+				}
 			break;
 
 			case 'install':
@@ -1254,7 +1267,7 @@
 		$keys = func_get_args();
 
 		$non_static		= array_shift($keys);
-		$value			= array_shift($keys);
+		$value			= utf8_normalize_nfc(array_shift($keys));
 
 		if (!$non_static)
 		{
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_logs.php 3.0.6.src/includes/acp/acp_logs.php
--- 3.0.5.src/includes/acp/acp_logs.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_logs.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_logs.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: acp_logs.php 10042 2009-08-22 02:56:05Z terrafrost $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -33,6 +33,7 @@
 		// Set up general vars
 		$action		= request_var('action', '');
 		$forum_id	= request_var('f', 0);
+		$topic_id	= request_var('t', 0);
 		$start		= request_var('start', 0);
 		$deletemark = (!empty($_POST['delmarked'])) ? true : false;
 		$deleteall	= (!empty($_POST['delall'])) ? true : false;
@@ -104,6 +105,9 @@
 		$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
 		$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
 
+		$keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+		$keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
+
 		$l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS'];
 		$l_title_explain = $user->lang['ACP_' . strtoupper($mode) . '_LOGS_EXPLAIN'];
 
@@ -123,7 +127,7 @@
 		// Grab log data
 		$log_data = array();
 		$log_count = 0;
-		view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort);
+		view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort, $keywords);
 
 		$template->assign_vars(array(
 			'L_TITLE'		=> $l_title,
@@ -131,12 +135,13 @@
 			'U_ACTION'		=> $this->u_action,
 
 			'S_ON_PAGE'		=> on_page($log_count, $config['topics_per_page'], $start),
-			'PAGINATION'	=> generate_pagination($this->u_action . "&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
+			'PAGINATION'	=> generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true),
 
 			'S_LIMIT_DAYS'	=> $s_limit_days,
 			'S_SORT_KEY'	=> $s_sort_key,
 			'S_SORT_DIR'	=> $s_sort_dir,
 			'S_CLEARLOGS'	=> $auth->acl_get('a_clearlogs'),
+			'S_KEYWORDS'	=> $keywords,
 			)
 		);
 
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_main.php 3.0.6.src/includes/acp/acp_main.php
--- 3.0.5.src/includes/acp/acp_main.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_main.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_main.php 9351 2009-02-28 19:22:27Z acydburn $
+* @version $Id: acp_main.php 10081 2009-09-01 11:21:42Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -97,6 +97,10 @@
 						$confirm = true;
 						$confirm_lang = 'PURGE_CACHE_CONFIRM';
 					break;
+					case 'purge_sessions':
+						$confirm = true;
+						$confirm_lang = 'PURGE_SESSIONS_CONFIRM';
+					break;
 
 					default:
 						$confirm = true;
@@ -341,10 +345,76 @@
 
 						add_log('admin', 'LOG_PURGE_CACHE');
 					break;
+
+					case 'purge_sessions':
+						if ((int) $user->data['user_type'] !== USER_FOUNDER)
+						{
+							trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
+						}
+
+						$tables = array(CONFIRM_TABLE, SESSIONS_TABLE);
+
+						foreach ($tables as $table)
+						{
+							switch ($db->sql_layer)
+							{
+								case 'sqlite':
+								case 'firebird':
+									$db->sql_query("DELETE FROM $table");
+								break;
+
+								default:
+									$db->sql_query("TRUNCATE TABLE $table");
+								break;
+							}
+						}
+
+						// let's restore the admin session
+						$reinsert_ary = array(
+								'session_id'			=> (string) $user->session_id,
+								'session_page'			=> (string) substr($user->page['page'], 0, 199),
+								'session_forum_id'		=> $user->page['forum'],
+								'session_user_id'		=> (int) $user->data['user_id'],
+								'session_start'			=> (int) $user->data['session_start'],
+								'session_last_visit'	=> (int) $user->data['session_last_visit'],
+								'session_time'			=> (int) $user->time_now,
+								'session_browser'		=> (string) trim(substr($user->browser, 0, 149)),
+								'session_forwarded_for'	=> (string) $user->forwarded_for,
+								'session_ip'			=> (string) $user->ip,
+								'session_autologin'		=> (int) $user->data['session_autologin'],
+								'session_admin'			=> 1,
+								'session_viewonline'	=> (int) $user->data['session_viewonline'],
+						);
+
+						$sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $reinsert_ary);
+						$db->sql_query($sql);
+
+						add_log('admin', 'LOG_PURGE_SESSIONS');
+					break;
 				}
 			}
 		}
 
+		// Version check
+		$user->add_lang('install');
+
+		$latest_version_info = false;
+		if (($latest_version_info = obtain_latest_version_info(request_var('versioncheck_force', false))) === false)
+		{
+			$template->assign_var('S_VERSIONCHECK_FAIL', true);
+		}
+		else
+		{
+			$latest_version_info = explode("\n", $latest_version_info);
+
+			$latest_version = str_replace('rc', 'RC', strtolower(trim($latest_version_info[0])));
+			$current_version = str_replace('rc', 'RC', strtolower($config['version']));
+
+			$template->assign_vars(array(
+				'S_VERSION_UP_TO_DATE'	=> version_compare($current_version, $latest_version, '<') ? false : true,
+			));
+		}
+
 		// Get forum statistics
 		$total_posts = $config['num_posts'];
 		$total_topics = $config['num_topics'];
@@ -435,13 +505,15 @@
 			'UPLOAD_DIR_SIZE'	=> $upload_dir_size,
 			'TOTAL_ORPHAN'		=> $total_orphan,
 			'S_TOTAL_ORPHAN'	=> ($total_orphan === false) ? false : true,
-			'GZIP_COMPRESSION'	=> ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF'],
+			'GZIP_COMPRESSION'	=> ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'],
 			'DATABASE_INFO'		=> $db->sql_server_info(),
 			'BOARD_VERSION'		=> $config['version'],
 
 			'U_ACTION'			=> $this->u_action,
 			'U_ADMIN_LOG'		=> append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
 			'U_INACTIVE_USERS'	=> append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
+			'U_VERSIONCHECK'	=> append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&amp;mode=version_check'),
+			'U_VERSIONCHECK_FORCE'	=> append_sid("{$phpbb_admin_path}index.$phpEx", 'i=1&amp;versioncheck_force=1'),
 
 			'S_ACTION_OPTIONS'	=> ($auth->acl_get('a_board')) ? true : false,
 			'S_FOUNDER'			=> ($user->data['user_type'] == USER_FOUNDER) ? true : false,
@@ -468,6 +540,8 @@
 
 		if ($auth->acl_get('a_user'))
 		{
+			$user->add_lang('memberlist');
+
 			$inactive = array();
 			$inactive_count = 0;
 
@@ -477,13 +551,24 @@
 			{
 				$template->assign_block_vars('inactive', array(
 					'INACTIVE_DATE'	=> $user->format_date($row['user_inactive_time']),
+					'REMINDED_DATE'	=> $user->format_date($row['user_reminded_time']),
 					'JOINED'		=> $user->format_date($row['user_regdate']),
 					'LAST_VISIT'	=> (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
+
 					'REASON'		=> $row['inactive_reason'],
 					'USER_ID'		=> $row['user_id'],
-					'USERNAME'		=> $row['username'],
-					'U_USER_ADMIN'	=> append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
-				);
+					'POSTS'			=> ($row['user_posts']) ? $row['user_posts'] : 0,
+					'REMINDED'		=> $row['user_reminded'],
+
+					'REMINDED_EXPLAIN'	=> $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])),
+
+					'USERNAME_FULL'		=> get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview')),
+					'USERNAME'			=> get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
+					'USER_COLOR'		=> get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
+
+					'U_USER_ADMIN'	=> append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"),
+					'U_SEARCH_USER'	=> ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&amp;sr=posts") : '',
+				));
 			}
 
 			$option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE');
@@ -499,12 +584,12 @@
 		}
 
 		// Warn if install is still present
-		if (file_exists($phpbb_root_path . 'install'))
+		if (file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
 		{
 			$template->assign_var('S_REMOVE_INSTALL', true);
 		}
 
-		if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && is_writable($phpbb_root_path . 'config.' . $phpEx))
+		if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx))
 		{
 			// World-Writable? (000x)
 			$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_permissions.php 3.0.6.src/includes/acp/acp_permissions.php
--- 3.0.5.src/includes/acp/acp_permissions.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_permissions.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_permissions.php 9496 2009-04-29 14:52:43Z acydburn $
+* @version $Id: acp_permissions.php 10017 2009-08-18 14:37:49Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -57,6 +57,21 @@
 			trigger_error('NO_MODE', E_USER_ERROR);
 		}
 
+		// Copy forum permissions
+		if ($mode == 'setting_forum_copy')
+		{
+			$this->tpl_name = 'permission_forum_copy';
+
+			if ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))
+			{
+				$this->page_title = 'ACP_FORUM_PERMISSIONS_COPY';
+				$this->copy_forum_permissions();
+				return;
+			}
+
+			trigger_error('NO_MODE', E_USER_ERROR);
+		}
+
 		// Set some vars
 		$action = request_var('action', array('' => 0));
 		$action = key($action);
@@ -217,43 +232,71 @@
 			trigger_error($user->lang['WRONG_PERMISSION_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
 		}
 
-
 		// Handle actions
 		if (strpos($mode, 'setting_') === 0 && $action)
 		{
 			switch ($action)
 			{
 				case 'delete':
-
-					if (!check_form_key($form_name))
+					if (confirm_box(true))
 					{
-						trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
-					}
-					// All users/groups selected?
-					$all_users = (isset($_POST['all_users'])) ? true : false;
-					$all_groups = (isset($_POST['all_groups'])) ? true : false;
+						// All users/groups selected?
+						$all_users = (isset($_POST['all_users'])) ? true : false;
+						$all_groups = (isset($_POST['all_groups'])) ? true : false;
 
-					if ($all_users || $all_groups)
-					{
-						$items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
+						if ($all_users || $all_groups)
+						{
+							$items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
 
-						if ($all_users && sizeof($items['user_ids']))
+							if ($all_users && sizeof($items['user_ids']))
+							{
+								$user_id = $items['user_ids'];
+							}
+							else if ($all_groups && sizeof($items['group_ids']))
+							{
+								$group_id = $items['group_ids'];
+							}
+						}
+
+						if (sizeof($user_id) || sizeof($group_id))
 						{
-							$user_id = $items['user_ids'];
+							$this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id);
 						}
-						else if ($all_groups && sizeof($items['group_ids']))
+						else
 						{
-							$group_id = $items['group_ids'];
+							trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
 						}
 					}
-
-					if (sizeof($user_id) || sizeof($group_id))
-					{
-						$this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id);
-					}
 					else
 					{
-						trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
+						if (isset($_POST['cancel']))
+						{
+							$u_redirect = $this->u_action . '&amp;type=' . $permission_type;
+							foreach ($forum_id as $fid)
+							{
+								$u_redirect .= '&amp;forum_id[]=' . $fid;
+							}
+							redirect($u_redirect);
+						}
+
+						$s_hidden_fields = array(
+							'i'				=> $id,
+							'mode'			=> $mode,
+							'action'		=> array($action => 1),
+							'user_id'		=> $user_id,
+							'group_id'		=> $group_id,
+							'forum_id'		=> $forum_id,
+							'type'			=> $permission_type,
+						);
+						if (isset($_POST['all_users']))
+						{
+							$s_hidden_fields['all_users'] = 1;
+						}
+						if (isset($_POST['all_groups']))
+						{
+							$s_hidden_fields['all_groups'] = 1;
+						}
+						confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
 					}
 				break;
 
@@ -963,6 +1006,7 @@
 				LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.group_id = g.group_id)
 			WHERE ug.user_id = ' . $user_id . '
 				AND ug.user_pending = 0
+				AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
 			ORDER BY g.group_type DESC, g.group_id DESC';
 		$result = $db->sql_query($sql);
 
@@ -1124,6 +1168,57 @@
 	}
 
 	/**
+	* Handles copying permissions from one forum to others
+	*/
+	function copy_forum_permissions()
+	{
+		global $auth, $cache, $template, $user;
+
+		$user->add_lang('acp/forums');
+
+		$submit = isset($_POST['submit']) ? true : false;
+
+		if ($submit)
+		{
+			$src = request_var('src_forum_id', 0);
+			$dest = request_var('dest_forum_ids', array(0));
+
+			if (confirm_box(true))
+			{
+				if (copy_forum_permissions($src, $dest))
+				{
+					cache_moderators();
+
+					$auth->acl_clear_prefetch();
+					$cache->destroy('sql', FORUMS_TABLE);
+
+					trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
+				}
+				else
+				{
+					trigger_error($user->lang['SELECTED_FORUM_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
+				}
+			}
+			else
+			{
+				$s_hidden_fields = array(
+					'submit'			=> $submit,
+					'src_forum_id'		=> $src,
+					'dest_forum_ids'	=> $dest,
+				);
+
+				$s_hidden_fields = build_hidden_fields($s_hidden_fields);
+
+				confirm_box(false, $user->lang['COPY_PERMISSIONS_CONFIRM'], $s_hidden_fields);
+			}
+		}
+
+		$template->assign_vars(array(
+			'S_FORUM_OPTIONS' => make_forum_select(false, false, false, false, false),
+		));
+	}
+
+	/**
 	* Get already assigned users/groups
 	*/
 	function retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type)
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_profile.php 3.0.6.src/includes/acp/acp_profile.php
--- 3.0.5.src/includes/acp/acp_profile.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_profile.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_profile.php 9516 2009-05-14 05:15:27Z terrafrost $
+* @version $Id: acp_profile.php 10216 2009-10-07 14:54:10Z toonarmy $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -369,6 +369,7 @@
 						'field_show_profile'=> 0,
 						'field_no_view'		=> 0,
 						'field_show_on_reg'	=> 0,
+						'field_show_on_vt'	=> 0,
 						'lang_name'			=> utf8_normalize_nfc(request_var('field_ident', '', true)),
 						'lang_explain'		=> '',
 						'lang_default_value'=> '')
@@ -379,7 +380,7 @@
 
 				// $exclude contains the data we gather in each step
 				$exclude = array(
-					1	=> array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'),
+					1	=> array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'),
 					2	=> array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
 					3	=> array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
 				);
@@ -405,6 +406,7 @@
 				$visibility_ary = array(
 					'field_required',
 					'field_show_on_reg',
+					'field_show_on_vt',
 					'field_show_profile',
 					'field_hide',
 				);
@@ -507,6 +509,14 @@
 						// Get the number of options if this key is 'field_maxlen'
 						$var = request_var('field_default_value', 0);
 					}*/
+					else if ($field_type == FIELD_INT && $key == 'field_default_value')
+					{
+						// Permit an empty string
+						if (request_var('field_default_value', '') === '')
+						{
+							$var = '';
+						}
+					}
 
 					$cp->vars[$key] = $var;
 				}
@@ -721,6 +731,7 @@
 							'S_STEP_ONE'		=> true,
 							'S_FIELD_REQUIRED'	=> ($cp->vars['field_required']) ? true : false,
 							'S_SHOW_ON_REG'		=> ($cp->vars['field_show_on_reg']) ? true : false,
+							'S_SHOW_ON_VT'		=> ($cp->vars['field_show_on_vt']) ? true : false,
 							'S_FIELD_HIDE'		=> ($cp->vars['field_hide']) ? true : false,
 							'S_SHOW_PROFILE'	=> ($cp->vars['field_show_profile']) ? true : false,
 							'S_FIELD_NO_VIEW'	=> ($cp->vars['field_no_view']) ? true : false,
@@ -1036,6 +1047,7 @@
 			'field_validation'		=> $cp->vars['field_validation'],
 			'field_required'		=> $cp->vars['field_required'],
 			'field_show_on_reg'		=> $cp->vars['field_show_on_reg'],
+			'field_show_on_vt'		=> $cp->vars['field_show_on_vt'],
 			'field_hide'			=> $cp->vars['field_hide'],
 			'field_show_profile'	=> $cp->vars['field_show_profile'],
 			'field_no_view'			=> $cp->vars['field_no_view']
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_prune.php 3.0.6.src/includes/acp/acp_prune.php
--- 3.0.5.src/includes/acp/acp_prune.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_prune.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_prune.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: acp_prune.php 9754 2009-07-14 12:02:11Z rxu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -406,7 +406,12 @@
 			$where_sql .= (sizeof($joined)) ? " AND user_regdate " . $key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]) : '';
 			$where_sql .= ($count !== '') ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : '';
 
-			if (sizeof($active) && $active_select != 'lt')
+			// First handle pruning of users who never logged in, last active date is 0000-00-00
+			if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0)
+			{
+				$where_sql .= ' AND user_lastvisit = 0';
+			}			
+			else if (sizeof($active) && $active_select != 'lt')
 			{
 				$where_sql .= ' AND user_lastvisit ' . $key_match[$active_select] . ' ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]);
 			}
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_ranks.php 3.0.6.src/includes/acp/acp_ranks.php
--- 3.0.5.src/includes/acp/acp_ranks.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_ranks.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_ranks.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: acp_ranks.php 9698 2009-06-27 20:56:49Z naderman $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -39,7 +39,7 @@
 		$this->tpl_name = 'acp_ranks';
 		$this->page_title = 'ACP_MANAGE_RANKS';
 
-		$form_name = 'acp_prune';
+		$form_name = 'acp_ranks';
 		add_form_key($form_name);
 
 		switch ($action)
@@ -168,25 +168,22 @@
 					{
 						$img = $path . $img;
 
-						if (!in_array($img, $existing_imgs) || $action == 'edit')
+						if ($ranks && $img == $ranks['rank_image'])
 						{
-							if ($ranks && $img == $ranks['rank_image'])
-							{
-								$selected = ' selected="selected"';
-								$edit_img = $img;
-							}
-							else
-							{
-								$selected = '';
-							}
-
-							if (strlen($img) > 255)
-							{
-								continue;
-							}
+							$selected = ' selected="selected"';
+							$edit_img = $img;
+						}
+						else
+						{
+							$selected = '';
+						}
 
-							$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
+						if (strlen($img) > 255)
+						{
+							continue;
 						}
+
+						$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . ((in_array($img, $existing_imgs)) ? ' ' . $user->lang['RANK_IMAGE_IN_USE'] : '') . '</option>';
 					}
 				}
 
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_send_statistics.php 3.0.6.src/includes/acp/acp_send_statistics.php
--- 3.0.5.src/includes/acp/acp_send_statistics.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/acp/acp_send_statistics.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,90 @@
+<?php
+/**
+*
+* @package acp
+* @version $Id$
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+include($phpbb_root_path . 'includes/questionnaire/questionnaire.' . $phpEx);
+
+/**
+* @package acp
+*/
+class acp_send_statistics
+{
+	var $u_action;
+
+	function main($id, $mode)
+	{
+		global $config, $template, $phpbb_admin_path, $phpEx;
+
+		$collect_url = "http://www.phpbb.com/stats/receive_stats.php";
+
+		$this->tpl_name = 'acp_send_statistics';
+		$this->page_title = 'ACP_SEND_STATISTICS';
+
+		// generate a unique id if necessary
+		if (!isset($config['questionnaire_unique_id']))
+		{
+			$install_id = unique_id();
+			set_config('questionnaire_unique_id', $install_id);
+		}
+		else
+		{
+			$install_id = $config['questionnaire_unique_id'];
+		}
+
+		$collector = new phpbb_questionnaire_data_collector($install_id);
+
+		// Add data provider
+		$collector->add_data_provider(new phpbb_questionnaire_php_data_provider());
+		$collector->add_data_provider(new phpbb_questionnaire_system_data_provider());
+		$collector->add_data_provider(new phpbb_questionnaire_phpbb_data_provider($config));
+
+		$template->assign_vars(array(
+			'U_COLLECT_STATS'	=> $collect_url,
+			'RAW_DATA'			=> $collector->get_data_for_form(),
+			'U_ACP_MAIN'		=> append_sid("{$phpbb_admin_path}index.$phpEx"),
+		));
+
+		$raw = $collector->get_data_raw();
+
+		foreach ($raw as $provider => $data)
+		{
+			if ($provider == 'install_id')
+			{
+				$data = array($provider => $data);
+			}
+
+			$template->assign_block_vars('providers', array(
+				'NAME'	=> htmlspecialchars($provider),
+			));
+
+			foreach ($data as $key => $value)
+			{
+				if (is_array($value))
+				{
+					$value = utf8_wordwrap(serialize($value), 75, "\n", true);
+				}
+
+				$template->assign_block_vars('providers.values', array(
+					'KEY'	=> utf8_htmlspecialchars($key),
+					'VALUE'	=> utf8_htmlspecialchars($value),
+				));
+			}
+		}
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_styles.php 3.0.6.src/includes/acp/acp_styles.php
--- 3.0.5.src/includes/acp/acp_styles.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_styles.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_styles.php 9514 2009-05-13 10:19:43Z Kellanved $
+* @version $Id: acp_styles.php 10074 2009-08-31 11:25:28Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -210,23 +210,36 @@
 							trigger_error($user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action), E_USER_WARNING);
 						}
 
-						$sql = 'UPDATE ' . STYLES_TABLE . '
-							SET style_active = ' . (($action == 'activate') ? 1 : 0) . '
-							WHERE style_id = ' . $style_id;
-						$db->sql_query($sql);
-
-						// Set style to default for any member using deactivated style
-						if ($action == 'deactivate')
-						{
-							$sql = 'UPDATE ' . USERS_TABLE . '
-								SET user_style = ' . $config['default_style'] . "
-								WHERE user_style = $style_id";
+						if (($action == 'deactivate' && confirm_box(true)) || $action == 'activate')
+						{
+							$sql = 'UPDATE ' . STYLES_TABLE . '
+								SET style_active = ' . (($action == 'activate') ? 1 : 0) . '
+								WHERE style_id = ' . $style_id;
 							$db->sql_query($sql);
 
-							$sql = 'UPDATE ' . FORUMS_TABLE . '
-								SET forum_style = 0
-								WHERE forum_style = ' . $style_id;
-							$db->sql_query($sql);
+							// Set style to default for any member using deactivated style
+							if ($action == 'deactivate')
+							{
+								$sql = 'UPDATE ' . USERS_TABLE . '
+									SET user_style = ' . $config['default_style'] . "
+									WHERE user_style = $style_id";
+								$db->sql_query($sql);
+
+								$sql = 'UPDATE ' . FORUMS_TABLE . '
+									SET forum_style = 0
+									WHERE forum_style = ' . $style_id;
+								$db->sql_query($sql);
+							}
+						}
+						else if ($action == 'deactivate')
+						{
+							$s_hidden_fields = array(
+								'i'			=> $id,
+								'mode'		=> $mode,
+								'action'	=> $action,
+								'style_id'	=> $style_id,
+							);
+							confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
 						}
 					break;
 				}
@@ -734,7 +747,8 @@
 			{
 				if (!($fp = @fopen($file, 'wb')))
 				{
-					trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
+					// File exists and is writeable, but still not able to be written to
+					trigger_error(sprintf($user->lang['TEMPLATE_FILE_NOT_WRITABLE'], htmlspecialchars($template_file)) . adm_back_link($this->u_action), E_USER_WARNING);
 				}
 				fwrite($fp, $template_data);
 				fclose($fp);
@@ -827,6 +841,11 @@
 			unset($file_info);
 		}
 
+		if (empty($filelist['']))
+		{
+			trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
+		}
+
 		// Now create the categories
 		$filelist_cats[''] = array();
 		foreach ($filelist as $pathfile => $file_ary)
@@ -1024,12 +1043,12 @@
 
 		foreach ($file_ary as $file)
 		{
-			$file 		= str_replace('/', '.', $file);
+			$file		= str_replace('/', '.', $file);
 
 			// perform some dirty guessing to get the path right.
 			// We assume that three dots in a row were '../'
-			$tpl_file 	= str_replace('.', '/', $file);
-			$tpl_file 	= str_replace('///', '../', $tpl_file);
+			$tpl_file	= str_replace('.', '/', $file);
+			$tpl_file	= str_replace('///', '../', $tpl_file);
 
 			$filename = "{$cache_prefix}_$file.html.$phpEx";
 
@@ -1061,6 +1080,11 @@
 				}
 			}
 
+			// Correct the filename if it is stored in database and the file is in a subfolder.
+			if ($template_row['template_storedb'])
+			{
+				$file = str_replace('.', '/', $file);
+			}
 
 			$template->assign_block_vars('file', array(
 				'U_VIEWSOURCE'	=> $this->u_action . "&amp;action=cache&amp;id=$template_id&amp;source=$file",
@@ -1068,7 +1092,7 @@
 				'CACHED'		=> $user->format_date(filemtime("{$phpbb_root_path}cache/$filename")),
 				'FILENAME'		=> $file,
 				'FILENAME_PATH'	=> $file_tpl,
-				'FILESIZE'		=> sprintf('%.1f ' . $user->lang['KIB'], filesize("{$phpbb_root_path}cache/$filename") / 1024),
+				'FILESIZE'		=> get_formatted_filesize(filesize("{$phpbb_root_path}cache/$filename")),
 				'MODIFIED'		=> $user->format_date((!$template_row['template_storedb']) ? filemtime($file_tpl) : $filemtime[$file . '.html']))
 			);
 		}
@@ -1266,7 +1290,6 @@
 		);
 	}
 
-
 	/**
 	* Edit imagesets
 	*
@@ -2404,7 +2427,6 @@
 			}
 		}
 
-
 		if ($mode == 'template')
 		{
 			$super = array();
@@ -2535,9 +2557,22 @@
 				{
 					trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR);
 				}
-				$template_data = fread($fp, filesize("{$phpbb_root_path}styles/$template_path$pathfile$file"));
+
+				$filesize = filesize("{$phpbb_root_path}styles/$template_path$pathfile$file");
+
+				if ($filesize)
+				{
+					$template_data = fread($fp, $filesize);
+				}
+
 				fclose($fp);
 
+				if (!$filesize)
+				{
+					// File is empty
+					continue;
+				}
+
 				if (preg_match_all('#<!-- INCLUDE (.*?\.html) -->#is', $template_data, $matches))
 				{
 					foreach ($matches[1] as $match)
@@ -3204,7 +3239,6 @@
 		$row = $db->sql_fetchrow($result);
 		$db->sql_freeresult($result);
 
-
 		if ($row)
 		{
 			// If it exist, we just use the style on installation
@@ -3255,7 +3289,6 @@
 			$inherit_bf = false;
 		}
 
-
 		if (sizeof($error))
 		{
 			return false;
@@ -3525,7 +3558,6 @@
 			break;
 		}
 
-
 		$sql = "SELECT {$mode}_inherits_id
 			FROM $sql_from
 			WHERE {$mode}_id = " . (int) $id;
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_update.php 3.0.6.src/includes/acp/acp_update.php
--- 3.0.5.src/includes/acp/acp_update.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_update.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_update.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: acp_update.php 10195 2009-09-29 14:48:24Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -37,17 +37,18 @@
 		$errstr = '';
 		$errno = 0;
 
-		$info = get_remote_file('www.phpbb.com', '/updatecheck', ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
+		$info = obtain_latest_version_info(request_var('versioncheck_force', false), true);
 
 		if ($info === false)
 		{
-			trigger_error($errstr, E_USER_WARNING);
+			trigger_error('VERSIONCHECK_FAIL', E_USER_WARNING);
 		}
 
 		$info = explode("\n", $info);
 		$latest_version = trim($info[0]);
 
 		$announcement_url = trim($info[1]);
+		$announcement_url = (strpos($announcement_url, '&amp;') === false) ? str_replace('&', '&amp;', $announcement_url) : $announcement_url;
 		$update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
 
 		// Determine automatic update...
@@ -68,6 +69,7 @@
 			'S_UP_TO_DATE_AUTO'	=> $up_to_date_automatic,
 			'S_VERSION_CHECK'	=> true,
 			'U_ACTION'			=> $this->u_action,
+			'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&amp;versioncheck_force=1'),
 
 			'LATEST_VERSION'	=> $latest_version,
 			'CURRENT_VERSION'	=> $config['version'],
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_users.php 3.0.6.src/includes/acp/acp_users.php
--- 3.0.5.src/includes/acp/acp_users.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_users.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_users.php 9492 2009-04-28 11:18:02Z acydburn $
+* @version $Id: acp_users.php 10199 2009-09-30 15:00:44Z Kellanved $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -385,6 +385,31 @@
 
 							user_active_flip('flip', $user_id);
 
+							if ($user_row['user_type'] == USER_INACTIVE)
+							{
+								if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
+								{
+									include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+
+									$messenger = new messenger(false);
+
+									$messenger->template('admin_welcome_activated', $user_row['user_lang']);
+
+									$messenger->to($user_row['user_email'], $user_row['username']);
+
+									$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
+									$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
+									$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
+									$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+
+									$messenger->assign_vars(array(
+										'USERNAME'	=> htmlspecialchars_decode($user_row['username']))
+									);
+
+									$messenger->send(NOTIFY_EMAIL);
+								}
+							}
+
 							$message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
 							$log = ($user_row['user_type'] == USER_INACTIVE) ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE';
 
@@ -495,6 +520,56 @@
 
 						break;
 
+						case 'deloutbox':
+
+							if (confirm_box(true))
+							{
+								$msg_ids = array();
+								$lang = 'EMPTY';
+
+								$sql = 'SELECT msg_id
+									FROM ' . PRIVMSGS_TO_TABLE . "
+									WHERE author_id = $user_id
+										AND folder_id = " . PRIVMSGS_OUTBOX;
+								$result = $db->sql_query($sql);
+
+								if ($row = $db->sql_fetchrow($result))
+								{
+									if (!function_exists('delete_pm'))
+									{
+										include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
+									}
+
+									do
+									{
+										$msg_ids[] = (int) $row['msg_id'];
+									}
+									while ($row = $db->sql_fetchrow($result));
+
+									$db->sql_freeresult($result);
+
+									delete_pm($user_id, $msg_ids, PRIVMSGS_OUTBOX);
+
+									add_log('admin', 'LOG_USER_DEL_OUTBOX', $user_row['username']);
+
+									$lang = 'EMPTIED';
+								}
+								$db->sql_freeresult($result);
+
+								trigger_error($user->lang['USER_OUTBOX_' . $lang] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
+							}
+							else
+							{
+								confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+									'u'				=> $user_id,
+									'i'				=> $id,
+									'mode'			=> $mode,
+									'action'		=> $action,
+									'update'		=> true))
+								);
+							}
+						break;
+
 						case 'moveposts':
 
 							if (!check_form_key($form_name))
@@ -650,6 +725,28 @@
 							trigger_error($user->lang['USER_POSTS_MOVED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
 
 						break;
+
+						case 'leave_nr':
+
+							if (confirm_box(true))
+							{
+								remove_newly_registered($user_id, $user_row);
+
+								add_log('admin', 'LOG_USER_REMOVED_NR', $user_row['username']);
+								trigger_error($user->lang['USER_LIFTED_NR'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
+							}
+							else
+							{
+								confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+									'u'				=> $user_id,
+									'i'				=> $id,
+									'mode'			=> $mode,
+									'action'		=> $action,
+									'update'		=> true))
+								);
+							}
+
+						break;
 					}
 
 					// Handle registration info updates
@@ -775,7 +872,7 @@
 						{
 							$sql_ary += array(
 								'user_email'		=> $update_email,
-								'user_email_hash'	=> crc32($update_email) . strlen($update_email)
+								'user_email_hash'	=> phpbb_email_hash($update_email),
 							);
 
 							add_log('user', $user_id, 'LOG_USER_UPDATE_EMAIL', $user_row['username'], $user_row['user_email'], $update_email);
@@ -820,7 +917,11 @@
 
 				if ($user_id == $user->data['user_id'])
 				{
-					$quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
+					$quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH', 'deloutbox' => 'DEL_OUTBOX');
+					if ($user_row['user_new'])
+					{
+						$quick_tool_ary['leave_nr'] = 'LEAVE_NR';
+					}
 				}
 				else
 				{
@@ -836,12 +937,17 @@
 						$quick_tool_ary += array('active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'));
 					}
 
-					$quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
+					$quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH', 'deloutbox' => 'DEL_OUTBOX');
 
 					if ($config['email_enable'] && ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_INACTIVE))
 					{
 						$quick_tool_ary['reactivate'] = 'FORCE';
 					}
+
+					if ($user_row['user_new'])
+					{
+						$quick_tool_ary['leave_nr'] = 'LEAVE_NR';
+					}
 				}
 
 				$s_action_options = '<option class="sep" value="">' . $user->lang['SELECT_OPTION'] . '</option>';
@@ -917,7 +1023,7 @@
 					'U_WHOIS'		=> $this->u_action . "&amp;action=whois&amp;user_ip={$user_row['user_ip']}",
 					'U_MCP_QUEUE'	=> ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',
 
-					'U_SWITCH_PERMISSIONS'	=> ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_row['user_id']}") : '',
+					'U_SWITCH_PERMISSIONS'	=> ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_row['user_id']}&amp;hash=" . generate_link_hash('switchperm')) : '',
 
 					'POSTS_IN_QUEUE'	=> $user_row['posts_in_queue'],
 					'USER'				=> $user_row['username'],
@@ -1035,6 +1141,154 @@
 
 			break;
 
+			case 'warnings':
+				$user->add_lang('mcp');
+
+				// Set up general vars
+				$start		= request_var('start', 0);
+				$deletemark	= (isset($_POST['delmarked'])) ? true : false;
+				$deleteall	= (isset($_POST['delall'])) ? true : false;
+				$confirm	= (isset($_POST['confirm'])) ? true : false;
+				$marked		= request_var('mark', array(0));
+				$message	= utf8_normalize_nfc(request_var('message', '', true));
+
+				// Sort keys
+				$sort_days	= request_var('st', 0);
+				$sort_key	= request_var('sk', 't');
+				$sort_dir	= request_var('sd', 'd');
+
+				// Delete entries if requested and able
+				if ($deletemark || $deleteall || $confirm)
+				{
+					if (confirm_box(true))
+					{
+						$where_sql = '';
+						$deletemark = request_var('delmarked', 0);
+						$deleteall = request_var('delall', 0);
+						if ($deletemark && $marked)
+						{
+							$where_sql = ' AND ' . $db->sql_in_set('warning_id', array_values($marked));
+						}
+
+						if ($where_sql || $deleteall)
+						{
+							$sql = 'DELETE FROM ' . WARNINGS_TABLE . "
+								WHERE user_id = $user_id
+									$where_sql";
+							$db->sql_query($sql);
+
+							if ($deleteall)
+							{
+								$log_warnings = $deleted_warnings = 0;
+							}
+							else
+							{
+								$num_warnings = (int) $db->sql_affectedrows();
+								$deleted_warnings = ' user_warnings - ' . $num_warnings;
+								$log_warnings = ($num_warnings > 2) ? 2 : $num_warnings;
+							}
+
+							$sql = 'UPDATE ' . USERS_TABLE . "
+								SET user_warnings = $deleted_warnings
+								WHERE user_id = $user_id";
+							$db->sql_query($sql);
+
+							switch ($log_warnings)
+							{
+								case 2:
+									add_log('admin', 'LOG_WARNINGS_DELETED', $user_row['username'], $num_warnings);
+								break;
+								case 1:
+									add_log('admin', 'LOG_WARNING_DELETED', $user_row['username']);
+								break;
+								default:
+									add_log('admin', 'LOG_WARNINGS_DELETED_ALL', $user_row['username']);
+								break;
+							}
+						}
+					}
+					else
+					{
+						$s_hidden_fields = array(
+							'i'				=> $id,
+							'mode'			=> $mode,
+							'u'				=> $user_id,
+							'mark'			=> $marked,
+						);
+						if (isset($_POST['delmarked']))
+						{
+							$s_hidden_fields['delmarked'] = 1;
+						}
+						if (isset($_POST['delall']))
+						{
+							$s_hidden_fields['delall'] = 1;
+						}
+						if (isset($_POST['delall']) || (isset($_POST['delmarked']) && sizeof($marked)))
+						{
+							confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
+						}
+					}
+				}
+
+				$sql = 'SELECT w.warning_id, w.warning_time, w.post_id, l.log_operation, l.log_data, l.user_id AS mod_user_id, m.username AS mod_username, m.user_colour AS mod_user_colour
+					FROM ' . WARNINGS_TABLE . ' w
+					LEFT JOIN ' . LOG_TABLE . ' l
+						ON (w.log_id = l.log_id)
+					LEFT JOIN ' . USERS_TABLE . ' m
+						ON (l.user_id = m.user_id)
+					WHERE w.user_id = ' . $user_id . '
+					ORDER BY w.warning_time DESC';
+				$result = $db->sql_query($sql);
+
+				while ($row = $db->sql_fetchrow($result))
+				{
+					if (!$row['log_operation'])
+					{
+						// We do not have a log-entry anymore, so there is no data available
+						$row['action'] = $user->lang['USER_WARNING_LOG_DELETED'];
+					}
+					else
+					{
+						$row['action'] = (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}';
+						if (!empty($row['log_data']))
+						{
+							$log_data_ary = @unserialize($row['log_data']);
+							$log_data_ary = ($log_data_ary === false) ? array() : $log_data_ary;
+
+							if (isset($user->lang[$row['log_operation']]))
+							{
+								// Check if there are more occurrences of % than arguments, if there are we fill out the arguments array
+								// It doesn't matter if we add more arguments than placeholders
+								if ((substr_count($row['action'], '%') - sizeof($log_data_ary)) > 0)
+								{
+									$log_data_ary = array_merge($log_data_ary, array_fill(0, substr_count($row['action'], '%') - sizeof($log_data_ary), ''));
+								}
+								$row['action'] = vsprintf($row['action'], $log_data_ary);
+								$row['action'] = bbcode_nl2br(censor_text($row['action']));
+							}
+							else if (!empty($log_data_ary))
+							{
+								$row['action'] .= '<br />' . implode('', $log_data_ary);
+							}
+						}
+					}
+
+
+					$template->assign_block_vars('warn', array(
+						'ID'		=> $row['warning_id'],
+						'USERNAME'	=> ($row['log_operation']) ? get_username_string('full', $row['mod_user_id'], $row['mod_username'], $row['mod_user_colour']) : '-',
+						'ACTION'	=> make_clickable($row['action']),
+						'DATE'		=> $user->format_date($row['warning_time']),
+					));
+				}
+				$db->sql_freeresult($result);
+
+				$template->assign_vars(array(
+					'S_WARNINGS'	=> true,
+				));
+
+			break;
+
 			case 'profile':
 
 				include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -1136,54 +1390,7 @@
 						$db->sql_query($sql);
 
 						// Update Custom Fields
-						if (sizeof($cp_data))
-						{
-							switch ($db->sql_layer)
-							{
-								case 'oracle':
-								case 'firebird':
-								case 'postgres':
-									$right_delim = $left_delim = '"';
-								break;
-
-								case 'sqlite':
-								case 'mssql':
-								case 'mssql_odbc':
-									$right_delim = ']';
-									$left_delim = '[';
-								break;
-
-								case 'mysql':
-								case 'mysql4':
-								case 'mysqli':
-									$right_delim = $left_delim = '`';
-								break;
-							}
-
-							foreach ($cp_data as $key => $value)
-							{
-								// Firebird is case sensitive with delimiter
-								$cp_data[$left_delim . (($db->sql_layer == 'firebird') ? strtoupper($key) : $key) . $right_delim] = $value;
-								unset($cp_data[$key]);
-							}
-
-							$sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
-								SET ' . $db->sql_build_array('UPDATE', $cp_data) . "
-								WHERE user_id = $user_id";
-							$db->sql_query($sql);
-
-							if (!$db->sql_affectedrows())
-							{
-								$cp_data['user_id'] = (int) $user_id;
-
-								$db->sql_return_on_error(true);
-
-								$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data);
-								$db->sql_query($sql);
-
-								$db->sql_return_on_error(false);
-							}
-						}
+						$cp->update_profile_field_data($user_id, $cp_data);
 
 						trigger_error($user->lang['USER_PROFILE_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
 					}
@@ -1476,8 +1683,19 @@
 					$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
 				}
 
+				if (!$config['allow_avatar'] && $user_row['user_avatar_type'])
+				{
+					$error[] = $user->lang['USER_AVATAR_NOT_ALLOWED'];
+				}
+				else if ((($user_row['user_avatar_type'] == AVATAR_UPLOAD) && !$config['allow_avatar_upload']) ||
+				 (($user_row['user_avatar_type'] == AVATAR_REMOTE) && !$config['allow_avatar_remote']) ||
+				 (($user_row['user_avatar_type'] == AVATAR_GALLERY) && !$config['allow_avatar_local']))
+				{
+					$error[] = $user->lang['USER_AVATAR_TYPE_NOT_ALLOWED'];
+				}
+
 				// Generate users avatar
-				$avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
+				$avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height'], 'USER_AVATAR', true) : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
 
 				$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
 				$avatar_select = basename(request_var('avatar_select', ''));
@@ -1490,10 +1708,12 @@
 
 				$template->assign_vars(array(
 					'S_AVATAR'			=> true,
-					'S_CAN_UPLOAD'		=> ($can_upload && $config['allow_avatar_upload']) ? true : false,
-					'S_ALLOW_REMOTE'	=> ($config['allow_avatar_remote']) ? true : false,
-					'S_DISPLAY_GALLERY'	=> ($config['allow_avatar_local'] && !$display_gallery) ? true : false,
-					'S_IN_GALLERY'		=> ($config['allow_avatar_local'] && $display_gallery) ? true : false,
+					'S_CAN_UPLOAD'		=> $can_upload,
+					'S_UPLOAD_FILE'		=> ($config['allow_avatar'] && $can_upload && $config['allow_avatar_upload']) ? true : false,
+					'S_REMOTE_UPLOAD'	=> ($config['allow_avatar'] && $can_upload && $config['allow_avatar_remote_upload']) ? true : false,
+					'S_ALLOW_REMOTE'	=> ($config['allow_avatar'] && $config['allow_avatar_remote']) ? true : false,
+					'S_DISPLAY_GALLERY'	=> ($config['allow_avatar'] && $config['allow_avatar_local'] && !$display_gallery) ? true : false,
+					'S_IN_GALLERY'		=> ($config['allow_avatar'] && $config['allow_avatar_local'] && $display_gallery) ? true : false,
 
 					'AVATAR_IMAGE'			=> $avatar_img,
 					'AVATAR_MAX_FILESIZE'	=> $config['avatar_filesize'],
@@ -1551,9 +1771,9 @@
 				include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
 				include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
 
-				$enable_bbcode	= ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', !$user->optionget('bbcode'))) ? false : true) : false;
-				$enable_smilies	= ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', !$user->optionget('smilies'))) ? false : true) : false;
-				$enable_urls	= ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
+				$enable_bbcode	= ($config['allow_sig_bbcode']) ? (bool) $this->optionget($user_row, 'sig_bbcode') : false;
+				$enable_smilies	= ($config['allow_sig_smilies']) ? (bool) $this->optionget($user_row, 'sig_smilies') : false;
+				$enable_urls	= ($config['allow_sig_links']) ? (bool) $this->optionget($user_row, 'sig_links') : false;
 				$signature		= utf8_normalize_nfc(request_var('signature', (string) $user_row['user_sig'], true));
 
 				$preview		= (isset($_POST['preview'])) ? true : false;
@@ -1562,6 +1782,10 @@
 				{
 					include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
 
+					$enable_bbcode	= ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', false)) ? false : true) : false;
+					$enable_smilies	= ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', false)) ? false : true) : false;
+					$enable_urls	= ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
+
 					$message_parser = new parse_message($signature);
 
 					// Allowing Quote BBCode
@@ -1579,8 +1803,13 @@
 
 					if (!sizeof($error) && $submit)
 					{
+						$this->optionset($user_row, 'sig_bbcode', $enable_bbcode);
+						$this->optionset($user_row, 'sig_smilies', $enable_smilies);
+						$this->optionset($user_row, 'sig_links', $enable_urls);
+
 						$sql_ary = array(
 							'user_sig'					=> (string) $message_parser->message,
+							'user_options'				=> $user_row['user_options'],
 							'user_sig_bbcode_uid'		=> (string) $message_parser->bbcode_uid,
 							'user_sig_bbcode_bitfield'	=> (string) $message_parser->bbcode_bitfield
 						);
@@ -1871,6 +2100,29 @@
 						}
 
 					break;
+
+					case 'approve':
+
+						if (confirm_box(true))
+						{
+							if (!$group_id)
+							{
+								trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
+							}
+							group_user_attributes($action, $group_id, $user_id);
+						}
+						else
+						{
+							confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+								'u'				=> $user_id,
+								'i'				=> $id,
+								'mode'			=> $mode,
+								'action'		=> $action,
+								'g'				=> $group_id))
+							);
+						}
+
+					break;
 				}
 
 				// Add user to group?
@@ -1963,10 +2215,12 @@
 							'U_DEFAULT'			=> $this->u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'],
 							'U_DEMOTE_PROMOTE'	=> $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'],
 							'U_DELETE'			=> $this->u_action . "&amp;action=delete&amp;u=$user_id&amp;g=" . $data['group_id'],
+							'U_APPROVE'			=> ($group_type == 'pending') ? $this->u_action . "&amp;action=approve&amp;u=$user_id&amp;g=" . $data['group_id'] : '',
 
 							'GROUP_NAME'		=> ($group_type == 'special') ? $user->lang['G_' . $data['group_name']] : $data['group_name'],
 							'L_DEMOTE_PROMOTE'	=> ($data['group_leader']) ? $user->lang['GROUP_DEMOTE'] : $user->lang['GROUP_PROMOTE'],
 
+							'S_IS_MEMBER'		=> ($group_type != 'pending') ? true : false,
 							'S_NO_DEFAULT'		=> ($user_row['group_id'] != $data['group_id']) ? true : false,
 							'S_SPECIAL_GROUP'	=> ($group_type == 'special') ? true : false,
 							)
diff -x .svn -aruN 3.0.5.src/includes/acp/acp_words.php 3.0.6.src/includes/acp/acp_words.php
--- 3.0.5.src/includes/acp/acp_words.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/acp_words.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_words.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: acp_words.php 10039 2009-08-21 09:44:55Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -23,7 +23,7 @@
 class acp_words
 {
 	var $u_action;
-	
+
 	function main($id, $mode)
 	{
 		global $db, $user, $auth, $template, $cache;
@@ -47,8 +47,9 @@
 		switch ($action)
 		{
 			case 'edit':
+
 				$word_id = request_var('id', 0);
-				
+
 				if (!$word_id)
 				{
 					trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
@@ -73,7 +74,7 @@
 					'REPLACEMENT'		=> (isset($word_info['replacement'])) ? $word_info['replacement'] : '',
 					'S_HIDDEN_FIELDS'	=> $s_hidden_fields)
 				);
-				
+
 				return;
 
 			break;
@@ -84,11 +85,12 @@
 				{
 					trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
 				}
+
 				$word_id		= request_var('id', 0);
 				$word			= utf8_normalize_nfc(request_var('word', '', true));
 				$replacement	= utf8_normalize_nfc(request_var('replacement', '', true));
-				
-				if (!$word || !$replacement)
+
+				if ($word === '' || $replacement === '')
 				{
 					trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
 				}
diff -x .svn -aruN 3.0.5.src/includes/acp/info/acp_board.php 3.0.6.src/includes/acp/info/acp_board.php
--- 3.0.5.src/includes/acp/info/acp_board.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/info/acp_board.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_board.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: acp_board.php 9575 2009-06-12 14:41:03Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -26,6 +26,7 @@
 				'message'		=> array('title' => 'ACP_MESSAGE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_MESSAGES')),
 				'post'			=> array('title' => 'ACP_POST_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
 				'signature'		=> array('title' => 'ACP_SIGNATURE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
+				'feed'			=> array('title' => 'ACP_FEED_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
 				'registration'	=> array('title' => 'ACP_REGISTER_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
 
 				'auth'		=> array('title' => 'ACP_AUTH_SETTINGS', 'auth' => 'acl_a_server', 'cat' => array('ACP_CLIENT_COMMUNICATION')),
diff -x .svn -aruN 3.0.5.src/includes/acp/info/acp_permissions.php 3.0.6.src/includes/acp/info/acp_permissions.php
--- 3.0.5.src/includes/acp/info/acp_permissions.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/info/acp_permissions.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_permissions.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: acp_permissions.php 9887 2009-07-28 22:09:46Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -24,6 +24,7 @@
 				'trace'					=> array('title' => 'ACP_PERMISSION_TRACE', 'auth' => 'acl_a_viewauth', 'display' => false, 'cat' => array('ACP_PERMISSION_MASKS')),
 
 				'setting_forum_local'	=> array('title' => 'ACP_FORUM_PERMISSIONS', 'auth' => 'acl_a_fauth && (acl_a_authusers || acl_a_authgroups)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')),
+				'setting_forum_copy'	=> array('title' => 'ACP_FORUM_PERMISSIONS_COPY', 'auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')),
 				'setting_mod_local'		=> array('title' => 'ACP_FORUM_MODERATORS', 'auth' => 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')),
 				'setting_user_global'	=> array('title' => 'ACP_USERS_PERMISSIONS', 'auth' => 'acl_a_authusers && (acl_a_aauth || acl_a_mauth || acl_a_uauth)', 'cat' => array('ACP_GLOBAL_PERMISSIONS', 'ACP_CAT_USERS')),
 				'setting_user_local'	=> array('title' => 'ACP_USERS_FORUM_PERMISSIONS', 'auth' => 'acl_a_authusers && (acl_a_mauth || acl_a_fauth)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS', 'ACP_CAT_USERS')),
diff -x .svn -aruN 3.0.5.src/includes/acp/info/acp_send_statistics.php 3.0.6.src/includes/acp/info/acp_send_statistics.php
--- 3.0.5.src/includes/acp/info/acp_send_statistics.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/acp/info/acp_send_statistics.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package acp
+* @version $Id$
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class acp_send_statistics_info
+{
+	function module()
+	{
+		return array(
+			'filename'	=> 'acp_send_statistics',
+			'title'		=> 'ACP_SEND_STATISTICS',
+			'version'	=> '1.0.0',
+			'modes'		=> array(
+				'send_statistics'		=> array('title' => 'ACP_SEND_STATISTICS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')),
+			),
+		);
+	}
+
+	function install()
+	{
+	}
+
+	function uninstall()
+	{
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/acp/info/acp_users.php 3.0.6.src/includes/acp/info/acp_users.php
--- 3.0.5.src/includes/acp/info/acp_users.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/acp/info/acp_users.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: acp_users.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: acp_users.php 9758 2009-07-14 20:35:53Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -22,6 +22,7 @@
 			'modes'		=> array(
 				'overview'		=> array('title' => 'ACP_MANAGE_USERS', 'auth' => 'acl_a_user', 'cat' => array('ACP_CAT_USERS')),
 				'feedback'		=> array('title' => 'ACP_USER_FEEDBACK', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
+				'warnings'		=> array('title' => 'ACP_USER_WARNINGS', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
 				'profile'		=> array('title' => 'ACP_USER_PROFILE', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
 				'prefs'			=> array('title' => 'ACP_USER_PREFS', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
 				'avatar'		=> array('title' => 'ACP_USER_AVATAR', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
diff -x .svn -aruN 3.0.5.src/includes/auth/auth_apache.php 3.0.6.src/includes/auth/auth_apache.php
--- 3.0.5.src/includes/auth/auth_apache.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/auth/auth_apache.php	2009-11-16 11:10:10.000000000 -0600
@@ -5,7 +5,7 @@
 * Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him.
 *
 * @package login
-* @version $Id: auth_apache.php 9311 2009-01-29 13:08:44Z acydburn $
+* @version $Id: auth_apache.php 9636 2009-06-20 18:45:16Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -217,6 +217,7 @@
 		'group_id'		=> (int) $row['group_id'],
 		'user_type'		=> USER_NORMAL,
 		'user_ip'		=> $user->ip,
+		'user_new'		=> ($config['new_member_post_limit']) ? 1 : 0,
 	);
 }
 
diff -x .svn -aruN 3.0.5.src/includes/auth/auth_db.php 3.0.6.src/includes/auth/auth_db.php
--- 3.0.5.src/includes/auth/auth_db.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/auth/auth_db.php	2009-11-16 11:10:10.000000000 -0600
@@ -7,7 +7,7 @@
 * This is for authentication via the integrated user table
 *
 * @package login
-* @version $Id: auth_db.php 9312 2009-02-06 14:51:26Z Kellanved $
+* @version $Id: auth_db.php 10143 2009-09-15 09:08:37Z Kellanved $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -67,11 +67,12 @@
 	// Every auth module is able to define what to do by itself...
 	if ($config['max_login_attempts'] && $row['user_login_attempts'] >= $config['max_login_attempts'])
 	{
-		$confirm_id = request_var('confirm_id', '');
-		$confirm_code = request_var('confirm_code', '');
-
 		// Visual Confirmation handling
-		if (!$confirm_id)
+
+		$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+		$captcha->init(CONFIRM_LOGIN);
+		$vc_response = $captcha->validate();
+		if ($vc_response)
 		{
 			return array(
 				'status'		=> LOGIN_ERROR_ATTEMPTS,
@@ -79,47 +80,7 @@
 				'user_row'		=> $row,
 			);
 		}
-		else
-		{
-			global $user;
-
-			$sql = 'SELECT code
-				FROM ' . CONFIRM_TABLE . "
-				WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
-					AND session_id = '" . $db->sql_escape($user->session_id) . "'
-					AND confirm_type = " . CONFIRM_LOGIN;
-			$result = $db->sql_query($sql);
-			$confirm_row = $db->sql_fetchrow($result);
-			$db->sql_freeresult($result);
-
-			if ($confirm_row)
-			{
-				if (strcasecmp($confirm_row['code'], $confirm_code) === 0)
-				{
-					$sql = 'DELETE FROM ' . CONFIRM_TABLE . "
-						WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
-							AND session_id = '" . $db->sql_escape($user->session_id) . "'
-							AND confirm_type = " . CONFIRM_LOGIN;
-					$db->sql_query($sql);
-				}
-				else
-				{
-					return array(
-						'status'		=> LOGIN_ERROR_ATTEMPTS,
-						'error_msg'		=> 'CONFIRM_CODE_WRONG',
-						'user_row'		=> $row,
-					);
-				}
-			}
-			else
-			{
-				return array(
-					'status'		=> LOGIN_ERROR_ATTEMPTS,
-					'error_msg'		=> 'CONFIRM_CODE_WRONG',
-					'user_row'		=> $row,
-				);
-			}
-		}
+		
 	}
 
 	// If the password convert flag is set we need to convert it
@@ -157,7 +118,7 @@
 				$row['user_pass_convert'] = 0;
 				$row['user_password'] = $hash;
 			}
-			else 
+			else
 			{
 				// Although we weren't able to convert this password we have to
 				// increase login attempt count to make sure this cannot be exploited
diff -x .svn -aruN 3.0.5.src/includes/auth/auth_ldap.php 3.0.6.src/includes/auth/auth_ldap.php
--- 3.0.5.src/includes/auth/auth_ldap.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/auth/auth_ldap.php	2009-11-16 11:10:10.000000000 -0600
@@ -6,7 +6,7 @@
 * Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him.
 *
 * @package login
-* @version $Id: auth_ldap.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: auth_ldap.php 9783 2009-07-18 21:20:20Z toonarmy $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -63,9 +63,11 @@
 	// ldap_connect only checks whether the specified server is valid, so the connection might still fail
 	$search = @ldap_search(
 		$ldap,
-		$config['ldap_base_dn'],
+		htmlspecialchars_decode($config['ldap_base_dn']),
 		ldap_user_filter($user->data['username']),
-		(empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email']),
+		(empty($config['ldap_email'])) ?
+			array(htmlspecialchars_decode($config['ldap_uid'])) :
+			array(htmlspecialchars_decode($config['ldap_uid']), htmlspecialchars_decode($config['ldap_email'])),
 		0,
 		1
 	);
@@ -85,7 +87,7 @@
 		return sprintf($user->lang['LDAP_NO_IDENTITY'], $user->data['username']);
 	}
 
-	if (!empty($config['ldap_email']) && !isset($result[0][$config['ldap_email']]))
+	if (!empty($config['ldap_email']) && !isset($result[0][htmlspecialchars_decode($config['ldap_email'])]))
 	{
 		return $user->lang['LDAP_NO_EMAIL'];
 	}
@@ -152,7 +154,7 @@
 
 	if ($config['ldap_user'] || $config['ldap_password'])
 	{
-		if (!@ldap_bind($ldap, $config['ldap_user'], htmlspecialchars_decode($config['ldap_password'])))
+		if (!@ldap_bind($ldap, htmlspecialchars_decode($config['ldap_user']), htmlspecialchars_decode($config['ldap_password'])))
 		{
 			return $user->lang['LDAP_NO_SERVER_CONNECTION'];
 		}
@@ -160,9 +162,11 @@
 
 	$search = @ldap_search(
 		$ldap,
-		$config['ldap_base_dn'],
+		htmlspecialchars_decode($config['ldap_base_dn']),
 		ldap_user_filter($username),
-		(empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email']),
+		(empty($config['ldap_email'])) ?
+			array(htmlspecialchars_decode($config['ldap_uid'])) :
+			array(htmlspecialchars_decode($config['ldap_uid']), htmlspecialchars_decode($config['ldap_email'])),
 		0,
 		1
 	);
@@ -223,10 +227,11 @@
 				$ldap_user_row = array(
 					'username'		=> $username,
 					'user_password'	=> phpbb_hash($password),
-					'user_email'	=> (!empty($config['ldap_email'])) ? $ldap_result[0][$config['ldap_email']][0] : '',
+					'user_email'	=> (!empty($config['ldap_email'])) ? utf8_htmlspecialchars($ldap_result[0][htmlspecialchars_decode($config['ldap_email'])][0]) : '',
 					'group_id'		=> (int) $row['group_id'],
 					'user_type'		=> USER_NORMAL,
 					'user_ip'		=> $user->ip,
+					'user_new'		=> ($config['new_member_post_limit']) ? 1 : 0,
 				);
 
 				unset($ldap_result);
@@ -276,7 +281,8 @@
 	$filter = '(' . $config['ldap_uid'] . '=' . ldap_escape(htmlspecialchars_decode($username)) . ')';
 	if ($config['ldap_user_filter'])
 	{
-		$filter = "(&$filter({$config['ldap_user_filter']}))";
+		$_filter = ($config['ldap_user_filter'][0] == '(' && substr($config['ldap_user_filter'], -1) == ')') ? $config['ldap_user_filter'] : "({$config['ldap_user_filter']})";
+		$filter = "(&{$filter}{$_filter})";
 	}
 	return $filter;
 }
diff -x .svn -aruN 3.0.5.src/includes/auth.php 3.0.6.src/includes/auth.php
--- 3.0.5.src/includes/auth.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/auth.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: auth.php 8985 2008-10-09 13:18:38Z acydburn $
+* @version $Id: auth.php 9894 2009-07-30 14:35:29Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -64,9 +64,9 @@
 			$db->sql_freeresult($result);
 
 			$cache->put('_acl_options', $this->acl_options);
-			$this->acl_cache($userdata);
 		}
-		else if (!trim($userdata['user_permissions']))
+
+		if (!trim($userdata['user_permissions']))
 		{
 			$this->acl_cache($userdata);
 		}
@@ -608,22 +608,26 @@
 
 		// Now grab group settings - non-role specific...
 		$sql_ary[] = 'SELECT ug.user_id, a.forum_id, a.auth_setting, a.auth_option_id' . $sql_opts_select . '
-			FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug' . $sql_opts_from . '
+			FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g' . $sql_opts_from . '
 			WHERE a.auth_role_id = 0 ' .
 				(($sql_opts_from) ? 'AND a.auth_option_id = ao.auth_option_id ' : '') . '
 				AND a.group_id = ug.group_id
+				AND g.group_id = ug.group_id
 				AND ug.user_pending = 0
+				AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
 				' . (($sql_user) ? 'AND ug.' . $sql_user : '') . "
 				$sql_forum
 				$sql_opts";
 
 		// Now grab group settings - role specific...
 		$sql_ary[] = 'SELECT ug.user_id, a.forum_id, r.auth_setting, r.auth_option_id' . $sql_opts_select . '
-			FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . '
+			FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . '
 			WHERE a.auth_role_id = r.role_id ' .
 				(($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') . '
 				AND a.group_id = ug.group_id
+				AND g.group_id = ug.group_id
 				AND ug.user_pending = 0
+				AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
 				' . (($sql_user) ? 'AND ug.' . $sql_user : '') . "
 				$sql_forum
 				$sql_opts";
@@ -825,9 +829,11 @@
 
 		// Now grab group-specific permission settings
 		$sql = 'SELECT a.forum_id, a.auth_option_id, a.auth_role_id, a.auth_setting
-			FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug
+			FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g
 			WHERE a.group_id = ug.group_id
+				AND g.group_id = ug.group_id
 				AND ug.user_pending = 0
+				AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
 				AND ug.user_id = ' . $user_id;
 		$result = $db->sql_query($sql);
 
diff -x .svn -aruN 3.0.5.src/includes/bbcode.php 3.0.6.src/includes/bbcode.php
--- 3.0.5.src/includes/bbcode.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/bbcode.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: bbcode.php 9461 2009-04-17 15:23:17Z acydburn $
+* @version $Id: bbcode.php 10150 2009-09-16 08:11:52Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -128,7 +128,7 @@
 	*/
 	function bbcode_cache_init()
 	{
-		global $user, $phpbb_root_path;
+		global $phpbb_root_path, $template, $user;
 
 		if (empty($this->template_filename))
 		{
@@ -137,7 +137,7 @@
 
 			if (!@file_exists($this->template_filename))
 			{
-				if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
+				if (isset($template->orig_tpl_inherits_id) && $template->orig_tpl_inherits_id)
 				{
 					$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template/bbcode.html';
 					if (!@file_exists($this->template_filename))
@@ -265,7 +265,7 @@
 				case 6:
 					$this->bbcode_cache[$bbcode_id] = array(
 						'preg' => array(
-							'!\[color=(#[0-9a-f]{6}|[a-z\-]+):$uid\](.*?)\[/color:$uid\]!is'	=> $this->bbcode_tpl('color', $bbcode_id),
+							'!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+):$uid\](.*?)\[/color:$uid\]!is'	=> $this->bbcode_tpl('color', $bbcode_id),
 						)
 					);
 				break;
diff -x .svn -aruN 3.0.5.src/includes/cache.php 3.0.6.src/includes/cache.php
--- 3.0.5.src/includes/cache.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/cache.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acm
-* @version $Id: cache.php 8691 2008-07-28 13:26:20Z acydburn $
+* @version $Id: cache.php 9726 2009-07-07 12:59:30Z rxu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -84,7 +84,15 @@
 			$censors = array();
 			while ($row = $db->sql_fetchrow($result))
 			{
-				$censors['match'][] = '#(?<!\w)(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')(?!\w)#i';
+				if ((version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) && @preg_match('/\p{L}/u', 'a') !== false)
+				{
+					$censors['match'][] = '#(?<![\p{Nd}\p{L}_])(' . str_replace('\*', '[\p{Nd}\p{L}_]*?', preg_quote($row['word'], '#')) . ')(?![\p{Nd}\p{L}_])#u';
+				}
+				else
+				{
+					$censors['match'][] = '#(?<!\S)(' . str_replace('\*', '\S*?', preg_quote($row['word'], '#')) . ')(?!\S)#iu';
+				}
+
 				$censors['replace'][] = $row['replacement'];
 			}
 			$db->sql_freeresult($result);
diff -x .svn -aruN 3.0.5.src/includes/captcha/captcha_factory.php 3.0.6.src/includes/captcha/captcha_factory.php
--- 3.0.5.src/includes/captcha/captcha_factory.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/captcha/captcha_factory.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,100 @@
+<?php
+/**
+*
+* @package VC
+* @version $Id: captcha_factory.php 10224 2009-10-15 10:52:41Z Kellanved $
+* @copyright (c) 2008 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+/**
+* A small class for 3.0.x (no autoloader in 3.0.x)
+*
+* @package VC
+*/
+class phpbb_captcha_factory
+{
+	/**
+	* return an instance of class $name in file $name_plugin.php
+	*/
+	function &get_instance($name)
+	{
+		global $phpbb_root_path, $phpEx;
+
+		$name = basename($name);
+		if (!class_exists($name))
+		{
+			include($phpbb_root_path . "includes/captcha/plugins/{$name}_plugin." . $phpEx);
+		}
+		$instance = call_user_func(array($name, 'get_instance'));
+		return $instance;
+	}
+
+	/**
+	* Call the garbage collector
+	*/
+	function garbage_collect($name)
+	{
+		global $phpbb_root_path, $phpEx;
+
+		$name = basename($name);
+		if (!class_exists($name))
+		{
+			include($phpbb_root_path . "includes/captcha/plugins/{$name}_plugin." . $phpEx);
+		}
+		call_user_func(array($name, 'garbage_collect'), 0);
+	}
+
+	/**
+	* return a list of all discovered CAPTCHA plugins
+	*/
+	function get_captcha_types()
+	{
+		global $phpbb_root_path, $phpEx;
+
+		$captchas = array(
+			'available'		=> array(),
+			'unavailable'	=> array(),
+		);
+
+		$dp = @opendir($phpbb_root_path . 'includes/captcha/plugins');
+
+		if ($dp)
+		{
+			while (($file = readdir($dp)) !== false)
+			{
+				if ((preg_match('#_plugin\.' . $phpEx . '$#', $file)))
+				{
+					$name = preg_replace('#^(.*?)_plugin\.' . $phpEx . '$#', '\1', $file);
+					if (!class_exists($name))
+					{
+						include($phpbb_root_path . "includes/captcha/plugins/$file");
+					}
+
+					if (call_user_func(array($name, 'is_available')))
+					{
+						$captchas['available'][$name] = call_user_func(array($name, 'get_name'));
+					}
+					else
+					{
+						$captchas['unavailable'][$name] = call_user_func(array($name, 'get_name'));
+					}
+				}
+			}
+			closedir($dp);
+		}
+
+		return $captchas;
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/captcha/captcha_gd.php 3.0.6.src/includes/captcha/captcha_gd.php
--- 3.0.5.src/includes/captcha/captcha_gd.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/captcha/captcha_gd.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package VC
-* @version $Id: captcha_gd.php 9403 2009-03-20 16:34:06Z Kellanved $
+* @version $Id: captcha_gd.php 9609 2009-06-17 13:29:26Z Kellanved $
 * @copyright (c) 2006 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -34,8 +34,8 @@
 	function execute($code, $seed)
 	{
 		global $config;
-		srand($seed);
-		//mt_srand($seed);
+		
+		mt_srand($seed);
 
 		// Create image
 		$img = imagecreatetruecolor($this->width, $this->height);
@@ -108,7 +108,7 @@
 		
 		if ($config['captcha_gd_3d_noise'])
 		{
-			$xoffset = rand(0,9);
+			$xoffset = mt_rand(0,9);
 			$noise_bitmaps = $this->captcha_noise_bg_bitmaps();
 			for ($i = 0; $i < $code_len; ++$i)
 			{
diff -x .svn -aruN 3.0.5.src/includes/captcha/captcha_gd_wave.php 3.0.6.src/includes/captcha/captcha_gd_wave.php
--- 3.0.5.src/includes/captcha/captcha_gd_wave.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/captcha/captcha_gd_wave.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,845 @@
+<?php
+/**
+*
+* @package VC
+* @version $Id: captcha_gd_wave.php 9891 2009-07-29 22:59:51Z bantu $
+* @copyright (c) 2006 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* Wave3D CAPTCHA
+*
+* @author Robert Hetzler
+* @package VC
+*/
+class captcha
+{
+	var $width		= 360;
+	var $height		= 96;
+
+	function execute($code, $seed)
+	{
+		global $starttime;
+
+		// seed the random generator
+		mt_srand($seed);
+
+		// set height and width
+		$img_x = $this->width;
+		$img_y = $this->height;
+
+		// Generate image
+		$img	= imagecreatetruecolor($img_x, $img_y);
+		$x_grid = mt_rand(6, 10);
+		$y_grid = mt_rand(6, 10);
+
+		// Ok, so lets cut to the chase. We could accurately represent this in 3d and
+		// do all the appropriate linear transforms. my questions is... why bother?
+		// The computational overhead is unnecessary when you consider the simple fact:
+		// we're not here to accurately represent a model, but to just show off some random-ish
+		// polygons
+
+		// Conceive of 3 spaces.
+		// 1) planar-space (discrete "pixel" grid)
+		// 2) 3-space. (planar-space with z/height aspect)
+		// 3) image space (pixels on the screen)
+		// resolution of the planar-space we're embedding the text code in
+		$plane_x	= 100;
+		$plane_y	= 30;
+
+		$subdivision_factor = 3;
+
+		// $box is the 4 points in img_space that correspond to the corners of the plane in 3-space
+		$box = array(
+			'upper_left'	=> array(
+				'x' => mt_rand(5, 15),
+				'y' => mt_rand(10, 15)
+			),
+			'upper_right'	=> array(
+				'x' => mt_rand($img_x - 35, $img_x - 19),
+				'y' => mt_rand(10, 17)
+			),
+			'lower_left'	=> array(
+				'x' => mt_rand($img_x - 5, $img_x - 45),
+				'y' => mt_rand($img_y - 0, $img_y - 15)
+			),
+		);
+
+		$box['lower_right'] = array(
+			'x' => $box['lower_left']['x'] + $box['upper_left']['x'] - $box['upper_right']['x'],
+			'y' => $box['lower_left']['y'] + $box['upper_left']['y'] - $box['upper_right']['y'],
+		);
+
+		// TODO
+		$background = imagecolorallocate($img, mt_rand(155, 255), mt_rand(155, 255), mt_rand(155, 255));
+		imagefill($img, 0, 0, $background);
+		$black = imagecolorallocate($img, 0, 0, 0);
+
+		$random = array();
+		$fontcolors = array();
+
+		for ($i = 0; $i < 15; ++$i)
+		{
+			$random[$i] = imagecolorallocate($img, mt_rand(120, 255), mt_rand(120, 255), mt_rand(120, 255));
+		}
+
+		$fontcolors[0] = imagecolorallocate($img, mt_rand(0, 120), mt_rand(0, 120), mt_rand(0, 120));
+
+ 		$colors = array();
+
+		$minr = mt_rand(20, 30);
+		$ming = mt_rand(20, 30);
+		$minb = mt_rand(20, 30);
+
+		$maxr = mt_rand(150, 230);
+		$maxg = mt_rand(150, 230);
+		$maxb = mt_rand(150, 230);
+
+		for ($i = -30; $i <= 30; ++$i)
+		{
+			$coeff1 = ($i + 12) / 45;
+			$coeff2 = 1 - $coeff1;
+			$colors[$i] = imagecolorallocate($img, ($coeff2 * $maxr) + ($coeff1 * $minr), ($coeff2 * $maxg) + ($coeff1 * $ming), ($coeff2 * $maxb) + ($coeff1 * $minb));
+		}
+
+		// $img_buffer is the last row of 3-space positions (converted to img-space), cached
+		// (using this means we don't need to recalculate all 4 positions for each new polygon,
+		// merely the newest point that we're adding, which is then cached.
+		$img_buffer = array(array(), array());
+
+		// In image-space, the x- and y-offset necessary to move one unit in the x-direction in planar-space
+		$dxx = ($box['upper_right']['x'] - $box['upper_left']['x']) / ($subdivision_factor * $plane_x);
+		$dxy = ($box['upper_right']['y'] - $box['upper_left']['y']) / ($subdivision_factor * $plane_x);
+
+		// In image-space, the x- and y-offset necessary to move one unit in the y-direction in planar-space
+		$dyx = ($box['lower_right']['x'] - $box['upper_left']['x']) / ($subdivision_factor * $plane_y);
+		$dyy = ($box['lower_right']['y'] - $box['upper_left']['y']) / ($subdivision_factor * $plane_y);
+
+		// Initial captcha-letter offset in planar-space
+		$plane_offset_x = mt_rand(3, 8);
+		$plane_offset_y = mt_rand( 12, 15);
+
+		// character map
+		$map = $this->captcha_bitmaps();
+
+		// matrix
+		$plane = array();
+
+		// for each character, we'll silkscreen it into our boolean pixel plane
+		for ($c = 0, $code_num = strlen($code); $c < $code_num; ++$c)
+		{
+			$letter = $code[$c];
+
+			for ($x = $map['width'] - 1; $x >= 0; --$x)
+			{
+				for ($y = $map['height'] - 1; $y >= 0; --$y)
+				{
+					if ($map['data'][$letter][$y][$x])
+					{
+						$plane[$y + $plane_offset_y + (($c & 1) ? 1 : -1)][$x + $plane_offset_x] = true;
+					}
+				}
+			}
+			$plane_offset_x += 11;
+		}
+
+		// calculate our first buffer, we can't actually draw polys with these yet
+		// img_pos_prev == screen x,y location to our immediate left.
+		// img_pos_cur == current screen x,y location
+		// we calculate screen position of our
+		// current cell based on the difference from the previous cell
+		// rather than recalculating from absolute coordinates
+		// What we cache into the $img_buffer contains the raised text coordinates.
+		$img_pos_prev	= $img_buffer[0][0] = array($box['upper_left']['x'], $box['upper_left']['y']);
+		$cur_height		= $prev_height = $this->wave_height(0, 0, $subdivision_factor);
+		$full_x			= $plane_x * $subdivision_factor;
+		$full_y			= $plane_y * $subdivision_factor;
+
+		for ($x = 1; $x <= $full_x; ++$x)
+		{
+			$cur_height		= $this->wave_height($x, 0, $subdivision_factor);
+			$offset			= $cur_height - $prev_height;
+			$img_pos_cur	= array($img_pos_prev[0] + $dxx, $img_pos_prev[1] + $dxy + $offset);
+
+			$img_buffer[0][$x]	= $img_pos_cur;
+			$img_pos_prev		= $img_pos_cur;
+			$prev_height		= $cur_height;
+		}
+
+		for ($y = 1; $y <= $full_y; ++$y)
+		{
+			// swap buffers
+			$buffer_cur		= $y & 1;
+			$buffer_prev	= 1 - $buffer_cur;
+
+			$prev_height	= $this->wave_height(0, $y, $subdivision_factor);
+			$offset			= $prev_height - $this->wave_height(0, $y - 1, $subdivision_factor);
+			$img_pos_cur	= array($img_buffer[$buffer_prev][0][0] + $dyx, min($img_buffer[$buffer_prev][0][1] + $dyy + $offset, $img_y - 1));
+
+			// make sure we don't try to write off the page
+			$img_pos_prev	= $img_pos_cur;
+
+			$img_buffer[$buffer_cur][0]	= $img_pos_cur;
+
+			for ($x = 1; $x <= $full_x; ++$x)
+			{
+				$cur_height		= $this->wave_height($x, $y, $subdivision_factor) + $this->grid_height($x, $y, 1, $x_grid, $y_grid);
+
+				// height is a z-factor, not a y-factor
+				$offset			= $cur_height - $prev_height;
+				$img_pos_cur	= array($img_pos_prev[0] + $dxx, $img_pos_prev[1] + $dxy + $offset);
+
+				// height is float, index it to an int, get closest color
+				$color			= $colors[intval($cur_height)];
+				$img_pos_prev	= $img_pos_cur;
+				$prev_height	= $cur_height;
+
+				$y_index_old = intval(($y - 1) / $subdivision_factor);
+				$y_index_new = intval($y / $subdivision_factor);
+				$x_index_old = intval(($x - 1) / $subdivision_factor);
+				$x_index_new = intval($x / $subdivision_factor);
+
+				if (!empty($plane[$y_index_new][$x_index_new]))
+				{
+					$img_pos_cur[1]	+= $this->wave_height($x, $y, $subdivision_factor, 1) - 30 - $cur_height;
+					$color			= $colors[20];
+				}
+				$img_pos_cur[1] = min($img_pos_cur[1], $img_y - 1);
+				$img_buffer[$buffer_cur][$x] = $img_pos_cur;
+
+				// Smooth the edges as much as possible by having not more than one low<->high traingle per square
+				// Otherwise, just
+				$diag_down	= (empty($plane[$y_index_old][$x_index_old]) == empty($plane[$y_index_new][$x_index_new]));
+				$diag_up	= (empty($plane[$y_index_old][$x_index_new]) == empty($plane[$y_index_new][$x_index_old]));
+
+				// natural switching
+				$mode = ($x + $y) & 1;
+
+				// override if it requires it
+				if ($diag_down != $diag_up)
+				{
+					$mode = $diag_up;
+				}
+
+				if ($mode)
+				{
+					//		+-/			  /
+					// 1	|/		2	 /|
+					//		/			/-+
+					$poly1 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_prev][$x]);
+					$poly2 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_cur][$x], $img_buffer[$buffer_prev][$x]);
+				}
+				else
+				{
+					//		\			\-+
+					// 1	|\		2	 \|
+					//		+-\			  \
+					$poly1 = array_merge($img_buffer[$buffer_cur][$x - 1], $img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_cur][$x]);
+					$poly2 = array_merge($img_buffer[$buffer_prev][$x - 1], $img_buffer[$buffer_prev][$x], $img_buffer[$buffer_cur][$x]);
+				}
+
+				imagefilledpolygon($img, $poly1, 3, $color);
+				imagefilledpolygon($img, $poly2, 3, $color);
+			}
+		}
+
+		// Output image
+		header('Content-Type: image/png');
+		header('Cache-control: no-cache, no-store');
+		//$mtime = explode(' ', microtime());
+		//$totaltime = $mtime[0] + $mtime[1] - $starttime;
+
+		//echo $totaltime . "<br />\n";
+		//echo memory_get_usage() - $tmp;
+		imagepng($img);
+		imagedestroy($img);
+	}
+
+	function wave_height($x, $y, $factor = 1, $tweak = 0.7)
+	{
+		// stretch the wave. TODO: pretty it up
+		$x = $x/5 + 180;
+		$y = $y/4;
+		return ((sin($x / (3 * $factor)) + sin($y / (3 * $factor))) * 10 * $tweak);
+	}
+
+	function grid_height($x, $y, $factor = 1, $x_grid, $y_grid)
+	{
+		return ((!($x % ($x_grid * $factor)) || !($y % ($y_grid * $factor))) ? 3 : 0);
+	}
+
+	function captcha_bitmaps()
+	{
+		return array(
+			'width'		=> 9,
+			'height'	=> 13,
+			'data'		=> array(
+				'A' => array(
+					array(0,0,1,1,1,1,0,0,0),
+					array(0,1,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,1,1,1,1,1,1,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'B' => array(
+					array(1,1,1,1,1,1,0,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,1,1,1,1,1,0,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,1,1,1,1,1,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'C' => array(
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'D' => array(
+					array(1,1,1,1,1,1,1,0,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,1,1,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'E' => array(
+					array(0,0,1,1,1,1,1,1,1),
+					array(0,1,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,1,1,1,1,1,1,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(0,1,0,0,0,0,0,0,0),
+					array(0,0,1,1,1,1,1,1,1),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'F' => array(
+					array(0,0,1,1,1,1,1,1,0),
+					array(0,1,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,1,1,1,1,1,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'G' => array(
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,1,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'H' => array(
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,1,1,1,1,1,1,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'I' => array(
+					array(0,1,1,1,1,1,1,1,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,1,1,1,1,1,1,1,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'J' => array(
+					array(0,0,0,0,0,0,1,1,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,0,1),
+					array(0,0,1,0,0,0,0,1,0),
+					array(0,0,0,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'K' => array(
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,1,0,0,0),
+					array(1,0,0,0,1,0,0,0,0),
+					array(1,0,0,1,0,0,0,0,0),
+					array(1,0,1,0,0,0,0,0,0),
+					array(1,1,0,0,0,0,0,0,0),
+					array(1,0,1,0,0,0,0,0,0),
+					array(1,0,0,1,0,0,0,0,0),
+					array(1,0,0,0,1,0,0,0,0),
+					array(1,0,0,0,0,1,0,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'L' => array(
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(0,1,0,0,0,0,0,0,0),
+					array(0,0,1,1,1,1,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'M' => array(
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,1,1,0,0,0,1,1,0),
+					array(0,1,0,1,0,1,0,1,0),
+					array(0,1,0,0,1,0,0,1,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'N' => array(
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,1,0,0,0,0,0,0,1),
+					array(1,0,1,0,0,0,0,0,1),
+					array(1,0,0,1,0,0,0,0,1),
+					array(1,0,0,0,1,0,0,0,1),
+					array(1,0,0,0,0,1,0,0,1),
+					array(1,0,0,0,0,0,1,0,1),
+					array(1,0,0,0,0,0,0,1,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'O' => array(
+					array(0,0,0,1,1,1,0,0,0),
+					array(0,0,1,0,0,0,1,0,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,1,0,0,0,1,0,0),
+					array(0,0,0,1,1,1,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'P' => array(
+					array(1,1,1,1,1,1,0,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,1,1,1,1,1,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'Q' => array(
+					array(0,0,1,1,1,1,0,0,0),
+					array(0,1,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,1,0,0,1,0),
+					array(1,0,0,0,0,1,0,1,0),
+					array(0,1,0,0,0,0,1,0,0),
+					array(0,0,1,1,1,1,0,1,0),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'R' => array(
+					array(1,1,1,1,1,1,0,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(1,1,1,1,1,1,0,0,0),
+					array(1,0,1,0,0,0,0,0,0),
+					array(1,0,0,1,0,0,0,0,0),
+					array(1,0,0,0,1,0,0,0,0),
+					array(1,0,0,0,0,1,0,0,0),
+					array(1,0,0,0,0,0,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'S' => array(
+					array(0,0,1,1,1,1,1,1,1),
+					array(0,1,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(0,1,0,0,0,0,0,0,0),
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,1,0),
+					array(1,1,1,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'T' => array(
+					array(1,1,1,1,1,1,1,1,1),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'U' => array(
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'V' => array(
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,1,0,0,0,1,0,0),
+					array(0,0,0,1,0,1,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'W' => array(
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,1,0,0,0,1),
+					array(1,0,0,1,0,1,0,0,1),
+					array(1,0,1,0,0,0,1,0,1),
+					array(1,1,0,0,0,0,0,1,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'X' => array(
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,1,0,0,0,1,0,0),
+					array(0,0,0,1,0,1,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,1,0,1,0,0,0),
+					array(0,0,1,0,0,0,1,0,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'Y' => array(
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,1,0,0,0,1,0,0),
+					array(0,0,0,1,0,1,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'Z' => array(
+					array(1,1,1,1,1,1,1,1,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,1,0,0),
+					array(0,0,0,0,0,1,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,1,0,0,0,0,0),
+					array(0,0,1,0,0,0,0,0,0),
+					array(0,1,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,1,1,1,1,1,1,1,1),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'1' => array(
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,1,1,0,0,0,0),
+					array(0,0,1,0,1,0,0,0,0),
+					array(0,1,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,1,1,1,1,1,1,1,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'2' => array(
+					array(0,0,0,1,1,1,0,0,0),
+					array(0,0,1,0,0,0,1,0,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,1,0,0),
+					array(0,0,0,0,0,1,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,1,0,0,0,0,0),
+					array(0,0,1,0,0,0,0,0,0),
+					array(0,1,1,1,1,1,1,1,1),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'3' => array(
+					array(0,0,0,1,1,1,1,0,0),
+					array(0,0,1,0,0,0,0,1,0),
+					array(0,1,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,1,1,0,0),
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,0,1),
+					array(0,0,1,0,0,0,0,1,0),
+					array(0,0,0,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'4' => array(
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,1,1,0),
+					array(0,0,0,0,0,1,0,1,0),
+					array(0,0,0,0,1,0,0,1,0),
+					array(0,0,0,1,0,0,0,1,0),
+					array(0,0,1,0,0,0,0,1,0),
+					array(0,1,1,1,1,1,1,1,1),
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'5' => array(
+					array(1,1,1,1,1,1,1,1,1),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(0,1,0,0,0,0,0,0,0),
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'6' => array(
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,0,0,0,0,0,0),
+					array(1,0,0,1,1,1,1,0,0),
+					array(1,0,1,0,0,0,0,1,0),
+					array(1,1,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'7' => array(
+					array(1,1,1,1,1,1,1,1,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,1,0),
+					array(0,0,0,0,0,0,1,0,0),
+					array(0,0,0,0,0,1,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,1,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'8' => array(
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,1,0,0,0,0,0,1,0),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(1,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,0),
+					array(0,0,1,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+				'9' => array(
+					array(0,0,0,1,1,1,1,0,0),
+					array(0,0,1,0,0,0,0,1,0),
+					array(0,1,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,1,1),
+					array(0,0,1,1,1,1,1,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,0,0,0,0,0,0,0,1),
+					array(0,1,0,0,0,0,0,0,1),
+					array(0,0,1,0,0,0,0,1,0),
+					array(0,0,0,1,1,1,1,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+					array(0,0,0,0,0,0,0,0,0),
+				),
+			)
+		);
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/captcha/plugins/captcha_abstract.php 3.0.6.src/includes/captcha/plugins/captcha_abstract.php
--- 3.0.5.src/includes/captcha/plugins/captcha_abstract.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/captcha/plugins/captcha_abstract.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,375 @@
+<?php
+/**
+*
+* @package VC
+* @version $Id: captcha_abstract.php 10085 2009-09-01 15:08:04Z acydburn $
+* @copyright (c) 2006, 2008 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+
+/**
+* This class holds the code shared by the two default 3.0.x CAPTCHAs.
+*
+* @package VC
+*/
+class phpbb_default_captcha
+{
+	var $confirm_id;
+	var $confirm_code;
+	var $code;
+	var $seed;
+	var $attempts = 0;
+	var $type;
+	var $solved = 0;
+	var $captcha_vars = false;
+
+	function init($type)
+	{
+		global $config, $db, $user;
+
+		// read input
+		$this->confirm_id = request_var('confirm_id', '');
+		$this->confirm_code = request_var('confirm_code', '');
+		$refresh = request_var('refresh_vc', false) && $config['confirm_refresh'];
+
+		$this->type = (int) $type;
+
+		if (!strlen($this->confirm_id) || !$this->load_code())
+		{
+			// we have no confirm ID, better get ready to display something
+			$this->generate_code();
+		}
+		else if ($refresh)
+		{
+			$this->regenerate_code();
+		}
+	}
+
+	function execute_demo()
+	{
+		global $user;
+
+		$this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+		$this->seed = hexdec(substr(unique_id(), 4, 10));
+
+		// compute $seed % 0x7fffffff
+		$this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
+
+		$captcha = new captcha();
+		define('IMAGE_OUTPUT', 1);
+		$captcha->execute($this->code, $this->seed);
+	}
+
+	function execute()
+	{
+		if (empty($this->code))
+		{
+			if (!$this->load_code())
+			{
+				// invalid request, bail out
+				return false;
+			}
+		}
+		$captcha = new captcha();
+		define('IMAGE_OUTPUT', 1);
+		$captcha->execute($this->code, $this->seed);
+	}
+
+	function get_template()
+	{
+		global $config, $user, $template, $phpEx, $phpbb_root_path;
+
+		if ($this->is_solved())
+		{
+			return false;
+		}
+		else
+		{
+			$link = append_sid($phpbb_root_path . 'ucp.' . $phpEx,  'mode=confirm&amp;confirm_id=' . $this->confirm_id . '&amp;type=' . $this->type);
+			$explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
+
+			$template->assign_vars(array(
+				'CONFIRM_IMAGE_LINK'		=> $link,
+				'CONFIRM_IMAGE'				=> '<img src="' . $link . '" />',
+				'CONFIRM_IMG'				=> '<img src="' . $link . '" />',
+				'CONFIRM_ID'				=> $this->confirm_id,
+				'S_CONFIRM_CODE'			=> true,
+				'S_TYPE'					=> $this->type,
+				'S_CONFIRM_REFRESH'			=> ($config['enable_confirm'] && $config['confirm_refresh'] && $this->type == CONFIRM_REG) ? true : false,
+				'L_CONFIRM_EXPLAIN'			=> $explain,
+			));
+
+			return 'captcha_default.html';
+		}
+	}
+
+	function get_demo_template($id)
+	{
+		global $config, $user, $template, $phpbb_admin_path, $phpEx;
+
+		$variables = '';
+
+		if (is_array($this->captcha_vars))
+		{
+			foreach ($this->captcha_vars as $captcha_var => $template_var)
+			{
+				$variables .= '&amp;' . rawurlencode($captcha_var) . '=' . request_var($captcha_var, (int) $config[$captcha_var]);
+			}
+		}
+
+		// acp_captcha has a delivery function; let's use it
+		$template->assign_vars(array(
+			'CONFIRM_IMAGE'		=> append_sid($phpbb_admin_path . 'index.' . $phpEx, 'captcha_demo=1&amp;mode=visual&amp;i=' . $id . '&amp;select_captcha=' . $this->get_class_name()) . $variables,
+			'CONFIRM_ID'		=> $this->confirm_id,
+		));
+
+		return 'captcha_default_acp_demo.html';
+	}
+
+	function get_hidden_fields()
+	{
+		$hidden_fields = array();
+
+		// this is required for posting.php - otherwise we would forget about the captcha being already solved
+		if ($this->solved)
+		{
+			$hidden_fields['confirm_code'] = $this->confirm_code;
+		}
+		$hidden_fields['confirm_id'] = $this->confirm_id;
+		return $hidden_fields;
+	}
+
+	function garbage_collect($type)
+	{
+		global $db, $config;
+
+		$sql = 'SELECT DISTINCT c.session_id
+			FROM ' . CONFIRM_TABLE . ' c
+			LEFT JOIN ' . SESSIONS_TABLE . ' s ON (c.session_id = s.session_id)
+			WHERE s.session_id IS NULL' .
+				((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type);
+		$result = $db->sql_query($sql);
+
+		if ($row = $db->sql_fetchrow($result))
+		{
+			$sql_in = array();
+			do
+			{
+				$sql_in[] = (string) $row['session_id'];
+			}
+			while ($row = $db->sql_fetchrow($result));
+
+			if (sizeof($sql_in))
+			{
+				$sql = 'DELETE FROM ' . CONFIRM_TABLE . '
+					WHERE ' . $db->sql_in_set('session_id', $sql_in);
+				$db->sql_query($sql);
+			}
+		}
+		$db->sql_freeresult($result);
+	}
+
+	function uninstall()
+	{
+		$this->garbage_collect(0);
+	}
+
+	function install()
+	{
+		return;
+	}
+
+	function validate()
+	{
+		global $config, $db, $user;
+
+		$error = '';
+		if (!$this->confirm_id)
+		{
+			$error = $user->lang['CONFIRM_CODE_WRONG'];
+		}
+		else
+		{
+			if ($this->check_code())
+			{
+				// $this->delete_code(); commented out to allow posting.php to repeat the question
+				$this->solved = true;
+			}
+			else
+			{
+				$error = $user->lang['CONFIRM_CODE_WRONG'];
+			}
+		}
+
+		if (strlen($error))
+		{
+			// okay, incorrect answer. Let's ask a new question.
+			$this->new_attempt();
+			return $error;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	/**
+	* The old way to generate code, suitable for GD and non-GD. Resets the internal state.
+	*/
+	function generate_code()
+	{
+		global $db, $user;
+
+		$this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+		$this->confirm_id = md5(unique_id($user->ip));
+		$this->seed = hexdec(substr(unique_id(), 4, 10));
+		$this->solved = 0;
+		// compute $seed % 0x7fffffff
+		$this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
+
+		$sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+				'confirm_id'	=> (string) $this->confirm_id,
+				'session_id'	=> (string) $user->session_id,
+				'confirm_type'	=> (int) $this->type,
+				'code'			=> (string) $this->code,
+				'seed'			=> (int) $this->seed)
+		);
+		$db->sql_query($sql);
+	}
+
+	/**
+	* New Question, if desired.
+	*/
+	function regenerate_code()
+	{
+		global $db, $user;
+
+		$this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+		$this->seed = hexdec(substr(unique_id(), 4, 10));
+		$this->solved = 0;
+		// compute $seed % 0x7fffffff
+		$this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
+
+		$sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
+				'code'			=> (string) $this->code,
+				'seed'			=> (int) $this->seed)) . '
+				WHERE
+				confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
+					AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
+		$db->sql_query($sql);
+	}
+
+	/**
+	* New Question, if desired.
+	*/
+	function new_attempt()
+	{
+		global $db, $user;
+
+		$this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+		$this->seed = hexdec(substr(unique_id(), 4, 10));
+		$this->solved = 0;
+		// compute $seed % 0x7fffffff
+		$this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
+
+		$sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
+				'code'			=> (string) $this->code,
+				'seed'			=> (int) $this->seed)) . '
+				, attempts = attempts + 1
+				WHERE
+				confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
+					AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
+		$db->sql_query($sql);
+	}
+
+	/**
+	* Look up everything we need for painting&checking.
+	*/
+	function load_code()
+	{
+		global $db, $user;
+
+		$sql = 'SELECT code, seed, attempts
+			FROM ' . CONFIRM_TABLE . "
+			WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
+				AND session_id = '" . $db->sql_escape($user->session_id) . "'
+				AND confirm_type = " . $this->type;
+		$result = $db->sql_query($sql);
+		$row = $db->sql_fetchrow($result);
+		$db->sql_freeresult($result);
+
+		if ($row)
+		{
+			$this->code = $row['code'];
+			$this->seed = $row['seed'];
+			$this->attempts = $row['attempts'];
+			return true;
+		}
+
+		return false;
+	}
+
+	function check_code()
+	{
+		return (strcasecmp($this->code, $this->confirm_code) === 0);
+	}
+
+	function delete_code()
+	{
+		global $db, $user;
+
+		$sql = 'DELETE FROM ' . CONFIRM_TABLE . "
+			WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
+				AND session_id = '" . $db->sql_escape($user->session_id) . "'
+				AND confirm_type = " . $this->type;
+		$db->sql_query($sql);
+	}
+
+	function get_attempt_count()
+	{
+		return $this->attempts;
+	}
+
+	function reset()
+	{
+		global $db, $user;
+
+		$sql = 'DELETE FROM ' . CONFIRM_TABLE . "
+			WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
+				AND confirm_type = " . (int) $this->type;
+		$db->sql_query($sql);
+
+		// we leave the class usable by generating a new question
+		$this->generate_code();
+	}
+
+	function is_solved()
+	{
+		if (request_var('confirm_code', false) && $this->solved === 0)
+		{
+			$this->validate();
+		}
+		return (bool) $this->solved;
+	}
+
+	/**
+	*  API function
+	*/
+	function has_config()
+	{
+		return false;
+	}
+
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/captcha/plugins/phpbb_captcha_gd_plugin.php 3.0.6.src/includes/captcha/plugins/phpbb_captcha_gd_plugin.php
--- 3.0.5.src/includes/captcha/plugins/phpbb_captcha_gd_plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/captcha/plugins/phpbb_captcha_gd_plugin.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,165 @@
+<?php
+/**
+*
+* @package VC
+* @version $Id: phpbb_captcha_gd_plugin.php 10177 2009-09-22 10:03:17Z acydburn $
+* @copyright (c) 2006, 2008 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+/**
+* Placeholder for autoload
+*/
+if (!class_exists('phpbb_default_captcha'))
+{
+	include($phpbb_root_path . 'includes/captcha/plugins/captcha_abstract.' . $phpEx);
+}
+
+/**
+* @package VC
+*/
+class phpbb_captcha_gd extends phpbb_default_captcha
+{
+
+	var $captcha_vars = array(
+		'captcha_gd_x_grid'				=> 'CAPTCHA_GD_X_GRID',
+		'captcha_gd_y_grid'				=> 'CAPTCHA_GD_Y_GRID',
+		'captcha_gd_foreground_noise'	=> 'CAPTCHA_GD_FOREGROUND_NOISE',
+//		'captcha_gd'					=> 'CAPTCHA_GD_PREVIEWED',
+		'captcha_gd_wave'				=> 'CAPTCHA_GD_WAVE',
+		'captcha_gd_3d_noise'			=> 'CAPTCHA_GD_3D_NOISE',
+		'captcha_gd_fonts'				=> 'CAPTCHA_GD_FONTS',
+	);
+
+	function phpbb_captcha_gd()
+	{
+		global $phpbb_root_path, $phpEx;
+
+		if (!class_exists('captcha'))
+		{
+			include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
+		}
+	}
+
+	function &get_instance()
+	{
+		$instance =& new phpbb_captcha_gd();
+		return $instance;
+	}
+
+	function is_available()
+	{
+		global $phpbb_root_path, $phpEx;
+
+		if (@extension_loaded('gd'))
+		{
+			return true;
+		}
+
+		if (!function_exists('can_load_dll'))
+		{
+			include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
+		}
+
+		return can_load_dll('gd');
+	}
+
+	/**
+	*  API function
+	*/
+	function has_config()
+	{
+		return true;
+	}
+
+	function get_name()
+	{
+		return 'CAPTCHA_GD';
+	}
+
+	function get_class_name()
+	{
+		return 'phpbb_captcha_gd';
+	}
+
+	function acp_page($id, &$module)
+	{
+		global $db, $user, $auth, $template;
+		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+
+		$user->add_lang('acp/board');
+
+		$config_vars = array(
+			'enable_confirm'		=> 'REG_ENABLE',
+			'enable_post_confirm'	=> 'POST_ENABLE',
+			'confirm_refresh'		=> 'CONFIRM_REFRESH',
+			'captcha_gd'			=> 'CAPTCHA_GD',
+		);
+
+		$module->tpl_name = 'captcha_gd_acp';
+		$module->page_title = 'ACP_VC_SETTINGS';
+		$form_key = 'acp_captcha';
+		add_form_key($form_key);
+
+		$submit = request_var('submit', '');
+
+		if ($submit && check_form_key($form_key))
+		{
+			$captcha_vars = array_keys($this->captcha_vars);
+			foreach ($captcha_vars as $captcha_var)
+			{
+				$value = request_var($captcha_var, 0);
+				if ($value >= 0)
+				{
+					set_config($captcha_var, $value);
+				}
+			}
+
+			add_log('admin', 'LOG_CONFIG_VISUAL');
+			trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action));
+		}
+		else if ($submit)
+		{
+			trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action));
+		}
+		else
+		{
+			foreach ($this->captcha_vars as $captcha_var => $template_var)
+			{
+				$var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
+				$template->assign_var($template_var, $var);
+			}
+
+			$template->assign_vars(array(
+				'CAPTCHA_PREVIEW'	=> $this->get_demo_template($id),
+				'CAPTCHA_NAME'		=> $this->get_class_name(),
+				'U_ACTION'			=> $module->u_action,
+			));
+		}
+	}
+
+	function execute_demo()
+	{
+		global $config;
+
+		$config_old = $config;
+		foreach ($this->captcha_vars as $captcha_var => $template_var)
+		{
+				$config[$captcha_var] = request_var($captcha_var, (int) $config[$captcha_var]);
+		}
+		parent::execute_demo();
+		$config = $config_old;
+	}
+
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php 3.0.6.src/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php
--- 3.0.5.src/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,83 @@
+<?php
+/**
+*
+* @package VC
+* @version $Id: phpbb_captcha_gd_wave_plugin.php 9942 2009-08-10 09:46:38Z Kellanved $
+* @copyright (c) 2006, 2008 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+/**
+* Placeholder for autoload
+*/
+if (!class_exists('phpbb_default_captcha'))
+{
+	include($phpbb_root_path . 'includes/captcha/plugins/captcha_abstract.' . $phpEx);
+}
+
+/**
+* @package VC
+*/
+class phpbb_captcha_gd_wave extends phpbb_default_captcha
+{
+
+	function phpbb_captcha_gd_wave()
+	{
+		global $phpbb_root_path, $phpEx;
+
+		if (!class_exists('captcha'))
+		{
+			include_once($phpbb_root_path . 'includes/captcha/captcha_gd_wave.' . $phpEx);
+		}
+	}
+
+	function get_instance()
+	{
+		return new phpbb_captcha_gd_wave();
+	}
+
+	function is_available()
+	{
+		global $phpbb_root_path, $phpEx;
+
+		if (@extension_loaded('gd'))
+		{
+			return true;
+		}
+
+		if (!function_exists('can_load_dll'))
+		{
+			include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
+		}
+
+		return can_load_dll('gd');
+	}
+
+	function get_name()
+	{
+		return 'CAPTCHA_GD_3D';
+	}
+
+	function get_class_name()
+	{
+		return 'phpbb_captcha_gd_wave';
+	}
+
+	function acp_page($id, &$module)
+	{
+		global $config, $db, $template, $user;
+
+		trigger_error($user->lang['CAPTCHA_NO_OPTIONS'] . adm_back_link($module->u_action));
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php 3.0.6.src/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php
--- 3.0.5.src/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,72 @@
+<?php
+/**
+*
+* @package VC
+* @version $Id: phpbb_captcha_nogd_plugin.php 9940 2009-08-07 15:37:27Z Kellanved $
+* @copyright (c) 2006, 2008 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+/**
+* Placeholder for autoload
+*/
+if (!class_exists('phpbb_default_captcha'))
+{
+	include($phpbb_root_path . 'includes/captcha/plugins/captcha_abstract.' . $phpEx);
+}
+
+/**
+* @package VC
+*/
+class phpbb_captcha_nogd extends phpbb_default_captcha
+{
+
+	function phpbb_captcha_nogd()
+	{
+		global $phpbb_root_path, $phpEx;
+
+		if (!class_exists('captcha'))
+		{
+			include_once($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
+		}
+	}
+
+	function &get_instance()
+	{
+		$instance =& new phpbb_captcha_nogd();
+		return $instance;
+	}
+
+	function is_available()
+	{
+		return true;
+	}
+
+	function get_name()
+	{
+		return 'CAPTCHA_NO_GD';
+	}
+
+	function get_class_name()
+	{
+		return 'phpbb_captcha_nogd';
+	}
+
+	function acp_page($id, &$module)
+	{
+		global $user;
+
+		trigger_error($user->lang['CAPTCHA_NO_OPTIONS'] . adm_back_link($module->u_action));
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/captcha/plugins/phpbb_captcha_qa_plugin.php 3.0.6.src/includes/captcha/plugins/phpbb_captcha_qa_plugin.php
--- 3.0.5.src/includes/captcha/plugins/phpbb_captcha_qa_plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/captcha/plugins/phpbb_captcha_qa_plugin.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,947 @@
+<?php
+/**
+*
+* @package VC
+* @version $Id: phpbb_captcha_qa_plugin.php 10239 2009-10-27 13:54:03Z Kellanved $
+* @copyright (c) 2006, 2008 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+global $table_prefix;
+
+define('CAPTCHA_QUESTIONS_TABLE',	$table_prefix . 'captcha_questions');
+define('CAPTCHA_ANSWERS_TABLE',		$table_prefix . 'captcha_answers');
+define('CAPTCHA_QA_CONFIRM_TABLE',	$table_prefix . 'qa_confirm');
+
+/**
+* And now to something completely different. Let's make a captcha without extending the abstract class.
+* QA CAPTCHA sample implementation
+*
+* @package VC
+*/
+class phpbb_captcha_qa
+{
+	var $confirm_id;
+	var $answer;
+	var $question_ids;
+	var $question_text;
+	var $question_lang;
+	var $question_strict;
+	var $attempts = 0;
+	var $type;
+	// dirty trick: 0 is false, but can still encode that the captcha is not yet validated
+	var $solved = 0;
+
+	/**
+	* @param int $type  as per the CAPTCHA API docs, the type
+	*/
+	function init($type)
+	{
+		global $config, $db, $user;
+
+		// load our language file
+		$user->add_lang('captcha_qa');
+
+		// read input
+		$this->confirm_id = request_var('qa_confirm_id', '');
+		$this->answer = utf8_normalize_nfc(request_var('qa_answer', '', true));
+
+		$this->type = (int) $type;
+		$this->question_lang = $user->lang_name;
+
+		// we need all defined questions - shouldn't be too many, so we can just grab them
+		// try the user's lang first
+		$sql = 'SELECT question_id
+			FROM ' . CAPTCHA_QUESTIONS_TABLE . "
+			WHERE lang_iso = '" . $db->sql_escape($user->lang_name) . "'";
+		$result = $db->sql_query($sql, 3600);
+
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$this->question_ids[$row['question_id']] = $row['question_id'];
+		}
+		$db->sql_freeresult($result);
+
+		// fallback to the board default lang
+		if (!sizeof($this->question_ids))
+		{
+			$this->question_lang = $config['default_lang'];
+
+			$sql = 'SELECT question_id
+				FROM ' . CAPTCHA_QUESTIONS_TABLE . "
+				WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
+			$result = $db->sql_query($sql, 7200);
+
+			while ($row = $db->sql_fetchrow($result))
+			{
+				$this->question_ids[$row['question_id']] = $row['question_id'];
+			}
+			$db->sql_freeresult($result);
+		}
+
+		// okay, if there is a confirm_id, we try to load that confirm's state
+		if (!strlen($this->confirm_id) || !$this->load_answer())
+		{
+			// we have no valid confirm ID, better get ready to ask something
+			$this->select_question();
+		}
+	}
+
+	/**
+	*  API function
+	*/
+	function &get_instance()
+	{
+		$instance =& new phpbb_captcha_qa();
+
+		return $instance;
+	}
+
+	/**
+	* See if the captcha has created its tables.
+	*/
+	function is_installed()
+	{
+		global $db, $phpbb_root_path, $phpEx;
+
+		if (!class_exists('phpbb_db_tools'))
+		{
+			include("$phpbb_root_path/includes/db/db_tools.$phpEx");
+		}
+		$db_tool = new phpbb_db_tools($db);
+
+		return $db_tool->sql_table_exists(CAPTCHA_QUESTIONS_TABLE);
+	}
+
+	/**
+	*  API function - for the captcha to be available, it must have installed itself and there has to be at least one question in the board's default lang
+	*/
+	function is_available()
+	{
+		global $config, $db, $phpbb_root_path, $phpEx, $user;
+
+		// load language file for pretty display in the ACP dropdown
+		$user->add_lang('captcha_qa');
+
+		if (!phpbb_captcha_qa::is_installed())
+		{
+			return false;
+		}
+
+		$sql = 'SELECT COUNT(question_id) as count
+			FROM ' . CAPTCHA_QUESTIONS_TABLE . "
+			WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
+		$result = $db->sql_query($sql);
+		$row = $db->sql_fetchrow($result);
+		$db->sql_freeresult($result);
+
+		return ((bool) $row['count']);
+	}
+
+	/**
+	*  API function
+	*/
+	function has_config()
+	{
+		return true;
+	}
+
+	/**
+	*  API function
+	*/
+	function get_name()
+	{
+		return 'CAPTCHA_QA';
+	}
+
+	/**
+	*  API function
+	*/
+	function get_class_name()
+	{
+		return 'phpbb_captcha_qa';
+	}
+
+	/**
+	*  API function - not needed as we don't display an image
+	*/
+	function execute_demo()
+	{
+	}
+
+	/**
+	*  API function - not needed as we don't display an image
+	*/
+	function execute()
+	{
+	}
+
+	/**
+	*  API function - send the question to the template
+	*/
+	function get_template()
+	{
+		global $template;
+
+		if ($this->is_solved())
+		{
+			return false;
+		}
+		else
+		{
+			$template->assign_vars(array(
+				'QA_CONFIRM_QUESTION'		=> $this->question_text,
+				'QA_CONFIRM_ID'				=> $this->confirm_id,
+				'S_CONFIRM_CODE'			=> true,
+				'S_TYPE'					=> $this->type,
+			));
+
+			return 'captcha_qa.html';
+		}
+	}
+
+	/**
+	*  API function - we just display a mockup so that the captcha doesn't need to be installed
+	*/
+	function get_demo_template()
+	{
+		return 'captcha_qa_acp_demo.html';
+	}
+
+	/**
+	*  API function
+	*/
+	function get_hidden_fields()
+	{
+		$hidden_fields = array();
+
+		// this is required - otherwise we would forget about the captcha being already solved
+		if ($this->solved)
+		{
+			$hidden_fields['qa_answer'] = $this->answer;
+		}
+		$hidden_fields['qa_confirm_id'] = $this->confirm_id;
+
+		return $hidden_fields;
+	}
+
+	/**
+	*  API function
+	*/
+	function garbage_collect($type)
+	{
+		global $db, $config;
+
+		$sql = 'SELECT DISTINCT c.session_id
+			FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' c
+			LEFT JOIN ' . SESSIONS_TABLE . ' s
+				ON (c.session_id = s.session_id)
+			WHERE s.session_id IS NULL' .
+				((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type);
+		$result = $db->sql_query($sql);
+
+		if ($row = $db->sql_fetchrow($result))
+		{
+			$sql_in = array();
+
+			do
+			{
+				$sql_in[] = (string) $row['session_id'];
+			}
+			while ($row = $db->sql_fetchrow($result));
+
+			if (sizeof($sql_in))
+			{
+				$sql = 'DELETE FROM ' . CAPTCHA_QA_CONFIRM_TABLE . '
+					WHERE ' . $db->sql_in_set('session_id', $sql_in);
+				$db->sql_query($sql);
+			}
+		}
+		$db->sql_freeresult($result);
+	}
+
+	/**
+	*  API function - we don't drop the tables here, as that would cause the loss of all entered questions.
+	*/
+	function uninstall()
+	{
+		$this->garbage_collect(0);
+	}
+
+	/**
+	*  API function - set up shop
+	*/
+	function install()
+	{
+		global $db, $phpbb_root_path, $phpEx;
+
+		if (!class_exists('phpbb_db_tools'))
+		{
+			include("$phpbb_root_path/includes/db/db_tools.$phpEx");
+		}
+		$db_tool = new phpbb_db_tools($db);
+
+		$tables = array(CAPTCHA_QUESTIONS_TABLE, CAPTCHA_ANSWERS_TABLE, CAPTCHA_QA_CONFIRM_TABLE);
+
+		$schemas = array(
+				CAPTCHA_QUESTIONS_TABLE		=> array (
+					'COLUMNS' => array(
+						'question_id'	=> array('UINT', Null, 'auto_increment'),
+						'strict'		=> array('BOOL', 0),
+						'lang_id'		=> array('UINT', 0),
+						'lang_iso'		=> array('VCHAR:30', ''),
+						'question_text'	=> array('TEXT_UNI', ''),
+					),
+					'PRIMARY_KEY'		=> 'question_id',
+					'KEYS'				=> array(
+						'lang_iso'			=> array('INDEX', 'lang_iso'),
+					),
+				),
+				CAPTCHA_ANSWERS_TABLE		=> array (
+					'COLUMNS' => array(
+						'question_id'	=> array('UINT', 0),
+						'answer_text'	=> array('STEXT_UNI', ''),
+					),
+					'KEYS'				=> array(
+						'question_id'			=> array('INDEX', 'question_id'),
+					),
+				),
+				CAPTCHA_QA_CONFIRM_TABLE		=> array (
+					'COLUMNS' => array(
+						'session_id'	=> array('CHAR:32', ''),
+						'confirm_id'	=> array('CHAR:32', ''),
+						'lang_iso'		=> array('VCHAR:30', ''),
+						'question_id'	=> array('UINT', 0),
+						'attempts'		=> array('UINT', 0),
+						'confirm_type'	=> array('USINT', 0),
+					),
+					'KEYS'				=> array(
+						'session_id'			=> array('INDEX', 'session_id'),
+						'lookup'				=> array('INDEX', array('confirm_id', 'session_id', 'lang_iso')),
+					),
+					'PRIMARY_KEY'		=> 'confirm_id',
+				),
+		);
+
+		foreach($schemas as $table => $schema)
+		{
+			if (!$db_tool->sql_table_exists($table))
+			{
+				$db_tool->sql_create_table($table, $schema);
+			}
+		}
+	}
+
+	/**
+	*  API function - see what has to be done to validate
+	*/
+	function validate()
+	{
+		global $config, $db, $user;
+
+		$error = '';
+		
+		if (!sizeof($this->question_ids))
+		{
+			return false;
+		}
+		
+		if (!$this->confirm_id)
+		{
+			$error = $user->lang['CONFIRM_QUESTION_WRONG'];
+		}
+		else
+		{
+			if ($this->check_answer())
+			{
+				// $this->delete_code(); commented out to allow posting.php to repeat the question
+				$this->solved = true;
+			}
+			else
+			{
+				$error = $user->lang['CONFIRM_QUESTION_WRONG'];
+			}
+		}
+
+		if (strlen($error))
+		{
+			// okay, incorrect answer. Let's ask a new question.
+			$this->new_attempt();
+			$this->solved = false;
+
+			return $error;
+		}
+		else
+		{
+			return false;
+		}
+	}
+
+	/**
+	*  Select a question
+	*/
+	function select_question()
+	{
+		global $db, $user;
+
+
+		if (!sizeof($this->question_ids))
+		{
+			return false;
+		}
+		$this->confirm_id = md5(unique_id($user->ip));
+		$this->question = (int) array_rand($this->question_ids);
+
+		$sql = 'INSERT INTO ' . CAPTCHA_QA_CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+			'confirm_id'	=> (string) $this->confirm_id,
+			'session_id'	=> (string) $user->session_id,
+			'lang_iso'		=> (string) $this->question_lang,
+			'confirm_type'	=> (int) $this->type,
+			'question_id'	=> (int) $this->question,
+		));
+		$db->sql_query($sql);
+
+		$this->load_answer();
+	}
+
+	/**
+	* New Question, if desired.
+	*/
+	function reselect_question()
+	{
+		global $db, $user;
+		
+		if (!sizeof($this->question_ids))
+		{
+			return false;
+		}
+
+		$this->question = (int) array_rand($this->question_ids);
+		$this->solved = 0;
+
+		$sql = 'UPDATE ' . CAPTCHA_QA_CONFIRM_TABLE . '
+			SET question_id = ' . (int) $this->question . "
+			WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
+				AND session_id = '" . $db->sql_escape($user->session_id) . "'";
+		$db->sql_query($sql);
+
+		$this->load_answer();
+	}
+
+	/**
+	* Wrong answer, so we increase the attempts and use a different question.
+	*/
+	function new_attempt()
+	{
+		global $db, $user;
+
+		// yah, I would prefer a stronger rand, but this should work
+		$this->question = (int) array_rand($this->question_ids);
+		$this->solved = 0;
+
+		$sql = 'UPDATE ' . CAPTCHA_QA_CONFIRM_TABLE . '
+			SET question_id = ' . (int) $this->question . ",
+				attempts = attempts + 1
+			WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
+				AND session_id = '" . $db->sql_escape($user->session_id) . "'";
+		$db->sql_query($sql);
+
+		$this->load_answer();
+	}
+
+	/**
+	* Look up everything we need and populate the instance variables.
+	*/
+	function load_answer()
+	{
+		global $db, $user;
+		
+		if (!sizeof($this->question_ids))
+		{
+			return false;
+		}
+
+		$sql = 'SELECT con.question_id, attempts, question_text, strict
+			FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' con, ' . CAPTCHA_QUESTIONS_TABLE . " qes
+			WHERE con.question_id = qes.question_id
+				AND confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
+				AND session_id = '" . $db->sql_escape($user->session_id) . "'
+				AND qes.lang_iso = '" . $db->sql_escape($this->question_lang) . "'
+				AND confirm_type = " . $this->type;
+		$result = $db->sql_query($sql);
+		$row = $db->sql_fetchrow($result);
+		$db->sql_freeresult($result);
+
+		if ($row)
+		{
+			$this->question = $row['question_id'];
+
+			$this->attempts = $row['attempts'];
+			$this->question_strict = $row['strict'];
+			$this->question_text = $row['question_text'];
+
+			return true;
+		}
+
+		return false;
+	}
+
+	/**
+	*  The actual validation
+	*/
+	function check_answer()
+	{
+		global $db;
+
+		$answer = ($this->question_strict) ? utf8_normalize_nfc(request_var('qa_answer', '', true)) : utf8_clean_string(utf8_normalize_nfc(request_var('qa_answer', '', true)));
+
+		$sql = 'SELECT answer_text
+			FROM ' . CAPTCHA_ANSWERS_TABLE . '
+			WHERE question_id = ' . (int) $this->question;
+		$result = $db->sql_query($sql);
+
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$solution = ($this->question_strict) ? $row['answer_text'] : utf8_clean_string($row['answer_text']);
+
+			if ($solution === $answer)
+			{
+				$this->solved = true;
+
+				break;
+			}
+		}
+		$db->sql_freeresult($result);
+
+		return $this->solved;
+	}
+
+	/**
+	*  API function - clean the entry
+	*/
+	function delete_code()
+	{
+		global $db, $user;
+
+		$sql = 'DELETE FROM ' . CAPTCHA_QA_CONFIRM_TABLE . "
+			WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
+				AND session_id = '" . $db->sql_escape($user->session_id) . "'
+				AND confirm_type = " . $this->type;
+		$db->sql_query($sql);
+	}
+
+	/**
+	*  API function
+	*/
+	function get_attempt_count()
+	{
+		return $this->attempts;
+	}
+
+	/**
+	*  API function
+	*/
+	function reset()
+	{
+		global $db, $user;
+
+		$sql = 'DELETE FROM ' . CAPTCHA_QA_CONFIRM_TABLE . "
+			WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
+				AND confirm_type = " . (int) $this->type;
+		$db->sql_query($sql);
+
+		// we leave the class usable by generating a new question
+		$this->select_question();
+	}
+
+	/**
+	*  API function
+	*/
+	function is_solved()
+	{
+		if (request_var('qa_answer', false) && $this->solved === 0)
+		{
+			$this->validate();
+		}
+
+		return (bool) $this->solved;
+	}
+
+	/**
+	*  API function - The ACP backend, this marks the end of the easy methods
+	*/
+	function acp_page($id, &$module)
+	{
+		global $db, $user, $auth, $template;
+		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+
+		$user->add_lang('acp/board');
+		$user->add_lang('captcha_qa');
+
+		if (!$this->is_installed())
+		{
+			$this->install();
+		}
+
+		$module->tpl_name = 'captcha_qa_acp';
+		$module->page_title = 'ACP_VC_SETTINGS';
+		$form_key = 'acp_captcha';
+		add_form_key($form_key);
+
+		$submit = request_var('submit', false);
+		$question_id = request_var('question_id', 0);
+		$action = request_var('action', '');
+
+		// we have two pages, so users might want to navigate from one to the other
+		$list_url = $module->u_action . "&amp;configure=1&amp;select_captcha=" . $this->get_class_name();
+
+		$template->assign_vars(array(
+			'U_ACTION'		=> $module->u_action,
+			'QUESTION_ID'	=> $question_id ,
+			'CLASS'			=> $this->get_class_name(),
+		));
+
+		// show the list?
+		if (!$question_id && $action != 'add')
+		{
+			$this->acp_question_list($module);
+		}
+		else if ($question_id && $action == 'delete')
+		{
+			if (confirm_box(true))
+			{
+				$this->acp_delete_question($question_id);
+
+				trigger_error($user->lang['QUESTION_DELETED'] . adm_back_link($list_url));
+			}
+			else
+			{
+				confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+					'question_id'		=> $question_id,
+					'action'			=> $action,
+					'configure'			=> 1,
+					'select_captcha'	=> $this->get_class_name(),
+					))
+				);
+			}
+		}
+		else
+		{
+			// okay, show the editor
+			$error = false;
+			$input_question = request_var('question_text', '', true);
+			$input_answers = request_var('answers', '', true);
+			$input_lang = request_var('lang_iso', '', true);
+			$input_strict = request_var('strict', false);
+			$langs = $this->get_languages();
+
+			foreach ($langs as $lang => $entry)
+			{
+				$template->assign_block_vars('langs', array(
+					'ISO' => $lang,
+					'NAME' => $entry['name'],
+				));
+			}
+
+			$template->assign_vars(array(
+				'U_LIST' => $list_url,
+			));
+
+			if ($question_id)
+			{
+				if ($question = $this->acp_get_question_data($question_id))
+				{
+					$answers = (isset($input_answers[$lang])) ? $input_answers[$lang] : implode("\n", $question['answers']);
+
+					$template->assign_vars(array(
+						'QUESTION_TEXT'		=> ($input_question) ? $input_question : $question['question_text'],
+						'LANG_ISO'			=> ($input_lang) ? $input_lang : $question['lang_iso'],
+						'STRICT'			=> (isset($_REQUEST['strict'])) ? $input_strict : $question['strict'],
+						'ANSWERS'			=> $answers,
+					));
+				}
+				else
+				{
+					trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url));
+				}
+			}
+			else
+			{
+				$template->assign_vars(array(
+					'QUESTION_TEXT'		=> $input_question,
+					'LANG_ISO'			=> $input_lang,
+					'STRICT'			=> $input_strict,
+					'ANSWERS'			=> $input_answers,
+				));
+			}
+
+			if ($submit && check_form_key($form_key))
+			{
+				$data = $this->acp_get_question_input();
+
+				if (!$this->validate_input($data))
+				{
+					$template->assign_vars(array(
+						'S_ERROR'			=> true,
+					));
+				}
+				else
+				{
+					if ($question_id)
+					{
+						$this->acp_update_question($data, $question_id);
+					}
+					else
+					{
+						$this->acp_add_question($data);
+					}
+
+					add_log('admin', 'LOG_CONFIG_VISUAL');
+					trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($list_url));
+				}
+			}
+			else if ($submit)
+			{
+				trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url));
+			}
+		}
+	}
+
+	/**
+	*  This handles the list overview
+	*/
+	function acp_question_list(&$module)
+	{
+		global $db, $template;
+
+		$sql = 'SELECT *
+			FROM ' . CAPTCHA_QUESTIONS_TABLE;
+		$result = $db->sql_query($sql);
+
+		$template->assign_vars(array(
+			'S_LIST'			=> true,
+		));
+
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$url = $module->u_action . "&amp;question_id={$row['question_id']}&amp;configure=1&amp;select_captcha=" . $this->get_class_name() . '&amp;';
+
+			$template->assign_block_vars('questions', array(
+				'QUESTION_TEXT'		=> $row['question_text'],
+				'QUESTION_ID'		=> $row['question_id'],
+				'QUESTION_LANG'		=> $row['lang_iso'],
+				'U_DELETE'			=> "{$url}action=delete",
+				'U_EDIT'			=> "{$url}action=edit",
+			));
+		}
+		$db->sql_freeresult($result);
+	}
+
+	/**
+	*  Grab a question and bring it into a format the editor understands
+	*/
+	function acp_get_question_data($question_id)
+	{
+		global $db;
+
+		if ($question_id)
+		{
+			$sql = 'SELECT *
+				FROM ' . CAPTCHA_QUESTIONS_TABLE . '
+				WHERE question_id = ' . $question_id;
+			$result = $db->sql_query($sql);
+			$question = $db->sql_fetchrow($result);
+			$db->sql_freeresult($result);
+
+			if (!$question)
+			{
+				return false;
+			}
+
+			$question['answers'] = array();
+
+			$sql = 'SELECT *
+				FROM ' . CAPTCHA_ANSWERS_TABLE . '
+				WHERE question_id = ' . $question_id;
+			$result = $db->sql_query($sql);
+
+			while ($row = $db->sql_fetchrow($result))
+			{
+				$question['answers'][] = $row['answer_text'];
+			}
+			$db->sql_freeresult($result);
+
+			return $question;
+		}
+	}
+
+	/**
+	*  Grab a question from input and bring it into a format the editor understands
+	*/
+	function acp_get_question_input()
+	{
+		$answers = utf8_normalize_nfc(request_var('answers', '', true));
+		$question = array(
+			'question_text'	=> request_var('question_text', '', true),
+			'strict'		=> request_var('strict', false),
+			'lang_iso'		=> request_var('lang_iso', ''),
+			'answers'		=> (strlen($answers)) ? explode("\n", $answers) : '',
+		);
+
+		return $question;
+	}
+
+	/**
+	*  Update a question.
+	* param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
+	*/
+	function acp_update_question($data, $question_id)
+	{
+		global $db, $cache;
+
+		// easier to delete all answers than to figure out which to update
+		$sql = 'DELETE FROM ' . CAPTCHA_ANSWERS_TABLE . " WHERE question_id = $question_id";
+		$db->sql_query($sql);
+
+		$langs = $this->get_languages();
+		$question_ary = $data;
+		$question_ary['lang_id'] = $langs[$question_ary['lang_iso']]['id'];
+		unset($question_ary['answers']);
+
+		$sql = 'UPDATE ' . CAPTCHA_QUESTIONS_TABLE . '
+			SET ' . $db->sql_build_array('UPDATE', $question_ary) . "
+			WHERE question_id = $question_id";
+		$db->sql_query($sql);
+
+		$this->acp_insert_answers($data, $question_id);
+
+		$cache->destroy('sql', CAPTCHA_QUESTIONS_TABLE);
+	}
+
+	/**
+	*  Insert a question.
+	* param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
+	*/
+	function acp_add_question($data)
+	{
+		global $db, $cache;
+
+		$langs = $this->get_languages();
+		$question_ary = $data;
+
+		$question_ary['lang_id'] = $langs[$data['lang_iso']]['id'];
+		unset($question_ary['answers']);
+
+		$sql = 'INSERT INTO ' . CAPTCHA_QUESTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $question_ary);
+		$db->sql_query($sql);
+
+		$question_id = $db->sql_nextid();
+
+		$this->acp_insert_answers($data, $question_id);
+
+		$cache->destroy('sql', CAPTCHA_QUESTIONS_TABLE);
+	}
+
+	/**
+	*  Insert the answers.
+	* param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
+	*/
+	function acp_insert_answers($data, $question_id)
+	{
+		global $db, $cache;
+
+		foreach ($data['answers'] as $answer)
+		{
+			$answer_ary = array(
+				'question_id'	=> $question_id,
+				'answer_text'	=> $answer,
+			);
+
+			$sql = 'INSERT INTO ' . CAPTCHA_ANSWERS_TABLE . ' ' . $db->sql_build_array('INSERT', $answer_ary);
+			$db->sql_query($sql);
+		}
+
+		$cache->destroy('sql', CAPTCHA_ANSWERS_TABLE);
+	}
+
+	/**
+	*  Delete a question.
+	*/
+	function acp_delete_question($question_id)
+	{
+		global $db, $cache;
+
+		$tables = array(CAPTCHA_QUESTIONS_TABLE, CAPTCHA_ANSWERS_TABLE);
+
+		foreach ($tables as $table)
+		{
+			$sql = "DELETE FROM $table
+				WHERE question_id = $question_id";
+			$db->sql_query($sql);
+		}
+
+		$cache->destroy('sql', $tables);
+	}
+
+	/**
+	*  Check if the entered data can be inserted/used
+	* param mixed $data : an array as created from acp_get_question_input or acp_get_question_data
+	*/
+	function validate_input($question_data)
+	{
+		$langs = $this->get_languages();
+
+		if (!isset($question_data['lang_iso']) ||
+			!isset($question_data['question_text']) ||
+			!isset($question_data['strict']) ||
+			!isset($question_data['answers']))
+		{
+			return false;
+		}
+
+		if (!isset($langs[$question_data['lang_iso']]) ||
+			!strlen($question_data['question_text']) ||
+			!sizeof($question_data['answers']) ||
+			!is_array($question_data['answers']))
+		{
+			return false;
+		}
+
+		return true;
+	}
+
+	/**
+	* List the installed language packs
+	*/
+	function get_languages()
+	{
+		global $db;
+
+		$sql = 'SELECT *
+			FROM ' . LANG_TABLE;
+		$result = $db->sql_query($sql);
+
+		$langs = array();
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$langs[$row['lang_iso']] = array(
+				'name'	=> $row['lang_local_name'],
+				'id'	=> (int) $row['lang_id'],
+			);
+		}
+		$db->sql_freeresult($result);
+
+		return $langs;
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/captcha/plugins/phpbb_recaptcha_plugin.php 3.0.6.src/includes/captcha/plugins/phpbb_recaptcha_plugin.php
--- 3.0.5.src/includes/captcha/plugins/phpbb_recaptcha_plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/captcha/plugins/phpbb_recaptcha_plugin.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,336 @@
+<?php
+/**
+*
+* @package VC
+* @version $Id: phpbb_recaptcha_plugin.php 10177 2009-09-22 10:03:17Z acydburn $
+* @copyright (c) 2006, 2008 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+if (!class_exists('phpbb_default_captcha'))
+{
+	// we need the classic captcha code for tracking solutions and attempts
+	include($phpbb_root_path . 'includes/captcha/plugins/captcha_abstract.' . $phpEx);
+}
+
+/**
+* @package VC
+*/
+class phpbb_recaptcha extends phpbb_default_captcha
+{
+	var $recaptcha_server = 'http://api.recaptcha.net';
+	var $recaptcha_verify_server = 'api-verify.recaptcha.net';
+	var $challenge;
+	var $response;
+
+	function init($type)
+	{
+		global $config, $db, $user;
+
+		$user->add_lang('captcha_recaptcha');
+		parent::init($type);
+		$this->challenge = request_var('recaptcha_challenge_field', '');
+		$this->response = request_var('recaptcha_response_field', '');
+	}
+
+	function &get_instance()
+	{
+		$instance =& new phpbb_recaptcha();
+		return $instance;
+	}
+
+	function is_available()
+	{
+		global $config, $user;
+		$user->add_lang('captcha_recaptcha');
+		return (isset($config['recaptcha_pubkey']) && !empty($config['recaptcha_pubkey']));
+	}
+
+	/**
+	*  API function
+	*/
+	function has_config()
+	{
+		return true;
+	}
+
+	function get_name()
+	{
+		return 'CAPTCHA_RECAPTCHA';
+	}
+
+	function get_class_name()
+	{
+		return 'phpbb_recaptcha';
+	}
+
+	function acp_page($id, &$module)
+	{
+		global $config, $db, $template, $user;
+
+		$captcha_vars = array(
+			'recaptcha_pubkey'				=> 'RECAPTCHA_PUBKEY',
+			'recaptcha_privkey'				=> 'RECAPTCHA_PRIVKEY',
+		);
+
+		$module->tpl_name = 'captcha_recaptcha_acp';
+		$module->page_title = 'ACP_VC_SETTINGS';
+		$form_key = 'acp_captcha';
+		add_form_key($form_key);
+
+		$submit = request_var('submit', '');
+
+		if ($submit && check_form_key($form_key))
+		{
+			$captcha_vars = array_keys($captcha_vars);
+			foreach ($captcha_vars as $captcha_var)
+			{
+				$value = request_var($captcha_var, '');
+				if ($value)
+				{
+					set_config($captcha_var, $value);
+				}
+			}
+
+			add_log('admin', 'LOG_CONFIG_VISUAL');
+			trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action));
+		}
+		else if ($submit)
+		{
+			trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action));
+		}
+		else
+		{
+			foreach ($captcha_vars as $captcha_var => $template_var)
+			{
+				$var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, '') : ((isset($config[$captcha_var])) ? $config[$captcha_var] : '');
+				$template->assign_var($template_var, $var);
+			}
+
+			$template->assign_vars(array(
+				'CAPTCHA_PREVIEW'	=> $this->get_demo_template($id),
+				'CAPTCHA_NAME'		=> $this->get_class_name(),
+				'U_ACTION'			=> $module->u_action,
+			));
+
+		}
+	}
+
+	// not needed
+	function execute_demo()
+	{
+	}
+
+	// not needed
+	function execute()
+	{
+	}
+
+	function get_template()
+	{
+		global $config, $user, $template;
+
+		if ($this->is_solved())
+		{
+			return false;
+		}
+		else
+		{
+			$explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
+
+			$template->assign_vars(array(
+				'RECAPTCHA_SERVER'			=> $this->recaptcha_server,
+				'RECAPTCHA_PUBKEY'			=> isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '',
+				'RECAPTCHA_ERRORGET'		=> '',
+				'S_RECAPTCHA_AVAILABLE'		=> $this->is_available(),
+				'S_CONFIRM_CODE'			=> true,
+				'S_TYPE'					=> $this->type,
+				'L_CONFIRM_EXPLAIN'			=> $explain,
+			));
+
+			return 'captcha_recaptcha.html';
+		}
+	}
+
+	function get_demo_template($id)
+	{
+		return $this->get_template();
+	}
+
+	function get_hidden_fields()
+	{
+		$hidden_fields = array();
+
+		// this is required for posting.php - otherwise we would forget about the captcha being already solved
+		if ($this->solved)
+		{
+			$hidden_fields['confirm_code'] = $this->code;
+		}
+		$hidden_fields['confirm_id'] = $this->confirm_id;
+		return $hidden_fields;
+	}
+
+	function uninstall()
+	{
+		$this->garbage_collect(0);
+	}
+
+	function install()
+	{
+		return;
+	}
+
+	function validate()
+	{
+		if (!parent::validate())
+		{
+			return false;
+		}
+		else
+		{
+			return $this->recaptcha_check_answer();
+		}
+	}
+
+// Code from here on is based on recaptchalib.php
+/*
+ * This is a PHP library that handles calling reCAPTCHA.
+ *	- Documentation and latest version
+ *		  http://recaptcha.net/plugins/php/
+ *	- Get a reCAPTCHA API Key
+ *		  http://recaptcha.net/api/getkey
+ *	- Discussion group
+ *		  http://groups.google.com/group/recaptcha
+ *
+ * Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
+ * AUTHORS:
+ *   Mike Crawford
+ *   Ben Maurer
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+	/**
+	* Submits an HTTP POST to a reCAPTCHA server
+	* @param string $host
+	* @param string $path
+	* @param array $data
+	* @param int port
+	* @return array response
+	*/
+	function _recaptcha_http_post($host, $path, $data, $port = 80)
+	{
+		$req = $this->_recaptcha_qsencode ($data);
+
+		$http_request  = "POST $path HTTP/1.0\r\n";
+		$http_request .= "Host: $host\r\n";
+		$http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
+		$http_request .= "Content-Length: " . strlen($req) . "\r\n";
+		$http_request .= "User-Agent: reCAPTCHA/PHP/phpBB\r\n";
+		$http_request .= "\r\n";
+		$http_request .= $req;
+
+		$response = '';
+		if (false == ($fs = @fsockopen($host, $port, $errno, $errstr, 10)))
+		{
+			trigger_error('Could not open socket', E_USER_ERROR);
+		}
+
+		fwrite($fs, $http_request);
+
+		while (!feof($fs))
+		{
+			// One TCP-IP packet
+			$response .= fgets($fs, 1160);
+		}
+		fclose($fs);
+		$response = explode("\r\n\r\n", $response, 2);
+
+		return $response;
+	}
+
+	/**
+	* Calls an HTTP POST function to verify if the user's guess was correct
+	* @param array $extra_params an array of extra variables to post to the server
+	* @return ReCaptchaResponse
+	*/
+	function recaptcha_check_answer($extra_params = array())
+	{
+		global $config, $user;
+
+		//discard spam submissions
+		if ($this->challenge == null || strlen($this->challenge) == 0 || $this->response == null || strlen($this->response) == 0)
+		{
+			return $user->lang['RECAPTCHA_INCORRECT'];
+		}
+
+		$response = $this->_recaptcha_http_post($this->recaptcha_verify_server, '/verify',
+			array(
+				'privatekey'	=> $config['recaptcha_privkey'],
+				'remoteip'		=> $user->ip,
+				'challenge'		=> $this->challenge,
+				'response'		=> $this->response
+			) + $extra_params
+		);
+
+		$answers = explode("\n", $response[1]);
+
+		if (trim($answers[0]) === 'true')
+		{
+			$this->solved = true;
+			return false;
+		}
+		else
+		{
+			if ($answers[1] === 'incorrect-captcha-sol')
+			{
+				return $user->lang['RECAPTCHA_INCORRECT'];
+			}
+		}
+	}
+
+	/**
+	* Encodes the given data into a query string format
+	* @param $data - array of string elements to be encoded
+	* @return string - encoded request
+	*/
+	function _recaptcha_qsencode($data)
+	{
+		$req = '';
+		foreach ($data as $key => $value)
+		{
+			$req .= $key . '=' . urlencode(stripslashes($value)) . '&';
+		}
+
+		// Cut the last '&'
+		$req = substr($req, 0, strlen($req) - 1);
+		return $req;
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/constants.php 3.0.6.src/includes/constants.php
--- 3.0.5.src/includes/constants.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/constants.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: constants.php 9521 2009-05-31 10:46:40Z acydburn $
+* @version $Id: constants.php 10268 2009-11-14 20:15:50Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -25,7 +25,7 @@
 */
 
 // phpBB Version
-define('PHPBB_VERSION', '3.0.5');
+define('PHPBB_VERSION', '3.0.6');
 
 // QA-related
 // define('PHPBB_QA', 1);
@@ -91,6 +91,11 @@
 define('FORUM_FLAG_PRUNE_STICKY', 8);
 define('FORUM_FLAG_ACTIVE_TOPICS', 16);
 define('FORUM_FLAG_POST_REVIEW', 32);
+define('FORUM_FLAG_QUICK_REPLY', 64);
+
+// Forum Options... sequential order. Modifications should begin at number 10 (number 29 is maximum)
+define('FORUM_OPTION_FEED_NEWS', 1);
+define('FORUM_OPTION_FEED_EXCLUDE', 2);
 
 // Optional text flags
 define('OPTION_FLAG_BBCODE', 1);
@@ -160,6 +165,9 @@
 // Number of core BBCodes
 define('NUM_CORE_BBCODES', 12);
 
+// Smiley hard limit
+define('SMILEY_LIMIT', 1000);
+
 // Magic url types
 define('MAGIC_URL_EMAIL', 1);
 define('MAGIC_URL_FULL', 2);
diff -x .svn -aruN 3.0.5.src/includes/db/dbal.php 3.0.6.src/includes/db/dbal.php
--- 3.0.5.src/includes/db/dbal.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/db/dbal.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package dbal
-* @version $Id: dbal.php 9178 2008-12-06 11:11:10Z acydburn $
+* @version $Id: dbal.php 10041 2009-08-21 21:47:19Z terrafrost $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -235,8 +235,8 @@
 	*/
 	function sql_like_expression($expression)
 	{
-		$expression = str_replace(array('_', '%'), array("\_", "\%"), $expression);
-		$expression = str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
+		$expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression);
+		$expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
 
 		return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\'');
 	}
@@ -412,6 +412,24 @@
 	}
 
 	/**
+	* Run binary AND operator on DB column.
+	* Results in sql statement: "{$column_name} & (1 << {$bit}) {$compare}"
+	*
+	* @param string $column_name The column name to use
+	* @param int $bit The value to use for the AND operator, will be converted to (1 << $bit). Is used by options, using the number schema... 0, 1, 2...29
+	* @param string $compare Any custom SQL code after the check (for example "= 0")
+	*/
+	function sql_bit_and($column_name, $bit, $compare = '')
+	{
+		if (method_exists($this, '_sql_bit_and'))
+		{
+			return $this->_sql_bit_and($column_name, $bit, $compare);
+		}
+
+		return $column_name . ' & ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
+	}
+
+	/**
 	* Run more than one insert statement.
 	*
 	* @param string $table table name to run the statements on
@@ -435,8 +453,7 @@
 				// If by accident the sql array is only one-dimensional we build a normal insert statement
 				if (!is_array($_sql_ary))
 				{
-					$this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $sql_ary));
-					return true;
+					return $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $sql_ary));
 				}
 
 				$values = array();
@@ -447,7 +464,7 @@
 				$ary[] = '(' . implode(', ', $values) . ')';
 			}
 
-			$this->sql_query('INSERT INTO ' . $table . ' ' . ' (' . implode(', ', array_keys($sql_ary[0])) . ') VALUES ' . implode(', ', $ary));
+			return $this->sql_query('INSERT INTO ' . $table . ' ' . ' (' . implode(', ', array_keys($sql_ary[0])) . ') VALUES ' . implode(', ', $ary));
 		}
 		else
 		{
@@ -458,7 +475,12 @@
 					return false;
 				}
 
-				$this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $ary));
+				$result = $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $ary));
+
+				if (!$result)
+				{
+					return false;
+				}
 			}
 		}
 
diff -x .svn -aruN 3.0.5.src/includes/db/db_tools.php 3.0.6.src/includes/db/db_tools.php
--- 3.0.5.src/includes/db/db_tools.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/db/db_tools.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package dbal
-* @version $Id: db_tools.php 9495 2009-04-29 13:41:49Z acydburn $
+* @version $Id: db_tools.php 10248 2009-10-30 19:19:48Z acydburn $
 * @copyright (c) 2007 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -347,6 +347,11 @@
 		// holds the DDL for a column
 		$columns = $statements = array();
 
+		if ($this->sql_table_exists($table_name))
+		{
+			return $this->_sql_run_sql($statements);
+		}
+
 		// Begin transaction
 		$statements[] = 'begin';
 
@@ -448,11 +453,17 @@
 
 					case 'firebird':
 					case 'mssql':
+						// We need the data here
+						$old_return_statements = $this->return_statements;
+						$this->return_statements = true;
+
 						$primary_key_stmts = $this->sql_create_primary_key($table_name, $table_data['PRIMARY_KEY']);
 						foreach ($primary_key_stmts as $pk_stmt)
 						{
 							$statements[] = $pk_stmt;
 						}
+
+						$this->return_statements = $old_return_statements;
 					break;
 
 					case 'oracle':
@@ -580,6 +591,14 @@
 		}
 
 		$statements = array();
+		$sqlite = false;
+
+		// For SQLite we need to perform the schema changes in a much more different way
+		if ($this->db->sql_layer == 'sqlite' && $this->return_statements)
+		{
+			$sqlite_data = array();
+			$sqlite = true;
+		}
 
 		// Change columns?
 		if (!empty($schema_changes['change_columns']))
@@ -589,16 +608,27 @@
 				foreach ($columns as $column_name => $column_data)
 				{
 					// If the column exists we change it, else we add it ;)
-					if ($this->sql_column_exists($table, $column_name))
+					if ($column_exists = $this->sql_column_exists($table, $column_name))
 					{
-						$result = $this->sql_column_change($table, $column_name, $column_data);
+						$result = $this->sql_column_change($table, $column_name, $column_data, true);
 					}
 					else
 					{
-						$result = $this->sql_column_add($table, $column_name, $column_data);
+						$result = $this->sql_column_add($table, $column_name, $column_data, true);
 					}
 
-					if ($this->return_statements)
+					if ($sqlite)
+					{
+						if ($column_exists)
+						{
+							$sqlite_data[$table]['change_columns'][] = $result;
+						}
+						else
+						{
+							$sqlite_data[$table]['add_columns'][] = $result;
+						}
+					}
+					else if ($this->return_statements)
 					{
 						$statements = array_merge($statements, $result);
 					}
@@ -614,16 +644,27 @@
 				foreach ($columns as $column_name => $column_data)
 				{
 					// Only add the column if it does not exist yet, else change it (to be consistent)
-					if ($this->sql_column_exists($table, $column_name))
+					if ($column_exists = $this->sql_column_exists($table, $column_name))
 					{
-						$result = $this->sql_column_change($table, $column_name, $column_data);
+						$result = $this->sql_column_change($table, $column_name, $column_data, true);
 					}
 					else
 					{
-						$result = $this->sql_column_add($table, $column_name, $column_data);
+						$result = $this->sql_column_add($table, $column_name, $column_data, true);
 					}
 
-					if ($this->return_statements)
+					if ($sqlite)
+					{
+						if ($column_exists)
+						{
+							$sqlite_data[$table]['change_columns'][] = $result;
+						}
+						else
+						{
+							$sqlite_data[$table]['add_columns'][] = $result;
+						}
+					}
+					else if ($this->return_statements)
 					{
 						$statements = array_merge($statements, $result);
 					}
@@ -658,9 +699,13 @@
 					// Only remove the column if it exists...
 					if ($this->sql_column_exists($table, $column))
 					{
-						$result = $this->sql_column_remove($table, $column);
+						$result = $this->sql_column_remove($table, $column, true);
 
-						if ($this->return_statements)
+						if ($sqlite)
+						{
+							$sqlite_data[$table]['drop_columns'][] = $result;
+						}
+						else if ($this->return_statements)
 						{
 							$statements = array_merge($statements, $result);
 						}
@@ -674,9 +719,13 @@
 		{
 			foreach ($schema_changes['add_primary_keys'] as $table => $columns)
 			{
-				$result = $this->sql_create_primary_key($table, $columns);
+				$result = $this->sql_create_primary_key($table, $columns, true);
 
-				if ($this->return_statements)
+				if ($sqlite)
+				{
+					$sqlite_data[$table]['primary_key'] = $result;
+				}
+				else if ($this->return_statements)
 				{
 					$statements = array_merge($statements, $result);
 				}
@@ -717,6 +766,147 @@
 			}
 		}
 
+		if ($sqlite)
+		{
+			foreach ($sqlite_data as $table_name => $sql_schema_changes)
+			{
+				// Create temporary table with original data
+				$statements[] = 'begin';
+
+				$sql = "SELECT sql
+					FROM sqlite_master
+					WHERE type = 'table'
+						AND name = '{$table_name}'
+					ORDER BY type DESC, name;";
+				$result = $this->db->sql_query($sql);
+
+				if (!$result)
+				{
+					continue;
+				}
+
+				$row = $this->db->sql_fetchrow($result);
+				$this->db->sql_freeresult($result);
+
+				// Create a backup table and populate it, destroy the existing one
+				$statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql']);
+				$statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
+				$statements[] = 'DROP TABLE ' . $table_name;
+
+				// Get the columns...
+				preg_match('#\((.*)\)#s', $row['sql'], $matches);
+
+				$plain_table_cols = trim($matches[1]);
+				$new_table_cols = preg_split('/,(?![\s\w]+\))/m', $plain_table_cols);
+				$column_list = array();
+
+				foreach ($new_table_cols as $declaration)
+				{
+					$entities = preg_split('#\s+#', trim($declaration));
+					if ($entities[0] == 'PRIMARY')
+					{
+						continue;
+					}
+					$column_list[] = $entities[0];
+				}
+
+				// note down the primary key notation because sqlite only supports adding it to the end for the new table
+				$primary_key = false;
+				$_new_cols = array();
+
+				foreach ($new_table_cols as $key => $declaration)
+				{
+					$entities = preg_split('#\s+#', trim($declaration));
+					if ($entities[0] == 'PRIMARY')
+					{
+						$primary_key = $declaration;
+						continue;
+					}
+					$_new_cols[] = $declaration;
+				}
+
+				$new_table_cols = $_new_cols;
+
+				// First of all... change columns
+				if (!empty($sql_schema_changes['change_columns']))
+				{
+					foreach ($sql_schema_changes['change_columns'] as $column_sql)
+					{
+						foreach ($new_table_cols as $key => $declaration)
+						{
+							$entities = preg_split('#\s+#', trim($declaration));
+							if (strpos($column_sql, $entities[0] . ' ') === 0)
+							{
+								$new_table_cols[$key] = $column_sql;
+							}
+						}
+					}
+				}
+
+				if (!empty($sql_schema_changes['add_columns']))
+				{
+					foreach ($sql_schema_changes['add_columns'] as $column_sql)
+					{
+						$new_table_cols[] = $column_sql;
+					}
+				}
+
+				// Now drop them...
+				if (!empty($sql_schema_changes['drop_columns']))
+				{
+					foreach ($sql_schema_changes['drop_columns'] as $column_name)
+					{
+						// Remove from column list...
+						$new_column_list = array();
+						foreach ($column_list as $key => $value)
+						{
+							if ($value === $column_name)
+							{
+								continue;
+							}
+
+							$new_column_list[] = $value;
+						}
+
+						$column_list = $new_column_list;
+
+						// Remove from table...
+						$_new_cols = array();
+						foreach ($new_table_cols as $key => $declaration)
+						{
+							$entities = preg_split('#\s+#', trim($declaration));
+							if (strpos($column_name . ' ', $entities[0] . ' ') === 0)
+							{
+								continue;
+							}
+							$_new_cols[] = $declaration;
+						}
+						$new_table_cols = $_new_cols;
+					}
+				}
+
+				// Primary key...
+				if (!empty($sql_schema_changes['primary_key']))
+				{
+					$new_table_cols[] = 'PRIMARY KEY (' . implode(', ', $sql_schema_changes['primary_key']) . ')';
+				}
+				// Add a new one or the old primary key
+				else if ($primary_key !== false)
+				{
+					$new_table_cols[] = $primary_key;
+				}
+
+				$columns = implode(',', $column_list);
+
+				// create a new table and fill it up. destroy the temp one
+				$statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $new_table_cols) . ');';
+				$statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
+				$statements[] = 'DROP TABLE ' . $table_name . '_temp';
+
+				$statements[] = 'commit';
+			}
+		}
+
 		if ($this->return_statements)
 		{
 			return $statements;
@@ -801,7 +991,7 @@
 			case 'oracle':
 				$sql = "SELECT column_name
 					FROM user_tab_columns
-					WHERE table_name = '{$table}'";
+					WHERE LOWER(table_name) = '" . strtolower($table) . "'";
 				$result = $this->db->sql_query($sql);
 				while ($row = $this->db->sql_fetchrow($result))
 				{
@@ -819,7 +1009,7 @@
 			case 'firebird':
 				$sql = "SELECT RDB\$FIELD_NAME as FNAME
 					FROM RDB\$RELATION_FIELDS
-					WHERE RDB\$RELATION_NAME = '{$table}'";
+					WHERE RDB\$RELATION_NAME = '" . strtoupper($table) . "'";
 				$result = $this->db->sql_query($sql);
 				while ($row = $this->db->sql_fetchrow($result))
 				{
@@ -972,10 +1162,12 @@
 		{
 			case 'firebird':
 				$sql .= " {$column_type} ";
+				$return_array['column_type_sql_type'] = " {$column_type} ";
 
 				if (!is_null($column_data[1]))
 				{
 					$sql .= 'DEFAULT ' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' ';
+					$return_array['column_type_sql_default'] = ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' ';
 				}
 
 				$sql .= 'NOT NULL';
@@ -1004,11 +1196,13 @@
 					// For hexadecimal values do not use single quotes
 					if (strpos($column_data[1], '0x') === 0)
 					{
-						$sql_default .= 'DEFAULT (' . $column_data[1] . ') ';
+						$return_array['default'] = 'DEFAULT (' . $column_data[1] . ') ';
+						$sql_default .= $return_array['default'];
 					}
 					else
 					{
-						$sql_default .= 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
+						$return_array['default'] = 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
+						$sql_default .= $return_array['default'];
 					}
 				}
 
@@ -1129,7 +1323,7 @@
 	/**
 	* Add new column
 	*/
-	function sql_column_add($table_name, $column_name, $column_data)
+	function sql_column_add($table_name, $column_name, $column_data, $inline = false)
 	{
 		$column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
 		$statements = array();
@@ -1158,6 +1352,12 @@
 			break;
 
 			case 'sqlite':
+
+				if ($inline && $this->return_statements)
+				{
+					return $column_name . ' ' . $column_data['column_type_sql'];
+				}
+
 				if (version_compare(sqlite_libversion(), '3.0') == -1)
 				{
 					$sql = "SELECT sql
@@ -1222,7 +1422,7 @@
 	/**
 	* Drop column
 	*/
-	function sql_column_remove($table_name, $column_name)
+	function sql_column_remove($table_name, $column_name, $inline = false)
 	{
 		$statements = array();
 
@@ -1250,6 +1450,12 @@
 			break;
 
 			case 'sqlite':
+
+				if ($inline && $this->return_statements)
+				{
+					return $column_name;
+				}
+
 				if (version_compare(sqlite_libversion(), '3.0') == -1)
 				{
 					$sql = "SELECT sql
@@ -1292,7 +1498,7 @@
 
 					$columns = implode(',', $column_list);
 
-					$new_table_cols = $new_table_cols = preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols);
+					$new_table_cols = preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols);
 
 					// create a new table and fill it up. destroy the temp one
 					$statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');';
@@ -1347,6 +1553,11 @@
 	{
 		$statements = array();
 
+		if (!$this->sql_table_exists($table_name))
+		{
+			return $this->_sql_run_sql($statements);
+		}
+
 		// the most basic operation, get rid of the table
 		$statements[] = 'DROP TABLE ' . $table_name;
 
@@ -1405,7 +1616,7 @@
 	/**
 	* Add primary key
 	*/
-	function sql_create_primary_key($table_name, $column)
+	function sql_create_primary_key($table_name, $column, $inline = false)
 	{
 		$statements = array();
 
@@ -1432,6 +1643,12 @@
 			break;
 
 			case 'sqlite':
+
+				if ($inline && $this->return_statements)
+				{
+					return $column;
+				}
+
 				$sql = "SELECT sql
 					FROM sqlite_master
 					WHERE type = 'table'
@@ -1572,7 +1789,7 @@
 				case 'firebird':
 					$sql = "SELECT LOWER(RDB\$INDEX_NAME) as index_name
 						FROM RDB\$INDICES
-						WHERE RDB\$RELATION_NAME = " . strtoupper($table_name) . "
+						WHERE RDB\$RELATION_NAME = '" . strtoupper($table_name) . "'
 							AND RDB\$UNIQUE_FLAG IS NULL
 							AND RDB\$FOREIGN_KEY IS NULL";
 					$col = 'index_name';
@@ -1599,8 +1816,9 @@
 				case 'oracle':
 					$sql = "SELECT index_name
 						FROM user_indexes
-						WHERE table_name = '" . $table_name . "'
-							AND generated = 'N'";
+						WHERE table_name = '" . strtoupper($table_name) . "'
+							AND generated = 'N'
+							AND uniqueness = 'NONUNIQUE'";
 					$col = 'index_name';
 				break;
 
@@ -1639,7 +1857,7 @@
 	/**
 	* Change column type (not name!)
 	*/
-	function sql_column_change($table_name, $column_name, $column_data)
+	function sql_column_change($table_name, $column_name, $column_data, $inline = false)
 	{
 		$column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
 		$statements = array();
@@ -1648,11 +1866,40 @@
 		{
 			case 'firebird':
 				// Change type...
-				$statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql'];
+				if (!empty($column_data['column_type_sql_default']))
+				{
+					$statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql_type'];
+					$statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" SET DEFAULT ' . ' ' . $column_data['column_type_sql_default'];
+				}
+				else
+				{
+					$statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql_type'];
+				}
 			break;
 
 			case 'mssql':
 				$statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];
+
+				if (!empty($column_data['default']))
+				{
+					// Using TRANSACT-SQL for this statement because we do not want to have colliding data if statements are executed at a later stage
+					$statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
+						SET @drop_default_name =
+							(SELECT so.name FROM sysobjects so
+							JOIN sysconstraints sc ON so.id = sc.constid
+							WHERE object_name(so.parent_obj) = '{$table_name}'
+								AND so.xtype = 'D'
+								AND sc.colid = (SELECT colid FROM syscolumns
+									WHERE id = object_id('{$table_name}')
+										AND name = '{$column_name}'))
+						IF @drop_default_name <> ''
+						BEGIN
+							SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
+							EXEC(@cmd)
+						END
+						SET @cmd = 'ALTER TABLE [{$table_name}] ADD CONSTRAINT [DF_{$table_name}_{$column_name}_1] {$column_data['default']} FOR [{$column_name}]'
+						EXEC(@cmd)";
+				}
 			break;
 
 			case 'mysql_40':
@@ -1729,6 +1976,11 @@
 
 			case 'sqlite':
 
+				if ($inline && $this->return_statements)
+				{
+					return $column_name . ' ' . $column_data['column_type_sql'];
+				}
+
 				$sql = "SELECT sql
 					FROM sqlite_master
 					WHERE type = 'table'
diff -x .svn -aruN 3.0.5.src/includes/db/firebird.php 3.0.6.src/includes/db/firebird.php
--- 3.0.5.src/includes/db/firebird.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/db/firebird.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package dbal
-* @version $Id: firebird.php 8967 2008-10-02 12:04:12Z acydburn $
+* @version $Id: firebird.php 9970 2009-08-13 15:25:20Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -20,7 +20,7 @@
 
 /**
 * Firebird/Interbase Database Abstraction Layer
-* Minimum Requirement is Firebird 2.0
+* Minimum Requirement is Firebird 2.1
 * @package dbal
 */
 class dbal_firebird extends dbal
@@ -72,7 +72,7 @@
 			return @ibase_server_info($this->service_handle, IBASE_SVC_SERVER_VERSION);
 		}
 
-		return ($raw) ? '2.0' : 'Firebird/Interbase';
+		return ($raw) ? '2.1' : 'Firebird/Interbase';
 	}
 
 	/**
@@ -446,6 +446,11 @@
 		return $data;
 	}
 
+	function _sql_bit_and($column_name, $bit, $compare = '')
+	{
+		return 'BIN_AND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
+	}
+
 	/**
 	* return sql error array
 	* @access private
diff -x .svn -aruN 3.0.5.src/includes/db/oracle.php 3.0.6.src/includes/db/oracle.php
--- 3.0.5.src/includes/db/oracle.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/db/oracle.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package dbal
-* @version $Id: oracle.php 9175 2008-12-05 11:18:59Z acydburn $
+* @version $Id: oracle.php 10247 2009-10-30 17:21:20Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -136,7 +136,7 @@
 	*/
 	function _rewrite_where($where_clause)
 	{
-		preg_match_all('/\s*(AND|OR)?\s*([\w_.]++)\s*(?:(=|<[=>]?|>=?)\s*((?>\'(?>[^\']++|\'\')*+\'|[\d-.]+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER);
+		preg_match_all('/\s*(AND|OR)?\s*([\w_.()]++)\s*(?:(=|<[=>]?|>=?|LIKE)\s*((?>\'(?>[^\']++|\'\')*+\'|[\d-.()]+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER);
 		$out = '';
 		foreach ($result as $val)
 		{
@@ -255,13 +255,62 @@
 				// We overcome Oracle's 4000 char limit by binding vars
 				if (strlen($query) > 4000)
 				{
-					if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/s', $query, $regs))
+					if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/sU', $query, $regs))
 					{
 						if (strlen($regs[3]) > 4000)
 						{
 							$cols = explode(', ', $regs[2]);
+
 							preg_match_all('/\'(?:[^\']++|\'\')*+\'|[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER);
 
+							if (sizeof($cols) !== sizeof($vals))
+							{
+								// Try to replace some common data we know is from our restore script or from other sources
+								$regs[3] = str_replace("'||chr(47)||'", '/', $regs[3]);
+								$_vals = explode(', ', $regs[3]);
+
+								$vals = array();
+								$is_in_val = false;
+								$i = 0;
+								$string = '';
+
+								foreach ($_vals as $value)
+								{
+									if (strpos($value, "'") === false && !$is_in_val)
+									{
+										$vals[$i++] = $value;
+										continue;
+									}
+
+									if (substr($value, -1) === "'")
+									{
+										$vals[$i] = $string . (($is_in_val) ? ', ' : '') . $value;
+										$string = '';
+										$is_in_val = false;
+
+										if ($vals[$i][0] !== "'")
+										{
+											$vals[$i] = "''" . $vals[$i];
+										}
+										$i++;
+										continue;
+									}
+									else
+									{
+										$string .= (($is_in_val) ? ', ' : '') . $value;
+										$is_in_val = true;
+									}
+								}
+
+								if ($string)
+								{
+									// New value if cols != value
+									$vals[(sizeof($cols) !== sizeof($vals)) ? $i : $i - 1] .= $string;
+								}
+
+								$vals = array(0 => $vals);
+							}
+
 							$inserts = $vals[0];
 							unset($vals);
 
@@ -568,6 +617,11 @@
 		return $data;
 	}
 
+	function _sql_bit_and($column_name, $bit, $compare = '')
+	{
+		return 'BITAND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
+	}
+
 	/**
 	* return sql error array
 	* @access private
diff -x .svn -aruN 3.0.5.src/includes/diff/diff.php 3.0.6.src/includes/diff/diff.php
--- 3.0.5.src/includes/diff/diff.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/diff/diff.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package diff
-* @version $Id: diff.php 9505 2009-05-01 11:08:48Z acydburn $
+* @version $Id: diff.php 10168 2009-09-20 16:20:20Z acydburn $
 * @copyright (c) 2006 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -71,8 +71,10 @@
 	{
 		$count = 0;
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
+
 			if (is_a($edit, 'diff_op_add') || is_a($edit, 'diff_op_change'))
 			{
 				$count += $edit->nfinal();
@@ -92,8 +94,10 @@
 	{
 		$count = 0;
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
+
 			if (is_a($edit, 'diff_op_delete') || is_a($edit, 'diff_op_change'))
 			{
 				$count += $edit->norig();
@@ -128,8 +132,9 @@
 
 		$rev->_edits = array();
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
 			$rev->_edits[] = $edit->reverse();
 		}
 
@@ -143,13 +148,36 @@
 	*/
 	function is_empty()
 	{
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
-			if (!is_a($edit, 'diff_op_copy'))
+			$edit = $this->_edits[$i];
+
+			// skip diff_op_copy
+			if (is_a($edit, 'diff_op_copy'))
+			{
+				continue;
+			}
+
+			if (is_a($edit, 'diff_op_delete') || is_a($edit, 'diff_op_add'))
 			{
+				$orig = $edit->orig;
+				$final = $edit->final;
+
+				// We can simplify one case where the array is usually supposed to be empty...
+				if (sizeof($orig) == 1 && trim($orig[0]) === '') $orig = array();
+				if (sizeof($final) == 1 && trim($final[0]) === '') $final = array();
+
+				if (!$orig && !$final)
+				{
+					continue;
+				}
+
 				return false;
 			}
+
+			return false;
 		}
+
 		return true;
 	}
 
@@ -164,8 +192,10 @@
 	{
 		$lcs = 0;
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
+
 			if (is_a($edit, 'diff_op_copy'))
 			{
 				$lcs += sizeof($edit->orig);
@@ -185,8 +215,10 @@
 	{
 		$lines = array();
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
+
 			if ($edit->orig)
 			{
 				array_splice($lines, sizeof($lines), 0, $edit->orig);
@@ -206,8 +238,10 @@
 	{
 		$lines = array();
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
+
 			if ($edit->final)
 			{
 				array_splice($lines, sizeof($lines), 0, $edit->final);
@@ -258,8 +292,10 @@
 
 		$prevtype = null;
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
+
 			if ($prevtype == get_class($edit))
 			{
 				trigger_error("[diff] Edit sequence is non-optimal", E_USER_ERROR);
@@ -456,14 +492,14 @@
 	* @param array $final1  The first version to compare to.
 	* @param array $final2  The second version to compare to.
 	*/
-	function diff3(&$orig, &$final1, &$final2)
+	function diff3(&$orig, &$final1, &$final2, $preserve_cr = true)
 	{
 		$diff_engine = new diff_engine();
 
-		$diff_1 = $diff_engine->diff($orig, $final1);
-		$diff_2 = $diff_engine->diff($orig, $final2);
+		$diff_1 = $diff_engine->diff($orig, $final1, $preserve_cr);
+		$diff_2 = $diff_engine->diff($orig, $final2, $preserve_cr);
 
-		unset($engine);
+		unset($diff_engine);
 
 		$this->_edits = $this->_diff3($diff_1, $diff_2);
 	}
@@ -475,8 +511,10 @@
 	{
 		$conflicts = 0;
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
+
 			if ($edit->is_conflict())
 			{
 				$conflicts++;
@@ -506,8 +544,10 @@
 
 		$lines = array();
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
+
 			if ($edit->is_conflict())
 			{
 				// Start conflict label
@@ -544,8 +584,10 @@
 	{
 		$lines = array();
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
+
 			if ($edit->is_conflict())
 			{
 				$lines = array_merge($lines, $edit->final2);
@@ -566,8 +608,10 @@
 	{
 		$lines = array();
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
+
 			if ($edit->is_conflict())
 			{
 				$lines = array_merge($lines, $edit->final1);
@@ -588,8 +632,10 @@
 	{
 		$conflicts = array();
 
-		foreach ($this->_edits as $edit)
+		for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
 		{
+			$edit = $this->_edits[$i];
+
 			if ($edit->is_conflict())
 			{
 				$conflicts[] = array($edit->final1, $edit->final2);
@@ -713,6 +759,9 @@
 	{
 		if (!isset($this->_merged))
 		{
+			// Prepare the arrays before we compare them. ;)
+			$this->solve_prepare();
+
 			if ($this->final1 === $this->final2)
 			{
 				$this->_merged = &$this->final1;
@@ -727,7 +776,9 @@
 			}
 			else
 			{
+				// The following tries to aggressively solve conflicts...
 				$this->_merged = false;
+				$this->solve_conflict();
 			}
 		}
 
@@ -738,6 +789,267 @@
 	{
 		return ($this->merged() === false) ? true : false;
 	}
+
+	/**
+	* Function to prepare the arrays for comparing - we want to skip over newline changes
+	* @author acydburn
+	*/
+	function solve_prepare()
+	{
+		// We can simplify one case where the array is usually supposed to be empty...
+		if (sizeof($this->orig) == 1 && trim($this->orig[0]) === '') $this->orig = array();
+		if (sizeof($this->final1) == 1 && trim($this->final1[0]) === '') $this->final1 = array();
+		if (sizeof($this->final2) == 1 && trim($this->final2[0]) === '') $this->final2 = array();
+
+		// Now we only can have the case where the only difference between arrays are newlines, so compare all cases
+
+		// First, some strings we can compare...
+		$orig = $final1 = $final2 = '';
+
+		foreach ($this->orig as $null => $line) $orig .= trim($line);
+		foreach ($this->final1 as $null => $line) $final1 .= trim($line);
+		foreach ($this->final2 as $null => $line) $final2 .= trim($line);
+
+		// final1 === final2
+		if ($final1 === $final2)
+		{
+			// We preserve the part which will be used in the merge later
+			$this->final2 = $this->final1;
+		}
+		// final1 === orig
+		else if ($final1 === $orig)
+		{
+			// Here it does not really matter what we choose, but we will use the new code
+			$this->orig = $this->final1;
+		}
+		// final2 === orig
+		else if ($final2 === $orig)
+		{
+			// Here it does not really matter too (final1 will be used), but we will use the new code
+			$this->orig = $this->final2;
+		}
+	}
+
+	/**
+	* Find code portions from $orig in $final1 and use $final2 as merged instance if provided
+	* @author acydburn
+	*/
+	function _compare_conflict_seq($orig, $final1, $final2 = false)
+	{
+		$result = array('merge_found' => false, 'merge' => array());
+
+		$_orig = &$this->$orig;
+		$_final1 = &$this->$final1;
+
+		// Ok, we basically search for $orig in $final1
+		$compare_seq = sizeof($_orig);
+
+		// Go through the conflict code
+		for ($i = 0, $j = 0, $size = sizeof($_final1); $i < $size; $i++, $j = $i)
+		{
+			$line = $_final1[$i];
+			$skip = 0;
+
+			for ($x = 0; $x < $compare_seq; $x++)
+			{
+				// Try to skip all matching lines
+				if (trim($line) === trim($_orig[$x]))
+				{
+					$line = (++$j < $size) ? $_final1[$j] : $line;
+					$skip++;
+				}
+			}
+
+			if ($skip === $compare_seq)
+			{
+				$result['merge_found'] = true;
+
+				if ($final2 !== false)
+				{
+					$result['merge'] = array_merge($result['merge'], $this->$final2);
+				}
+				$i += ($skip - 1);
+			}
+			else if ($final2 !== false)
+			{
+				$result['merge'][] = $line;
+			}
+		}
+
+		return $result;
+	}
+
+	/**
+	* Tries to solve conflicts aggressively based on typical "assumptions"
+	* @author acydburn
+	*/
+	function solve_conflict()
+	{
+		$this->_merged = false;
+
+		// CASE ONE: orig changed into final2, but modified/unknown code in final1.
+		// IF orig is found "as is" in final1 we replace the code directly in final1 and populate this as final2/merge
+		if (sizeof($this->orig) && sizeof($this->final2))
+		{
+			$result = $this->_compare_conflict_seq('orig', 'final1', 'final2');
+
+			if ($result['merge_found'])
+			{
+				$this->final2 = $result['merge'];
+				$this->_merged = &$this->final2;
+				return;
+			}
+
+			$result = $this->_compare_conflict_seq('final2', 'final1');
+
+			if ($result['merge_found'])
+			{
+				$this->_merged = &$this->final1;
+				return;
+			}
+
+			// Try to solve $Id: diff.php 10168 2009-09-20 16:20:20Z acydburn $ issues. ;)
+			if (sizeof($this->orig) == 1 && sizeof($this->final1) == 1 && sizeof($this->final2) == 1)
+			{
+				$match = '#^' . preg_quote('* @version $Id: ', '#') . '[a-z\._\- ]+[0-9]+ [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9\:Z]+ [a-z0-9_\- ]+\$$#';
+
+				if (preg_match($match, $this->orig[0]) && preg_match($match, $this->final1[0]) && preg_match($match, $this->final2[0]))
+				{
+					$this->_merged = &$this->final2;
+					return;
+				}
+			}
+
+			$second_run = false;
+
+			// Try to solve issues where the only reason why the above did not work is a newline being removed in the final1 code but exist in the orig/final2 code
+			if (trim($this->orig[0]) === '' && trim($this->final2[0]) === '')
+			{
+				unset($this->orig[0], $this->final2[0]);
+				$this->orig = array_values($this->orig);
+				$this->final2 = array_values($this->final2);
+
+				$second_run = true;
+			}
+
+			// The same is true for a line at the end. ;)
+			if (sizeof($this->orig) && sizeof($this->final2) && sizeof($this->orig) === sizeof($this->final2) && trim($this->orig[sizeof($this->orig)-1]) === '' && trim($this->final2[sizeof($this->final2)-1]) === '')
+			{
+				unset($this->orig[sizeof($this->orig)-1], $this->final2[sizeof($this->final2)-1]);
+				$this->orig = array_values($this->orig);
+				$this->final2 = array_values($this->final2);
+
+				$second_run = true;
+			}
+
+			if ($second_run)
+			{
+				$result = $this->_compare_conflict_seq('orig', 'final1', 'final2');
+
+				if ($result['merge_found'])
+				{
+					$this->final2 = $result['merge'];
+					$this->_merged = &$this->final2;
+					return;
+				}
+
+				$result = $this->_compare_conflict_seq('final2', 'final1');
+
+				if ($result['merge_found'])
+				{
+					$this->_merged = &$this->final1;
+					return;
+				}
+			}
+
+			return;
+		}
+
+		// CASE TWO: Added lines from orig to final2 but final1 had added lines too. Just merge them.
+		if (!sizeof($this->orig) && $this->final1 !== $this->final2 && sizeof($this->final1) && sizeof($this->final2))
+		{
+			$result = $this->_compare_conflict_seq('final2', 'final1');
+
+			if ($result['merge_found'])
+			{
+				$this->final2 = $this->final1;
+				$this->_merged = &$this->final1;
+			}
+			else
+			{
+				$result = $this->_compare_conflict_seq('final1', 'final2');
+
+				if (!$result['merge_found'])
+				{
+					$this->final2 = array_merge($this->final1, $this->final2);
+					$this->_merged = &$this->final2;
+				}
+				else
+				{
+					$this->final2 = $this->final1;
+					$this->_merged = &$this->final1;
+				}
+			}
+
+			return;
+		}
+
+		// CASE THREE: Removed lines (orig has the to-remove line(s), but final1 has additional lines which does not need to be removed). Just remove orig from final1 and then use final1 as final2/merge
+		if (!sizeof($this->final2) && sizeof($this->orig) && sizeof($this->final1) && $this->orig !== $this->final1)
+		{
+			$result = $this->_compare_conflict_seq('orig', 'final1');
+
+			if (!$result['merge_found'])
+			{
+				return;
+			}
+
+			// First of all, try to find the code in orig in final1. ;)
+			$compare_seq = sizeof($this->orig);
+			$begin = $end = -1;
+			$j = 0;
+
+			for ($i = 0, $size = sizeof($this->final1); $i < $size; $i++)
+			{
+				$line = $this->final1[$i];
+
+				if (trim($line) === trim($this->orig[$j]))
+				{
+					// Mark begin
+					if ($begin === -1)
+					{
+						$begin = $i;
+					}
+
+					// End is always $i, the last found line
+					$end = $i;
+
+					if (isset($this->orig[$j+1]))
+					{
+						$j++;
+					}
+				}
+			}
+
+			if ($begin !== -1 && $begin + ($compare_seq - 1) == $end)
+			{
+				foreach ($this->final1 as $i => $line)
+				{
+					if ($i < $begin || $i > $end)
+					{
+						$merged[] = $line;
+					}
+				}
+
+				$this->final2 = $merged;
+				$this->_merged = &$this->final2;
+			}
+
+			return;
+		}
+
+		return;
+	}
 }
 
 /**
diff -x .svn -aruN 3.0.5.src/includes/diff/engine.php 3.0.6.src/includes/diff/engine.php
--- 3.0.5.src/includes/diff/engine.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/diff/engine.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package diff
-* @version $Id: engine.php 9251 2009-01-12 16:47:58Z acydburn $
+* @version $Id: engine.php 10163 2009-09-18 18:18:54Z acydburn $
 * @copyright (c) 2006 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -49,6 +49,11 @@
 */
 class diff_engine
 {
+	/**
+	* If set to true we trim all lines before we compare them. This ensures that sole space/tab changes do not trigger diffs.
+	*/
+	var $skip_whitespace_changes = true;
+
 	function diff(&$from_lines, &$to_lines, $preserve_cr = true)
 	{
 		// Remove empty lines...
@@ -85,7 +90,7 @@
 		// Skip leading common lines.
 		for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++)
 		{
-			if ($from_lines[$skip] !== $to_lines[$skip])
+			if (trim($from_lines[$skip]) !== trim($to_lines[$skip]))
 			{
 				break;
 			}
@@ -98,7 +103,7 @@
 
 		for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++)
 		{
-			if ($from_lines[$xi] !== $to_lines[$yi])
+			if (trim($from_lines[$xi]) !== trim($to_lines[$yi]))
 			{
 				break;
 			}
@@ -108,12 +113,12 @@
 		// Ignore lines which do not exist in both files.
 		for ($xi = $skip; $xi < $n_from - $endskip; $xi++)
 		{
-			$xhash[$from_lines[$xi]] = 1;
+			if ($this->skip_whitespace_changes) $xhash[trim($from_lines[$xi])] = 1; else $xhash[$from_lines[$xi]] = 1;
 		}
 
 		for ($yi = $skip; $yi < $n_to - $endskip; $yi++)
 		{
-			$line = $to_lines[$yi];
+			$line = ($this->skip_whitespace_changes) ? trim($to_lines[$yi]) : $to_lines[$yi];
 
 			if (($this->ychanged[$yi] = empty($xhash[$line])))
 			{
@@ -126,7 +131,7 @@
 
 		for ($xi = $skip; $xi < $n_from - $endskip; $xi++)
 		{
-			$line = $from_lines[$xi];
+			$line = ($this->skip_whitespace_changes) ? trim($from_lines[$xi]) : $from_lines[$xi];
 
 			if (($this->xchanged[$xi] = empty($yhash[$line])))
 			{
@@ -140,8 +145,21 @@
 		$this->_compareseq(0, sizeof($this->xv), 0, sizeof($this->yv));
 
 		// Merge edits when possible.
-		$this->_shift_boundaries($from_lines, $this->xchanged, $this->ychanged);
-		$this->_shift_boundaries($to_lines, $this->ychanged, $this->xchanged);
+		if ($this->skip_whitespace_changes)
+		{
+			$from_lines_clean = array_map('trim', $from_lines);
+			$to_lines_clean = array_map('trim', $to_lines);
+
+			$this->_shift_boundaries($from_lines_clean, $this->xchanged, $this->ychanged);
+			$this->_shift_boundaries($to_lines_clean, $this->ychanged, $this->xchanged);
+
+			unset($from_lines_clean, $to_lines_clean);
+		}
+		else
+		{
+			$this->_shift_boundaries($from_lines, $this->xchanged, $this->ychanged);
+			$this->_shift_boundaries($to_lines, $this->ychanged, $this->xchanged);
+		}
 
 		// Compute the edit operations.
 		$edits = array();
diff -x .svn -aruN 3.0.5.src/includes/diff/renderer.php 3.0.6.src/includes/diff/renderer.php
--- 3.0.5.src/includes/diff/renderer.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/diff/renderer.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package diff
-* @version $Id: renderer.php 9254 2009-01-13 10:55:04Z acydburn $
+* @version $Id: renderer.php 9861 2009-07-26 17:58:10Z toonarmy $
 * @copyright (c) 2006 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -536,7 +536,7 @@
 	*/
 	function get_diff_content($diff)
 	{
-		return '<textarea style="height: 290px;" class="full">' . htmlspecialchars($this->render($diff)) . '</textarea>';
+		return '<textarea style="height: 290px;" rows="15" cols="76" class="full">' . htmlspecialchars($this->render($diff)) . '</textarea>';
 	}
 
 	function _block_header($xbeg, $xlen, $ybeg, $ylen)
diff -x .svn -aruN 3.0.5.src/includes/functions_admin.php 3.0.6.src/includes/functions_admin.php
--- 3.0.5.src/includes/functions_admin.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_admin.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package acp
-* @version $Id: functions_admin.php 9441 2009-04-12 13:21:25Z acydburn $
+* @version $Id: functions_admin.php 10261 2009-11-09 16:29:30Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -17,95 +17,47 @@
 }
 
 /**
-* Recalculate Binary Tree
-function recalc_btree($sql_id, $sql_table, $module_class = '')
+* Recalculate Nested Sets
+*
+* @param int	$new_id	first left_id (should start with 1)
+* @param string	$pkey	primary key-column (containing the id for the parent_id of the children)
+* @param string	$table	constant or fullname of the table
+* @param int	$parent_id parent_id of the current set (default = 0)
+* @param array	$where	contains strings to compare closer on the where statement (additional)
+*
+* @author EXreaction
+*/
+function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = array())
 {
 	global $db;
 
-	if (!$sql_id || !$sql_table)
-	{
-		return;
-	}
-
-	$sql_where = ($module_class) ? " WHERE module_class = '" . $db->sql_escape($module_class) . "'" : '';
-
-	// Reset to minimum possible left and right id
-	$sql = "SELECT MIN(left_id) as min_left_id, MIN(right_id) as min_right_id
-		FROM $sql_table
-		$sql_where";
+	$sql = 'SELECT *
+		FROM ' . $table . '
+		WHERE parent_id = ' . (int) $parent_id .
+		((!empty($where)) ? ' AND ' . implode(' AND ', $where) : '') . '
+		ORDER BY left_id ASC';
 	$result = $db->sql_query($sql);
-	$row = $db->sql_fetchrow($result);
-	$db->sql_freeresult($result);
-
-	$substract = (int) (min($row['min_left_id'], $row['min_right_id']) - 1);
-
-	if ($substract > 0)
+	while ($row = $db->sql_fetchrow($result))
 	{
-		$sql = "UPDATE $sql_table
-			SET left_id = left_id - $substract, right_id = right_id - $substract
-			$sql_where";
-		$db->sql_query($sql);
-	}
-
-	$sql = "SELECT $sql_id, parent_id, left_id, right_id
-		FROM $sql_table
-		$sql_where
-		ORDER BY left_id ASC, parent_id ASC, $sql_id ASC";
-	$f_result = $db->sql_query($sql);
-
-	while ($item_data = $db->sql_fetchrow($f_result))
-	{
-		if ($item_data['parent_id'])
-		{
-			$sql = "SELECT left_id, right_id
-				FROM $sql_table
-				$sql_where " . (($sql_where) ? 'AND' : 'WHERE') . "
-					$sql_id = {$item_data['parent_id']}";
-			$result = $db->sql_query($sql);
-
-			if (!$row = $db->sql_fetchrow($result))
-			{
-				$sql = "UPDATE $sql_table SET parent_id = 0 WHERE $sql_id = " . $item_data[$sql_id];
-				$db->sql_query($sql);
-			}
-			$db->sql_freeresult($result);
-
-			$sql = "UPDATE $sql_table
-				SET left_id = left_id + 2, right_id = right_id + 2
-				$sql_where " . (($sql_where) ? 'AND' : 'WHERE') . "
-					left_id > {$row['right_id']}";
-			$db->sql_query($sql);
+		// First we update the left_id for this module
+		if ($row['left_id'] != $new_id)
+		{
+			$db->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', array('left_id' => $new_id)) . " WHERE $pkey = {$row[$pkey]}");
+		}
+		$new_id++;
 
-			$sql = "UPDATE $sql_table
-				SET right_id = right_id + 2
-				$sql_where " . (($sql_where) ? 'AND' : 'WHERE') . "
-					{$row['left_id']} BETWEEN left_id AND right_id";
-			$db->sql_query($sql);
+		// Then we go through any children and update their left/right id's
+		recalc_nested_sets($new_id, $pkey, $table, $row[$pkey], $where);
 
-			$item_data['left_id'] = $row['right_id'];
-			$item_data['right_id'] = $row['right_id'] + 1;
-		}
-		else
+		// Then we come back and update the right_id for this module
+		if ($row['right_id'] != $new_id)
 		{
-			$sql = "SELECT MAX(right_id) AS right_id
-				FROM $sql_table
-				$sql_where";
-			$result = $db->sql_query($sql);
-			$row = $db->sql_fetchrow($result);
-			$db->sql_freeresult($result);
-
-			$item_data['left_id'] = $row['right_id'] + 1;
-			$item_data['right_id'] = $row['right_id'] + 2;
+			$db->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', array('right_id' => $new_id)) . " WHERE $pkey = {$row[$pkey]}");
 		}
-
-		$sql = "UPDATE $sql_table
-			SET left_id = {$item_data['left_id']}, right_id = {$item_data['right_id']}
-			WHERE $sql_id = " . $item_data[$sql_id];
-		$db->sql_query($sql);
+		$new_id++;
 	}
-	$db->sql_freeresult($f_result);
+	$db->sql_freeresult($result);
 }
-*/
 
 /**
 * Simple version of jumpbox, just lists authed forums
@@ -117,7 +69,7 @@
 	$acl = ($ignore_acl) ? '' : (($only_acl_post) ? 'f_post' : array('f_list', 'a_forum', 'a_forumadd', 'a_forumdel'));
 
 	// This query is identical to the jumpbox one
-	$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
+	$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, forum_flags, forum_options, left_id, right_id
 		FROM ' . FORUMS_TABLE . '
 		ORDER BY left_id ASC';
 	$result = $db->sql_query($sql, 600);
@@ -302,7 +254,7 @@
 
 		if ($acl_list == '' || ($acl_list != '' && $auth->acl_gets($acl_list, $row['forum_id'])))
 		{
-			$rowset[] = ($id_only) ? $row['forum_id'] : $row;
+			$rowset[] = ($id_only) ? (int) $row['forum_id'] : $row;
 		}
 	}
 
@@ -355,11 +307,156 @@
 }
 
 /**
+* Copies permissions from one forum to others
+*
+* @param int	$src_forum_id		The source forum we want to copy permissions from
+* @param array	$dest_forum_ids		The destination forum(s) we want to copy to
+* @param bool	$clear_dest_perms	True if destination permissions should be deleted
+* @param bool	$add_log			True if log entry should be added
+*
+* @return bool						False on error
+*
+* @author bantu
+*/
+function copy_forum_permissions($src_forum_id, $dest_forum_ids, $clear_dest_perms = true, $add_log = true)
+{
+	global $db;
+
+	// Only one forum id specified
+	if (!is_array($dest_forum_ids))
+	{
+		$dest_forum_ids = array($dest_forum_ids);
+	}
+
+	// Make sure forum ids are integers
+	$src_forum_id = (int) $src_forum_id;
+	$dest_forum_ids = array_map('intval', $dest_forum_ids);
+
+	// No source forum or no destination forums specified
+	if (empty($src_forum_id) || empty($dest_forum_ids))
+	{
+		return false;
+	}
+
+	// Check if source forum exists
+	$sql = 'SELECT forum_name
+		FROM ' . FORUMS_TABLE . '
+		WHERE forum_id = ' . $src_forum_id;
+	$result = $db->sql_query($sql);
+	$src_forum_name = $db->sql_fetchfield('forum_name');
+	$db->sql_freeresult($result);
+
+	// Source forum doesn't exist
+	if (empty($src_forum_name))
+	{
+		return false;
+	}
+
+	// Check if destination forums exists
+	$sql = 'SELECT forum_id, forum_name
+		FROM ' . FORUMS_TABLE . '
+		WHERE ' . $db->sql_in_set('forum_id', $dest_forum_ids);
+	$result = $db->sql_query($sql);
+
+	$dest_forum_ids = $dest_forum_names = array();
+	while ($row = $db->sql_fetchrow($result))
+	{
+		$dest_forum_ids[]	= (int) $row['forum_id'];
+		$dest_forum_names[]	= $row['forum_name'];
+	}
+	$db->sql_freeresult($result);
+
+	// No destination forum exists
+	if (empty($dest_forum_ids))
+	{
+		return false;
+	}
+
+	// From the mysql documentation:
+	// Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear
+	// in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
+	// Due to this we stay on the safe side if we do the insertion "the manual way"
+
+	// Rowsets we're going to insert
+	$users_sql_ary = $groups_sql_ary = array();
+
+	// Query acl users table for source forum data
+	$sql = 'SELECT user_id, auth_option_id, auth_role_id, auth_setting
+		FROM ' . ACL_USERS_TABLE . '
+		WHERE forum_id = ' . $src_forum_id;
+	$result = $db->sql_query($sql);
+
+	while ($row = $db->sql_fetchrow($result))
+	{
+		$row = array(
+			'user_id'			=> (int) $row['user_id'],
+			'auth_option_id'	=> (int) $row['auth_option_id'],
+			'auth_role_id'		=> (int) $row['auth_role_id'],
+			'auth_setting'		=> (int) $row['auth_setting'],
+		);
+
+		foreach ($dest_forum_ids as $dest_forum_id)
+		{
+			$users_sql_ary[] = $row + array('forum_id' => $dest_forum_id);
+		}
+	}
+	$db->sql_freeresult($result);
+
+	// Query acl groups table for source forum data
+	$sql = 'SELECT group_id, auth_option_id, auth_role_id, auth_setting
+		FROM ' . ACL_GROUPS_TABLE . '
+		WHERE forum_id = ' . $src_forum_id;
+	$result = $db->sql_query($sql);
+
+	while ($row = $db->sql_fetchrow($result))
+	{
+		$row = array(
+			'group_id'			=> (int) $row['group_id'],
+			'auth_option_id'	=> (int) $row['auth_option_id'],
+			'auth_role_id'		=> (int) $row['auth_role_id'],
+			'auth_setting'		=> (int) $row['auth_setting'],
+		);
+
+		foreach ($dest_forum_ids as $dest_forum_id)
+		{
+			$groups_sql_ary[] = $row + array('forum_id' => $dest_forum_id);
+		}
+	}
+	$db->sql_freeresult($result);
+
+	$db->sql_transaction('begin');
+
+	// Clear current permissions of destination forums
+	if ($clear_dest_perms)
+	{
+		$sql = 'DELETE FROM ' . ACL_USERS_TABLE . '
+			WHERE ' . $db->sql_in_set('forum_id', $dest_forum_ids);
+		$db->sql_query($sql);
+
+		$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
+			WHERE ' . $db->sql_in_set('forum_id', $dest_forum_ids);
+		$db->sql_query($sql);
+	}
+
+	$db->sql_multi_insert(ACL_USERS_TABLE, $users_sql_ary);
+	$db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary);
+
+	if ($add_log)
+	{
+		add_log('admin', 'LOG_FORUM_COPIED_PERMISSIONS', $src_forum_name, implode(', ', $dest_forum_names));
+	}
+
+	$db->sql_transaction('commit');
+
+	return true;
+}
+
+/**
 * Get physical file listing
 */
 function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png')
 {
-	$matches = array();
+	$matches = array($dir => array());
 
 	// Remove initial / if present
 	$rootdir = (substr($rootdir, 0, 1) == '/') ? substr($rootdir, 1) : $rootdir;
@@ -940,19 +1037,61 @@
 	// Update post indicators for posts now no longer having attachments
 	if (sizeof($post_ids))
 	{
-		$sql = 'UPDATE ' . POSTS_TABLE . '
-			SET post_attachment = 0
-			WHERE ' . $db->sql_in_set('post_id', $post_ids);
-		$db->sql_query($sql);
+		// Just check which posts are still having an assigned attachment not orphaned by querying the attachments table
+		$sql = 'SELECT post_msg_id
+			FROM ' . ATTACHMENTS_TABLE . '
+			WHERE ' . $db->sql_in_set('post_msg_id', $post_ids) . '
+				AND in_message = 0
+				AND is_orphan = 0';
+		$result = $db->sql_query($sql);
+
+		$remaining_ids = array();
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$remaining_ids[] = $row['post_msg_id'];
+		}
+		$db->sql_freeresult($result);
+
+		// Now only unset those ids remaining
+		$post_ids = array_diff($post_ids, $remaining_ids);
+
+		if (sizeof($post_ids))
+		{
+			$sql = 'UPDATE ' . POSTS_TABLE . '
+				SET post_attachment = 0
+				WHERE ' . $db->sql_in_set('post_id', $post_ids);
+			$db->sql_query($sql);
+		}
 	}
 
 	// Update message table if messages are affected
 	if (sizeof($message_ids))
 	{
-		$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
-			SET message_attachment = 0
-			WHERE ' . $db->sql_in_set('msg_id', $message_ids);
-		$db->sql_query($sql);
+		// Just check which messages are still having an assigned attachment not orphaned by querying the attachments table
+		$sql = 'SELECT post_msg_id
+			FROM ' . ATTACHMENTS_TABLE . '
+			WHERE ' . $db->sql_in_set('post_msg_id', $message_ids) . '
+				AND in_message = 1
+				AND is_orphan = 0';
+		$result = $db->sql_query($sql);
+
+		$remaining_ids = array();
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$remaining_ids[] = $row['post_msg_id'];
+		}
+		$db->sql_freeresult($result);
+
+		// Now only unset those ids remaining
+		$message_ids = array_diff($message_ids, $remaining_ids);
+
+		if (sizeof($message_ids))
+		{
+			$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
+				SET message_attachment = 0
+				WHERE ' . $db->sql_in_set('msg_id', $message_ids);
+			$db->sql_query($sql);
+		}
 	}
 
 	// Now update the topics. This is a bit trickier, because there could be posts still having attachments within the topic
@@ -1098,7 +1237,7 @@
 	// Because of copying topics or modifications a physical filename could be assigned more than once. If so, do not remove the file itself.
 	$sql = 'SELECT COUNT(attach_id) AS num_entries
 		FROM ' . ATTACHMENTS_TABLE . "
-		WHERE physical_filename = '" . $db->sql_escape(basename($filename)) . "'";
+		WHERE physical_filename = '" . $db->sql_escape(utf8_basename($filename)) . "'";
 	$result = $db->sql_query($sql);
 	$num_entries = (int) $db->sql_fetchfield('num_entries');
 	$db->sql_freeresult($result);
@@ -1109,7 +1248,7 @@
 		return false;
 	}
 
-	$filename = ($mode == 'thumbnail') ? 'thumb_' . basename($filename) : basename($filename);
+	$filename = ($mode == 'thumbnail') ? 'thumb_' . utf8_basename($filename) : utf8_basename($filename);
 	return @unlink($phpbb_root_path . $config['upload_path'] . '/' . $filename);
 }
 
@@ -1193,6 +1332,7 @@
 	switch ($mode)
 	{
 		case 'topic_moved':
+			$db->sql_transaction('begin');
 			switch ($db->sql_layer)
 			{
 				case 'mysql4':
@@ -1229,9 +1369,13 @@
 
 				break;
 			}
-		break;
+
+			$db->sql_transaction('commit');
+			break;
 
 		case 'topic_approved':
+
+			$db->sql_transaction('begin');
 			switch ($db->sql_layer)
 			{
 				case 'mysql4':
@@ -1267,11 +1411,15 @@
 					$db->sql_query($sql);
 				break;
 			}
-		break;
+
+			$db->sql_transaction('commit');
+			break;
 
 		case 'post_reported':
 			$post_ids = $post_reported = array();
 
+			$db->sql_transaction('begin');
+
 			$sql = 'SELECT p.post_id, p.post_reported
 				FROM ' . POSTS_TABLE . " p
 				$where_sql
@@ -1322,7 +1470,9 @@
 					WHERE ' . $db->sql_in_set('post_id', $post_ids);
 				$db->sql_query($sql);
 			}
-		break;
+
+			$db->sql_transaction('commit');
+			break;
 
 		case 'topic_reported':
 			if ($sync_extra)
@@ -1332,6 +1482,8 @@
 
 			$topic_ids = $topic_reported = array();
 
+			$db->sql_transaction('begin');
+
 			$sql = 'SELECT DISTINCT(t.topic_id)
 				FROM ' . POSTS_TABLE . " t
 				$where_sql_and t.post_reported = 1";
@@ -1364,11 +1516,15 @@
 					WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
 				$db->sql_query($sql);
 			}
-		break;
+
+			$db->sql_transaction('commit');
+			break;
 
 		case 'post_attachment':
 			$post_ids = $post_attachment = array();
 
+			$db->sql_transaction('begin');
+
 			$sql = 'SELECT p.post_id, p.post_attachment
 				FROM ' . POSTS_TABLE . " p
 				$where_sql
@@ -1419,7 +1575,9 @@
 					WHERE ' . $db->sql_in_set('post_id', $post_ids);
 				$db->sql_query($sql);
 			}
-		break;
+
+			$db->sql_transaction('commit');
+			break;
 
 		case 'topic_attachment':
 			if ($sync_extra)
@@ -1429,6 +1587,8 @@
 
 			$topic_ids = $topic_attachment = array();
 
+			$db->sql_transaction('begin');
+
 			$sql = 'SELECT DISTINCT(t.topic_id)
 				FROM ' . POSTS_TABLE . " t
 				$where_sql_and t.post_attachment = 1";
@@ -1461,10 +1621,15 @@
 					WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
 				$db->sql_query($sql);
 			}
-		break;
+
+			$db->sql_transaction('commit');
+
+			break;
 
 		case 'forum':
 
+			$db->sql_transaction('begin');
+
 			// 1: Get the list of all forums
 			$sql = 'SELECT f.*
 				FROM ' . FORUMS_TABLE . " f
@@ -1665,11 +1830,15 @@
 					$db->sql_query($sql);
 				}
 			}
-		break;
+
+			$db->sql_transaction('commit');
+			break;
 
 		case 'topic':
 			$topic_data = $post_ids = $approved_unapproved_ids = $resync_forums = $delete_topics = $delete_posts = $moved_topics = array();
 
+			$db->sql_transaction('begin');
+
 			$sql = 'SELECT t.topic_id, t.forum_id, t.topic_moved_id, t.topic_approved, ' . (($sync_extra) ? 't.topic_attachment, t.topic_reported, ' : '') . 't.topic_poster, t.topic_time, t.topic_replies, t.topic_replies_real, t.topic_first_post_id, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_post_subject, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time
 				FROM ' . TOPICS_TABLE . " t
 				$where_sql";
@@ -1992,6 +2161,8 @@
 			}
 			unset($topic_data);
 
+			$db->sql_transaction('commit');
+
 			// if some topics have been resync'ed then resync parent forums
 			// except when we're only syncing a range, we don't want to sync forums during
 			// batch processing.
@@ -1999,7 +2170,7 @@
 			{
 				sync('forum', 'forum_id', array_values($resync_forums), true, true);
 			}
-		break;
+			break;
 	}
 
 	return;
@@ -2185,12 +2356,13 @@
 
 		// Remove users who have group memberships with DENY moderator permissions
 		$sql = $db->sql_build_query('SELECT', array(
-			'SELECT'	=> 'a.forum_id, ug.user_id',
+			'SELECT'	=> 'a.forum_id, ug.user_id, g.group_id',
 
 			'FROM'		=> array(
 				ACL_OPTIONS_TABLE	=> 'o',
 				USER_GROUP_TABLE	=> 'ug',
-				ACL_GROUPS_TABLE	=> 'a'
+				GROUPS_TABLE		=> 'g',
+				ACL_GROUPS_TABLE	=> 'a',
 			),
 
 			'LEFT_JOIN'	=> array(
@@ -2204,6 +2376,8 @@
 				AND ((a.auth_setting = ' . ACL_NEVER . ' AND r.auth_setting IS NULL)
 					OR r.auth_setting = ' . ACL_NEVER . ')
 				AND a.group_id = ug.group_id
+				AND g.group_id = ug.group_id
+				AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
 				AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . "
 				AND ug.user_pending = 0
 				AND o.auth_option " . $db->sql_like_expression('m_' . $db->any_char),
@@ -2323,7 +2497,7 @@
 /**
 * View log
 */
-function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC')
+function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC', $keywords = '')
 {
 	global $db, $user, $auth, $phpEx, $phpbb_root_path, $phpbb_admin_path;
 
@@ -2340,18 +2514,19 @@
 
 		case 'mod':
 			$log_type = LOG_MOD;
+			$sql_forum = '';
 
 			if ($topic_id)
 			{
-				$sql_forum = 'AND l.topic_id = ' . intval($topic_id);
+				$sql_forum = 'AND l.topic_id = ' . (int) $topic_id;
 			}
 			else if (is_array($forum_id))
 			{
 				$sql_forum = 'AND ' . $db->sql_in_set('l.forum_id', array_map('intval', $forum_id));
 			}
-			else
+			else if ($forum_id)
 			{
-				$sql_forum = ($forum_id) ? 'AND l.forum_id = ' . intval($forum_id) : '';
+				$sql_forum = 'AND l.forum_id = ' . (int) $forum_id;
 			}
 		break;
 
@@ -2374,11 +2549,47 @@
 			return;
 	}
 
+	// Use no preg_quote for $keywords because this would lead to sole backslashes being added
+	// We also use an OR connection here for spaces and the | string. Currently, regex is not supported for searching (but may come later).
+	$keywords = preg_split('#[\s|]+#u', utf8_strtolower($keywords), 0, PREG_SPLIT_NO_EMPTY);
+	$sql_keywords = '';
+
+	if (!empty($keywords))
+	{
+		$keywords_pattern = array();
+
+		// Build pattern and keywords...
+		for ($i = 0, $num_keywords = sizeof($keywords); $i < $num_keywords; $i++)
+		{
+			$keywords_pattern[] = preg_quote($keywords[$i], '#');
+			$keywords[$i] = $db->sql_like_expression($db->any_char . $keywords[$i] . $db->any_char);
+		}
+
+		$keywords_pattern = '#' . implode('|', $keywords_pattern) . '#ui';
+
+		$operations = array();
+		foreach ($user->lang as $key => $value)
+		{
+			if (substr($key, 0, 4) == 'LOG_' && preg_match($keywords_pattern, $value))
+			{
+				$operations[] = $key;
+			}
+		}
+
+		$sql_keywords = 'AND (';
+		if (!empty($operations))
+		{
+			$sql_keywords .= $db->sql_in_set('l.log_operation', $operations) . ' OR ';
+		}
+		$sql_keywords .= 'LOWER(l.log_data) ' . implode(' OR LOWER(l.log_data) ', $keywords) . ')';
+	}
+
 	$sql = "SELECT l.*, u.username, u.username_clean, u.user_colour
 		FROM " . LOG_TABLE . " l, " . USERS_TABLE . " u
 		WHERE l.log_type = $log_type
 			AND u.user_id = l.user_id
 			" . (($limit_days) ? "AND l.log_time >= $limit_days" : '') . "
+			$sql_keywords
 			$sql_forum
 		ORDER BY $sort_by";
 	$result = $db->sql_query_limit($sql, $limit, $offset);
@@ -2419,7 +2630,8 @@
 
 		if (!empty($row['log_data']))
 		{
-			$log_data_ary = unserialize($row['log_data']);
+			$log_data_ary = @unserialize($row['log_data']);
+			$log_data_ary = ($log_data_ary === false) ? array() : $log_data_ary;
 
 			if (isset($user->lang[$row['log_operation']]))
 			{
@@ -2442,7 +2654,7 @@
 					$log[$i]['action'] = bbcode_nl2br(censor_text($log[$i]['action']));
 				}
 			}
-			else
+			else if (!empty($log_data_ary))
 			{
 				$log[$i]['action'] .= '<br />' . implode('', $log_data_ary);
 			}
@@ -2540,9 +2752,11 @@
 	}
 
 	$sql = 'SELECT COUNT(l.log_id) AS total_entries
-		FROM ' . LOG_TABLE . " l
+		FROM ' . LOG_TABLE . ' l, ' . USERS_TABLE . " u
 		WHERE l.log_type = $log_type
+			AND l.user_id = u.user_id
 			AND l.log_time >= $limit_days
+			$sql_keywords
 			$sql_forum";
 	$result = $db->sql_query($sql);
 	$log_count = (int) $db->sql_fetchfield('total_entries');
@@ -2685,7 +2899,7 @@
 		$offset = ($offset - $limit < 0) ? 0 : $offset - $limit;
 	}
 
-	$sql = 'SELECT user_id, username, user_regdate, user_lastvisit, user_inactive_time, user_inactive_reason
+	$sql = 'SELECT *
 		FROM ' . USERS_TABLE . '
 		WHERE user_type = ' . USER_INACTIVE .
 		(($limit_days) ? " AND user_inactive_time >= $limit_days" : '') . "
@@ -3054,4 +3268,43 @@
 	return true;
 }
 
+/**
+ * Obtains the latest version information
+ *
+ * @param bool $force_update Ignores cached data. Defaults to false.
+ * @param bool $warn_fail Trigger a warning if obtaining the latest version information fails. Defaults to false.
+ * @param int $ttl Cache version information for $ttl seconds. Defaults to 86400 (24 hours).
+ *
+ * @return string | false Version info on success, false on failure.
+ */
+function obtain_latest_version_info($force_update = false, $warn_fail = false, $ttl = 86400)
+{
+	global $cache;
+
+	$info = $cache->get('versioncheck');
+
+	if ($info === false || $force_update)
+	{
+		$errstr = '';
+		$errno = 0;
+
+		$info = get_remote_file('www.phpbb.com', '/updatecheck',
+				((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
+
+		if ($info === false)
+		{
+			$cache->destroy('versioncheck');
+			if ($warn_fail)
+			{
+				trigger_error($errstr, E_USER_WARNING);
+			}
+			return false;
+		}
+
+		$cache->put('versioncheck', $info, $ttl);
+	}
+
+	return $info;
+}
+
 ?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/functions_compress.php 3.0.6.src/includes/functions_compress.php
--- 3.0.5.src/includes/functions_compress.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_compress.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_compress.php 8780 2008-08-22 12:52:48Z acydburn $
+* @version $Id: functions_compress.php 9768 2009-07-17 11:32:27Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -155,7 +155,12 @@
 	*/
 	function compress_zip($mode, $file)
 	{
-		return $this->fp = @fopen($file, $mode . 'b');
+		$this->fp = @fopen($file, $mode . 'b');
+
+		if (!$this->fp)
+		{
+			trigger_error('Unable to open file ' . $file . ' [' . $mode . 'b]');
+		}
 	}
 
 	/**
diff -x .svn -aruN 3.0.5.src/includes/functions_content.php 3.0.6.src/includes/functions_content.php
--- 3.0.5.src/includes/functions_content.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_content.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_content.php 9515 2009-05-13 10:42:44Z acydburn $
+* @version $Id: functions_content.php 10039 2009-08-21 09:44:55Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -250,6 +250,11 @@
 	// first replace all whitespaces with single spaces
 	$text = preg_replace('/ +/', ' ', strtr($text, "\t\n\r\x0C ", '     '));
 
+	// we need to turn the entities back into their original form, to not cut the message in between them
+	$entities = array('&lt;', '&gt;', '&#91;', '&#93;', '&#46;', '&#58;', '&#058;');
+	$characters = array('<', '>', '[', ']', '.', ':', ':');
+	$text = str_replace($entities, $characters, $text);
+
 	$word_indizes = array();
 	if (sizeof($words))
 	{
@@ -345,13 +350,13 @@
 					}
 				}
 			}
-			return $final_text;
+			return str_replace($characters, $entities, $final_text);
 		}
 	}
 
 	if (!sizeof($words) || !sizeof($word_indizes))
 	{
-		return (utf8_strlen($text) >= $length + 3) ? utf8_substr($text, 0, $length) . '...' : $text;
+		return str_replace($characters, $entities, ((utf8_strlen($text) >= $length + 3) ? utf8_substr($text, 0, $length) . '...' : $text));
 	}
 }
 
@@ -680,6 +685,12 @@
 {
 	static $censors;
 
+	// Nothing to do?
+	if ($text === '')
+	{
+		return '';
+	}
+
 	// We moved the word censor checks in here because we call this function quite often - and then only need to do the check once
 	if (!isset($censors) || !is_array($censors))
 	{
@@ -728,7 +739,8 @@
 	}
 	else
 	{
-		return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img src="' . $phpbb_root_path . $config['smilies_path'] . '/\2 />', $text);
+		$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
+		return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img src="' . $root_path . $config['smilies_path'] . '/\2 />', $text);
 	}
 }
 
@@ -836,8 +848,8 @@
 
 		// Some basics...
 		$attachment['extension'] = strtolower(trim($attachment['extension']));
-		$filename = $phpbb_root_path . $config['upload_path'] . '/' . basename($attachment['physical_filename']);
-		$thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . basename($attachment['physical_filename']);
+		$filename = $phpbb_root_path . $config['upload_path'] . '/' . utf8_basename($attachment['physical_filename']);
+		$thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . utf8_basename($attachment['physical_filename']);
 
 		$upload_icon = '';
 
@@ -853,17 +865,15 @@
 			}
 		}
 
-		$filesize = $attachment['filesize'];
-		$size_lang = ($filesize >= 1048576) ? $user->lang['MIB'] : (($filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
-		$filesize = get_formatted_filesize($filesize, false);
+		$filesize = get_formatted_filesize($attachment['filesize'], false);
 
 		$comment = bbcode_nl2br(censor_text($attachment['attach_comment']));
 
 		$block_array += array(
 			'UPLOAD_ICON'		=> $upload_icon,
-			'FILESIZE'			=> $filesize,
-			'SIZE_LANG'			=> $size_lang,
-			'DOWNLOAD_NAME'		=> basename($attachment['real_filename']),
+			'FILESIZE'			=> $filesize['value'],
+			'SIZE_LANG'			=> $filesize['unit'],
+			'DOWNLOAD_NAME'		=> utf8_basename($attachment['real_filename']),
 			'COMMENT'			=> $comment,
 		);
 
diff -x .svn -aruN 3.0.5.src/includes/functions_convert.php 3.0.6.src/includes/functions_convert.php
--- 3.0.5.src/includes/functions_convert.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_convert.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package install
-* @version $Id: functions_convert.php 8876 2008-09-18 14:26:56Z acydburn $
+* @version $Id: functions_convert.php 9905 2009-08-01 12:28:50Z acydburn $
 * @copyright (c) 2006 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -551,7 +551,7 @@
 	);
 
 	// copy file will prepend $phpBB_root_path
-	$target = $config[$config_var] . '/' . basename(($use_target === false) ? $source : $use_target);
+	$target = $config[$config_var] . '/' . utf8_basename(($use_target === false) ? $source : $use_target);
 
 	if (!empty($convert->convertor[$config_var]) && strpos($source, $convert->convertor[$config_var]) !== 0)
 	{
@@ -567,11 +567,11 @@
 
 	if ($result['copied'])
 	{
-		$result['target'] = basename($target);
+		$result['target'] = utf8_basename($target);
 	}
 	else
 	{
-		$result['target'] = ($use_target !== false) ? $result['orig_source'] : basename($target);
+		$result['target'] = ($use_target !== false) ? $result['orig_source'] : utf8_basename($target);
 	}
 
 	return $result;
@@ -600,7 +600,7 @@
 		{
 			$thumb_dir = $convert->convertor['thumbnails'][0];
 			$thumb_prefix = $convert->convertor['thumbnails'][1];
-			$thumb_source = $thumb_dir . $thumb_prefix . basename($result['source']);
+			$thumb_source = $thumb_dir . $thumb_prefix . utf8_basename($result['source']);
 
 			if (strpos($thumb_source, $convert->convertor['upload_path']) !== 0)
 			{
@@ -1698,7 +1698,8 @@
 		'REGISTERED_COPPA'	=> array('', 0, 0),
 		'GLOBAL_MODERATORS'	=> array('00AA00', 1, 0),
 		'ADMINISTRATORS'	=> array('AA0000', 1, 1),
-		'BOTS'				=> array('9E8DA7', 0, 0)
+		'BOTS'				=> array('9E8DA7', 0, 0),
+		'NEWLY_REGISTERED'		=> array('', 0, 0),
 	);
 
 	$sql = 'SELECT *
@@ -2256,7 +2257,7 @@
 
 	if (substr($trg, -1) == '/')
 	{
-		$trg .= basename($src);
+		$trg .= utf8_basename($src);
 	}
 	$src_path = relative_base($src, $source_relative_path, __LINE__, __FILE__);
 	$trg_path = $trg;
diff -x .svn -aruN 3.0.5.src/includes/functions_display.php 3.0.6.src/includes/functions_display.php
--- 3.0.5.src/includes/functions_display.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_display.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_display.php 9467 2009-04-17 16:10:39Z Kellanved $
+* @version $Id: functions_display.php 10243 2009-10-28 16:49:23Z rxu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -102,6 +102,19 @@
 
 	$forum_tracking_info = array();
 	$branch_root_id = $root_data['forum_id'];
+
+	// Check for unread global announcements (index page only)
+	$ga_unread = false;
+	if ($root_data['forum_id'] == 0)
+	{
+		$unread_ga_list = get_unread_topics($user->data['user_id'], 'AND t.forum_id = 0', '', 1);
+
+		if (!empty($unread_ga_list))
+		{
+			$ga_unread = true;
+		}
+	}
+
 	while ($row = $db->sql_fetchrow($result))
 	{
 		$forum_id = $row['forum_id'];
@@ -154,6 +167,8 @@
 			$forum_tracking_info[$forum_id] = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark'];
 		}
 
+		// Count the difference of real to public topics, so we can display an information to moderators
+		$row['forum_id_unapproved_topics'] = ($auth->acl_get('m_approve', $forum_id) && ($row['forum_topics_real'] != $row['forum_topics'])) ? $forum_id : 0;
 		$row['forum_topics'] = ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics'];
 
 		// Display active topics from this forum?
@@ -212,6 +227,11 @@
 				$subforums[$parent_id][$row['parent_id']]['children'][] = $forum_id;
 			}
 
+			if (!$forum_rows[$parent_id]['forum_id_unapproved_topics'] && $row['forum_id_unapproved_topics'])
+			{
+				$forum_rows[$parent_id]['forum_id_unapproved_topics'] = $forum_id;
+			}
+
 			$forum_rows[$parent_id]['forum_topics'] += $row['forum_topics'];
 
 			// Do not list redirects in LINK Forums as Posts.
@@ -248,6 +268,8 @@
 			}
 			else
 			{
+				// Add 0 to forums array to mark global announcements correctly
+				$forum_ids[] = 0;
 				markread('topics', $forum_ids);
 				$message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
 			}
@@ -300,6 +322,12 @@
 
 		$forum_unread = (isset($forum_tracking_info[$forum_id]) && $row['orig_forum_last_post_time'] > $forum_tracking_info[$forum_id]) ? true : false;
 
+		// Mark the first visible forum on index as unread if there's any unread global announcement
+		if ($ga_unread && !empty($forum_ids_moderator) && $forum_id == $forum_ids_moderator[0])
+		{
+			$forum_unread = true;
+		}
+
 		$folder_image = $folder_alt = $l_subforums = '';
 		$subforums_list = array();
 
@@ -428,6 +456,7 @@
 			'S_LOCKED_FORUM'	=> ($row['forum_status'] == ITEM_LOCKED) ? true : false,
 			'S_LIST_SUBFORUMS'	=> ($row['display_subforum_list']) ? true : false,
 			'S_SUBFORUMS'		=> (sizeof($subforums_list)) ? true : false,
+			'S_FEED_ENABLED'	=> ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options'])) ? true : false,
 
 			'FORUM_ID'				=> $row['forum_id'],
 			'FORUM_NAME'			=> $row['forum_name'],
@@ -451,6 +480,7 @@
 			'L_FORUM_FOLDER_ALT'	=> $folder_alt,
 			'L_MODERATOR_STR'		=> $l_moderator,
 
+			'U_UNAPPROVED_TOPICS'	=> ($row['forum_id_unapproved_topics']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=unapproved_topics&amp;f=' . $row['forum_id_unapproved_topics']) : '',
 			'U_VIEWFORUM'		=> $u_viewforum,
 			'U_LAST_POSTER'		=> get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
 			'U_LAST_POST'		=> $last_post_url)
@@ -473,8 +503,9 @@
 		'U_MARK_FORUMS'		=> ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&amp;f=' . $root_data['forum_id'] . '&amp;mark=forums') : '',
 		'S_HAS_SUBFORUM'	=> ($visible_forums) ? true : false,
 		'L_SUBFORUM'		=> ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'],
-		'LAST_POST_IMG'		=> $user->img('icon_topic_latest', 'VIEW_LATEST_POST'))
-	);
+		'LAST_POST_IMG'		=> $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
+		'UNAPPROVED_IMG'	=> $user->img('icon_topic_unapproved', 'TOPICS_UNAPPROVED'),
+	));
 
 	if ($return_moderators)
 	{
@@ -514,7 +545,7 @@
 */
 function generate_forum_nav(&$forum_data)
 {
-	global $db, $user, $template, $auth;
+	global $db, $user, $template, $auth, $config;
 	global $phpEx, $phpbb_root_path;
 
 	if (!$auth->acl_get('f_list', $forum_data['forum_id']))
@@ -561,8 +592,10 @@
 	$template->assign_vars(array(
 		'FORUM_ID' 		=> $forum_data['forum_id'],
 		'FORUM_NAME'	=> $forum_data['forum_name'],
-		'FORUM_DESC'	=> generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options']))
-	);
+		'FORUM_DESC'	=> generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options']),
+
+		'S_ENABLE_FEEDS_FORUM'	=> ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $forum_data['forum_options'])) ? true : false,
+	));
 
 	return;
 }
@@ -658,14 +691,7 @@
 {
 	global $config, $template, $db, $phpbb_root_path, $phpEx, $user, $auth;
 
-	// Have we disabled the display of moderators? If so, then return
-	// from whence we came ...
-	if (!$config['load_moderators'])
-	{
-		return;
-	}
-
-	$forum_sql = '';
+	$forum_id_ary = array();
 
 	if ($forum_id !== false)
 	{
@@ -674,13 +700,8 @@
 			$forum_id = array($forum_id);
 		}
 
-		// If we don't have a forum then we can't have a moderator
-		if (!sizeof($forum_id))
-		{
-			return;
-		}
-
-		$forum_sql = 'AND m.' . $db->sql_in_set('forum_id', $forum_id);
+		// Exchange key/value pair to be able to faster check for the forum id existence
+		$forum_id_ary = array_flip($forum_id);
 	}
 
 	$sql_array = array(
@@ -701,17 +722,25 @@
 			),
 		),
 
-		'WHERE'		=> "m.display_on_index = 1 $forum_sql",
+		'WHERE'		=> 'm.display_on_index = 1',
 	);
 
+	// We query every forum here because for caching we should not have any parameter.
 	$sql = $db->sql_build_query('SELECT', $sql_array);
 	$result = $db->sql_query($sql, 3600);
 
 	while ($row = $db->sql_fetchrow($result))
 	{
+		$f_id = (int) $row['forum_id'];
+
+		if (!isset($forum_id_ary[$f_id]))
+		{
+			continue;
+		}
+
 		if (!empty($row['user_id']))
 		{
-			$forum_moderators[$row['forum_id']][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
+			$forum_moderators[$f_id][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
 		}
 		else
 		{
@@ -719,11 +748,11 @@
 
 			if ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))
 			{
-				$forum_moderators[$row['forum_id']][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>';
+				$forum_moderators[$f_id][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>';
 			}
 			else
 			{
-				$forum_moderators[$row['forum_id']][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_name . '</a>';
+				$forum_moderators[$f_id][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_name . '</a>';
 			}
 		}
 	}
@@ -1200,14 +1229,15 @@
 * @param string $avatar_width Width of users avatar
 * @param string $avatar_height Height of users avatar
 * @param string $alt Optional language string for alt tag within image, can be a language key or text
+* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
 *
 * @return string Avatar image
 */
-function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
+function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false)
 {
 	global $user, $config, $phpbb_root_path, $phpEx;
 
-	if (empty($avatar) || !$avatar_type)
+	if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
 	{
 		return '';
 	}
@@ -1217,12 +1247,27 @@
 	switch ($avatar_type)
 	{
 		case AVATAR_UPLOAD:
+			if (!$config['allow_avatar_upload'] && !$ignore_config)
+			{
+				return '';
+			}
 			$avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
 		break;
 
 		case AVATAR_GALLERY:
+			if (!$config['allow_avatar_local'] && !$ignore_config)
+			{
+				return '';
+			}
 			$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
 		break;
+
+		case AVATAR_REMOTE:
+			if (!$config['allow_avatar_remote'] && !$ignore_config)
+			{
+				return '';
+			}
+		break;
 	}
 
 	$avatar_img .= $avatar;
diff -x .svn -aruN 3.0.5.src/includes/functions_install.php 3.0.6.src/includes/functions_install.php
--- 3.0.5.src/includes/functions_install.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_install.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package install
-* @version $Id: functions_install.php 9518 2009-05-20 12:37:35Z toonarmy $
+* @version $Id: functions_install.php 9970 2009-08-13 15:25:20Z acydburn $
 * @copyright (c) 2006 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -21,6 +21,12 @@
 */
 function can_load_dll($dll)
 {
+	// SQLite2 is a tricky thing, from 5.0.0 it requires PDO; if PDO is not loaded we must state that SQLite is unavailable
+	// as the installer doesn't understand that the extension has a prerequisite.
+	if ($dll == 'sqlite' && version_compare(PHP_VERSION, '5.0.0', '>=') && !extension_loaded('pdo'))
+	{
+		return false;
+	}
 	return ((@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'on') && (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') && function_exists('dl') && @dl($dll . '.' . PHP_SHLIB_SUFFIX)) ? true : false;
 }
 
@@ -175,7 +181,7 @@
 function dbms_select($default = '', $only_20x_options = false)
 {
 	global $lang;
-	
+
 	$available_dbms = get_available_dbms(false, false, $only_20x_options);
 	$dbms_options = '';
 	foreach ($available_dbms as $dbms_name => $details)
@@ -396,10 +402,10 @@
 					}
 					else
 					{
-						$sql = "SELECT FIRST 0 char_length('')
-							FROM RDB\$DATABASE";
+						$sql = 'SELECT 1 FROM RDB$DATABASE
+							WHERE BIN_AND(10, 1) = 0';
 						$result = $db->sql_query($sql);
-						if (!$result) // This can only fail if char_length is not defined
+						if (!$result) // This can only fail if BIN_AND is not defined
 						{
 							$error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
 						}
@@ -440,7 +446,7 @@
 					unset($final);
 				}
 			break;
-			
+
 			case 'oracle':
 				if ($unicode_check)
 				{
@@ -462,7 +468,7 @@
 					}
 				}
 			break;
-			
+
 			case 'postgres':
 				if ($unicode_check)
 				{
diff -x .svn -aruN 3.0.5.src/includes/functions_jabber.php 3.0.6.src/includes/functions_jabber.php
--- 3.0.5.src/includes/functions_jabber.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_jabber.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_jabber.php 8979 2008-10-08 12:44:23Z acydburn $
+* @version $Id: functions_jabber.php 10245 2009-10-29 15:04:19Z acydburn $
 * @copyright (c) 2007 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -476,8 +476,9 @@
 					}
 					else if (in_array('PLAIN', $methods) && ($this->session['ssl'] || !empty($this->session['tls'])))
 					{
+						// http://www.ietf.org/rfc/rfc4616.txt (PLAIN SASL Mechanism)
 						$this->send("<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>"
-							. base64_encode(chr(0) . $this->username . '@' . $this->server . chr(0) . $this->password) .
+							. base64_encode($this->username . '@' . $this->server . chr(0) . $this->username . chr(0) . $this->password) .
 							'</auth>');
 					}
 					else if (in_array('ANONYMOUS', $methods))
diff -x .svn -aruN 3.0.5.src/includes/functions_messenger.php 3.0.6.src/includes/functions_messenger.php
--- 3.0.5.src/includes/functions_messenger.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_messenger.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_messenger.php 9450 2009-04-17 09:08:34Z acydburn $
+* @version $Id: functions_messenger.php 10178 2009-09-22 15:09:09Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -27,6 +27,8 @@
 
 	var $mail_priority = MAIL_NORMAL_PRIORITY;
 	var $use_queue = true;
+
+	var $tpl_obj = NULL;
 	var $tpl_msg = array();
 	var $eol = "\n";
 
@@ -171,13 +173,13 @@
 	/**
 	* Set email template to use
 	*/
-	function template($template_file, $template_lang = '')
+	function template($template_file, $template_lang = '', $template_path = '')
 	{
 		global $config, $phpbb_root_path, $user;
 
 		if (!trim($template_file))
 		{
-			trigger_error('No template file set', E_USER_ERROR);
+			trigger_error('No template file for emailing set.', E_USER_ERROR);
 		}
 
 		if (!trim($template_lang))
@@ -185,25 +187,28 @@
 			$template_lang = basename($config['default_lang']);
 		}
 
-		if (empty($this->tpl_msg[$template_lang . $template_file]))
+		// tpl_msg now holds a template object we can use to parse the template file
+		if (!isset($this->tpl_msg[$template_lang . $template_file]))
 		{
-			$tpl_file = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
-			$tpl_file .= $template_lang . "/email/$template_file.txt";
+			$this->tpl_msg[$template_lang . $template_file] = new template();
+			$tpl = &$this->tpl_msg[$template_lang . $template_file];
 
-			if (!file_exists($tpl_file))
+			if (!$template_path)
 			{
-				trigger_error("Could not find email template file [ $tpl_file ]", E_USER_ERROR);
+				$template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
+				$template_path .= $template_lang . '/email';
 			}
 
-			if (($data = @file_get_contents($tpl_file)) === false)
-			{
-				trigger_error("Failed opening template file [ $tpl_file ]", E_USER_ERROR);
-			}
+			$tpl->set_custom_template($template_path, $template_lang . '_email', 'email');
 
-			$this->tpl_msg[$template_lang . $template_file] = $data;
+			$tpl->set_filenames(array(
+				'body'		=> $template_file . '.txt',
+			));
 		}
 
-		$this->msg = $this->tpl_msg[$template_lang . $template_file];
+		$this->tpl_obj = &$this->tpl_msg[$template_lang . $template_file];
+		$this->vars = &$this->tpl_obj->_rootref;
+		$this->tpl_msg = '';
 
 		return true;
 	}
@@ -213,7 +218,22 @@
 	*/
 	function assign_vars($vars)
 	{
-		$this->vars = (empty($this->vars)) ? $vars : $this->vars + $vars;
+		if (!is_object($this->tpl_obj))
+		{
+			return;
+		}
+
+		$this->tpl_obj->assign_vars($vars);
+	}
+
+	function assign_block_vars($blockname, $vars)
+	{
+		if (!is_object($this->tpl_obj))
+		{
+			return;
+		}
+
+		$this->tpl_obj->assign_block_vars($blockname, $vars);
 	}
 
 	/**
@@ -224,15 +244,32 @@
 		global $config, $user;
 
 		// We add some standard variables we always use, no need to specify them always
-		$this->vars['U_BOARD'] = (!isset($this->vars['U_BOARD'])) ? generate_board_url() : $this->vars['U_BOARD'];
-		$this->vars['EMAIL_SIG'] = (!isset($this->vars['EMAIL_SIG'])) ? str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])) : $this->vars['EMAIL_SIG'];
-		$this->vars['SITENAME'] = (!isset($this->vars['SITENAME'])) ? htmlspecialchars_decode($config['sitename']) : $this->vars['SITENAME'];
-
-		// Escape all quotes, else the eval will fail.
-		$this->msg = str_replace ("'", "\'", $this->msg);
-		$this->msg = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "' . ((isset(\$this->vars['\\1'])) ? \$this->vars['\\1'] : '') . '", $this->msg);
+		if (!isset($this->vars['U_BOARD']))
+		{
+			$this->assign_vars(array(
+				'U_BOARD'	=> generate_board_url(),
+			));
+		}
+
+		if (!isset($this->vars['EMAIL_SIG']))
+		{
+			$this->assign_vars(array(
+				'EMAIL_SIG'	=> str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])),
+			));
+		}
+
+		if (!isset($this->vars['SITENAME']))
+		{
+			$this->assign_vars(array(
+				'SITENAME'	=> htmlspecialchars_decode($config['sitename']),
+			));
+		}
 
-		eval("\$this->msg = '$this->msg';");
+		// Parse message through template
+		$this->msg = trim($this->tpl_obj->assign_display('body'));
+
+		// Because we use \n for newlines in the body message we need to fix line encoding errors for those admins who uploaded email template files in the wrong encoding
+		$this->msg = str_replace("\r\n", "\n", $this->msg);
 
 		// We now try and pull a subject from the email body ... if it exists,
 		// do this here because the subject may contain a variable
@@ -356,7 +393,7 @@
 
 		$headers[] = 'X-Priority: ' . $this->mail_priority;
 		$headers[] = 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High'));
-		$headers[] = 'X-Mailer: PhpBB3';
+		$headers[] = 'X-Mailer: phpBB3';
 		$headers[] = 'X-MimeOLE: phpBB3';
 		$headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url());
 
@@ -408,6 +445,8 @@
 			$this->from = '<' . $config['board_contact'] . '>';
 		}
 
+		$encode_eol = ($config['smtp_delivery']) ? "\r\n" : $this->eol;
+
 		// Build to, cc and bcc strings
 		$to = $cc = $bcc = '';
 		foreach ($this->addresses as $type => $address_ary)
@@ -419,7 +458,7 @@
 
 			foreach ($address_ary as $which_ary)
 			{
-				$$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? '"' . mail_encode($which_ary['name']) . '" <' . $which_ary['email'] . '>' : $which_ary['email']);
+				$$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? mail_encode($which_ary['name'], $encode_eol) . ' <' . $which_ary['email'] . '>' : $which_ary['email']);
 			}
 		}
 
@@ -438,13 +477,7 @@
 			}
 			else
 			{
-				// We use the EOL character for the OS here because the PHP mail function does not correctly transform line endings. On Windows SMTP is used (SMTP is \r\n), on UNIX a command is used...
-				// Reference: http://bugs.php.net/bug.php?id=15841
-				$headers = implode($this->eol, $headers);
-
-				ob_start();
-				$result = $config['email_function_name']($mail_to, mail_encode($this->subject), wordwrap(utf8_wordwrap($this->msg), 997, "\n", true), $headers);
-				$err_msg = ob_get_clean();
+				$result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, $this->eol, $err_msg);
 			}
 
 			if (!$result)
@@ -687,9 +720,7 @@
 						}
 						else
 						{
-							ob_start();
-							$result = $config['email_function_name']($to, mail_encode($subject), wordwrap(utf8_wordwrap($msg), 997, "\n", true), implode($this->eol, $headers));
-							$err_msg = ob_get_clean();
+							$result = phpbb_mail($to, $subject, $msg, $headers, $this->eol, $err_msg);
 						}
 
 						if (!$result)
@@ -1103,7 +1134,24 @@
 		global $user;
 
 		$err_msg = '';
-		$local_host = (function_exists('php_uname')) ? gethostbyaddr(gethostbyname(php_uname('n'))) : $user->host;
+
+		// Here we try to determine the *real* hostname (reverse DNS entry preferrably)
+		$local_host = $user->host;
+
+		if (function_exists('php_uname'))
+		{
+			$local_host = php_uname('n');
+
+			// Able to resolve name to IP
+			if (($addr = @gethostbyname($local_host)) !== $local_host)
+			{
+				// Able to resolve IP back to name
+				if (($name = @gethostbyaddr($addr)) !== $addr)
+				{
+					$local_host = $name;
+				}
+			}
+		}
 
 		// If we are authenticating through pop-before-smtp, we
 		// have to login ones before we get authenticated
@@ -1441,13 +1489,15 @@
 * is basically doomed with an unreadable subject.
 *
 * Please note that this version fully supports RFC 2045 section 6.8.
+*
+* @param string $eol End of line we are using (optional to be backwards compatible)
 */
-function mail_encode($str)
+function mail_encode($str, $eol = "\r\n")
 {
 	// define start delimimter, end delimiter and spacer
 	$start = "=?UTF-8?B?";
 	$end = "?=";
-	$delimiter = "\r\n ";
+	$delimiter = "$eol ";
 
 	// Maximum length is 75. $split_length *must* be a multiple of 4, but <= 75 - strlen($start . $delimiter . $end)!!!
 	$split_length = 60;
@@ -1484,4 +1534,25 @@
 	return substr($str, 0, -strlen($delimiter));
 }
 
+/**
+* Wrapper for sending out emails with the PHP's mail function
+*/
+function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg)
+{
+	global $config;
+
+	// We use the EOL character for the OS here because the PHP mail function does not correctly transform line endings. On Windows SMTP is used (SMTP is \r\n), on UNIX a command is used...
+	// Reference: http://bugs.php.net/bug.php?id=15841
+	$headers = implode($eol, $headers);
+
+	ob_start();
+	// On some PHP Versions mail() *may* fail if there are newlines within the subject.
+	// Newlines are used as a delimiter for lines in mail_encode() according to RFC 2045 section 6.8.
+	// Because PHP can't decide what is wanted we revert back to the non-RFC-compliant way of separating by one space (Use '' as parameter to mail_encode() results in SPACE used)
+	$result = $config['email_function_name']($to, mail_encode($subject, ''), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers);
+	$err_msg = ob_get_clean();
+
+	return $result;
+}
+
 ?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/functions.php 3.0.6.src/includes/functions.php
--- 3.0.5.src/includes/functions.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions.php 9519 2009-05-23 16:11:40Z acydburn $
+* @version $Id: functions.php 10172 2009-09-20 18:50:35Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -71,12 +71,13 @@
 		$_REQUEST[$var_name] = isset($_POST[$var_name]) ? $_POST[$var_name] : $_GET[$var_name];
 	}
 
-	if (!isset($_REQUEST[$var_name]) || (is_array($_REQUEST[$var_name]) && !is_array($default)) || (is_array($default) && !is_array($_REQUEST[$var_name])))
+	$super_global = ($cookie) ? '_COOKIE' : '_REQUEST';
+	if (!isset($GLOBALS[$super_global][$var_name]) || is_array($GLOBALS[$super_global][$var_name]) != is_array($default))
 	{
 		return (is_array($default)) ? array() : $default;
 	}
 
-	$var = $_REQUEST[$var_name];
+	$var = $GLOBALS[$super_global][$var_name];
 	if (!is_array($default))
 	{
 		$type = gettype($default);
@@ -174,7 +175,7 @@
 	switch ($db->sql_layer)
 	{
 		case 'firebird':
-			$sql_update = 'CAST(CAST(config_value as integer) + ' . (int) $increment . ' as CHAR)';
+			$sql_update = 'CAST(CAST(config_value as integer) + ' . (int) $increment . ' as VARCHAR(255))';
 		break;
 
 		case 'postgres':
@@ -231,27 +232,82 @@
 
 /**
 * Return formatted string for filesizes
+*
+* @param int	$value			filesize in bytes
+* @param bool	$string_only	true if language string should be returned
+* @param array	$allowed_units	only allow these units (data array indexes)
+*
+* @return mixed					data array if $string_only is false
+* @author bantu
 */
-function get_formatted_filesize($bytes, $add_size_lang = true)
+function get_formatted_filesize($value, $string_only = true, $allowed_units = false)
 {
 	global $user;
 
-	if ($bytes >= pow(2, 30))
+	$available_units = array(
+		'gb' => array(
+			'min' 		=> 1073741824, // pow(2, 30)
+			'index'		=> 3,
+			'si_unit'	=> 'GB',
+			'iec_unit'	=> 'GIB',
+		),
+		'mb' => array(
+			'min'		=> 1048576, // pow(2, 20)
+			'index'		=> 2,
+			'si_unit'	=> 'MB',
+			'iec_unit'	=> 'MIB',
+		),
+		'kb' => array(
+			'min'		=> 1024, // pow(2, 10)
+			'index'		=> 1,
+			'si_unit'	=> 'KB',
+			'iec_unit'	=> 'KIB',
+		),
+		'b' => array(
+			'min'		=> 0,
+			'index'		=> 0,
+			'si_unit'	=> 'BYTES', // Language index
+			'iec_unit'	=> 'BYTES',  // Language index
+		),
+	);
+
+	foreach ($available_units as $si_identifier => $unit_info)
 	{
-		return ($add_size_lang) ? round($bytes / 1024 / 1024 / 1024, 2) . ' ' . $user->lang['GIB'] : round($bytes / 1024 / 1024 / 1024, 2);
+		if (!empty($allowed_units) && $si_identifier != 'b' && !in_array($si_identifier, $allowed_units))
+		{
+			continue;
+		}
+
+		if ($value >= $unit_info['min'])
+		{
+			$unit_info['si_identifier'] = $si_identifier;
+
+			break;
+		}
 	}
+	unset($available_units);
 
-	if ($bytes >= pow(2, 20))
+	for ($i = 0; $i < $unit_info['index']; $i++)
 	{
-		return ($add_size_lang) ? round($bytes / 1024 / 1024, 2) . ' ' . $user->lang['MIB'] : round($bytes / 1024 / 1024, 2);
+		$value /= 1024;
 	}
+	$value = round($value, 2);
+
+	// Lookup units in language dictionary
+	$unit_info['si_unit'] = (isset($user->lang[$unit_info['si_unit']])) ? $user->lang[$unit_info['si_unit']] : $unit_info['si_unit'];
+	$unit_info['iec_unit'] = (isset($user->lang[$unit_info['iec_unit']])) ? $user->lang[$unit_info['iec_unit']] : $unit_info['iec_unit'];
+
+	// Default to IEC
+	$unit_info['unit'] = $unit_info['iec_unit'];
 
-	if ($bytes >= pow(2, 10))
+	if (!$string_only)
 	{
-		return ($add_size_lang) ? round($bytes / 1024, 2) . ' ' . $user->lang['KIB'] : round($bytes / 1024, 2);
+		$unit_info['value'] = $value;
+
+		return $unit_info;
 	}
 
-	return ($add_size_lang) ? ($bytes) . ' ' . $user->lang['BYTES'] : ($bytes);
+	return $value  . ' ' . $unit_info['unit'];
 }
 
 /**
@@ -496,6 +552,18 @@
 }
 
 /**
+* Hashes an email address to a big integer
+*
+* @param string $email		Email address
+*
+* @return string			Big Integer
+*/
+function phpbb_email_hash($email)
+{
+	return crc32(strtolower($email)) . strlen($email);
+}
+
+/**
 * Global function for chmodding directories and files for internal use
 *
 * This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions.
@@ -669,6 +737,67 @@
 	return $result;
 }
 
+/**
+* Test if a file/directory is writable
+*
+* This function calls the native is_writable() when not running under
+* Windows and it is not disabled.
+*
+* @param string $file Path to perform write test on
+* @return bool True when the path is writable, otherwise false.
+*/
+function phpbb_is_writable($file)
+{
+	if (strtolower(substr(PHP_OS, 0, 3)) === 'win' || !function_exists('is_writable'))
+	{
+		if (file_exists($file))
+		{
+			// Canonicalise path to absolute path
+			$file = phpbb_realpath($file);
+
+			if (is_dir($file))
+			{
+				// Test directory by creating a file inside the directory
+				$result = @tempnam($file, 'i_w');
+
+				if (is_string($result) && file_exists($result))
+				{
+					unlink($result);
+
+					// Ensure the file is actually in the directory (returned realpathed)
+					return (strpos($result, $file) === 0) ? true : false;
+				}
+			}
+			else
+			{
+				$handle = @fopen($file, 'r+');
+
+				if (is_resource($handle))
+				{
+					fclose($handle);
+					return true;
+				}
+			}
+		}
+		else
+		{
+			// file does not exist test if we can write to the directory
+			$dir = dirname($file);
+
+			if (file_exists($dir) && is_dir($dir) && phpbb_is_writable($dir))
+			{
+				return true;
+			}
+		}
+
+		return false;
+	}
+	else
+	{
+		return is_writable($file);
+	}
+}
+
 // Compatibility functions
 
 if (!function_exists('array_combine'))
@@ -1047,7 +1176,7 @@
 		if (is_numeric($offset))
 		{
 			$selected = ($offset == $default) ? ' selected="selected"' : '';
-			$tz_select .= '<option title="'.$zone.'" value="' . $offset . '"' . $selected . '>' . $zone_trunc . '</option>';
+			$tz_select .= '<option title="' . $zone . '" value="' . $offset . '"' . $selected . '>' . $zone_trunc . '</option>';
 		}
 	}
 
@@ -1110,7 +1239,7 @@
 		}
 
 		// Add 0 to forums array to mark global announcements correctly
-		$forum_id[] = 0;
+		// $forum_id[] = 0;
 
 		if ($config['load_db_lastread'] && $user->data['is_registered'])
 		{
@@ -1528,6 +1657,132 @@
 }
 
 /**
+* Get list of unread topics
+*
+* @param int $user_id			User ID (or false for current user)
+* @param string $sql_extra		Extra WHERE SQL statement
+* @param string $sql_sort		ORDER BY SQL sorting statement
+* @param string $sql_limit		Limits the size of unread topics list, 0 for unlimited query
+*
+* @return array[int][int]		Topic ids as keys, mark_time of topic as value
+*/
+function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001)
+{
+	global $config, $db, $user;
+
+	$user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id;
+
+	// Data array we're going to return
+	$unread_topics = array();
+
+	if (empty($sql_sort))
+	{
+		$sql_sort = 'ORDER BY t.topic_last_post_time DESC';
+	}
+
+	if ($config['load_db_lastread'] && $user->data['is_registered'])
+	{
+		// Get list of the unread topics
+		$last_mark = $user->data['user_lastmark'];
+
+		$sql_array = array(
+			'SELECT'		=> 't.topic_id, t.topic_last_post_time, tt.mark_time as topic_mark_time, ft.mark_time as forum_mark_time',
+
+			'FROM'			=> array(TOPICS_TABLE => 't'),
+
+			'LEFT_JOIN'		=> array(
+				array(
+					'FROM'	=> array(TOPICS_TRACK_TABLE => 'tt'),
+					'ON'	=> "tt.user_id = $user_id AND t.topic_id = tt.topic_id",
+				),
+				array(
+					'FROM'	=> array(FORUMS_TRACK_TABLE => 'ft'),
+					'ON'	=> "ft.user_id = $user_id AND t.forum_id = ft.forum_id",
+				),
+			),
+
+			'WHERE'			=> "
+				(
+				(tt.mark_time IS NOT NULL AND t.topic_last_post_time > tt.mark_time) OR
+				(tt.mark_time IS NULL AND ft.mark_time IS NOT NULL AND t.topic_last_post_time > ft.mark_time) OR
+				(tt.mark_time IS NULL AND ft.mark_time IS NULL AND t.topic_last_post_time > $last_mark)
+				)
+				$sql_extra
+				$sql_sort",
+		);
+
+		$sql = $db->sql_build_query('SELECT', $sql_array);
+		$result = $db->sql_query_limit($sql, $sql_limit);
+
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$topic_id = (int) $row['topic_id'];
+			$unread_topics[$topic_id] = ($row['topic_mark_time']) ? (int) $row['topic_mark_time'] : (($row['forum_mark_time']) ? (int) $row['forum_mark_time'] : $last_mark);
+		}
+		$db->sql_freeresult($result);
+	}
+	else if ($config['load_anon_lastread'] || $user->data['is_registered'])
+	{
+		global $tracking_topics;
+
+		if (empty($tracking_topics))
+		{
+			$tracking_topics = request_var($config['cookie_name'] . '_track', '', false, true);
+			$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
+		}
+
+		if (!$user->data['is_registered'])
+		{
+			$user_lastmark = (isset($tracking_topics['l'])) ? base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate'] : 0;
+		}
+		else
+		{
+			$user_lastmark = (int) $user->data['user_lastmark'];
+		}
+
+		$sql = 'SELECT t.topic_id, t.forum_id, t.topic_last_post_time
+			FROM ' . TOPICS_TABLE . ' t
+			WHERE t.topic_last_post_time > ' . $user_lastmark . "
+			$sql_extra
+			$sql_sort";
+		$result = $db->sql_query_limit($sql, $sql_limit);
+
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$forum_id = (int) $row['forum_id'];
+			$topic_id = (int) $row['topic_id'];
+			$topic_id36 = base_convert($topic_id, 10, 36);
+
+			if (isset($tracking_topics['t'][$topic_id36]))
+			{
+				$last_read = base_convert($tracking_topics['t'][$topic_id36], 36, 10) + $config['board_startdate'];
+
+				if ($row['topic_last_post_time'] > $last_read)
+				{
+					$unread_topics[$topic_id] = $last_read;
+				}
+			}
+			else if (isset($tracking_topics['f'][$forum_id]))
+			{
+				$mark_time = base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate'];
+
+				if ($row['topic_last_post_time'] > $mark_time)
+				{
+					$unread_topics[$topic_id] = $mark_time;
+				}
+			}
+			else
+			{
+				$unread_topics[$topic_id] = $user_lastmark;
+			}
+		}
+		$db->sql_freeresult($result);
+	}
+
+	return $unread_topics;
+}
+
+/**
 * Check for read forums and update topic tracking info accordingly
 *
 * @param int $forum_id the forum id to check
@@ -1777,7 +2032,7 @@
 	}
 
 	$on_page = floor($start_item / $per_page) + 1;
-	$url_delim = (strpos($base_url, '?') === false) ? '?' : '&amp;';
+	$url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&amp;');
 
 	$page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href="' . $base_url . '">1</a>';
 
@@ -2056,7 +2311,7 @@
 	$url = str_replace('&amp;', '&', $url);
 
 	// Determine which type of redirect we need to handle...
-	$url_parts = parse_url($url);
+	$url_parts = @parse_url($url);
 
 	if ($url_parts === false)
 	{
@@ -2200,17 +2455,12 @@
 	}
 
 	// Remove previously added sid
-	if (strpos($url, '?sid=') !== false)
+	if (strpos($url, 'sid=') !== false)
 	{
-		$url = preg_replace('/(\?)sid=[a-z0-9]+(&amp;|&)?/', '\1', $url);
-	}
-	else if (strpos($url, '&sid=') !== false)
-	{
-		$url = preg_replace('/&sid=[a-z0-9]+(&)?/', '\1', $url);
-	}
-	else if (strpos($url, '&amp;sid=') !== false)
-	{
-		$url = preg_replace('/&amp;sid=[a-z0-9]+(&amp;)?/', '\1', $url);
+		// All kind of links
+		$url = preg_replace('/(\?)?(&amp;|&)?sid=[a-z0-9]+/', '', $url);
+		// if the sid was the first param, make the old second as first ones
+		$url = preg_replace("/$phpEx(&amp;|&)+?/", "$phpEx?", $url);
 	}
 
 	return append_sid($url);
@@ -2274,6 +2524,18 @@
 		$redirect .= ($query) ? '?' . $query : '';
 	}
 
+	// We need to be cautious here.
+	// On some situations, the redirect path is an absolute URL, sometimes a relative path
+	// For a relative path, let's prefix it with $phpbb_root_path to point to the correct location,
+	// else we use the URL directly.
+	$url_parts = @parse_url($redirect);
+
+	// URL
+	if ($url_parts !== false && !empty($url_parts['scheme']) && !empty($url_parts['host']))
+	{
+		return str_replace('&', '&amp;', $redirect);
+	}
+
 	return $phpbb_root_path . str_replace('&', '&amp;', $redirect);
 }
 
@@ -2435,7 +2697,7 @@
 
 	if ($check && $confirm)
 	{
-		$user_id = request_var('user_id', 0);
+		$user_id = request_var('confirm_uid', 0);
 		$session_id = request_var('sess', '');
 		$confirm_key = request_var('confirm_key', '');
 
@@ -2457,10 +2719,10 @@
 	}
 
 	$s_hidden_fields = build_hidden_fields(array(
-		'user_id'	=> $user->data['user_id'],
-		'sess'		=> $user->session_id,
-		'sid'		=> $user->session_id)
-	);
+		'confirm_uid'	=> $user->data['user_id'],
+		'sess'			=> $user->session_id,
+		'sid'			=> $user->session_id,
+	));
 
 	// generate activation key
 	$confirm_key = gen_rand_string(10);
@@ -2471,7 +2733,7 @@
 	}
 	else
 	{
-		page_header((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]);
+		page_header(((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]), false);
 	}
 
 	$template->set_filenames(array(
@@ -2520,6 +2782,11 @@
 {
 	global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config;
 
+	if (!class_exists('phpbb_captcha_factory'))
+	{
+		include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
+	}
+
 	$err = '';
 
 	// Make sure user->setup() has been called
@@ -2630,38 +2897,15 @@
 		{
 			case LOGIN_ERROR_ATTEMPTS:
 
-				// Show confirm image
-				$sql = 'DELETE FROM ' . CONFIRM_TABLE . "
-					WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
-						AND confirm_type = " . CONFIRM_LOGIN;
-				$db->sql_query($sql);
-
-				// Generate code
-				$code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
-				$confirm_id = md5(unique_id($user->ip));
-				$seed = hexdec(substr(unique_id(), 4, 10));
-
-				// compute $seed % 0x7fffffff
-				$seed -= 0x7fffffff * floor($seed / 0x7fffffff);
-
-				$sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
-					'confirm_id'	=> (string) $confirm_id,
-					'session_id'	=> (string) $user->session_id,
-					'confirm_type'	=> (int) CONFIRM_LOGIN,
-					'code'			=> (string) $code,
-					'seed'			=> (int) $seed)
-				);
-				$db->sql_query($sql);
+				$captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+				$captcha->init(CONFIRM_LOGIN);
+				// $captcha->reset();
 
 				$template->assign_vars(array(
-					'S_CONFIRM_CODE'			=> true,
-					'CONFIRM_ID'				=> $confirm_id,
-					'CONFIRM_IMAGE'				=> '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_LOGIN) . '" alt="" title="" />',
-					'L_LOGIN_CONFIRM_EXPLAIN'	=> sprintf($user->lang['LOGIN_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
+					'CAPTCHA_TEMPLATE'			=> $captcha->get_template(),
 				));
 
 				$err = $user->lang[$result['error_msg']];
-
 			break;
 
 			case LOGIN_ERROR_PASSWORD_CONVERT:
@@ -2688,28 +2932,18 @@
 		}
 	}
 
-	if (!$redirect)
-	{
-		// We just use what the session code determined...
-		// If we are not within the admin directory we use the page dir...
-		$redirect = '';
-
-		if (!$admin)
-		{
-			$redirect .= ($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '';
-		}
-
-		$redirect .= $user->page['page_name'] . (($user->page['query_string']) ? '?' . htmlspecialchars($user->page['query_string']) : '');
-	}
-
 	// Assign credential for username/password pair
 	$credential = ($admin) ? md5(unique_id()) : false;
 
 	$s_hidden_fields = array(
-		'redirect'	=> $redirect,
 		'sid'		=> $user->session_id,
 	);
 
+	if ($redirect)
+	{
+		$s_hidden_fields['redirect'] = $redirect;
+	}
+
 	if ($admin)
 	{
 		$s_hidden_fields['credential'] = $credential;
@@ -2722,12 +2956,11 @@
 		'LOGIN_EXPLAIN'		=> $l_explain,
 
 		'U_SEND_PASSWORD' 		=> ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '',
-		'U_RESEND_ACTIVATION'	=> ($config['require_activation'] != USER_ACTIVATION_NONE && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '',
+		'U_RESEND_ACTIVATION'	=> ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '',
 		'U_TERMS_USE'			=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
 		'U_PRIVACY'				=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
 
 		'S_DISPLAY_FULL_LOGIN'	=> ($s_display) ? true : false,
-		'S_LOGIN_ACTION'		=> (!$admin) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx", false, true, $user->session_id), // Needs to stay index.$phpEx because we are within the admin directory
 		'S_HIDDEN_FIELDS' 		=> $s_hidden_fields,
 
 		'S_ADMIN_AUTH'			=> $admin,
@@ -2811,9 +3044,10 @@
 		$template->assign_var('LOGIN_ERROR', $user->lang['WRONG_PASSWORD']);
 	}
 
-	page_header($user->lang['LOGIN']);
+	page_header($user->lang['LOGIN'], false);
 
 	$template->assign_vars(array(
+		'S_LOGIN_ACTION'		=> build_url(array('f')),
 		'S_HIDDEN_FIELDS'		=> build_hidden_fields(array('f' => $forum_data['forum_id'])))
 	);
 
@@ -2933,6 +3167,14 @@
 {
 	global $db, $user;
 
+	// In phpBB 3.1.x i want to have logging in a class to be able to control it
+	// For now, we need a quite hakish approach to circumvent logging for some actions
+	// @todo implement cleanly
+	if (!empty($GLOBALS['skip_add_log']))
+	{
+		return false;
+	}
+
 	$args = func_get_args();
 
 	$mode			= array_shift($args);
@@ -3200,7 +3442,7 @@
 	global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text;
 
 	// Do not display notices if we suppress them via @
-	if (error_reporting() == 0)
+	if (error_reporting() == 0 && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE)
 	{
 		return;
 	}
@@ -3211,6 +3453,11 @@
 		$msg_text = $msg_long_text;
 	}
 
+	if (!defined('E_DEPRECATED'))
+	{
+		define('E_DEPRECATED', 8192);
+	}
+
 	switch ($errno)
 	{
 		case E_NOTICE:
@@ -3243,8 +3490,13 @@
 				// remove complete path to installation, with the risk of changing backslashes meant to be there
 				$errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile);
 				$msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);
-
 				echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
+
+				// we are writing an image - the user won't see the debug, so let's place it in the log
+				if (defined('IMAGE_OUTPUT') || defined('IN_CRON'))
+				{
+					add_log('critical', 'LOG_IMAGE_GENERATION_ERROR', $errfile, $errline, $msg_text);
+				}
 				// echo '<br /><br />BACKTRACE<br />' . get_backtrace() . '<br />' . "\n";
 			}
 
@@ -3279,6 +3531,17 @@
 				}
 			}
 
+			if (defined('DEBUG') || defined('IN_CRON') || defined('IMAGE_OUTPUT'))
+			{
+				// let's avoid loops
+				$db->sql_return_on_error(true);
+				add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $msg_text);
+				$db->sql_return_on_error(false);
+			}
+
+			// Do not send 200 OK, but service unavailable on errors
+			header('HTTP/1.1 503 Service Unavailable');
+
 			garbage_collection();
 
 			// Try to not call the adm page data...
@@ -3357,7 +3620,7 @@
 				}
 				else
 				{
-					page_header($msg_title);
+					page_header($msg_title, false);
 				}
 			}
 
@@ -3386,6 +3649,11 @@
 
 			exit_handler();
 		break;
+
+		// PHP4 compatibility
+		case E_DEPRECATED:
+			return true;
+		break;
 	}
 
 	// If we notice an error not handled here we pass this back to PHP by returning false
@@ -3395,16 +3663,17 @@
 
 /**
 * Queries the session table to get information about online guests
-* @param int $forum_id Limits the search to the forum with this id
+* @param int $item_id Limits the search to the item with this id
+* @param string $item The name of the item which is stored in the session table as session_{$item}_id
 * @return int The number of active distinct guest sessions
 */
-function obtain_guest_count($forum_id = 0)
+function obtain_guest_count($item_id = 0, $item = 'forum')
 {
 	global $db, $config;
 
-	if ($forum_id)
+	if ($item_id)
 	{
-		$reading_sql = ' AND s.session_forum_id = ' . (int) $forum_id;
+		$reading_sql = ' AND s.session_' . $item . '_id = ' . (int) $item_id;
 	}
 	else
 	{
@@ -3442,17 +3711,18 @@
 
 /**
 * Queries the session table to get information about online users
-* @param int $forum_id Limits the search to the forum with this id
+* @param int $item_id Limits the search to the item with this id
+* @param string $item The name of the item which is stored in the session table as session_{$item}_id
 * @return array An array containing the ids of online, hidden and visible users, as well as statistical info
 */
-function obtain_users_online($forum_id = 0)
+function obtain_users_online($item_id = 0, $item = 'forum')
 {
 	global $db, $config, $user;
 
 	$reading_sql = '';
-	if ($forum_id !== 0)
+	if ($item_id !== 0)
 	{
-		$reading_sql = ' AND s.session_forum_id = ' . (int) $forum_id;
+		$reading_sql = ' AND s.session_' . $item . '_id = ' . (int) $item_id;
 	}
 
 	$online_users = array(
@@ -3466,7 +3736,7 @@
 
 	if ($config['load_online_guests'])
 	{
-		$online_users['guests_online'] = obtain_guest_count($forum_id);
+		$online_users['guests_online'] = obtain_guest_count($item_id, $item);
 	}
 
 	// a little discrete magic to cache this for 30 seconds
@@ -3505,14 +3775,17 @@
 /**
 * Uses the result of obtain_users_online to generate a localized, readable representation.
 * @param mixed $online_users result of obtain_users_online - array with user_id lists for total, hidden and visible users, and statistics
-* @param int $forum_id Indicate that the data is limited to one forum and not global.
+* @param int $item_id Indicate that the data is limited to one item and not global
+* @param string $item The name of the item which is stored in the session table as session_{$item}_id
 * @return array An array containing the string for output to the template
 */
-function obtain_users_online_string($online_users, $forum_id = 0)
+function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum')
 {
 	global $config, $db, $user, $auth;
 
 	$user_online_link = $online_userlist = '';
+	// Need caps version of $item for language-strings
+	$item_caps = strtoupper($item);
 
 	if (sizeof($online_users['online_users']))
 	{
@@ -3547,18 +3820,18 @@
 		$online_userlist = $user->lang['NO_ONLINE_USERS'];
 	}
 
-	if ($forum_id === 0)
+	if ($item_id === 0)
 	{
 		$online_userlist = $user->lang['REGISTERED_USERS'] . ' ' . $online_userlist;
 	}
 	else if ($config['load_online_guests'])
 	{
-		$l_online = ($online_users['guests_online'] === 1) ? $user->lang['BROWSING_FORUM_GUEST'] : $user->lang['BROWSING_FORUM_GUESTS'];
+		$l_online = ($online_users['guests_online'] === 1) ? $user->lang['BROWSING_' . $item_caps . '_GUEST'] : $user->lang['BROWSING_' . $item_caps . '_GUESTS'];
 		$online_userlist = sprintf($l_online, $online_userlist, $online_users['guests_online']);
 	}
 	else
 	{
-		$online_userlist = sprintf($user->lang['BROWSING_FORUM'], $online_userlist);
+		$online_userlist = sprintf($user->lang['BROWSING_' . $item_caps], $online_userlist);
 	}
 	// Build online listing
 	$vars_online = array(
@@ -3612,11 +3885,45 @@
 	);
 }
 
+/**
+* Get option bitfield from custom data
+*
+* @param int	$bit		The bit/value to get
+* @param int	$data		Current bitfield to check
+* @return bool	Returns true if value of constant is set in bitfield, else false
+*/
+function phpbb_optionget($bit, $data)
+{
+	return ($data & 1 << (int) $bit) ? true : false;
+}
+
+/**
+* Set option bitfield
+*
+* @param int	$bit		The bit/value to set/unset
+* @param bool	$set		True if option should be set, false if option should be unset.
+* @param int	$data		Current bitfield to change
+*
+* @return int	The new bitfield
+*/
+function phpbb_optionset($bit, $set, $data)
+{
+	if ($set && !($data & 1 << $bit))
+	{
+		$data += 1 << $bit;
+	}
+	else if (!$set && ($data & 1 << $bit))
+	{
+		$data -= 1 << $bit;
+	}
+
+	return $data;
+}
 
 /**
 * Generate page header
 */
-function page_header($page_title = '', $display_online_list = true)
+function page_header($page_title = '', $display_online_list = true, $item_id = 0, $item = 'forum')
 {
 	global $db, $config, $template, $SID, $_SID, $user, $auth, $phpEx, $phpbb_root_path;
 
@@ -3656,10 +3963,14 @@
 
 	if ($config['load_online'] && $config['load_online_time'] && $display_online_list)
 	{
-		$f = request_var('f', 0);
-		$f = max($f, 0);
-		$online_users = obtain_users_online($f);
-		$user_online_strings = obtain_users_online_string($online_users, $f);
+		/**
+		* Load online data:
+		* For obtaining another session column use $item and $item_id in the function-parameter, whereby the column is session_{$item}_id.
+		*/
+		$item_id = max($item_id, 0);
+
+		$online_users = obtain_users_online($item_id, $item);
+		$user_online_strings = obtain_users_online_string($online_users, $item_id, $item);
 
 		$l_online_users = $user_online_strings['l_online_users'];
 		$online_userlist = $user_online_strings['online_userlist'];
@@ -3721,6 +4032,26 @@
 		}
 	}
 
+	$forum_id = request_var('f', 0);
+	$topic_id = request_var('t', 0);
+
+	$s_feed_news = false;
+
+	// Get option for news
+	if ($config['feed_enable'])
+	{
+		$sql = 'SELECT forum_id
+			FROM ' . FORUMS_TABLE . '
+			WHERE ' . $db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
+		$result = $db->sql_query_limit($sql, 1, 0, 600);
+		$s_feed_news = (int) $db->sql_fetchfield('forum_id');
+		$db->sql_freeresult($result);
+	}
+
+	// Determine board url - we may need it later
+	$board_url = generate_board_url() . '/';
+	$web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $phpbb_root_path;
+
 	// Which timezone?
 	$tz = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']));
 
@@ -3748,11 +4079,13 @@
 
 		'S_USER_NEW_PRIVMSG'			=> $user->data['user_new_privmsg'],
 		'S_USER_UNREAD_PRIVMSG'			=> $user->data['user_unread_privmsg'],
+		'S_USER_NEW'					=> $user->data['user_new'],
 
 		'SID'				=> $SID,
 		'_SID'				=> $_SID,
 		'SESSION_ID'		=> $user->session_id,
 		'ROOT_PATH'			=> $phpbb_root_path,
+		'BOARD_URL'			=> $board_url,
 
 		'L_LOGIN_LOGOUT'	=> $l_login_logout,
 		'L_INDEX'			=> $user->lang['FORUM_INDEX'],
@@ -3774,10 +4107,14 @@
 		'U_SEARCH_SELF'			=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=egosearch'),
 		'U_SEARCH_NEW'			=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=newposts'),
 		'U_SEARCH_UNANSWERED'	=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unanswered'),
+		'U_SEARCH_UNREAD'		=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unreadposts'),
 		'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'),
 		'U_DELETE_COOKIES'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'),
 		'U_TEAM'				=> ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=leaders'),
+		'U_TERMS_USE'			=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
+		'U_PRIVACY'				=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
 		'U_RESTORE_PERMISSIONS'	=> ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '',
+		'U_FEED'				=> generate_board_url() . "/feed.$phpEx",
 
 		'S_USER_LOGGED_IN'		=> ($user->data['user_id'] != ANONYMOUS) ? true : false,
 		'S_AUTOLOGIN_ENABLED'	=> ($config['allow_autologin']) ? true : false,
@@ -3799,22 +4136,44 @@
 		'S_DISPLAY_MEMBERLIST'	=> (isset($auth)) ? $auth->acl_get('u_viewprofile') : 0,
 		'S_NEW_PM'				=> ($s_privmsg_new) ? 1 : 0,
 		'S_REGISTER_ENABLED'	=> ($config['require_activation'] != USER_ACTIVATION_DISABLE) ? true : false,
+		'S_FORUM_ID'			=> $forum_id,
+		'S_TOPIC_ID'			=> $topic_id,
 
-		'T_THEME_PATH'			=> "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme',
-		'T_TEMPLATE_PATH'		=> "{$phpbb_root_path}styles/" . $user->theme['template_path'] . '/template',
-		'T_SUPER_TEMPLATE_PATH'	=> (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$phpbb_root_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$phpbb_root_path}styles/" . $user->theme['template_path'] . '/template',
-		'T_IMAGESET_PATH'		=> "{$phpbb_root_path}styles/" . $user->theme['imageset_path'] . '/imageset',
-		'T_IMAGESET_LANG_PATH'	=> "{$phpbb_root_path}styles/" . $user->theme['imageset_path'] . '/imageset/' . $user->data['user_lang'],
-		'T_IMAGES_PATH'			=> "{$phpbb_root_path}images/",
-		'T_SMILIES_PATH'		=> "{$phpbb_root_path}{$config['smilies_path']}/",
-		'T_AVATAR_PATH'			=> "{$phpbb_root_path}{$config['avatar_path']}/",
-		'T_AVATAR_GALLERY_PATH'	=> "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
-		'T_ICONS_PATH'			=> "{$phpbb_root_path}{$config['icons_path']}/",
-		'T_RANKS_PATH'			=> "{$phpbb_root_path}{$config['ranks_path']}/",
-		'T_UPLOAD_PATH'			=> "{$phpbb_root_path}{$config['upload_path']}/",
-		'T_STYLESHEET_LINK'		=> (!$user->theme['theme_storedb']) ? "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$user->session_id&amp;id=" . $user->theme['style_id'] . '&amp;lang=' . $user->data['user_lang'],
+		'S_LOGIN_ACTION'		=> (!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') . '&amp;redirect=' . urlencode(str_replace('&amp;', '&', build_url())) : append_sid("index.$phpEx", false, true, $user->session_id) . '&amp;redirect=' . urlencode(str_replace('&amp;', '&', build_url())),
+
+		'S_ENABLE_FEEDS'			=> ($config['feed_enable']) ? true : false,
+		'S_ENABLE_FEEDS_FORUMS'		=> ($config['feed_overall_forums']) ? true : false,
+		'S_ENABLE_FEEDS_TOPICS'		=> ($config['feed_overall_topics']) ? true : false,
+		'S_ENABLE_FEEDS_NEWS'		=> ($s_feed_news) ? true : false,
+
+		'T_THEME_PATH'			=> "{$web_path}styles/" . $user->theme['theme_path'] . '/theme',
+		'T_TEMPLATE_PATH'		=> "{$web_path}styles/" . $user->theme['template_path'] . '/template',
+		'T_SUPER_TEMPLATE_PATH'	=> (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$web_path}styles/" . $user->theme['template_path'] . '/template',
+		'T_IMAGESET_PATH'		=> "{$web_path}styles/" . $user->theme['imageset_path'] . '/imageset',
+		'T_IMAGESET_LANG_PATH'	=> "{$web_path}styles/" . $user->theme['imageset_path'] . '/imageset/' . $user->data['user_lang'],
+		'T_IMAGES_PATH'			=> "{$web_path}images/",
+		'T_SMILIES_PATH'		=> "{$web_path}{$config['smilies_path']}/",
+		'T_AVATAR_PATH'			=> "{$web_path}{$config['avatar_path']}/",
+		'T_AVATAR_GALLERY_PATH'	=> "{$web_path}{$config['avatar_gallery_path']}/",
+		'T_ICONS_PATH'			=> "{$web_path}{$config['icons_path']}/",
+		'T_RANKS_PATH'			=> "{$web_path}{$config['ranks_path']}/",
+		'T_UPLOAD_PATH'			=> "{$web_path}{$config['upload_path']}/",
+		'T_STYLESHEET_LINK'		=> (!$user->theme['theme_storedb']) ? "{$web_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : append_sid("{$phpbb_root_path}style.$phpEx", 'id=' . $user->theme['style_id'] . '&amp;lang=' . $user->data['user_lang']),
 		'T_STYLESHEET_NAME'		=> $user->theme['theme_name'],
 
+		'T_THEME_NAME'			=> $user->theme['theme_path'],
+		'T_TEMPLATE_NAME'		=> $user->theme['template_path'],
+		'T_SUPER_TEMPLATE_NAME'	=> (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? $user->theme['template_inherit_path'] : $user->theme['template_path'],
+		'T_IMAGESET_NAME'		=> $user->theme['imageset_path'],
+		'T_IMAGESET_LANG_NAME'	=> $user->data['user_lang'],
+		'T_IMAGES'				=> 'images',
+		'T_SMILIES'				=> $config['smilies_path'],
+		'T_AVATAR'				=> $config['avatar_path'],
+		'T_AVATAR_GALLERY'		=> $config['avatar_gallery_path'],
+		'T_ICONS'				=> $config['icons_path'],
+		'T_RANKS'				=> $config['ranks_path'],
+		'T_UPLOAD'				=> $config['upload_path'],
+
 		'SITE_LOGO_IMG'			=> $user->img('site_logo'),
 
 		'A_COOKIE_SETTINGS'		=> addslashes('; path=' . $config['cookie_path'] . ((!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain']) . ((!$config['cookie_secure']) ? '' : '; secure')),
@@ -3848,7 +4207,7 @@
 			$db->sql_report('display');
 		}
 
-		$debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime);
+		$debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress'] && @extension_loaded('zlib')) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime);
 
 		if ($auth->acl_get('a_') && defined('DEBUG_EXTRA'))
 		{
@@ -3876,35 +4235,55 @@
 	);
 
 	// Call cron-type script
+	$call_cron = false;
 	if (!defined('IN_CRON') && $run_cron && !$config['board_disable'])
 	{
+		$call_cron = true;
+		$time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time();
+
+		// Any old lock present?
+		if (!empty($config['cron_lock']))
+		{
+			$cron_time = explode(' ', $config['cron_lock']);
+
+			// If 1 hour lock is present we do not call cron.php
+			if ($cron_time[0] + 3600 >= $time_now)
+			{
+				$call_cron = false;
+			}
+		}
+	}
+
+	// Call cron job?
+	if ($call_cron)
+	{
 		$cron_type = '';
 
-		if (time() - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
+		if ($time_now - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
 		{
 			// Process email queue
 			$cron_type = 'queue';
 		}
-		else if (method_exists($cache, 'tidy') && time() - $config['cache_gc'] > $config['cache_last_gc'])
+		else if (method_exists($cache, 'tidy') && $time_now - $config['cache_gc'] > $config['cache_last_gc'])
 		{
 			// Tidy the cache
 			$cron_type = 'tidy_cache';
 		}
-		else if (time() - $config['warnings_gc'] > $config['warnings_last_gc'])
+		else if ($config['warnings_expire_days'] && ($time_now - $config['warnings_gc'] > $config['warnings_last_gc']))
 		{
 			$cron_type = 'tidy_warnings';
 		}
-		else if (time() - $config['database_gc'] > $config['database_last_gc'])
+		else if ($time_now - $config['database_gc'] > $config['database_last_gc'])
 		{
 			// Tidy the database
 			$cron_type = 'tidy_database';
 		}
-		else if (time() - $config['search_gc'] > $config['search_last_gc'])
+		else if ($time_now - $config['search_gc'] > $config['search_last_gc'])
 		{
 			// Tidy the search
 			$cron_type = 'tidy_search';
 		}
-		else if (time() - $config['session_gc'] > $config['session_last_gc'])
+		else if ($time_now - $config['session_gc'] > $config['session_last_gc'])
 		{
 			$cron_type = 'tidy_sessions';
 		}
diff -x .svn -aruN 3.0.5.src/includes/functions_posting.php 3.0.6.src/includes/functions_posting.php
--- 3.0.5.src/includes/functions_posting.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_posting.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_posting.php 9462 2009-04-17 15:35:56Z acydburn $
+* @version $Id: functions_posting.php 10008 2009-08-17 14:45:14Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -24,6 +24,8 @@
 	global $auth, $db, $user, $config, $template;
 	global $phpEx, $phpbb_root_path;
 
+	$start = request_var('start', 0);
+
 	if ($mode == 'window')
 	{
 		if ($forum_id)
@@ -44,9 +46,26 @@
 
 		page_header($user->lang['SMILIES']);
 
+		$sql = 'SELECT COUNT(smiley_id) AS count
+			FROM ' . SMILIES_TABLE . '
+			GROUP BY smiley_url';
+		$result = $db->sql_query($sql, 3600);
+
+		$smiley_count = 0;
+		while ($row = $db->sql_fetchrow($result))
+		{
+			++$smiley_count;
+		}
+		$db->sql_freeresult($result);
+
 		$template->set_filenames(array(
 			'body' => 'posting_smilies.html')
 		);
+
+		$template->assign_var('PAGINATION',
+			generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id),
+				$smiley_count, $config['smilies_per_page'], $start, true)
+		);
 	}
 
 	$display_link = false;
@@ -64,13 +83,22 @@
 		$db->sql_freeresult($result);
 	}
 
-	$last_url = '';
-
-	$sql = 'SELECT *
-		FROM ' . SMILIES_TABLE .
-		(($mode == 'inline') ? ' WHERE display_on_posting = 1 ' : '') . '
-		ORDER BY smiley_order';
-	$result = $db->sql_query($sql, 3600);
+	if ($mode == 'window')
+	{
+		$sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height
+			FROM ' . SMILIES_TABLE . '
+			GROUP BY smiley_url, smiley_width, smiley_height
+			ORDER BY smiley_order';
+		$result = $db->sql_query_limit($sql, $config['smilies_per_page'], $start, 3600);
+	}
+	else
+	{
+		$sql = 'SELECT *
+			FROM ' . SMILIES_TABLE . '
+			WHERE display_on_posting = 1
+			ORDER BY smiley_order';
+		$result = $db->sql_query($sql, 3600);
+	}
 
 	$smilies = array();
 	while ($row = $db->sql_fetchrow($result))
@@ -84,12 +112,14 @@
 
 	if (sizeof($smilies))
 	{
+		$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
+
 		foreach ($smilies as $row)
 		{
 			$template->assign_block_vars('smiley', array(
 				'SMILEY_CODE'	=> $row['code'],
 				'A_SMILEY_CODE'	=> addslashes($row['code']),
-				'SMILEY_IMG'	=> $phpbb_root_path . $config['smilies_path'] . '/' . $row['smiley_url'],
+				'SMILEY_IMG'	=> $root_path . $config['smilies_path'] . '/' . $row['smiley_url'],
 				'SMILEY_WIDTH'	=> $row['smiley_width'],
 				'SMILEY_HEIGHT'	=> $row['smiley_height'],
 				'SMILEY_DESC'	=> $row['emotion'])
@@ -656,6 +686,7 @@
 				break;
 
 				case IMG_JPG:
+					@ini_set('gd.jpeg_ignore_warning', 1);
 					$image = @imagecreatefromjpeg($source);
 				break;
 
@@ -668,6 +699,11 @@
 				break;
 			}
 
+			if (empty($image))
+			{
+				return false;
+			}
+
 			if ($type['version'] == 1)
 			{
 				$new_image = imagecreate($new_width, $new_height);
@@ -751,7 +787,7 @@
 
 		foreach ($attachment_data as $i => $attachment)
 		{
-			$s_inline_attachment_options .= '<option value="' . $i . '">' . basename($attachment['real_filename']) . '</option>';
+			$s_inline_attachment_options .= '<option value="' . $i . '">' . utf8_basename($attachment['real_filename']) . '</option>';
 		}
 
 		$template->assign_var('S_INLINE_ATTACHMENT_OPTIONS', $s_inline_attachment_options);
@@ -785,7 +821,7 @@
 		foreach ($attachment_data as $count => $attach_row)
 		{
 			$hidden = '';
-			$attach_row['real_filename'] = basename($attach_row['real_filename']);
+			$attach_row['real_filename'] = utf8_basename($attach_row['real_filename']);
 
 			foreach ($attach_row as $key => $value)
 			{
@@ -795,8 +831,8 @@
 			$download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&amp;id=' . (int) $attach_row['attach_id'], true, ($attach_row['is_orphan']) ? $user->session_id : false);
 
 			$template->assign_block_vars('attach_row', array(
-				'FILENAME'			=> basename($attach_row['real_filename']),
-				'A_FILENAME'		=> addslashes(basename($attach_row['real_filename'])),
+				'FILENAME'			=> utf8_basename($attach_row['real_filename']),
+				'A_FILENAME'		=> addslashes(utf8_basename($attach_row['real_filename'])),
 				'FILE_COMMENT'		=> $attach_row['attach_comment'],
 				'ATTACH_ID'			=> $attach_row['attach_id'],
 				'S_IS_ORPHAN'		=> $attach_row['is_orphan'],
@@ -818,7 +854,7 @@
 /**
 * Load Drafts
 */
-function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
+function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $msg_id = 0)
 {
 	global $user, $db, $template, $auth;
 	global $phpbb_root_path, $phpEx;
@@ -911,7 +947,7 @@
 		{
 			// Either display as PM draft if forum_id and topic_id are empty or if access to the forums has been denied afterwards...
 			$link_pm = true;
-			$insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=compose&amp;d={$draft['draft_id']}");
+			$insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=compose&amp;d={$draft['draft_id']}" . (($pm_action) ? "&amp;action=$pm_action" : '') . (($msg_id) ? "&amp;p=$msg_id" : ''));
 		}
 
 		$template->assign_block_vars('draftrow', array(
@@ -944,6 +980,7 @@
 		WHERE p.topic_id = $topic_id
 			" . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . '
 			' . (($mode == 'post_review') ? " AND p.post_id > $cur_post_id" : '') . '
+			' . (($mode == 'post_review_edit') ? " AND p.post_id = $cur_post_id" : '') . '
 		ORDER BY p.post_time ';
 	$sql .= ($mode == 'post_review') ? 'ASC' : 'DESC';
 	$result = $db->sql_query_limit($sql, $config['posts_per_page']);
@@ -962,6 +999,12 @@
 		return false;
 	}
 
+	// Handle 'post_review_edit' like 'post_review' from now on
+	if ($mode == 'post_review_edit')
+	{
+		$mode = 'post_review';
+	}
+
 	$sql = $db->sql_build_query('SELECT', array(
 		'SELECT'	=> 'u.username, u.user_id, u.user_colour, p.*, z.friend, z.foe',
 
@@ -1514,6 +1557,21 @@
 		break;
 	}
 
+	if (($post_mode == 'delete') || ($post_mode == 'delete_last_post') || ($post_mode == 'delete_first_post'))
+	{
+		$sql = 'SELECT 1 AS has_attachments
+			FROM ' . ATTACHMENTS_TABLE . '
+			WHERE topic_id = ' . $topic_id;
+		$result = $db->sql_query_limit($sql, 1);
+		$has_attachments = (int) $db->sql_fetchfield('has_attachments');
+		$db->sql_freeresult($result);
+
+		if (!$has_attachments)
+		{
+			$sql_data[TOPICS_TABLE] .= ', topic_attachment = 0';
+		}
+	}
+
 //	$sql_data[USERS_TABLE] = ($data['post_postcount']) ? 'user_posts = user_posts - 1' : '';
 
 	$db->sql_transaction('begin');
@@ -1565,8 +1623,9 @@
 
 /**
 * Submit Post
+* @todo Split up and create lightweight, simple API for this.
 */
-function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true)
+function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true, $update_search_index = true)
 {
 	global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path;
 
@@ -1618,14 +1677,22 @@
 	}
 
 	// This variable indicates if the user is able to post or put into the queue - it is used later for all code decisions regarding approval
+	// The variable name should be $post_approved, because it indicates if the post is approved or not
 	$post_approval = 1;
 
-	// Check the permissions for post approval, as well as the queue trigger where users are put on approval with a post count lower than specified. Moderators are not affected.
-	if ((($config['enable_queue_trigger'] && $user->data['user_posts'] < $config['queue_trigger_posts']) || !$auth->acl_get('f_noapprove', $data['forum_id'])) && !$auth->acl_get('m_approve', $data['forum_id']))
+	// Check the permissions for post approval. Moderators are not affected.
+	if (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id']))
 	{
+		// Post not approved, but in queue
 		$post_approval = 0;
 	}
 
+	// Mods are able to force approved/unapproved posts. True means the post is approved, false the post is unapproved
+	if (isset($data['force_approved_state']))
+	{
+		$post_approval = ($data['force_approved_state']) ? 1 : 0;
+	}
+
 	// Start the transaction here
 	$db->sql_transaction('begin');
 
@@ -2119,7 +2186,7 @@
 			else
 			{
 				// insert attachment into db
-				if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
+				if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . utf8_basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
 				{
 					continue;
 				}
@@ -2423,7 +2490,7 @@
 	}
 
 	// Index message contents
-	if ($update_message && $data['enable_indexing'])
+	if ($update_search_index && $data['enable_indexing'])
 	{
 		// Select the search method and do some additional checks to ensure it can actually be utilised
 		$search_type = basename($config['search_type']);
@@ -2475,7 +2542,7 @@
 
 	// Mark this topic as read
 	// We do not use post_time here, this is intended (post_time can have a date in the past if editing a message)
-	markread('topic', $data['forum_id'], $data['topic_id'], time());
+	markread('topic', (($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']), $data['topic_id'], time());
 
 	//
 	if ($config['load_db_lastread'] && $user->data['is_registered'])
@@ -2483,7 +2550,7 @@
 		$sql = 'SELECT mark_time
 			FROM ' . FORUMS_TRACK_TABLE . '
 			WHERE user_id = ' . $user->data['user_id'] . '
-				AND forum_id = ' . $data['forum_id'];
+				AND forum_id = ' . (($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']);
 		$result = $db->sql_query($sql);
 		$f_mark_time = (int) $db->sql_fetchfield('mark_time');
 		$db->sql_freeresult($result);
@@ -2496,14 +2563,23 @@
 	if (($config['load_db_lastread'] && $user->data['is_registered']) || $config['load_anon_lastread'] || $user->data['is_registered'])
 	{
 		// Update forum info
-		$sql = 'SELECT forum_last_post_time
-			FROM ' . FORUMS_TABLE . '
-			WHERE forum_id = ' . $data['forum_id'];
+		if ($topic_type == POST_GLOBAL)
+		{
+			$sql = 'SELECT MAX(topic_last_post_time) as forum_last_post_time
+				FROM ' . TOPICS_TABLE . '
+				WHERE forum_id = 0';
+		}
+		else
+		{
+			$sql = 'SELECT forum_last_post_time
+				FROM ' . FORUMS_TABLE . '
+				WHERE forum_id = ' . $data['forum_id'];
+		}
 		$result = $db->sql_query($sql);
 		$forum_last_post_time = (int) $db->sql_fetchfield('forum_last_post_time');
 		$db->sql_freeresult($result);
 
-		update_forum_tracking_info($data['forum_id'], $forum_last_post_time, $f_mark_time, false);
+		update_forum_tracking_info((($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']), $forum_last_post_time, $f_mark_time, false);
 	}
 
 	// Send Notifications
diff -x .svn -aruN 3.0.5.src/includes/functions_privmsgs.php 3.0.6.src/includes/functions_privmsgs.php
--- 3.0.5.src/includes/functions_privmsgs.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_privmsgs.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_privmsgs.php 9441 2009-04-12 13:21:25Z acydburn $
+* @version $Id: functions_privmsgs.php 10165 2009-09-19 12:21:39Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -1145,8 +1145,7 @@
 		{
 			$sql = 'SELECT user_id, username, user_colour
 				FROM ' . USERS_TABLE . '
-				WHERE ' . $db->sql_in_set('user_id', $u) . '
-					AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+				WHERE ' . $db->sql_in_set('user_id', $u);
 			$result = $db->sql_query($sql);
 
 			while ($row = $db->sql_fetchrow($result))
@@ -1356,6 +1355,12 @@
 
 			while ($row = $db->sql_fetchrow($result))
 			{
+				// Additionally, do not include the sender if he is in the group he wants to send to. ;)
+				if ($row['user_id'] === $user->data['user_id'])
+				{
+					continue;
+				}
+
 				$field = ($data['address_list']['g'][$row['group_id']] == 'to') ? 'to' : 'bcc';
 				$recipients[$row['user_id']] = $field;
 			}
@@ -1405,7 +1410,8 @@
 				'bbcode_bitfield'	=> $data['bbcode_bitfield'],
 				'bbcode_uid'		=> $data['bbcode_uid'],
 				'to_address'		=> implode(':', $to),
-				'bcc_address'		=> implode(':', $bcc)
+				'bcc_address'		=> implode(':', $bcc),
+				'message_reported'	=> 0,
 			);
 		break;
 
@@ -1545,7 +1551,7 @@
 			else
 			{
 				// insert attachment into db
-				if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
+				if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . utf8_basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
 				{
 					continue;
 				}
@@ -1691,14 +1697,34 @@
 {
 	global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode;
 
+	// Select all receipts and the author from the pm we currently view, to only display their pm-history
+	$sql = 'SELECT author_id, user_id
+		FROM ' . PRIVMSGS_TO_TABLE . "
+		WHERE msg_id = $msg_id
+			AND folder_id <> " . PRIVMSGS_HOLD_BOX;
+	$result = $db->sql_query($sql);
+
+	$recipients = array();
+	while ($row = $db->sql_fetchrow($result))
+	{
+		$recipients[] = (int) $row['user_id'];
+		$recipients[] = (int) $row['author_id'];
+	}
+	$db->sql_freeresult($result);
+	$recipients = array_unique($recipients);
+
 	// Get History Messages (could be newer)
 	$sql = 'SELECT t.*, p.*, u.*
 		FROM ' . PRIVMSGS_TABLE . ' p, ' . PRIVMSGS_TO_TABLE . ' t, ' . USERS_TABLE . ' u
 		WHERE t.msg_id = p.msg_id
 			AND p.author_id = u.user_id
-			AND t.folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ")
+			AND t.folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ')
+			AND ' . $db->sql_in_set('t.author_id', $recipients, false, true) . "
 			AND t.user_id = $user_id";
 
+	// We no longer need those.
+	unset($recipients);
+
 	if (!$message_row['root_level'])
 	{
 		$sql .= " AND (p.root_level = $msg_id OR (p.root_level = 0 AND p.msg_id = $msg_id))";
@@ -1781,7 +1807,7 @@
 
 		$decoded_message = false;
 
-		if ($in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS && $author_id != $user->data['user_id'])
+		if ($in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS)
 		{
 			$decoded_message = $message;
 			decode_message($decoded_message, $row['bbcode_uid']);
@@ -1824,10 +1850,10 @@
 
 			'MSG_ID'			=> $row['msg_id'],
 			'U_VIEW_MESSAGE'	=> "$url&amp;f=$folder_id&amp;p=" . $row['msg_id'],
-			'U_QUOTE'			=> (!$in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS && $author_id != $user->data['user_id']) ? "$url&amp;mode=compose&amp;action=quote&amp;f=" . $folder_id . "&amp;p=" . $row['msg_id'] : '',
+			'U_QUOTE'			=> (!$in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=quote&amp;f=" . $folder_id . "&amp;p=" . $row['msg_id'] : '',
 			'U_POST_REPLY_PM'	=> ($author_id != $user->data['user_id'] && $author_id != ANONYMOUS && $auth->acl_get('u_sendpm')) ? "$url&amp;mode=compose&amp;action=reply&amp;f=$folder_id&amp;p=" . $row['msg_id'] : '')
 		);
-		unset($rowset[$id]);
+		unset($rowset[$i]);
 		$prev_id = $id;
 	}
 
@@ -1863,4 +1889,93 @@
 	$user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit;
 }
 
+/**
+* Generates an array of coloured recipient names from a list of PMs - (groups & users)
+*
+* @param	array	$pm_by_id	An array of rows from PRIVMSGS_TABLE, keys are the msg_ids.
+*
+* @return	array				2D Array: array(msg_id => array('username or group string', ...), ...)
+*								Usernames are generated with {@link get_username_string get_username_string}
+*								Groups are coloured and have a link to the membership page
+*/
+function get_recipient_strings($pm_by_id)
+{
+	global $db, $phpbb_root_path, $phpEx, $user;
+
+	$address_list = $recipient_list = $address = array();
+
+	$_types = array('u', 'g');
+
+	foreach ($pm_by_id as $message_id => $row)
+	{
+		$address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address']));
+
+		foreach ($_types as $ug_type)
+		{
+			if (isset($address[$message_id][$ug_type]) && sizeof($address[$message_id][$ug_type]))
+			{
+				foreach ($address[$message_id][$ug_type] as $ug_id => $in_to)
+				{
+					$recipient_list[$ug_type][$ug_id] = array('name' => $user->lang['NA'], 'colour' => '');
+				}
+			}
+		}
+	}
+
+	foreach ($_types as $ug_type)
+	{
+		if (!empty($recipient_list[$ug_type]))
+		{
+			if ($ug_type == 'u')
+			{
+				$sql = 'SELECT user_id as id, username as name, user_colour as colour
+					FROM ' . USERS_TABLE . '
+					WHERE ';
+			}
+			else
+			{
+				$sql = 'SELECT group_id as id, group_name as name, group_colour as colour, group_type
+					FROM ' . GROUPS_TABLE . '
+					WHERE ';
+			}
+			$sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type])));
+
+			$result = $db->sql_query($sql);
+
+			while ($row = $db->sql_fetchrow($result))
+			{
+				if ($ug_type == 'g')
+				{
+					$row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name'];
+				}
+
+				$recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']);
+			}
+			$db->sql_freeresult($result);
+		}
+	}
+
+	foreach ($address as $message_id => $adr_ary)
+	{
+		foreach ($adr_ary as $type => $id_ary)
+		{
+			foreach ($id_ary as $ug_id => $_id)
+			{
+				if ($type == 'u')
+				{
+					$address_list[$message_id][] = get_username_string('full', $ug_id, $recipient_list[$type][$ug_id]['name'], $recipient_list[$type][$ug_id]['colour']);
+				}
+				else
+				{
+					$user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : '';
+					$link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $ug_id) . '"' . $user_colour . '>';
+					$address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '</a>' : '');
+				}
+			}
+		}
+	}
+
+	return $address_list;
+}
+
 ?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/functions_profile_fields.php 3.0.6.src/includes/functions_profile_fields.php
--- 3.0.5.src/includes/functions_profile_fields.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_profile_fields.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_profile_fields.php 9504 2009-05-01 10:10:35Z acydburn $
+* @version $Id: functions_profile_fields.php 10216 2009-10-07 14:54:10Z toonarmy $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -92,18 +92,6 @@
 	{
 		switch ($field_type)
 		{
-			case FIELD_INT:
-			case FIELD_DROPDOWN:
-				$field_value = (int) $field_value;
-			break;
-
-			case FIELD_BOOL:
-				$field_value = (bool) $field_value;
-			break;
-		}
-
-		switch ($field_type)
-		{
 			case FIELD_DATE:
 				$field_validate = explode('-', $field_value);
 
@@ -133,6 +121,8 @@
 			break;
 
 			case FIELD_BOOL:
+				$field_value = (bool) $field_value;
+			
 				if (!$field_value && $field_data['field_required'])
 				{
 					return 'FIELD_REQUIRED';
@@ -140,10 +130,12 @@
 			break;
 
 			case FIELD_INT:
-				if (empty($field_value) && !$field_data['field_required'])
+				if (trim($field_value) === '' && !$field_data['field_required'])
 				{
 					return false;
 				}
+				
+				$field_value = (int) $field_value;
 
 				if ($field_value < $field_data['field_minlen'])
 				{
@@ -156,6 +148,8 @@
 			break;
 
 			case FIELD_DROPDOWN:
+				$field_value = (int) $field_value;
+			
 				if ($field_value == $field_data['field_novalue'] && $field_data['field_required'])
 				{
 					return 'FIELD_REQUIRED';
@@ -259,7 +253,7 @@
 	}
 
 	/**
-	* Submit profile field
+	* Submit profile field for validation
 	* @access public
 	*/
 	function submit_cp_field($mode, $lang_id, &$cp_data, &$cp_error)
@@ -350,6 +344,66 @@
 	}
 
 	/**
+	* Update profile field data directly
+	*/
+	function update_profile_field_data($user_id, &$cp_data)
+	{
+		global $db;
+
+		if (!sizeof($cp_data))
+		{
+			return;
+		}
+
+		switch ($db->sql_layer)
+		{
+			case 'oracle':
+			case 'firebird':
+			case 'postgres':
+				$right_delim = $left_delim = '"';
+			break;
+
+			case 'sqlite':
+			case 'mssql':
+			case 'mssql_odbc':
+				$right_delim = ']';
+				$left_delim = '[';
+			break;
+
+			case 'mysql':
+			case 'mysql4':
+			case 'mysqli':
+				$right_delim = $left_delim = '`';
+			break;
+		}
+
+		// use new array for the UPDATE; changes in the key do not affect the original array
+		$cp_data_sql = array();
+		foreach ($cp_data as $key => $value)
+		{
+			// Firebird is case sensitive with delimiter
+			$cp_data_sql[$left_delim . (($db->sql_layer == 'firebird' || $db->sql_layer == 'oracle') ? strtoupper($key) : $key) . $right_delim] = $value;
+		}
+
+		$sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
+			SET ' . $db->sql_build_array('UPDATE', $cp_data_sql) . "
+			WHERE user_id = $user_id";
+		$db->sql_query($sql);
+
+		if (!$db->sql_affectedrows())
+		{
+			$cp_data_sql['user_id'] = (int) $user_id;
+
+			$db->sql_return_on_error(true);
+
+			$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data_sql);
+			$db->sql_query($sql);
+
+			$db->sql_return_on_error(false);
+		}
+	}
+
+	/**
 	* Assign fields to template, used for viewprofile, viewtopic and memberlist (if load setting is enabled)
 	* This is directly connected to the user -> mode == grab is to grab the user specific fields, mode == show is for assigning the row to the template
 	* @access public
@@ -454,7 +508,7 @@
 		switch ($this->profile_types[$field_type])
 		{
 			case 'int':
-				if ($value == '')
+				if ($value === '')
 				{
 					return NULL;
 				}
@@ -570,7 +624,7 @@
 			}
 			else
 			{
-				if (!$preview && isset($user->profile_fields[$user_ident]) && is_null($user->profile_fields[$user_ident]))
+				if (!$preview && array_key_exists($user_ident, $user->profile_fields) && is_null($user->profile_fields[$user_ident]))
 				{
 					$value = NULL;
 				}
@@ -584,7 +638,7 @@
 				}
 			}
 
-			return (is_null($value)) ? '' : (int) $value;
+			return (is_null($value) || $value === '') ? '' : (int) $value;
 		}
 		else
 		{
diff -x .svn -aruN 3.0.5.src/includes/functions_template.php 3.0.6.src/includes/functions_template.php
--- 3.0.5.src/includes/functions_template.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_template.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_template.php 9419 2009-03-31 12:21:36Z toonarmy $
+* @version $Id: functions_template.php 10064 2009-08-30 11:15:24Z acydburn $
 * @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -128,9 +128,9 @@
 		$php_blocks = $matches[1];
 		$code = preg_replace('#<!-- PHP -->.*?<!-- ENDPHP -->#s', '<!-- PHP -->', $code);
 
-		preg_match_all('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches);
+		preg_match_all('#<!-- INCLUDE (\{\$?[A-Z0-9\-_]+\}|[a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches);
 		$include_blocks = $matches[1];
-		$code = preg_replace('#<!-- INCLUDE [a-zA-Z0-9\_\-\+\./]+ -->#', '<!-- INCLUDE -->', $code);
+		$code = preg_replace('#<!-- INCLUDE (?:\{\$?[A-Z0-9\-_]+\}|[a-zA-Z0-9\_\-\+\./]+) -->#', '<!-- INCLUDE -->', $code);
 
 		preg_match_all('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches);
 		$includephp_blocks = $matches[1];
@@ -193,8 +193,39 @@
 
 				case 'INCLUDE':
 					$temp = array_shift($include_blocks);
+
+					// Dynamic includes
+					// Cheap match rather than a full blown regexp, we already know
+					// the format of the input so just use string manipulation.
+					if ($temp[0] == '{')
+					{
+						$file = false;
+
+						if ($temp[1] == '$')
+						{
+							$var = substr($temp, 2, -1);
+							//$file = $this->template->_tpldata['DEFINE']['.'][$var];
+							$temp = "\$this->_tpldata['DEFINE']['.']['$var']";
+						}
+						else
+						{
+							$var = substr($temp, 1, -1);
+							//$file = $this->template->_rootref[$var];
+							$temp = "\$this->_rootref['$var']";
+						}
+					}
+					else
+					{
+						$file = $temp;
+					}
+
 					$compile_blocks[] = '<?php ' . $this->compile_tag_include($temp) . ' ?>';
-					$this->template->_tpl_include($temp, false);
+
+					// No point in checking variable includes
+					if ($file)
+					{
+						$this->template->_tpl_include($file, false);
+					}
 				break;
 
 				case 'INCLUDEPHP':
@@ -220,15 +251,22 @@
 			$template_php .= (!$no_echo) ? (($trim_check_text != '') ? $text_blocks[$i] : '') . ((isset($compile_blocks[$i])) ? $compile_blocks[$i] : '') : (($trim_check_text != '') ? $text_blocks[$i] : '') . ((isset($compile_blocks[$i])) ? $compile_blocks[$i] : '');
 		}
 
+		// Remove unused opening/closing tags
+		$template_php = str_replace(' ?><?php ', ' ', $template_php);
+
+		// Now add a newline after each php closing tag which already has a newline
+		// PHP itself strips a newline if a closing tag is used (this is documented behaviour) and it is mostly not intended by style authors to remove newlines
+		$template_php = preg_replace('#\?\>([\r\n])#', '?>\1\1', $template_php);
+
 		// There will be a number of occasions where we switch into and out of
 		// PHP mode instantaneously. Rather than "burden" the parser with this
 		// we'll strip out such occurences, minimising such switching
 		if ($no_echo)
 		{
-			return "\$$echo_var .= '" . str_replace(' ?><?php ', ' ', $template_php) . "'";
+			return "\$$echo_var .= '" . $template_php . "'";
 		}
 
-		return str_replace(' ?><?php ', ' ', $template_php);
+		return $template_php;
 	}
 
 	/**
@@ -594,6 +632,12 @@
 	*/
 	function compile_tag_include($tag_args)
 	{
+		// Process dynamic includes
+		if ($tag_args[0] == '$')
+		{
+			return "if (isset($tag_args)) { \$this->_tpl_include($tag_args); }";
+		}
+
 		return "\$this->_tpl_include('$tag_args');";
 	}
 
@@ -603,7 +647,7 @@
 	*/
 	function compile_tag_include_php($tag_args)
 	{
-		return "include('" . $tag_args . "');";
+		return "\$this->_php_include('$tag_args');";
 	}
 
 	/**
diff -x .svn -aruN 3.0.5.src/includes/functions_transfer.php 3.0.6.src/includes/functions_transfer.php
--- 3.0.5.src/includes/functions_transfer.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_transfer.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_transfer.php 9433 2009-04-10 10:13:20Z acydburn $
+* @version $Id: functions_transfer.php 9822 2009-07-22 03:02:45Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -316,15 +316,15 @@
 			return 'ERR_CONNECTING_SERVER';
 		}
 
-		// attempt to turn pasv mode on
-		@ftp_pasv($this->connection, true);
-
 		// login to the server
 		if (!@ftp_login($this->connection, $this->username, $this->password))
 		{
 			return 'ERR_UNABLE_TO_LOGIN';
 		}
 
+		// attempt to turn pasv mode on
+		@ftp_pasv($this->connection, true);
+
 		// change to the root directory
 		if (!$this->_chdir($this->root_path))
 		{
@@ -462,6 +462,20 @@
 	{
 		$list = @ftp_nlist($this->connection, $dir);
 
+		// See bug #46295 - Some FTP daemons don't like './'
+		if ($dir === './')
+		{
+			// Let's try some alternatives
+			$list = (empty($list)) ? @ftp_nlist($this->connection, '.') : $list;
+			$list = (empty($list)) ? @ftp_nlist($this->connection, '') : $list;
+		}
+
+		// Return on error
+		if ($list === false)
+		{
+			return false;
+		}
+
 		// Remove path if prepended
 		foreach ($list as $key => $item)
 		{
@@ -469,7 +483,7 @@
 			$item = str_replace('\\', '/', $item);
 			$dir = str_replace('\\', '/', $dir);
 
-			if (strpos($item, $dir) === 0)
+			if (!empty($dir) && strpos($item, $dir) === 0)
 			{
 				$item = substr($item, strlen($dir));
 			}
@@ -723,13 +737,32 @@
 		$list = array();
 		while (!@feof($this->data_connection))
 		{
-			$list[] = preg_replace('#[\r\n]#', '', @fgets($this->data_connection, 512));
+			$filename = preg_replace('#[\r\n]#', '', @fgets($this->data_connection, 512));
+
+			if ($filename !== '')
+			{
+				$list[] = $filename;
+			}
 		}
 		$this->_close_data_connection();
 
 		// Clear buffer
 		$this->_check_command();
 
+		// See bug #46295 - Some FTP daemons don't like './'
+		if ($dir === './' && empty($list))
+		{
+			// Let's try some alternatives
+			$list = $this->_ls('.');
+
+			if (empty($list))
+			{
+				$list = $this->_ls('');
+			}
+
+			return $list;
+		}
+
 		// Remove path if prepended
 		foreach ($list as $key => $item)
 		{
@@ -737,7 +770,7 @@
 			$item = str_replace('\\', '/', $item);
 			$dir = str_replace('\\', '/', $dir);
 
-			if (strpos($item, $dir) === 0)
+			if (!empty($dir) && strpos($item, $dir) === 0)
 			{
 				$item = substr($item, strlen($dir));
 			}
@@ -826,7 +859,7 @@
 			$result = @fgets($this->connection, 512);
 			$response .= $result;
 		}
-		while (substr($response, 3, 1) != ' ');
+		while (substr($result, 3, 1) !== ' ');
 
 		if (!preg_match('#^[123]#', $response))
 		{
diff -x .svn -aruN 3.0.5.src/includes/functions_upload.php 3.0.6.src/includes/functions_upload.php
--- 3.0.5.src/includes/functions_upload.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_upload.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_upload.php 9464 2009-04-17 15:52:40Z acydburn $
+* @version $Id: functions_upload.php 10141 2009-09-13 14:31:32Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -58,7 +58,7 @@
 
 		$this->filename = $upload_ary['tmp_name'];
 		$this->filesize = $upload_ary['size'];
-		$name = trim(htmlspecialchars(basename($upload_ary['name'])));
+		$name = trim(utf8_htmlspecialchars(utf8_basename($upload_ary['name'])));
 		$this->realname = $this->uploadname = (STRIP) ? stripslashes($name) : $name;
 		$this->mimetype = $upload_ary['type'];
 
@@ -290,7 +290,7 @@
 
 		$upload_mode = (@ini_get('open_basedir') || @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on') ? 'move' : 'copy';
 		$upload_mode = ($this->local) ? 'local' : $upload_mode;
-		$this->destination_file = $this->destination_path . '/' . basename($this->realname);
+		$this->destination_file = $this->destination_path . '/' . utf8_basename($this->realname);
 
 		// Check if the file already exist, else there is something wrong...
 		if (file_exists($this->destination_file) && !$overwrite)
@@ -313,12 +313,9 @@
 						if (!@move_uploaded_file($this->filename, $this->destination_file))
 						{
 							$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
-							return false;
 						}
 					}
 
-					@unlink($this->filename);
-
 				break;
 
 				case 'move':
@@ -328,12 +325,9 @@
 						if (!@copy($this->filename, $this->destination_file))
 						{
 							$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
-							return false;
 						}
 					}
 
-					@unlink($this->filename);
-
 				break;
 
 				case 'local':
@@ -341,13 +335,19 @@
 					if (!@copy($this->filename, $this->destination_file))
 					{
 						$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
-						return false;
 					}
-					@unlink($this->filename);
 
 				break;
 			}
 
+			// Remove temporary filename
+			@unlink($this->filename);
+
+			if (sizeof($this->error))
+			{
+				return false;
+			}
+
 			phpbb_chmod($this->destination_file, $chmod);
 		}
 
@@ -417,10 +417,9 @@
 		// Filesize is too big or it's 0 if it was larger than the maxsize in the upload form
 		if ($this->upload->max_filesize && ($this->get('filesize') > $this->upload->max_filesize || $this->filesize == 0))
 		{
-			$size_lang = ($this->upload->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->upload->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES'] );
 			$max_filesize = get_formatted_filesize($this->upload->max_filesize, false);
 
-			$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
+			$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']);
 
 			return false;
 		}
@@ -635,7 +634,7 @@
 
 		if ($filedata === false)
 		{
-			$_FILES[$form_name]['name'] = basename($source_file);
+			$_FILES[$form_name]['name'] = utf8_basename($source_file);
 			$_FILES[$form_name]['size'] = 0;
 			$mimetype = '';
 
@@ -747,7 +746,7 @@
 		$ext = array_pop($url['path']);
 
 		$url['path'] = implode('', $url['path']);
-		$upload_ary['name'] = basename($url['path']) . (($ext) ? '.' . $ext : '');
+		$upload_ary['name'] = utf8_basename($url['path']) . (($ext) ? '.' . $ext : '');
 		$filename = $url['path'];
 		$filesize = 0;
 
@@ -855,10 +854,9 @@
 			break;
 
 			case 2:
-				$size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
 				$max_filesize = get_formatted_filesize($this->max_filesize, false);
 
-				$error = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
+				$error = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']);
 			break;
 
 			case 3:
@@ -891,10 +889,9 @@
 		// Filesize is too big or it's 0 if it was larger than the maxsize in the upload form
 		if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0))
 		{
-			$size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
 			$max_filesize = get_formatted_filesize($this->max_filesize, false);
 
-			$file->error[] = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
+			$file->error[] = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']);
 		}
 
 		// check Filename
diff -x .svn -aruN 3.0.5.src/includes/functions_user.php 3.0.6.src/includes/functions_user.php
--- 3.0.5.src/includes/functions_user.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/functions_user.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: functions_user.php 9409 2009-03-27 16:39:19Z acydburn $
+* @version $Id: functions_user.php 10214 2009-10-05 17:54:55Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -171,7 +171,7 @@
 		'user_password'		=> (isset($user_row['user_password'])) ? $user_row['user_password'] : '',
 		'user_pass_convert'	=> 0,
 		'user_email'		=> strtolower($user_row['user_email']),
-		'user_email_hash'	=> crc32(strtolower($user_row['user_email'])) . strlen($user_row['user_email']),
+		'user_email_hash'	=> phpbb_email_hash($user_row['user_email']),
 		'group_id'			=> $user_row['group_id'],
 		'user_type'			=> $user_row['user_type'],
 	);
@@ -187,7 +187,9 @@
 		'user_ip'			=> '',
 		'user_regdate'		=> time(),
 		'user_passchg'		=> time(),
-		'user_options'		=> 895,
+		'user_options'		=> 230271,
+		// We do not set the new flag here - registration scripts need to specify it
+		'user_new'			=> 0,
 
 		'user_inactive_reason'	=> 0,
 		'user_inactive_time'	=> 0,
@@ -275,8 +277,38 @@
 	// Now make it the users default group...
 	group_set_user_default($user_row['group_id'], array($user_id), false);
 
+	// Add to newly registered users group if user_new is 1
+	if ($config['new_member_post_limit'] && $sql_ary['user_new'])
+	{
+		$sql = 'SELECT group_id
+			FROM ' . GROUPS_TABLE . "
+			WHERE group_name = 'NEWLY_REGISTERED'
+				AND group_type = " . GROUP_SPECIAL;
+		$result = $db->sql_query($sql);
+		$add_group_id = (int) $db->sql_fetchfield('group_id');
+		$db->sql_freeresult($result);
+
+		if ($add_group_id)
+		{
+			// Because these actions only fill the log unneccessarily we skip the add_log() entry with a little hack. :/
+			$GLOBALS['skip_add_log'] = true;
+
+			// Add user to "newly registered users" group and set to default group if admin specified so.
+			if ($config['new_member_group_default'])
+			{
+				group_user_add($add_group_id, $user_id, false, false, true);
+			}
+			else
+			{
+				group_user_add($add_group_id, $user_id);
+			}
+
+			unset($GLOBALS['skip_add_log']);
+		}
+	}
+
 	// set the newest user and adjust the user count if the user is a normal user and no activation mail is sent
-	if ($user_row['user_type'] == USER_NORMAL)
+	if ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_FOUNDER)
 	{
 		set_config('newest_user_id', $user_id, true);
 		set_config('newest_username', $user_row['username'], true);
@@ -421,6 +453,11 @@
 					WHERE topic_last_poster_id = $user_id";
 				$db->sql_query($sql);
 
+				$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
+					SET poster_id = ' . ANONYMOUS . "
+					WHERE poster_id = $user_id";
+				$db->sql_query($sql);
+
 				// Since we change every post by this author, we need to count this amount towards the anonymous user
 
 				// Update the post count for the anonymous user
@@ -501,6 +538,23 @@
 
 	$cache->destroy('sql', MODERATOR_CACHE_TABLE);
 
+	// Delete user log entries about this user
+	$sql = 'DELETE FROM ' . LOG_TABLE . '
+		WHERE reportee_id = ' . $user_id;
+	$db->sql_query($sql);
+
+	// Change user_id to anonymous for this users triggered events
+	$sql = 'UPDATE ' . LOG_TABLE . '
+		SET user_id = ' . ANONYMOUS . '
+		WHERE user_id = ' . $user_id;
+	$db->sql_query($sql);
+
+	// Delete the user_id from the zebra table
+	$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
+		WHERE user_id = ' . $user_id . '
+			OR zebra_id = ' . $user_id;
+	$db->sql_query($sql);
+
 	// Delete the user_id from the banlist
 	$sql = 'DELETE FROM ' . BANLIST_TABLE . '
 		WHERE ban_userid = ' . $user_id;
@@ -904,7 +958,8 @@
 						}
 					}
 				}
-				else
+
+				if (empty($banlist_ary))
 				{
 					trigger_error('NO_IPS_DEFINED');
 				}
@@ -977,7 +1032,17 @@
 		}
 		while ($row = $db->sql_fetchrow($result));
 
-		$banlist_ary = array_unique(array_diff($banlist_ary, $banlist_ary_tmp));
+		$banlist_ary_tmp = array_intersect($banlist_ary, $banlist_ary_tmp);
+
+		if (sizeof($banlist_ary_tmp))
+		{
+			// One or more entities are already banned/excluded, delete the existing bans, so they can be re-inserted with the given new length
+			$sql = 'DELETE FROM ' . BANLIST_TABLE . '
+				WHERE ' . $db->sql_in_set($type, $banlist_ary_tmp) . '
+					AND ban_exclude = ' . (int) $ban_exclude;
+			$db->sql_query($sql);
+		}
+
 		unset($banlist_ary_tmp);
 	}
 	$db->sql_freeresult($result);
@@ -1060,9 +1125,16 @@
 		// Update log
 		$log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_';
 
-		// Add to moderator and admin log
+		// Add to moderator log, admin log and user notes
 		add_log('admin', $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
 		add_log('mod', 0, 0, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
+		if ($mode == 'user')
+		{
+			foreach ($banlist_ary as $user_id)
+			{
+				add_log('user', $user_id, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
+			}
+		}
 
 		$cache->destroy('sql', BANLIST_TABLE);
 
@@ -1101,7 +1173,7 @@
 		switch ($mode)
 		{
 			case 'user':
-				$sql = 'SELECT u.username AS unban_info
+				$sql = 'SELECT u.username AS unban_info, u.user_id
 					FROM ' . USERS_TABLE . ' u, ' . BANLIST_TABLE . ' b
 					WHERE ' . $db->sql_in_set('b.ban_id', $unban_sql) . '
 						AND u.user_id = b.ban_userid';
@@ -1122,9 +1194,14 @@
 		$result = $db->sql_query($sql);
 
 		$l_unban_list = '';
+		$user_ids_ary = array();
 		while ($row = $db->sql_fetchrow($result))
 		{
 			$l_unban_list .= (($l_unban_list != '') ? ', ' : '') . $row['unban_info'];
+			if ($mode == 'user')
+			{
+				$user_ids_ary[] = $row['user_id'];
+			}
 		}
 		$db->sql_freeresult($result);
 
@@ -1132,9 +1209,16 @@
 			WHERE ' . $db->sql_in_set('ban_id', $unban_sql);
 		$db->sql_query($sql);
 
-		// Add to moderator and admin log
+		// Add to moderator log, admin log and user notes
 		add_log('admin', 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
 		add_log('mod', 0, 0, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
+		if ($mode == 'user')
+		{
+			foreach ($user_ids_ary as $user_id)
+			{
+				add_log('user', $user_id, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
+			}
+		}
 	}
 
 	$cache->destroy('sql', BANLIST_TABLE);
@@ -1643,7 +1727,7 @@
 	{
 		$sql = 'SELECT user_email_hash
 			FROM ' . USERS_TABLE . "
-			WHERE user_email_hash = " . (crc32($email) . strlen($email));
+			WHERE user_email_hash = " . $db->sql_escape(phpbb_email_hash($email));
 		$result = $db->sql_query($sql);
 		$row = $db->sql_fetchrow($result);
 		$db->sql_freeresult($result);
@@ -2077,8 +2161,8 @@
 						if (preg_match('#^[^&\'"<>]+\.(?:gif|png|jpe?g)$#i', $sub_file))
 						{
 							$avatar_list[$file][$avatar_row_count][$avatar_col_count] = array(
-								'file'		=> "$file/$sub_file",
-								'filename'	=> $sub_file,
+								'file'		=> rawurlencode($file) . '/' . rawurlencode($sub_file),
+								'filename'	=> rawurlencode($sub_file),
 								'name'		=> ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $sub_file))),
 							);
 							$avatar_col_count++;
@@ -2365,24 +2449,9 @@
 	global $phpbb_root_path, $config, $db, $user, $file_upload;
 
 	$error = array();
-	$attribute_ary = array(
-		'group_colour'			=> 'string',
-		'group_rank'			=> 'int',
-		'group_avatar'			=> 'string',
-		'group_avatar_type'		=> 'int',
-		'group_avatar_width'	=> 'int',
-		'group_avatar_height'	=> 'int',
 
-		'group_receive_pm'		=> 'int',
-		'group_legend'			=> 'int',
-		'group_message_limit'	=> 'int',
-		'group_max_recipients'	=> 'int',
-
-		'group_founder_manage'	=> 'int',
-	);
-
-	// Those are group-only attributes
-	$group_only_ary = array('group_receive_pm', 'group_legend', 'group_message_limit', 'group_max_recipients', 'group_founder_manage');
+	// Attributes which also affect the users table
+	$user_attribute_ary = array('group_colour', 'group_rank', 'group_avatar', 'group_avatar_type', 'group_avatar_width', 'group_avatar_height');
 
 	// Check data. Limit group name length.
 	if (!utf8_strlen($name) || utf8_strlen($name) > 60)
@@ -2420,14 +2489,8 @@
 
 		if (sizeof($group_attributes))
 		{
-			foreach ($attribute_ary as $attribute => $_type)
-			{
-				if (isset($group_attributes[$attribute]))
-				{
-					settype($group_attributes[$attribute], $_type);
-					$sql_ary[$attribute] = $group_attributes[$attribute];
-				}
-			}
+			// Merge them with $sql_ary to properly update the group
+			$sql_ary = array_merge($sql_ary, $group_attributes);
 		}
 
 		// Setting the log message before we set the group id (if group gets added)
@@ -2452,6 +2515,7 @@
 			{
 				remove_default_avatar($group_id, $user_ary);
 			}
+
 			if (isset($sql_ary['group_rank']) && !$sql_ary['group_rank'])
 			{
 				remove_default_rank($group_id, $user_ary);
@@ -2467,6 +2531,32 @@
 				SET group_name = '" . $db->sql_escape($sql_ary['group_name']) . "'
 				WHERE group_id = $group_id";
 			$db->sql_query($sql);
+
+			// One special case is the group skip auth setting. If this was changed we need to purge permissions for this group
+			if (isset($group_attributes['group_skip_auth']))
+			{
+				// Get users within this group...
+				$sql = 'SELECT user_id
+					FROM ' . USER_GROUP_TABLE . '
+					WHERE group_id = ' . $group_id . '
+						AND user_pending = 0';
+				$result = $db->sql_query($sql);
+
+				$user_id_ary = array();
+				while ($row = $db->sql_fetchrow($result))
+				{
+					$user_id_ary[] = $row['user_id'];
+				}
+				$db->sql_freeresult($result);
+
+				if (!empty($user_id_ary))
+				{
+					global $auth;
+
+					// Clear permissions cache of relevant users
+					$auth->acl_clear_prefetch($user_id_ary);
+				}
+			}
 		}
 		else
 		{
@@ -2477,6 +2567,7 @@
 		if (!$group_id)
 		{
 			$group_id = $db->sql_nextid();
+
 			if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == AVATAR_UPLOAD)
 			{
 				group_correct_avatar($group_id, $sql_ary['group_avatar']);
@@ -2487,18 +2578,21 @@
 		$sql_ary = array();
 		if (sizeof($group_attributes))
 		{
-			foreach ($attribute_ary as $attribute => $_type)
+			// Go through the user attributes array, check if a group attribute matches it and then set it. ;)
+			foreach ($user_attribute_ary as $attribute)
 			{
-				if (isset($group_attributes[$attribute]) && !in_array($attribute, $group_only_ary))
+				if (!isset($group_attributes[$attribute]))
 				{
-					// If we are about to set an avatar, we will not overwrite user avatars if no group avatar is set...
-					if (strpos($attribute, 'group_avatar') === 0 && !$group_attributes[$attribute])
-					{
-						continue;
-					}
+					continue;
+				}
 
-					$sql_ary[$attribute] = $group_attributes[$attribute];
+				// If we are about to set an avatar, we will not overwrite user avatars if no group avatar is set...
+				if (strpos($attribute, 'group_avatar') === 0 && !$group_attributes[$attribute])
+				{
+					continue;
 				}
+
+				$sql_ary[$attribute] = $group_attributes[$attribute];
 			}
 		}
 
@@ -2702,7 +2796,7 @@
 
 	if ($default)
 	{
-		group_set_user_default($group_id, $user_id_ary, $group_attributes);
+		group_user_attributes('default', $group_id, $user_id_ary, false, $group_name, $group_attributes);
 	}
 
 	$db->sql_transaction('commit');
@@ -2715,7 +2809,7 @@
 		$group_name = get_group_name($group_id);
 	}
 
-	$log = ($leader) ? 'LOG_MODS_ADDED' : 'LOG_USERS_ADDED';
+	$log = ($leader) ? 'LOG_MODS_ADDED' : (($pending) ? 'LOG_USERS_PENDING' : 'LOG_USERS_ADDED');
 
 	add_log('admin', $log, $group_name, implode(', ', $username_ary));
 
@@ -2738,11 +2832,11 @@
 
 	if ($config['coppa_enable'])
 	{
-		$group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'REGISTERED_COPPA', 'REGISTERED', 'BOTS', 'GUESTS');
+		$group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'NEWLY_REGISTERED', 'REGISTERED_COPPA', 'REGISTERED', 'BOTS', 'GUESTS');
 	}
 	else
 	{
-		$group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'REGISTERED', 'BOTS', 'GUESTS');
+		$group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'NEWLY_REGISTERED', 'REGISTERED', 'BOTS', 'GUESTS');
 	}
 
 	// We need both username and user_id info
@@ -2826,7 +2920,7 @@
 	{
 		if (isset($sql_where_ary[$gid]) && sizeof($sql_where_ary[$gid]))
 		{
-			remove_default_rank($gid, $sql_where_ary[$gid]);
+			remove_default_rank($group_id, $sql_where_ary[$gid]);
 			remove_default_avatar($group_id, $sql_where_ary[$gid]);
 			group_set_user_default($gid, $sql_where_ary[$gid], $default_data_ary);
 		}
@@ -2848,7 +2942,10 @@
 
 	$log = 'LOG_GROUP_REMOVE';
 
-	add_log('admin', $log, $group_name, implode(', ', $username_ary));
+	if ($group_name)
+	{
+		add_log('admin', $log, $group_name, implode(', ', $username_ary));
+	}
 
 	group_update_listings($group_id);
 
@@ -3038,6 +3135,27 @@
 		break;
 
 		case 'default':
+			// We only set default group for approved members of the group
+			$sql = 'SELECT user_id
+				FROM ' . USER_GROUP_TABLE . "
+				WHERE group_id = $group_id
+					AND user_pending = 0
+					AND " . $db->sql_in_set('user_id', $user_id_ary);
+			$result = $db->sql_query($sql);
+
+			$user_id_ary = $username_ary = array();
+			while ($row = $db->sql_fetchrow($result))
+			{
+				$user_id_ary[] = $row['user_id'];
+			}
+			$db->sql_freeresult($result);
+
+			$result = user_get_id_name($user_id_ary, $username_ary);
+			if (!sizeof($user_id_ary) || $result !== false)
+			{
+				return 'NO_USERS';
+			}
+
 			$sql = 'SELECT user_id, group_id FROM ' . USERS_TABLE . '
 				WHERE ' . $db->sql_in_set('user_id', $user_id_ary, false, true);
 			$result = $db->sql_query($sql);
@@ -3126,7 +3244,7 @@
 */
 function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false)
 {
-	global $db;
+	global $cache, $db;
 
 	if (empty($user_id_ary))
 	{
@@ -3226,6 +3344,9 @@
 	{
 		group_update_listings($group_id);
 	}
+
+	// Because some tables/caches use usercolour-specific data we need to purge this here.
+	$cache->destroy('sql', MODERATOR_CACHE_TABLE);
 }
 
 /**
@@ -3242,7 +3363,7 @@
 	$row = $db->sql_fetchrow($result);
 	$db->sql_freeresult($result);
 
-	if (!$row)
+	if (!$row || ($row['group_type'] == GROUP_SPECIAL && empty($user->lang)))
 	{
 		return '';
 	}
@@ -3385,4 +3506,77 @@
 	}
 }
 
+
+
+/**
+* Funtion to make a user leave the NEWLY_REGISTERED system group.
+* @access public
+* @param $user_id The id of the user to remove from the group
+*/
+function remove_newly_registered($user_id, $user_data = false)
+{
+	global $db;
+
+	if ($user_data === false)
+	{
+		$sql = 'SELECT *
+			FROM ' . USERS_TABLE . '
+			WHERE user_id = ' . $user_id;
+		$result = $db->sql_query($sql);
+		$user_row = $db->sql_fetchrow($result);
+		$db->sql_freeresult($result);
+
+		if (!$user_row)
+		{
+			return false;
+		}
+		else
+		{
+			$user_data  = $user_row;
+		}
+	}
+
+	if (empty($user_data['user_new']))
+	{
+		return false;
+	}
+
+	$sql = 'SELECT group_id
+		FROM ' . GROUPS_TABLE . "
+		WHERE group_name = 'NEWLY_REGISTERED'
+			AND group_type = " . GROUP_SPECIAL;
+	$result = $db->sql_query($sql);
+	$group_id = (int) $db->sql_fetchfield('group_id');
+	$db->sql_freeresult($result);
+
+	if (!$group_id)
+	{
+		return false;
+	}
+
+	// We need to call group_user_del here, because this function makes sure everything is correctly changed.
+	// A downside for a call within the session handler is that the language is not set up yet - so no log entry
+	group_user_del($group_id, $user_id);
+
+	// Set user_new to 0 to let this not be triggered again
+	$sql = 'UPDATE ' . USERS_TABLE . '
+		SET user_new = 0
+		WHERE user_id = ' . $user_id;
+	$db->sql_query($sql);
+
+	// The new users group was the users default group?
+	if ($user_data['group_id'] == $group_id)
+	{
+		// Which group is now the users default one?
+		$sql = 'SELECT group_id
+			FROM ' . USERS_TABLE . '
+			WHERE user_id = ' . $user_id;
+		$result = $db->sql_query($sql);
+		$user_data['group_id'] = $db->sql_fetchfield('group_id');
+		$db->sql_freeresult($result);
+	}
+
+	return $user_data['group_id'];
+}
+
 ?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/mcp/info/mcp_pm_reports.php 3.0.6.src/includes/mcp/info/mcp_pm_reports.php
--- 3.0.5.src/includes/mcp/info/mcp_pm_reports.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/mcp/info/mcp_pm_reports.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,39 @@
+<?php
+/**
+*
+* @package mcp
+* @version $Id: mcp_pm_reports.php 9816 2009-07-21 21:21:11Z bantu $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class mcp_pm_reports_info
+{
+	function module()
+	{
+		return array(
+			'filename'	=> 'mcp_pm_reports',
+			'title'		=> 'MCP_PM_REPORTS',
+			'version'	=> '1.0.0',
+			'modes'		=> array(
+				'pm_reports'			=> array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
+				'pm_reports_closed'	=> array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
+				'pm_report_details'	=> array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
+			),
+		);
+	}
+
+	function install()
+	{
+	}
+
+	function uninstall()
+	{
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/mcp/mcp_forum.php 3.0.6.src/includes/mcp/mcp_forum.php
--- 3.0.5.src/includes/mcp/mcp_forum.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/mcp/mcp_forum.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package mcp
-* @version $Id: mcp_forum.php 9003 2008-10-11 18:23:12Z toonarmy $
+* @version $Id: mcp_forum.php 10201 2009-10-03 11:35:39Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
diff -x .svn -aruN 3.0.5.src/includes/mcp/mcp_front.php 3.0.6.src/includes/mcp/mcp_front.php
--- 3.0.5.src/includes/mcp/mcp_front.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/mcp/mcp_front.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package mcp
-* @version $Id: mcp_front.php 9029 2008-10-18 18:44:41Z toonarmy $
+* @version $Id: mcp_front.php 10139 2009-09-12 13:17:58Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -34,7 +34,7 @@
 		$forum_id = request_var('f', 0);
 
 		$template->assign_var('S_SHOW_UNAPPROVED', (!empty($forum_list)) ? true : false);
-		
+
 		if (!empty($forum_list))
 		{
 			$sql = 'SELECT COUNT(post_id) AS total
@@ -119,7 +119,12 @@
 				$db->sql_freeresult($result);
 			}
 
+			$s_hidden_fields = build_hidden_fields(array(
+				'redirect'		=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main' . (($forum_id) ? '&amp;f=' . $forum_id : ''))
+			));
+
 			$template->assign_vars(array(
+				'S_HIDDEN_FIELDS'		=> $s_hidden_fields,
 				'S_MCP_QUEUE_ACTION'	=> append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"),
 			));
 
@@ -152,6 +157,7 @@
 			$sql = 'SELECT COUNT(r.report_id) AS total
 				FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p
 				WHERE r.post_id = p.post_id
+					AND r.pm_id = 0
 					AND r.report_closed = 0
 					AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')';
 			$result = $db->sql_query($sql);
@@ -181,6 +187,7 @@
 					),
 
 					'WHERE'		=> 'r.post_id = p.post_id
+						AND r.pm_id = 0
 						AND r.report_closed = 0
 						AND r.reason_id = rr.reason_id
 						AND p.topic_id = t.topic_id
@@ -243,6 +250,96 @@
 		}
 	}
 
+	// Latest 5 reported PMs
+	if ($module->loaded('pm_reports') && $auth->acl_getf_global('m_report'))
+	{
+		$template->assign_var('S_SHOW_PM_REPORTS', true);
+		$user->add_lang(array('ucp'));
+
+		$sql = 'SELECT COUNT(r.report_id) AS total
+			FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . ' p
+			WHERE r.post_id = 0
+				AND r.pm_id = p.msg_id
+				AND r.report_closed = 0';
+		$result = $db->sql_query($sql);
+		$total = (int) $db->sql_fetchfield('total');
+		$db->sql_freeresult($result);
+
+		if ($total)
+		{
+			include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
+
+			$sql = $db->sql_build_query('SELECT', array(
+				'SELECT'	=> 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id',
+
+				'FROM'		=> array(
+					REPORTS_TABLE			=> 'r',
+					REPORTS_REASONS_TABLE	=> 'rr',
+					USERS_TABLE				=> array('u', 'u2'),
+					PRIVMSGS_TABLE				=> 'p'
+				),
+
+				'WHERE'		=> 'r.pm_id = p.msg_id
+					AND r.post_id = 0
+					AND r.report_closed = 0
+					AND r.reason_id = rr.reason_id
+					AND r.user_id = u.user_id
+					AND p.author_id = u2.user_id',
+
+				'ORDER_BY'	=> 'p.message_time DESC'
+			));
+			$result = $db->sql_query_limit($sql, 5);
+
+			$pm_by_id = $pm_list = array();
+			while ($row = $db->sql_fetchrow($result))
+			{
+				$pm_by_id[(int) $row['msg_id']] = $row;
+				$pm_list[] = (int) $row['msg_id'];
+			}
+
+			$address_list = get_recipient_strings($pm_by_id);
+
+			foreach ($pm_list as $message_id)
+			{
+				$row = $pm_by_id[$message_id];
+
+				$template->assign_block_vars('pm_report', array(
+					'U_PM_DETAILS'	=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'r=' . $row['report_id'] . "&amp;i=pm_reports&amp;mode=pm_report_details"),
+
+					'REPORTER_FULL'		=> get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
+					'REPORTER'			=> get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
+					'REPORTER_COLOUR'	=> get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
+					'U_REPORTER'		=> get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
+
+					'PM_AUTHOR_FULL'		=> get_username_string('full', $row['author_id'], $row['author_name'], $row['author_colour']),
+					'PM_AUTHOR'			=> get_username_string('username', $row['author_id'], $row['author_name'], $row['author_colour']),
+					'PM_AUTHOR_COLOUR'		=> get_username_string('colour', $row['author_id'], $row['author_name'], $row['author_colour']),
+					'U_PM_AUTHOR'			=> get_username_string('profile', $row['author_id'], $row['author_name'], $row['author_colour']),
+
+					'PM_SUBJECT'		=> $row['message_subject'],
+					'REPORT_TIME'		=> $user->format_date($row['report_time']),
+					'PM_TIME'			=> $user->format_date($row['message_time']),
+					'RECIPIENTS'		=> implode(', ', $address_list[$row['msg_id']]),
+				));
+			}
+		}
+
+		if ($total == 0)
+		{
+			$template->assign_vars(array(
+				'L_PM_REPORTS_TOTAL'	=>	$user->lang['PM_REPORTS_ZERO_TOTAL'],
+				'S_HAS_PM_REPORTS'		=>	false)
+			);
+		}
+		else
+		{
+			$template->assign_vars(array(
+				'L_PM_REPORTS_TOTAL'	=> ($total == 1) ? $user->lang['PM_REPORT_TOTAL'] : sprintf($user->lang['PM_REPORTS_TOTAL'], $total),
+				'S_HAS_PM_REPORTS'		=> true)
+			);
+		}
+	}
+
 	// Latest 5 logs
 	if ($module->loaded('logs'))
 	{
diff -x .svn -aruN 3.0.5.src/includes/mcp/mcp_logs.php 3.0.6.src/includes/mcp/mcp_logs.php
--- 3.0.5.src/includes/mcp/mcp_logs.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/mcp/mcp_logs.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package mcp
-* @version $Id: mcp_logs.php 9029 2008-10-18 18:44:41Z toonarmy $
+* @version $Id: mcp_logs.php 10109 2009-09-05 12:06:12Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -164,15 +164,18 @@
 		$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
 		$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
 
+		$keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+		$keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
+
 		// Grab log data
 		$log_data = array();
 		$log_count = 0;
-		view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort);
+		view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort, $keywords);
 
 		$template->assign_vars(array(
 			'PAGE_NUMBER'		=> on_page($log_count, $config['topics_per_page'], $start),
 			'TOTAL'				=> ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count),
-			'PAGINATION'		=> generate_pagination($this->u_action . "&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start),
+			'PAGINATION'		=> generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true),
 
 			'L_TITLE'			=> $user->lang['MCP_LOGS'],
 
@@ -182,13 +185,14 @@
 			'S_SELECT_SORT_KEY'		=> $s_sort_key,
 			'S_SELECT_SORT_DAYS'	=> $s_limit_days,
 			'S_LOGS'				=> ($log_count > 0),
+			'S_KEYWORDS'			=> $keywords,
 			)
 		);
 
 		foreach ($log_data as $row)
 		{
 			$data = array();
-				
+
 			$checks = array('viewtopic', 'viewforum');
 			foreach ($checks as $check)
 			{
diff -x .svn -aruN 3.0.5.src/includes/mcp/mcp_main.php 3.0.6.src/includes/mcp/mcp_main.php
--- 3.0.5.src/includes/mcp/mcp_main.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/mcp/mcp_main.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package mcp
-* @version $Id: mcp_main.php 9491 2009-04-28 09:35:36Z acydburn $
+* @version $Id: mcp_main.php 10196 2009-09-29 14:51:58Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -813,7 +813,14 @@
 
 		foreach ($data as $topic_id => $row)
 		{
-			add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_' . ($row['topic_moved_id'] ? 'SHADOW_' : '') . 'TOPIC', $row['topic_title']);
+			if ($row['topic_moved_id'])
+			{
+				add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_SHADOW_TOPIC', $row['topic_title']);
+			}
+			else
+			{
+				add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']);
+			}
 		}
 
 		$return = delete_topics('topic_id', $topic_ids);
@@ -897,7 +904,8 @@
 
 		foreach ($post_data as $id => $row)
 		{
-			add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject']);
+			$post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username'];
+			add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username);
 		}
 
 		// Now delete the posts, topics and forums are automatically resync'ed
@@ -1064,7 +1072,9 @@
 				'topic_bumper'				=> (int) $topic_row['topic_bumper'],
 				'poll_title'				=> (string) $topic_row['poll_title'],
 				'poll_start'				=> (int) $topic_row['poll_start'],
-				'poll_length'				=> (int) $topic_row['poll_length']
+				'poll_length'				=> (int) $topic_row['poll_length'],
+				'poll_max_options'			=> (int) $topic_row['poll_max_options'],
+				'poll_vote_change'			=> (int) $topic_row['poll_vote_change'],
 			);
 
 			$db->sql_query('INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
@@ -1166,8 +1176,8 @@
 							'in_message'		=> 0,
 							'is_orphan'			=> (int) $attach_row['is_orphan'],
 							'poster_id'			=> (int) $attach_row['poster_id'],
-							'physical_filename'	=> (string) basename($attach_row['physical_filename']),
-							'real_filename'		=> (string) basename($attach_row['real_filename']),
+							'physical_filename'	=> (string) utf8_basename($attach_row['physical_filename']),
+							'real_filename'		=> (string) utf8_basename($attach_row['real_filename']),
 							'download_count'	=> (int) $attach_row['download_count'],
 							'attach_comment'	=> (string) $attach_row['attach_comment'],
 							'extension'			=> (string) $attach_row['extension'],
diff -x .svn -aruN 3.0.5.src/includes/mcp/mcp_notes.php 3.0.6.src/includes/mcp/mcp_notes.php
--- 3.0.5.src/includes/mcp/mcp_notes.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/mcp/mcp_notes.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package mcp
-* @version $Id: mcp_notes.php 9343 2009-02-27 10:54:57Z toonarmy $
+* @version $Id: mcp_notes.php 10042 2009-08-22 02:56:05Z terrafrost $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -193,9 +193,12 @@
 		$sql_where = ($st) ? (time() - ($st * 86400)) : 0;
 		$sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');
 
+		$keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+		$keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
+
 		$log_data = array();
 		$log_count = 0;
-		view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
+		view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort, $keywords);
 
 		if ($log_count)
 		{
@@ -219,11 +222,12 @@
 			'S_SELECT_SORT_DIR'		=> $s_sort_dir,
 			'S_SELECT_SORT_KEY'		=> $s_sort_key,
 			'S_SELECT_SORT_DAYS'	=> $s_limit_days,
+			'S_KEYWORDS'			=> $keywords,
 
 			'L_TITLE'			=> $user->lang['MCP_NOTES_USER'],
 
 			'PAGE_NUMBER'		=> on_page($log_count, $config['posts_per_page'], $start),
-			'PAGINATION'		=> generate_pagination($this->u_action . "&amp;st=$st&amp;sk=$sk&amp;sd=$sd", $log_count, $config['posts_per_page'], $start),
+			'PAGINATION'	=> generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true),
 			'TOTAL_REPORTS'		=> ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count),
 
 			'RANK_TITLE'		=> $rank_title,
diff -x .svn -aruN 3.0.5.src/includes/mcp/mcp_pm_reports.php 3.0.6.src/includes/mcp/mcp_pm_reports.php
--- 3.0.5.src/includes/mcp/mcp_pm_reports.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/mcp/mcp_pm_reports.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,323 @@
+<?php
+/**
+*
+* @package mcp
+* @version $Id: mcp_pm_reports.php 9830 2009-07-22 13:33:54Z naderman $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+/**
+* mcp_reports
+* Handling the reports queue
+* @package mcp
+*/
+class mcp_pm_reports
+{
+	var $p_master;
+	var $u_action;
+
+	function mcp_pm_reports(&$p_master)
+	{
+		$this->p_master = &$p_master;
+	}
+
+	function main($id, $mode)
+	{
+		global $auth, $db, $user, $template, $cache;
+		global $config, $phpbb_root_path, $phpEx, $action;
+
+		include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+		include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
+
+		$start = request_var('start', 0);
+
+		$this->page_title = 'MCP_PM_REPORTS';
+
+		switch ($action)
+		{
+			case 'close':
+			case 'delete':
+				include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+
+				$report_id_list = request_var('report_id_list', array(0));
+
+				if (!sizeof($report_id_list))
+				{
+					trigger_error('NO_REPORT_SELECTED');
+				}
+
+				if (!function_exists('close_report'))
+				{
+					include($phpbb_root_path . 'includes/mcp/mcp_reports.' . $phpEx);
+				}
+
+				close_report($report_id_list, $mode, $action, true);
+
+			break;
+		}
+
+		switch ($mode)
+		{
+			case 'pm_report_details':
+
+				$user->add_lang(array('posting', 'viewforum', 'viewtopic', 'ucp'));
+
+				$report_id = request_var('r', 0);
+
+				$sql = 'SELECT r.pm_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour
+					FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u
+					WHERE r.report_id = ' . $report_id . '
+						AND rr.reason_id = r.reason_id
+						AND r.user_id = u.user_id
+						AND r.post_id = 0
+					ORDER BY report_closed ASC';
+				$result = $db->sql_query_limit($sql, 1);
+				$report = $db->sql_fetchrow($result);
+				$db->sql_freeresult($result);
+
+				if (!$report_id || !$report)
+				{
+					trigger_error('NO_REPORT');
+				}
+
+				$pm_id = $report['pm_id'];
+				$report_id = $report['report_id'];
+
+				$pm_info = get_pm_data(array($pm_id));
+
+				if (!sizeof($pm_info))
+				{
+					trigger_error('NO_REPORT_SELECTED');
+				}
+
+				$pm_info = $pm_info[$pm_id];
+
+				write_pm_addresses(array('to' => $pm_info['to_address'], 'bcc' => $pm_info['bcc_address']), (int) $pm_info['author_id']);
+
+				$reason = array('title' => $report['reason_title'], 'description' => $report['reason_description']);
+				if (isset($user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])]))
+				{
+					$reason['description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])];
+					$reason['title'] = $user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])];
+				}
+
+				// Process message, leave it uncensored
+				$message = $pm_info['message_text'];
+
+				if ($pm_info['bbcode_bitfield'])
+				{
+					include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+					$bbcode = new bbcode($pm_info['bbcode_bitfield']);
+					$bbcode->bbcode_second_pass($message, $pm_info['bbcode_uid'], $pm_info['bbcode_bitfield']);
+				}
+
+				$message = bbcode_nl2br($message);
+				$message = smiley_text($message);
+
+				if ($pm_info['message_attachment'] && $auth->acl_get('u_pm_download'))
+				{
+					$sql = 'SELECT *
+						FROM ' . ATTACHMENTS_TABLE . '
+						WHERE post_msg_id = ' . $pm_id . '
+							AND in_message = 1
+						ORDER BY filetime DESC';
+					$result = $db->sql_query($sql);
+
+					while ($row = $db->sql_fetchrow($result))
+					{
+						$attachments[] = $row;
+					}
+					$db->sql_freeresult($result);
+
+					if (sizeof($attachments))
+					{
+						$update_count = array();
+						parse_attachments(0, $message, $attachments, $update_count);
+					}
+
+					// Display not already displayed Attachments for this post, we already parsed them. ;)
+					if (!empty($attachments))
+					{
+						$template->assign_var('S_HAS_ATTACHMENTS', true);
+
+						foreach ($attachments as $attachment)
+						{
+							$template->assign_block_vars('attachment', array(
+								'DISPLAY_ATTACHMENT'	=> $attachment)
+							);
+						}
+					}
+				}
+
+				$template->assign_vars(array(
+					'S_MCP_REPORT'			=> true,
+					'S_PM'					=> true,
+					'S_CLOSE_ACTION'		=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&amp;mode=pm_report_details&amp;r=' . $report_id),
+					'S_CAN_VIEWIP'			=> $auth->acl_getf_global('m_info'),
+					'S_POST_REPORTED'		=> $pm_info['message_reported'],
+					'S_USER_NOTES'			=> true,
+
+					'U_MCP_REPORT'				=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&amp;mode=pm_report_details&amp;r=' . $report_id),
+					'U_MCP_REPORTER_NOTES'		=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $report['user_id']),
+					'U_MCP_USER_NOTES'			=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $pm_info['author_id']),
+					'U_MCP_WARN_REPORTER'		=> ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '',
+					'U_MCP_WARN_USER'			=> ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $pm_info['author_id']) : '',
+					
+					'EDIT_IMG'				=> $user->img('icon_post_edit', $user->lang['EDIT_POST']),
+					'MINI_POST_IMG'			=> $user->img('icon_post_target', 'POST'),
+
+					'RETURN_REPORTS'			=> sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports' . (($pm_info['message_reported']) ? '&amp;mode=pm_reports' : '&amp;mode=pm_reports_closed') . '&amp;start=' . $start) . '">', '</a>'),
+					'REPORTED_IMG'				=> $user->img('icon_topic_reported', $user->lang['POST_REPORTED']),
+					'REPORT_DATE'				=> $user->format_date($report['report_time']),
+					'REPORT_ID'					=> $report_id,
+					'REPORT_REASON_TITLE'		=> $reason['title'],
+					'REPORT_REASON_DESCRIPTION'	=> $reason['description'],
+					'REPORT_TEXT'				=> $report['report_text'],
+
+					'POST_AUTHOR_FULL'		=> get_username_string('full', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']),
+					'POST_AUTHOR_COLOUR'	=> get_username_string('colour', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']),
+					'POST_AUTHOR'			=> get_username_string('username', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']),
+					'U_POST_AUTHOR'			=> get_username_string('profile', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']),
+
+					'REPORTER_FULL'				=> get_username_string('full', $report['user_id'], $report['username'], $report['user_colour']),
+					'REPORTER_COLOUR'			=> get_username_string('colour', $report['user_id'], $report['username'], $report['user_colour']),
+					'REPORTER_NAME'				=> get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']),
+					'U_VIEW_REPORTER_PROFILE'	=> get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']),
+
+					'POST_PREVIEW'			=> $message,
+					'POST_SUBJECT'			=> ($pm_info['message_subject']) ? $pm_info['message_subject'] : $user->lang['NO_SUBJECT'],
+					'POST_DATE'				=> $user->format_date($pm_info['message_time']),
+					'POST_IP'				=> $pm_info['author_ip'],
+					'POST_IPADDR'			=> ($auth->acl_getf_global('m_info') && request_var('lookup', '')) ? @gethostbyaddr($pm_info['author_ip']) : '',
+					'POST_ID'				=> $pm_info['msg_id'],
+
+					'U_LOOKUP_IP'			=> ($auth->acl_getf_global('m_info')) ? $this->u_action . '&amp;r=' . $report_id . '&amp;pm=' . $pm_id . '&amp;lookup=' . $pm_info['author_ip'] . '#ip' : '',
+				));
+
+				$this->tpl_name = 'mcp_post';
+
+			break;
+
+			case 'pm_reports':
+			case 'pm_reports_closed':
+				$user->add_lang(array('ucp'));
+
+				$sort_days = $total = 0;
+				$sort_key = $sort_dir = '';
+				$sort_by_sql = $sort_order_sql = array();
+				mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total);
+
+				$limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : '';
+
+				if ($mode == 'pm_reports')
+				{
+					$report_state = 'p.message_reported = 1 AND r.report_closed = 0';
+				}
+				else
+				{
+					$report_state = 'r.report_closed = 1';
+				}
+
+				$sql = 'SELECT r.report_id
+					FROM ' . PRIVMSGS_TABLE . ' p, ' . REPORTS_TABLE . ' r ' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . (($sort_order_sql[0] == 'r') ? ', ' . USERS_TABLE . ' ru' : '') . "
+					WHERE $report_state
+						AND r.pm_id = p.msg_id
+						" . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.author_id' : '') . '
+						' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = r.user_id' : '') . "
+						AND r.post_id = 0
+						$limit_time_sql
+					ORDER BY $sort_order_sql";
+				$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
+
+				$i = 0;
+				$report_ids = array();
+				while ($row = $db->sql_fetchrow($result))
+				{
+					$report_ids[] = $row['report_id'];
+					$row_num[$row['report_id']] = $i++;
+				}
+				$db->sql_freeresult($result);
+
+				if (sizeof($report_ids))
+				{
+					$sql = 'SELECT p.*, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id
+						FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru
+						WHERE ' . $db->sql_in_set('r.report_id', $report_ids) . "
+							AND r.pm_id = p.msg_id
+							AND p.author_id = u.user_id
+							AND ru.user_id = r.user_id
+						ORDER BY $sort_order_sql";
+					$result = $db->sql_query($sql);
+
+					$pm_list = $pm_by_id = array();
+					while ($row = $db->sql_fetchrow($result))
+					{
+						$pm_by_id[(int) $row['msg_id']] = $row;
+						$pm_list[] = (int) $row['msg_id'];
+					}
+					$db->sql_freeresult($result);
+
+					if (sizeof($pm_list))
+					{
+						$address_list = get_recipient_strings($pm_by_id);
+
+						foreach ($pm_list as $message_id)
+						{
+							$row = $pm_by_id[$message_id];
+							$template->assign_block_vars('postrow', array(
+								'U_VIEW_DETAILS'			=> append_sid("{$phpbb_root_path}mcp.$phpEx", "i=pm_reports&amp;mode=pm_report_details&amp;r={$row['report_id']}"),
+
+								'PM_AUTHOR_FULL'		=> get_username_string('full', $row['author_id'], $row['username'], $row['user_colour']),
+								'PM_AUTHOR_COLOUR'		=> get_username_string('colour', $row['author_id'], $row['username'], $row['user_colour']),
+								'PM_AUTHOR'				=> get_username_string('username', $row['author_id'], $row['username'], $row['user_colour']),
+								'U_PM_AUTHOR'			=> get_username_string('profile', $row['author_id'], $row['username'], $row['user_colour']),
+
+								'REPORTER_FULL'			=> get_username_string('full', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
+								'REPORTER_COLOUR'		=> get_username_string('colour', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
+								'REPORTER'				=> get_username_string('username', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
+								'U_REPORTER'			=> get_username_string('profile', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
+
+								'PM_SUBJECT'			=> ($row['message_subject']) ? $row['message_subject'] : $user->lang['NO_SUBJECT'],
+								'PM_TIME'				=> $user->format_date($row['message_time']),
+								'REPORT_ID'				=> $row['report_id'],
+								'REPORT_TIME'			=> $user->format_date($row['report_time']),
+
+								'RECIPIENTS'			=> implode(', ', $address_list[$row['msg_id']]),
+							));
+						}
+					}
+				}
+
+				// Now display the page
+				$template->assign_vars(array(
+					'L_EXPLAIN'				=> ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_PM_REPORTS_CLOSED_EXPLAIN'],
+					'L_TITLE'				=> ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN'] : $user->lang['MCP_PM_REPORTS_CLOSED'],
+					
+					'S_PM'					=> true,
+					'S_MCP_ACTION'			=> $this->u_action,
+					'S_CLOSED'				=> ($mode == 'pm_reports_closed') ? true : false,
+
+					'PAGINATION'			=> generate_pagination($this->u_action . "&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start),
+					'PAGE_NUMBER'			=> on_page($total, $config['topics_per_page'], $start),
+					'TOTAL'					=> $total,
+					'TOTAL_REPORTS'			=> ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),					
+					)
+				);
+
+				$this->tpl_name = 'mcp_reports';
+			break;
+		}
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/mcp/mcp_queue.php 3.0.6.src/includes/mcp/mcp_queue.php
--- 3.0.5.src/includes/mcp/mcp_queue.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/mcp/mcp_queue.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package mcp
-* @version $Id: mcp_queue.php 9482 2009-04-24 17:27:10Z terrafrost $
+* @version $Id: mcp_queue.php 10252 2009-11-03 14:51:07Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -105,6 +105,7 @@
 				{
 					$template->assign_vars(array(
 						'S_TOPIC_REVIEW'	=> true,
+						'S_BBCODE_ALLOWED'	=> $post_info['enable_bbcode'],
 						'TOPIC_TITLE'		=> $post_info['topic_title'])
 					);
 				}
@@ -491,11 +492,9 @@
 		// If Post -> total_posts = total_posts+1, forum_posts = forum_posts+1, topic_replies = topic_replies+1
 
 		$total_topics = $total_posts = 0;
-		$forum_topics_posts = $topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = $forum_id_list = $approve_log = array();
+		$topic_approve_sql = $post_approve_sql = $topic_id_list = $forum_id_list = $approve_log = array();
 		$user_posts_sql = $post_approved_list = array();
 
-		$update_forum_information = false;
-
 		foreach ($post_info as $post_id => $post_data)
 		{
 			if ($post_data['post_approved'])
@@ -523,16 +522,7 @@
 			{
 				if ($post_data['forum_id'])
 				{
-					if (!isset($forum_topics_posts[$post_data['forum_id']]))
-					{
-						$forum_topics_posts[$post_data['forum_id']] = array(
-							'forum_posts'	=> 0,
-							'forum_topics'	=> 0
-						);
-					}
-
 					$total_topics++;
-					$forum_topics_posts[$post_data['forum_id']]['forum_topics']++;
 				}
 				$topic_approve_sql[] = $post_data['topic_id'];
 
@@ -553,45 +543,21 @@
 				);
 			}
 
-			if ($post_data['topic_replies_real'] > 0)
-			{
-				if (!isset($topic_replies_sql[$post_data['topic_id']]))
-				{
-					$topic_replies_sql[$post_data['topic_id']] = 0;
-				}
-				$topic_replies_sql[$post_data['topic_id']]++;
-			}
-
 			if ($post_data['forum_id'])
 			{
-				if (!isset($forum_topics_posts[$post_data['forum_id']]))
-				{
-					$forum_topics_posts[$post_data['forum_id']] = array(
-						'forum_posts'	=> 0,
-						'forum_topics'	=> 0
-					);
-				}
-
 				$total_posts++;
-				$forum_topics_posts[$post_data['forum_id']]['forum_posts']++;
 
 				// Increment by topic_replies if we approve a topic...
 				// This works because we do not adjust the topic_replies when re-approving a topic after an edit.
 				if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_replies'])
 				{
 					$total_posts += $post_data['topic_replies'];
-					$forum_topics_posts[$post_data['forum_id']]['forum_posts'] += $post_data['topic_replies'];
 				}
 			}
 
 			$post_approve_sql[] = $post_id;
-
-			// If the post is newer than the last post information stored we need to update the forum information
-			if ($post_data['post_time'] >= $post_data['forum_last_post_time'])
-			{
-				$update_forum_information = true;
-			}
 		}
+
 		$post_id_list = array_values(array_diff($post_id_list, $post_approved_list));
 		for ($i = 0, $size = sizeof($post_approved_list); $i < $size; $i++)
 		{
@@ -614,37 +580,13 @@
 			$db->sql_query($sql);
 		}
 
+		unset($topic_approve_sql, $post_approve_sql);
+
 		foreach ($approve_log as $log_data)
 		{
 			add_log('mod', $log_data['forum_id'], $log_data['topic_id'], ($log_data['type'] == 'topic') ? 'LOG_TOPIC_APPROVED' : 'LOG_POST_APPROVED', $log_data['post_subject']);
 		}
 
-		if (sizeof($topic_replies_sql))
-		{
-			foreach ($topic_replies_sql as $topic_id => $num_replies)
-			{
-				$sql = 'UPDATE ' . TOPICS_TABLE . "
-					SET topic_replies = topic_replies + $num_replies
-					WHERE topic_id = $topic_id";
-				$db->sql_query($sql);
-			}
-		}
-
-		if (sizeof($forum_topics_posts))
-		{
-			foreach ($forum_topics_posts as $forum_id => $row)
-			{
-				$sql = 'UPDATE ' . FORUMS_TABLE . '
-					SET ';
-				$sql .= ($row['forum_topics']) ? "forum_topics = forum_topics + {$row['forum_topics']}" : '';
-				$sql .= ($row['forum_topics'] && $row['forum_posts']) ? ', ' : '';
-				$sql .= ($row['forum_posts']) ? "forum_posts = forum_posts + {$row['forum_posts']}" : '';
-				$sql .= " WHERE forum_id = $forum_id";
-
-				$db->sql_query($sql);
-			}
-		}
-
 		if (sizeof($user_posts_sql))
 		{
 			// Try to minimize the query count by merging users with the same post count additions
@@ -673,14 +615,9 @@
 		{
 			set_config_count('num_posts', $total_posts, true);
 		}
-		unset($topic_approve_sql, $topic_replies_sql, $post_approve_sql);
-
-		update_post_information('topic', array_keys($topic_id_list));
 
-		if ($update_forum_information)
-		{
-			update_post_information('forum', array_keys($forum_id_list));
-		}
+		sync('topic', 'topic_id', array_keys($topic_id_list), true);
+		sync('forum', 'forum_id', array_keys($forum_id_list), true, true);
 		unset($topic_id_list, $forum_id_list);
 
 		$messenger = new messenger();
@@ -859,89 +796,63 @@
 
 	if (confirm_box(true))
 	{
+		$disapprove_log = $disapprove_log_topics = $disapprove_log_posts = array();
+		$topic_replies_real = $post_disapprove_list = array();
 
-		// If Topic -> forum_topics_real -= 1
-		// If Post -> topic_replies_real -= 1
-
-		$num_disapproved = 0;
-		$forum_topics_real = $topic_id_list = $forum_id_list = $topic_replies_real_sql = $post_disapprove_sql = $disapprove_log = array();
-
+		// Build a list of posts to be unapproved and get the related topics real replies count
 		foreach ($post_info as $post_id => $post_data)
 		{
-			$topic_id_list[$post_data['topic_id']] = 1;
-
-			if ($post_data['forum_id'])
+			$post_disapprove_list[$post_id] = $post_data['topic_id'];
+			if (!isset($topic_replies_real[$post_data['topic_id']]))
 			{
-				$forum_id_list[$post_data['forum_id']] = 1;
+				$topic_replies_real[$post_data['topic_id']] = $post_data['topic_replies_real'];
 			}
+		}
 
-			// Topic or Post. ;)
-			/**
-			* @todo this probably is a different method than the one used by delete_posts, does this cause counter inconsistency?
-			*/
-			if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_last_post_id'] == $post_id)
+		// Now we build the log array
+		foreach ($post_disapprove_list as $post_id => $topic_id)
+		{
+			// If the count of disapproved posts for the topic is greater
+			// than topic's real replies count, the whole topic is disapproved/deleted
+			if (sizeof(array_keys($post_disapprove_list, $topic_id)) > $topic_replies_real[$topic_id])
 			{
-				if ($post_data['forum_id'])
+				// Don't write the log more than once for every topic
+				if (!isset($disapprove_log_topics[$topic_id]))
 				{
-					if (!isset($forum_topics_real[$post_data['forum_id']]))
-					{
-						$forum_topics_real[$post_data['forum_id']] = 0;
-					}
-					$forum_topics_real[$post_data['forum_id']]++;
-					$num_disapproved++;
+					// Build disapproved topics log
+					$disapprove_log_topics[$topic_id] = array(
+						'type'			=> 'topic',
+						'post_subject'	=> $post_info[$post_id]['topic_title'],
+						'forum_id'		=> $post_info[$post_id]['forum_id'],
+						'topic_id'		=> 0, // useless to log a topic id, as it will be deleted
+					);
 				}
-
-				$disapprove_log[] = array(
-					'type'			=> 'topic',
-					'post_subject'	=> $post_data['post_subject'],
-					'forum_id'		=> $post_data['forum_id'],
-					'topic_id'		=> 0, // useless to log a topic id, as it will be deleted
-				);
 			}
 			else
 			{
-				if (!isset($topic_replies_real_sql[$post_data['topic_id']]))
-				{
-					$topic_replies_real_sql[$post_data['topic_id']] = 0;
-				}
-				$topic_replies_real_sql[$post_data['topic_id']]++;
-
-				$disapprove_log[] = array(
+				// Build disapproved posts log
+				$disapprove_log_posts[] = array(
 					'type'			=> 'post',
-					'post_subject'	=> $post_data['post_subject'],
-					'forum_id'		=> $post_data['forum_id'],
-					'topic_id'		=> $post_data['topic_id'],
+					'post_subject'	=> $post_info[$post_id]['post_subject'],
+					'forum_id'		=> $post_info[$post_id]['forum_id'],
+					'topic_id'		=> $post_info[$post_id]['topic_id'],
 				);
-			}
 
-			$post_disapprove_sql[] = $post_id;
+			}
 		}
 
-		unset($post_data);
+		// Get disapproved posts/topics counts separately
+		$num_disapproved_topics = sizeof($disapprove_log_topics);
+		$num_disapproved_posts = sizeof($disapprove_log_posts);
 
-		if (sizeof($forum_topics_real))
-		{
-			foreach ($forum_topics_real as $forum_id => $topics_real)
-			{
-				$sql = 'UPDATE ' . FORUMS_TABLE . "
-					SET forum_topics_real = forum_topics_real - $topics_real
-					WHERE forum_id = $forum_id";
-				$db->sql_query($sql);
-			}
-		}
+		// Build the whole log
+		$disapprove_log = array_merge($disapprove_log_topics, $disapprove_log_posts);
 
-		if (sizeof($topic_replies_real_sql))
-		{
-			foreach ($topic_replies_real_sql as $topic_id => $num_replies)
-			{
-				$sql = 'UPDATE ' . TOPICS_TABLE . "
-					SET topic_replies_real = topic_replies_real - $num_replies
-					WHERE topic_id = $topic_id";
-				$db->sql_query($sql);
-			}
-		}
+		// Unset unneeded arrays
+		unset($post_data, $disapprove_log_topics, $disapprove_log_posts);
 
-		if (sizeof($post_disapprove_sql))
+		// Let's do the job - delete disapproved posts
+		if (sizeof($post_disapprove_list))
 		{
 			if (!function_exists('delete_posts'))
 			{
@@ -949,22 +860,15 @@
 			}
 
 			// We do not check for permissions here, because the moderator allowed approval/disapproval should be allowed to delete the disapproved posts
-			delete_posts('post_id', $post_disapprove_sql);
+			// Note: function delete_posts triggers related forums/topics sync,
+			// so we don't need to call update_post_information later and to adjust real topic replies or forum topics count manually
+			delete_posts('post_id', array_keys($post_disapprove_list));
 
 			foreach ($disapprove_log as $log_data)
 			{
 				add_log('mod', $log_data['forum_id'], $log_data['topic_id'], ($log_data['type'] == 'topic') ? 'LOG_TOPIC_DISAPPROVED' : 'LOG_POST_DISAPPROVED', $log_data['post_subject'], $disapprove_reason);
 			}
 		}
-		unset($post_disapprove_sql, $topic_replies_real_sql);
-
-		update_post_information('topic', array_keys($topic_id_list));
-
-		if (sizeof($forum_id_list))
-		{
-			update_post_information('forum', array_keys($forum_id_list));
-		}
-		unset($topic_id_list, $forum_id_list);
 
 		$messenger = new messenger();
 
@@ -993,7 +897,7 @@
 						{
 							// Load up the language pack
 							$lang = array();
-							@include($phpbb_root_path . '/language/' . $post_data['user_lang'] . '/mcp.' . $phpEx);
+							@include($phpbb_root_path . '/language/' . basename($post_data['user_lang']) . '/mcp.' . $phpEx);
 
 							// If we find the reason in this language pack use it
 							if (isset($lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang]))
@@ -1032,13 +936,13 @@
 
 		$messenger->save_queue();
 
-		if (sizeof($forum_topics_real))
+		if ($num_disapproved_topics)
 		{
-			$success_msg = ($num_disapproved == 1) ? 'TOPIC_DISAPPROVED_SUCCESS' : 'TOPICS_DISAPPROVED_SUCCESS';
+			$success_msg = ($num_disapproved_topics == 1) ? 'TOPIC_DISAPPROVED_SUCCESS' : 'TOPICS_DISAPPROVED_SUCCESS';
 		}
 		else
 		{
-			$success_msg = (sizeof($post_id_list) == 1) ? 'POST_DISAPPROVED_SUCCESS' : 'POSTS_DISAPPROVED_SUCCESS';
+			$success_msg = ($num_disapproved_posts == 1) ? 'POST_DISAPPROVED_SUCCESS' : 'POSTS_DISAPPROVED_SUCCESS';
 		}
 	}
 	else
diff -x .svn -aruN 3.0.5.src/includes/mcp/mcp_reports.php 3.0.6.src/includes/mcp/mcp_reports.php
--- 3.0.5.src/includes/mcp/mcp_reports.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/mcp/mcp_reports.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package mcp
-* @version $Id: mcp_reports.php 9015 2008-10-14 18:29:50Z toonarmy $
+* @version $Id: mcp_reports.php 10252 2009-11-03 14:51:07Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -77,6 +77,7 @@
 					WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . '
 						AND rr.reason_id = r.reason_id
 						AND r.user_id = u.user_id
+						AND r.pm_id = 0
 					ORDER BY report_closed ASC';
 				$result = $db->sql_query_limit($sql, 1);
 				$report = $db->sql_fetchrow($result);
@@ -115,6 +116,7 @@
 				{
 					$template->assign_vars(array(
 						'S_TOPIC_REVIEW'	=> true,
+						'S_BBCODE_ALLOWED'	=> $post_info['enable_bbcode'],
 						'TOPIC_TITLE'		=> $post_info['topic_title'])
 					);
 				}
@@ -149,13 +151,11 @@
 
 				if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
 				{
-					$extensions = $cache->obtain_attach_extensions($post_info['forum_id']);
-
 					$sql = 'SELECT *
 						FROM ' . ATTACHMENTS_TABLE . '
 						WHERE post_msg_id = ' . $post_id . '
 							AND in_message = 0
-						ORDER BY filetime DESC, post_msg_id ASC';
+						ORDER BY filetime DESC';
 					$result = $db->sql_query($sql);
 
 					while ($row = $db->sql_fetchrow($result))
@@ -258,7 +258,7 @@
 				}
 				unset($forum_list_read);
 
-				if ($topic_id && $forum_id)
+				if ($topic_id)
 				{
 					$topic_info = get_topic_data(array($topic_id));
 
@@ -267,12 +267,15 @@
 						trigger_error('TOPIC_NOT_EXIST');
 					}
 
-					$topic_info = $topic_info[$topic_id];
-					$forum_id = $topic_info['forum_id'];
-				}
-				else if ($topic_id && !$forum_id)
-				{
-					$topic_id = 0;
+					if ($forum_id != $topic_info[$topic_id]['forum_id'])
+					{
+						$topic_id = 0;
+					}
+					else
+					{
+						$topic_info = $topic_info[$topic_id];
+						$forum_id = (int) $topic_info['forum_id'];
+					}
 				}
 
 				$forum_list = array();
@@ -329,7 +332,7 @@
 				mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
 
 				$forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total;
-				$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
+				$limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : '';
 
 				if ($mode == 'reports')
 				{
@@ -346,9 +349,10 @@
 						$report_state
 						AND r.post_id = p.post_id
 						" . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
-						' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = p.poster_id' : '') . '
+						' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = r.user_id' : '') . '
 						' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "
 						AND t.topic_id = p.topic_id
+						AND r.pm_id = 0
 						$limit_time_sql
 					ORDER BY $sort_order_sql";
 				$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
@@ -371,6 +375,7 @@
 							AND r.post_id = p.post_id
 							AND u.user_id = p.poster_id
 							AND ru.user_id = r.user_id
+							AND r.pm_id = 0
 						ORDER BY ' . $sort_order_sql;
 					$result = $db->sql_query($sql);
 
@@ -425,7 +430,7 @@
 					'PAGE_NUMBER'			=> on_page($total, $config['topics_per_page'], $start),
 					'TOPIC_ID'				=> $topic_id,
 					'TOTAL'					=> $total,
-					'TOTAL_REPORTS'			=> ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),					
+					'TOTAL_REPORTS'			=> ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),
 					)
 				);
 
@@ -438,35 +443,54 @@
 /**
 * Closes a report
 */
-function close_report($report_id_list, $mode, $action)
+function close_report($report_id_list, $mode, $action, $pm = false)
 {
-	global $db, $template, $user, $config;
+	global $db, $template, $user, $config, $auth;
 	global $phpEx, $phpbb_root_path;
 
-	$sql = 'SELECT r.post_id
-		FROM ' . REPORTS_TABLE . ' r
-		WHERE ' . $db->sql_in_set('r.report_id', $report_id_list);
+	$pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 ';
+	$id_column = ($pm) ? 'pm_id' : 'post_id';
+	$module = ($pm) ? 'pm_reports' : 'reports';
+	$pm_prefix = ($pm) ? 'PM_' : '';
+
+	$sql = "SELECT r.$id_column
+		FROM " . REPORTS_TABLE . ' r
+		WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . $pm_where;
 	$result = $db->sql_query($sql);
 
 	$post_id_list = array();
 	while ($row = $db->sql_fetchrow($result))
 	{
-		$post_id_list[] = $row['post_id'];
+		$post_id_list[] = $row[$id_column];
 	}
 	$post_id_list = array_unique($post_id_list);
 
-	if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report')))
+	if ($pm)
 	{
-		trigger_error('NOT_AUTHORISED');
+		if (!$auth->acl_getf_global('m_report'))
+		{
+			trigger_error('NOT_AUTHORISED');
+		}
+	}
+	else
+	{
+		if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report')))
+		{
+			trigger_error('NOT_AUTHORISED');
+		}
 	}
 
 	if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false)
 	{
 		$redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=reports');
 	}
+	elseif ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false)
+	{
+		$redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=pm_reports');
+	}
 	else if ($action == 'close' && !request_var('r', 0))
 	{
-		$redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&amp;mode=reports');
+		$redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&amp;mode=' . $module);
 	}
 	else
 	{
@@ -477,7 +501,7 @@
 	$topic_ids = array();
 
 	$s_hidden_fields = build_hidden_fields(array(
-		'i'					=> 'reports',
+		'i'					=> $module,
 		'mode'				=> $mode,
 		'report_id_list'	=> $report_id_list,
 		'action'			=> $action,
@@ -486,13 +510,13 @@
 
 	if (confirm_box(true))
 	{
-		$post_info = get_post_data($post_id_list, 'm_report');
+		$post_info = ($pm) ? get_pm_data($post_id_list) : get_post_data($post_id_list, 'm_report');
 
-		$sql = 'SELECT r.report_id, r.post_id, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type
-			FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u
+		$sql = "SELECT r.report_id, r.$id_column, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type
+			FROM " . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u
 			WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . '
 				' . (($action == 'close') ? 'AND r.report_closed = 0' : '') . '
-				AND r.user_id = u.user_id';
+				AND r.user_id = u.user_id' . $pm_where;
 		$result = $db->sql_query($sql);
 
 		$reports = $close_report_posts = $close_report_topics = $notify_reporters = $report_id_list = array();
@@ -503,8 +527,12 @@
 
 			if (!$report['report_closed'])
 			{
-				$close_report_posts[] = $report['post_id'];
-				$close_report_topics[] = $post_info[$report['post_id']]['topic_id'];
+				$close_report_posts[] = $report[$id_column];
+
+				if (!$pm)
+				{
+					$close_report_topics[] = $post_info[$report['post_id']]['topic_id'];
+				}
 			}
 
 			if ($report['user_notify'] && !$report['report_closed'])
@@ -519,7 +547,7 @@
 			$close_report_posts = array_unique($close_report_posts);
 			$close_report_topics = array_unique($close_report_topics);
 
-			if (sizeof($close_report_posts))
+			if (!$pm && sizeof($close_report_posts))
 			{
 				// Get a list of topics that still contain reported posts
 				$sql = 'SELECT DISTINCT topic_id
@@ -558,18 +586,33 @@
 
 			if (sizeof($close_report_posts))
 			{
-				$sql = 'UPDATE ' . POSTS_TABLE . '
-					SET post_reported = 0
-					WHERE ' . $db->sql_in_set('post_id', $close_report_posts);
-				$db->sql_query($sql);
-
-				if (sizeof($close_report_topics))
-				{
-					$sql = 'UPDATE ' . TOPICS_TABLE . '
-						SET topic_reported = 0
-						WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . '
-							OR ' . $db->sql_in_set('topic_moved_id', $close_report_topics);
+				if ($pm)
+				{
+					$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
+						SET message_reported = 0
+						WHERE ' . $db->sql_in_set('msg_id', $close_report_posts);
 					$db->sql_query($sql);
+
+					if ($action == 'delete')
+					{
+						delete_pm(ANONYMOUS, $close_report_posts, PRIVMSGS_INBOX);
+					}
+				}
+				else
+				{
+					$sql = 'UPDATE ' . POSTS_TABLE . '
+						SET post_reported = 0
+						WHERE ' . $db->sql_in_set('post_id', $close_report_posts);
+					$db->sql_query($sql);
+
+					if (sizeof($close_report_topics))
+					{
+						$sql = 'UPDATE ' . TOPICS_TABLE . '
+							SET topic_reported = 0
+							WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . '
+								OR ' . $db->sql_in_set('topic_moved_id', $close_report_topics);
+						$db->sql_query($sql);
+					}
 				}
 			}
 
@@ -579,7 +622,14 @@
 
 		foreach ($reports as $report)
 		{
-			add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' .  strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']);
+			if ($pm)
+			{
+				add_log('mod', 0, 0, 'LOG_PM_REPORT_' .  strtoupper($action) . 'D', $post_info[$report['pm_id']]['message_subject']);
+			}
+			else
+			{
+				add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' .  strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']);
+			}
 		}
 
 		$messenger = new messenger();
@@ -594,39 +644,53 @@
 					continue;
 				}
 
-				$post_id = $reporter['post_id'];
+				$post_id = $reporter[$id_column];
 
-				$messenger->template('report_' . $action . 'd', $reporter['user_lang']);
+				$messenger->template((($pm) ? 'pm_report_' : 'report_') . $action . 'd', $reporter['user_lang']);
 
 				$messenger->to($reporter['user_email'], $reporter['username']);
 				$messenger->im($reporter['user_jabber'], $reporter['username']);
 
-				$messenger->assign_vars(array(
-					'USERNAME'		=> htmlspecialchars_decode($reporter['username']),
-					'CLOSER_NAME'	=> htmlspecialchars_decode($user->data['username']),
-					'POST_SUBJECT'	=> htmlspecialchars_decode(censor_text($post_info[$post_id]['post_subject'])),
-					'TOPIC_TITLE'	=> htmlspecialchars_decode(censor_text($post_info[$post_id]['topic_title'])))
-				);
+				if ($pm)
+				{
+					$messenger->assign_vars(array(
+						'USERNAME'		=> htmlspecialchars_decode($reporter['username']),
+						'CLOSER_NAME'	=> htmlspecialchars_decode($user->data['username']),
+						'PM_SUBJECT'	=> htmlspecialchars_decode(censor_text($post_info[$post_id]['message_subject'])),
+					));
+				}
+				else
+				{
+					$messenger->assign_vars(array(
+						'USERNAME'		=> htmlspecialchars_decode($reporter['username']),
+						'CLOSER_NAME'	=> htmlspecialchars_decode($user->data['username']),
+						'POST_SUBJECT'	=> htmlspecialchars_decode(censor_text($post_info[$post_id]['post_subject'])),
+						'TOPIC_TITLE'	=> htmlspecialchars_decode(censor_text($post_info[$post_id]['topic_title'])))
+					);
+				}
 
 				$messenger->send($reporter['user_notify_type']);
 			}
 		}
-		
-		foreach ($post_info as $post)
+
+		if (!$pm)
 		{
-			$forum_ids[$post['forum_id']] = $post['forum_id'];
-			$topic_ids[$post['topic_id']] = $post['topic_id'];
+			foreach ($post_info as $post)
+			{
+				$forum_ids[$post['forum_id']] = $post['forum_id'];
+				$topic_ids[$post['topic_id']] = $post['topic_id'];
+			}
 		}
-		
+
 		unset($notify_reporters, $post_info, $reports);
 
 		$messenger->save_queue();
 
-		$success_msg = (sizeof($report_id_list) == 1) ? 'REPORT_' . strtoupper($action) . 'D_SUCCESS' : 'REPORTS_' . strtoupper($action) . 'D_SUCCESS';
+		$success_msg = (sizeof($report_id_list) == 1) ? "{$pm_prefix}REPORT_" . strtoupper($action) . 'D_SUCCESS' : "{$pm_prefix}REPORTS_" . strtoupper($action) . 'D_SUCCESS';
 	}
 	else
 	{
-		confirm_box(false, $user->lang[strtoupper($action) . '_REPORT' . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);
+		confirm_box(false, $user->lang[strtoupper($action) . "_{$pm_prefix}REPORT" . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);
 	}
 
 	$redirect = request_var('redirect', "index.$phpEx");
@@ -639,17 +703,23 @@
 	else
 	{
 		meta_refresh(3, $redirect);
+
 		$return_forum = '';
-		if (sizeof($forum_ids == 1))
-		{
-			$return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
-		}
 		$return_topic = '';
-		if (sizeof($topic_ids == 1))
+
+		if (!$pm)
 		{
-			$return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&amp;f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
+			if (sizeof($forum_ids) === 1)
+			{
+				$return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
+			}
+
+			if (sizeof($topic_ids) === 1)
+			{
+				$return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&amp;f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
+			}
 		}
-		
+
 		trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
 	}
 }
diff -x .svn -aruN 3.0.5.src/includes/mcp/mcp_topic.php 3.0.6.src/includes/mcp/mcp_topic.php
--- 3.0.5.src/includes/mcp/mcp_topic.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/mcp/mcp_topic.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package mcp
-* @version $Id: mcp_topic.php 9398 2009-03-19 17:01:59Z acydburn $
+* @version $Id: mcp_topic.php 10201 2009-10-03 11:35:39Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -259,7 +259,7 @@
 	// Display topic icons for split topic
 	$s_topic_icons = false;
 
-	if ($auth->acl_get('m_split', $topic_info['forum_id']))
+	if ($auth->acl_gets('m_split', 'm_merge', (int) $topic_info['forum_id']))
 	{
 		include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
 		$s_topic_icons = posting_gen_topic_icons('', $icon_id);
@@ -301,8 +301,9 @@
 		'POSTS_PER_PAGE'	=> $posts_per_page,
 		'ACTION'			=> $action,
 
-		'REPORTED_IMG'		=> $user->img('icon_topic_reported', 'POST_REPORTED', false, true),
-		'UNAPPROVED_IMG'	=> $user->img('icon_topic_unapproved', 'POST_UNAPPROVED', false, true),
+		'REPORTED_IMG'		=> $user->img('icon_topic_reported', 'POST_REPORTED'),
+		'UNAPPROVED_IMG'	=> $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
+		'INFO_IMG'			=> $user->img('icon_post_info', 'VIEW_INFO'),
 
 		'S_MCP_ACTION'		=> "$url&amp;i=$id&amp;mode=$mode&amp;action=$action&amp;start=$start",
 		'S_FORUM_SELECT'	=> ($to_forum_id) ? make_forum_select($to_forum_id, false, false, true, true, true) : make_forum_select($topic_info['forum_id'], false, false, true, true, true),
diff -x .svn -aruN 3.0.5.src/includes/mcp/mcp_warn.php 3.0.6.src/includes/mcp/mcp_warn.php
--- 3.0.5.src/includes/mcp/mcp_warn.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/mcp/mcp_warn.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package mcp
-* @version $Id: mcp_warn.php 9343 2009-02-27 10:54:57Z toonarmy $
+* @version $Id: mcp_warn.php 9738 2009-07-08 14:58:06Z toonarmy $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -204,7 +204,7 @@
 
 		$sql = 'SELECT u.*, p.*
 			FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
-			WHERE post_id = $post_id
+			WHERE p.post_id = $post_id
 				AND u.user_id = p.poster_id";
 		$result = $db->sql_query($sql);
 		$user_row = $db->sql_fetchrow($result);
diff -x .svn -aruN 3.0.5.src/includes/message_parser.php 3.0.6.src/includes/message_parser.php
--- 3.0.5.src/includes/message_parser.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/message_parser.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: message_parser.php 9453 2009-04-17 13:07:51Z acydburn $
+* @version $Id: message_parser.php 10249 2009-11-01 15:33:44Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -118,7 +118,7 @@
 			'url'			=> array('bbcode_id' => 3,	'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")),
 			'img'			=> array('bbcode_id' => 4,	'regexp' => array('#\[img\](.*)\[/img\]#iUe' => "\$this->bbcode_img('\$1')")),
 			'size'			=> array('bbcode_id' => 5,	'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")),
-			'color'			=> array('bbcode_id' => 6,	'regexp' => array('!\[color=(#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")),
+			'color'			=> array('bbcode_id' => 6,	'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")),
 			'u'				=> array('bbcode_id' => 7,	'regexp' => array('#\[u\](.*?)\[/u\]#ise' => "\$this->bbcode_underline('\$1')")),
 			'list'			=> array('bbcode_id' => 9,	'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#ise' => "\$this->bbcode_parse_list('\$0')")),
 			'email'			=> array('bbcode_id' => 10,	'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#ise' => "\$this->validate_email('\$1', '\$2')")),
@@ -1062,10 +1062,16 @@
 	{
 		global $config, $db, $user;
 
-		$mode = ($mode != 'post') ? 'sig' : 'post';
-
 		$this->mode = $mode;
 
+		foreach (array('chars', 'smilies', 'urls', 'font_size', 'img_height', 'img_width') as $key)
+		{
+			if (!isset($config['max_' . $mode . '_' . $key]))
+			{
+				$config['max_' . $mode . '_' . $key] = 0;
+			}
+		}
+
 		$this->allow_img_bbcode = $allow_img_bbcode;
 		$this->allow_flash_bbcode = $allow_flash_bbcode;
 		$this->allow_quote_bbcode = $allow_quote_bbcode;
@@ -1089,14 +1095,22 @@
 		$replace = array("\\1&#058;");
 		$this->message = preg_replace($match, $replace, trim($this->message));
 
-		// Message length check. 0 disables this check completely.
-		if ($config['max_' . $mode . '_chars'] > 0)
+		// Store message length...
+		$message_length = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message));
+
+		// Maximum message length check. 0 disables this check completely.
+		if ((int) $config['max_' . $mode . '_chars'] > 0 && $message_length > (int) $config['max_' . $mode . '_chars'])
 		{
-			$msg_len = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message));
+			$this->warn_msg[] = sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $message_length, (int) $config['max_' . $mode . '_chars']);
+			return (!$update_this_message) ? $return_message : $this->warn_msg;
+		}
 
-			if ((!$msg_len && $mode !== 'sig') || $config['max_' . $mode . '_chars'] && $msg_len > $config['max_' . $mode . '_chars'])
+		// Minimum message length check for post only
+		if ($mode === 'post')
+		{
+			if (!$message_length || $message_length < (int) $config['min_post_chars'])
 			{
-				$this->warn_msg[] = (!$msg_len) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $msg_len, $config['max_' . $mode . '_chars']);
+				$this->warn_msg[] = (!$message_length) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_FEW_CHARS_LIMIT'], $message_length, (int) $config['min_post_chars']);
 				return (!$update_this_message) ? $return_message : $this->warn_msg;
 			}
 		}
@@ -1145,7 +1159,7 @@
 
 		// Check for "empty" message. We do not check here for maximum length, because bbcode, smilies, etc. can add to the length.
 		// The maximum length check happened before any parsings.
-		if ($mode !== 'sig' && utf8_clean_string($this->message) === '')
+		if ($mode === 'post' && utf8_clean_string($this->message) === '')
 		{
 			$this->warn_msg[] = $user->lang['TOO_FEW_CHARS'];
 			return (!$update_this_message) ? $return_message : $this->warn_msg;
@@ -1298,7 +1312,7 @@
 				}
 
 				// (assertion)
-				$match[] = '(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)';
+				$match[] = preg_quote($row['code'], '#');
 				$replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['code'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->';
 			}
 			$db->sql_freeresult($result);
@@ -1308,7 +1322,7 @@
 		{
 			if ($max_smilies)
 			{
-				$num_matches = preg_match_all('#' . implode('|', $match) . '#', $this->message, $matches);
+				$num_matches = preg_match_all('#(?<=^|[\n .])(?:' . implode('|', $match) . ')(?![^<>]*>)#', $this->message, $matches);
 				unset($matches);
 
 				if ($num_matches !== false && $num_matches > $max_smilies)
@@ -1319,7 +1333,7 @@
 			}
 
 			// Make sure the delimiter # is added in front and at the end of every element within $match
-			$this->message = trim(preg_replace(explode(chr(0), '#' . implode('#' . chr(0) . '#', $match) . '#'), $replace, $this->message));
+			$this->message = trim(preg_replace(explode(chr(0), '#(?<=^|[\n .])' . implode('(?![^<>]*>)#' . chr(0) . '#(?<=^|[\n .])', $match) . '(?![^<>]*>)#'), $replace, $this->message));
 		}
 	}
 
@@ -1612,7 +1626,7 @@
 		$this->message = $poll['poll_option_text'];
 		$bbcode_bitfield = $this->bbcode_bitfield;
 
-		$poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false);
+		$poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false, 'poll');
 
 		$bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield));
 		$this->message = $tmp_message;
@@ -1635,7 +1649,7 @@
 			{
 				$this->warn_msg[] = $user->lang['POLL_TITLE_TOO_LONG'];
 			}
-			$poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false);
+			$poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false, 'poll');
 			if (strlen($poll['poll_title']) > 255)
 			{
 				$this->warn_msg[] = $user->lang['POLL_TITLE_COMP_TOO_LONG'];
diff -x .svn -aruN 3.0.5.src/includes/questionnaire/questionnaire.php 3.0.6.src/includes/questionnaire/questionnaire.php
--- 3.0.5.src/includes/questionnaire/questionnaire.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/includes/questionnaire/questionnaire.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,472 @@
+<?php
+/**
+*
+* @package phpBB3
+* @version $Id: questionnaire.php 10226 2009-10-20 11:16:30Z acydburn $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+/**
+* This class collects data which is used to create some usage statistics.
+*
+* The collected data is - after authorization of the administrator - submitted
+* to a central server. For privacy reasons we try to collect only data which aren't private
+* or don't give any information which might help to identify the user.
+*
+* @author		Johannes Schlueter <johannes@php.net>
+* @copyright	(c) 2007-2008 Johannes Schlueter
+*/
+class phpbb_questionnaire_data_collector
+{
+	var $providers;
+	var $data = null;
+	var $install_id = '';
+
+	/**
+	* Constructor.
+	*
+	* @param	string
+	*/
+	function phpbb_questionnaire_data_collector($install_id)
+	{
+		$this->install_id = $install_id;
+		$this->providers = array();
+	}
+
+	function add_data_provider(&$provider)
+	{
+		$this->providers[] = &$provider;
+	}
+
+	/**
+	* Get data as an array.
+	*
+	* @return	array	All Data
+	*/
+	function get_data_raw()
+	{
+		if (!$this->data)
+		{
+			$this->collect();
+		}
+
+		return $this->data;
+	}
+
+	function get_data_for_form()
+	{
+		return base64_encode(serialize($this->get_data_raw()));
+	}
+
+	/**
+	* Collect info into the data property.
+	*
+	* @return	void
+	*/
+	function collect()
+	{
+		foreach (array_keys($this->providers) as $key)
+		{
+			$provider = &$this->providers[$key];
+			$this->data[$provider->get_identifier()] = $provider->get_data();
+		}
+		$this->data['install_id'] = $this->install_id;
+	}
+}
+
+/** interface: get_indentifier(), get_data() */
+
+/**
+* Questionnaire PHP data provider
+* @package phpBB3
+*/
+class phpbb_questionnaire_php_data_provider
+{
+	function get_identifier()
+	{
+		return 'PHP';
+	}
+
+	/**
+	* Get data about the PHP runtime setup.
+	*
+	* @return	array
+	*/
+	function get_data()
+	{
+		return array(
+			'version'						=> PHP_VERSION,
+			'sapi'							=> PHP_SAPI,
+			'int_size'						=> defined('PHP_INT_SIZE') ? PHP_INT_SIZE : '',
+			'safe_mode'						=> (int) @ini_get('safe_mode'),
+			'open_basedir'					=> (int) @ini_get('open_basedir'),
+			'memory_limit'					=> @ini_get('memory_limit'),
+			'allow_url_fopen'				=> (int) @ini_get('allow_url_fopen'),
+			'allow_url_include'				=> (int) @ini_get('allow_url_include'),
+			'file_uploads'					=> (int) @ini_get('file_uploads'),
+			'upload_max_filesize'			=> @ini_get('upload_max_filesize'),
+			'post_max_size'					=> @ini_get('post_max_size'),
+			'disable_functions'				=> @ini_get('disable_functions'),
+			'disable_classes'				=> @ini_get('disable_classes'),
+			'enable_dl'						=> (int) @ini_get('enable_dl'),
+			'magic_quotes_gpc'				=> (int) @ini_get('magic_quotes_gpc'),
+			'register_globals'				=> (int) @ini_get('register_globals'),
+			'filter.default'				=> @ini_get('filter.default'),
+			'zend.ze1_compatibility_mode'	=> (int) @ini_get('zend.ze1_compatibility_mode'),
+			'unicode.semantics'				=> (int) @ini_get('unicode.semantics'),
+			'zend_thread_safty'				=> (int) function_exists('zend_thread_id'),
+			'extensions'					=> get_loaded_extensions(),
+		);
+	}
+}
+
+/**
+* Questionnaire System data provider
+* @package phpBB3
+*/
+class phpbb_questionnaire_system_data_provider
+{
+	function get_identifier()
+	{
+		return 'System';
+	}
+
+	/**
+	* Get data about the general system information, like OS or IP (shortened).
+	*
+	* @return	array
+	*/
+	function get_data()
+	{
+		// Start discovering the IPV4 server address, if available
+		$server_address = '0.0.0.0';
+
+		if (!empty($_SERVER['SERVER_ADDR']))
+		{
+			$server_address = $_SERVER['SERVER_ADDR'];
+		}
+
+		// Running on IIS?
+		if (!empty($_SERVER['LOCAL_ADDR']))
+		{
+			$server_address = $_SERVER['LOCAL_ADDR'];
+		}
+
+		$ip_address_ary = explode('.', $server_address);
+
+		// build ip
+		if (!isset($ip_address_ary[0]) || !isset($ip_address_ary[1]))
+		{
+			$ip_address_ary = explode('.', '0.0.0.0');
+		}
+
+		return array(
+			'os'	=> PHP_OS,
+			'httpd'	=> $_SERVER['SERVER_SOFTWARE'],
+			// we don't want the real IP address (for privacy policy reasons) but only
+			// a network address to see whether your installation is running on a private or public network.
+			// IANA reserved addresses for private networks (RFC 1918) are:
+			// - 10.0.0.0/8
+			// - 172.16.0.0/12
+			// - 192.168.0.0/16
+			'ip'		=> $ip_address_ary[0] . '.' . $ip_address_ary[1] . '.XXX.YYY',
+		);
+	}
+}
+
+/**
+* Questionnaire phpBB data provider
+* @package phpBB3
+*/
+class phpbb_questionnaire_phpbb_data_provider
+{
+	var $config;
+	var $unique_id;
+
+	/**
+	* Constructor.
+	*
+	* @param	array	$config
+	*/
+	function phpbb_questionnaire_phpbb_data_provider($config)
+	{
+		// generate a unique id if necessary
+		if (empty($config['questionnaire_unique_id']))
+		{
+			$this->unique_id = unique_id();
+			set_config('questionnaire_unique_id', $this->unique_id);
+		}
+		else
+		{
+			$this->unique_id = $config['questionnaire_unique_id'];
+		}
+
+		$this->config = $config;
+	}
+
+	/**
+	* Returns a string identifier for this data provider
+	*
+	* @return	string	"phpBB"
+	*/
+	function get_identifier()
+	{
+		return 'phpBB';
+	}
+
+	/**
+	* Get data about this phpBB installation.
+	*
+	* @return	array	Relevant anonymous config options
+	*/
+	function get_data()
+	{
+		global $phpbb_root_path, $phpEx;
+		include("{$phpbb_root_path}config.$phpEx");
+
+		// Only send certain config vars
+		$config_vars = array(
+			'active_sessions' => true,
+			'allow_attachments' => true,
+			'allow_autologin' => true,
+			'allow_avatar' => true,
+			'allow_avatar_local' => true,
+			'allow_avatar_remote' => true,
+			'allow_avatar_upload' => true,
+			'allow_bbcode' => true,
+			'allow_birthdays' => true,
+			'allow_bookmarks' => true,
+			'allow_emailreuse' => true,
+			'allow_forum_notify' => true,
+			'allow_mass_pm' => true,
+			'allow_name_chars' => true,
+			'allow_namechange' => true,
+			'allow_nocensors' => true,
+			'allow_pm_attach' => true,
+			'allow_pm_report' => true,
+			'allow_post_flash' => true,
+			'allow_post_links' => true,
+			'allow_privmsg' => true,
+			'allow_quick_reply' => true,
+			'allow_sig' => true,
+			'allow_sig_bbcode' => true,
+			'allow_sig_flash' => true,
+			'allow_sig_img' => true,
+			'allow_sig_links' => true,
+			'allow_sig_pm' => true,
+			'allow_sig_smilies' => true,
+			'allow_smilies' => true,
+			'allow_topic_notify' => true,
+			'attachment_quota' => true,
+			'auth_bbcode_pm' => true,
+			'auth_flash_pm' => true,
+			'auth_img_pm' => true,
+			'auth_method' => true,
+			'auth_smilies_pm' => true,
+			'avatar_filesize' => true,
+			'avatar_max_height' => true,
+			'avatar_max_width' => true,
+			'avatar_min_height' => true,
+			'avatar_min_width' => true,
+			'board_dst' => true,
+			'board_email_form' => true,
+			'board_hide_emails' => true,
+			'board_timezone' => true,
+			'browser_check' => true,
+			'bump_interval' => true,
+			'bump_type' => true,
+			'cache_gc' => true,
+			'captcha_plugin' => true,
+			'captcha_gd' => true,
+			'captcha_gd_foreground_noise' => true,
+			'captcha_gd_x_grid' => true,
+			'captcha_gd_y_grid' => true,
+			'captcha_gd_wave' => true,
+			'captcha_gd_3d_noise' => true,
+			'captcha_gd_fonts' => true,
+			'confirm_refresh' => true,
+			'check_attachment_content' => true,
+			'check_dnsbl' => true,
+			'chg_passforce' => true,
+			'cookie_secure' => true,
+			'coppa_enable' => true,
+			'database_gc' => true,
+			'dbms_version' => true,
+			'default_dateformat' => true,
+			'default_lang' => true,
+			'display_last_edited' => true,
+			'display_order' => true,
+			'edit_time' => true,
+			'email_check_mx' => true,
+			'email_enable' => true,
+			'email_function_name' => true,
+			'email_package_size' => true,
+			'enable_confirm' => true,
+			'enable_pm_icons' => true,
+			'enable_post_confirm' => true,
+			'feed_enable' => true,
+			'feed_limit' => true,
+			'feed_overall_forums' => true,
+			'feed_overall_forums_limit' => true,
+			'feed_overall_topics' => true,
+			'feed_overall_topics_limit' => true,
+			'feed_forum' => true,
+			'feed_topic' => true,
+			'feed_item_statistics' => true,
+			'flood_interval' => true,
+			'force_server_vars' => true,
+			'form_token_lifetime' => true,
+			'form_token_mintime' => true,
+			'form_token_sid_guests' => true,
+			'forward_pm' => true,
+			'forwarded_for_check' => true,
+			'full_folder_action' => true,
+			'fulltext_native_common_thres' => true,
+			'fulltext_native_load_upd' => true,
+			'fulltext_native_max_chars' => true,
+			'fulltext_native_min_chars' => true,
+			'gzip_compress' => true,
+			'hot_threshold' => true,
+			'img_create_thumbnail' => true,
+			'img_display_inlined' => true,
+			'img_imagick' => true,
+			'img_link_height' => true,
+			'img_link_width' => true,
+			'img_max_height' => true,
+			'img_max_thumb_width' => true,
+			'img_max_width' => true,
+			'img_min_thumb_filesize' => true,
+			'ip_check' => true,
+			'jab_enable' => true,
+			'jab_package_size' => true,
+			'jab_use_ssl' => true,
+			'limit_load' => true,
+			'limit_search_load' => true,
+			'load_anon_lastread' => true,
+			'load_birthdays' => true,
+			'load_cpf_memberlist' => true,
+			'load_cpf_viewprofile' => true,
+			'load_cpf_viewtopic' => true,
+			'load_db_lastread' => true,
+			'load_db_track' => true,
+			'load_jumpbox' => true,
+			'load_moderators' => true,
+			'load_online' => true,
+			'load_online_guests' => true,
+			'load_online_time' => true,
+			'load_onlinetrack' => true,
+			'load_search' => true,
+			'load_tplcompile' => true,
+			'load_user_activity' => true,
+			'max_attachments' => true,
+			'max_attachments_pm' => true,
+			'max_autologin_time' => true,
+			'max_filesize' => true,
+			'max_filesize_pm' => true,
+			'max_login_attempts' => true,
+			'max_name_chars' => true,
+			'max_num_search_keywords' => true,
+			'max_pass_chars' => true,
+			'max_poll_options' => true,
+			'max_post_chars' => true,
+			'max_post_font_size' => true,
+			'max_post_img_height' => true,
+			'max_post_img_width' => true,
+			'max_post_smilies' => true,
+			'max_post_urls' => true,
+			'max_quote_depth' => true,
+			'max_reg_attempts' => true,
+			'max_sig_chars' => true,
+			'max_sig_font_size' => true,
+			'max_sig_img_height' => true,
+			'max_sig_img_width' => true,
+			'max_sig_smilies' => true,
+			'max_sig_urls' => true,
+			'min_name_chars' => true,
+			'min_pass_chars' => true,
+			'min_post_chars' => true,
+			'min_search_author_chars' => true,
+			'mime_triggers' => true,
+			'new_member_post_limit' => true,
+			'new_member_group_default' => true,
+			'override_user_style' => true,
+			'pass_complex' => true,
+			'pm_edit_time' => true,
+			'pm_max_boxes' => true,
+			'pm_max_msgs' => true,
+			'pm_max_recipients' => true,
+			'posts_per_page' => true,
+			'print_pm' => true,
+			'queue_interval' => true,
+			'require_activation' => true,
+			'referer_validation' => true,
+			'search_block_size' => true,
+			'search_gc' => true,
+			'search_interval' => true,
+			'search_anonymous_interval' => true,
+			'search_type' => true,
+			'search_store_results' => true,
+			'secure_allow_deny' => true,
+			'secure_allow_empty_referer' => true,
+			'secure_downloads' => true,
+			'session_gc' => true,
+			'session_length' => true,
+			'smtp_auth_method' => true,
+			'smtp_delivery' => true,
+			'topics_per_page' => true,
+			'tpl_allow_php' => true,
+			'version' => true,
+			'warnings_expire_days' => true,
+			'warnings_gc' => true,
+
+			'num_files' => true,
+			'num_posts' => true,
+			'num_topics' => true,
+			'num_users' => true,
+			'record_online_users' => true,
+		);
+
+		$result = array();
+		foreach ($config_vars as $name => $void)
+		{
+			if (isset($this->config[$name]))
+			{
+				$result['config_' . $name] = $this->config[$name];
+			}
+		}
+
+		$result['dbms'] = $dbms;
+		$result['acm_type'] = $acm_type;
+		$result['load_extensions'] = $load_extensions;
+		$result['user_agent'] = 'Unknown';
+
+		// Try to get user agent vendor and version
+		$match = array();
+		$user_agent = (!empty($_SERVER['HTTP_USER_AGENT'])) ? (string) $_SERVER['HTTP_USER_AGENT'] : '';
+		$agents = array('firefox', 'msie', 'opera', 'chrome', 'safari', 'mozilla', 'seamonkey', 'konqueror', 'netscape', 'gecko', 'navigator', 'mosaic', 'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol');
+
+		// We check here 1 by 1 because some strings occur after others (for example Mozilla [...] Firefox/)
+		foreach ($agents as $agent)
+		{
+			if (preg_match('#(' . $agent . ')[/ ]?([0-9.]*)#i', $user_agent, $match))
+			{
+				$result['user_agent'] = $match[1] . ' ' . $match[2];
+				break;
+			}
+		}
+
+		return $result;
+	}
+}
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/search/fulltext_mysql.php 3.0.6.src/includes/search/fulltext_mysql.php
--- 3.0.5.src/includes/search/fulltext_mysql.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/search/fulltext_mysql.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package search
-* @version $Id: fulltext_mysql.php 9438 2009-04-11 11:09:45Z acydburn $
+* @version $Id: fulltext_mysql.php 10075 2009-08-31 12:07:18Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -324,16 +324,17 @@
 	* Performs a search on keywords depending on display specific params. You have to run split_keywords() first.
 	*
 	* @param	string		$type				contains either posts or topics depending on what should be searched for
-	* @param	string		&$fields			contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
-	* @param	string		&$terms				is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
-	* @param	array		&$sort_by_sql		contains SQL code for the ORDER BY part of a query
-	* @param	string		&$sort_key			is the key of $sort_by_sql for the selected sorting
-	* @param	string		&$sort_dir			is either a or d representing ASC and DESC
-	* @param	string		&$sort_days			specifies the maximum amount of days a post may be old
-	* @param	array		&$ex_fid_ary		specifies an array of forum ids which should not be searched
-	* @param	array		&$m_approve_fid_ary	specifies an array of forum ids in which the searcher is allowed to view unapproved posts
-	* @param	int			&$topic_id			is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
-	* @param	array		&$author_ary		an array of author ids if the author should be ignored during the search the array is empty
+	* @param	string		$fields				contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
+	* @param	string		$terms				is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
+	* @param	array		$sort_by_sql		contains SQL code for the ORDER BY part of a query
+	* @param	string		$sort_key			is the key of $sort_by_sql for the selected sorting
+	* @param	string		$sort_dir			is either a or d representing ASC and DESC
+	* @param	string		$sort_days			specifies the maximum amount of days a post may be old
+	* @param	array		$ex_fid_ary			specifies an array of forum ids which should not be searched
+	* @param	array		$m_approve_fid_ary	specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+	* @param	int			$topic_id			is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+	* @param	array		$author_ary			an array of author ids if the author should be ignored during the search the array is empty
+	* @param	string		$author_name		specifies the author match, when ANONYMOUS is also a search-match
 	* @param	array		&$id_ary			passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
 	* @param	int			$start				indicates the first index of the page
 	* @param	int			$per_page			number of ids each page is supposed to contain
@@ -341,7 +342,7 @@
 	*
 	* @access	public
 	*/
-	function keyword_search($type, &$fields, &$terms, &$sort_by_sql, &$sort_key, &$sort_dir, &$sort_days, &$ex_fid_ary, &$m_approve_fid_ary, &$topic_id, &$author_ary, &$id_ary, $start, $per_page)
+	function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
 	{
 		global $config, $db;
 
@@ -440,14 +441,26 @@
 		$sql_select			= ($type == 'posts') ? $sql_select . 'p.post_id' : 'DISTINCT ' . $sql_select . 't.topic_id';
 		$sql_from			= ($join_topic) ? TOPICS_TABLE . ' t, ' : '';
 		$field				= ($type == 'posts') ? 'post_id' : 'topic_id';
-		$sql_author			= (sizeof($author_ary) == 1) ? ' = ' . $author_ary[0] : 'IN (' . implode(', ', $author_ary) . ')';
+		if (sizeof($author_ary) && $author_name)
+		{
+			// first one matches post of registered users, second one guests and deleted users
+			$sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+		}
+		else if (sizeof($author_ary))
+		{
+			$sql_author = ' AND ' . $db->sql_in_set('p.poster_id', $author_ary);
+		}
+		else
+		{
+			$sql_author = '';
+		}
 
 		$sql_where_options = $sql_sort_join;
 		$sql_where_options .= ($topic_id) ? ' AND p.topic_id = ' . $topic_id : '';
 		$sql_where_options .= ($join_topic) ? ' AND t.topic_id = p.topic_id' : '';
 		$sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
 		$sql_where_options .= $m_approve_fid_sql;
-		$sql_where_options .= (sizeof($author_ary)) ? ' AND p.poster_id ' . $sql_author : '';
+		$sql_where_options .= $sql_author;
 		$sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
 		$sql_where_options .= $sql_match_where;
 
@@ -495,12 +508,25 @@
 	/**
 	* Performs a search on an author's posts without caring about message contents. Depends on display specific params
 	*
-	* @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
-	* @param int $start indicates the first index of the page
-	* @param int $per_page number of ids each page is supposed to contain
-	* @return total number of results
+	* @param	string		$type				contains either posts or topics depending on what should be searched for
+	* @param	boolean		$firstpost_only		if true, only topic starting posts will be considered
+	* @param	array		$sort_by_sql		contains SQL code for the ORDER BY part of a query
+	* @param	string		$sort_key			is the key of $sort_by_sql for the selected sorting
+	* @param	string		$sort_dir			is either a or d representing ASC and DESC
+	* @param	string		$sort_days			specifies the maximum amount of days a post may be old
+	* @param	array		$ex_fid_ary			specifies an array of forum ids which should not be searched
+	* @param	array		$m_approve_fid_ary	specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+	* @param	int			$topic_id			is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+	* @param	array		$author_ary			an array of author ids
+	* @param	string		$author_name		specifies the author match, when ANONYMOUS is also a search-match
+	* @param	array		&$id_ary			passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
+	* @param	int			$start				indicates the first index of the page
+	* @param	int			$per_page			number of ids each page is supposed to contain
+	* @return	boolean|int						total number of results
+	*
+	* @access	public
 	*/
-	function author_search($type, $firstpost_only, &$sort_by_sql, &$sort_key, &$sort_dir, &$sort_days, &$ex_fid_ary, &$m_approve_fid_ary, &$topic_id, &$author_ary, &$id_ary, $start, $per_page)
+	function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
 	{
 		global $config, $db;
 
@@ -522,7 +548,8 @@
 			$topic_id,
 			implode(',', $ex_fid_ary),
 			implode(',', $m_approve_fid_ary),
-			implode(',', $author_ary)
+			implode(',', $author_ary),
+			$author_name,
 		)));
 
 		// try reading the results from cache
@@ -535,7 +562,15 @@
 		$id_ary = array();
 
 		// Create some display specific sql strings
-		$sql_author		= $db->sql_in_set('p.poster_id', $author_ary);
+		if ($author_name)
+		{
+			// first one matches post of registered users, second one guests and deleted users
+			$sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+		}
+		else
+		{
+			$sql_author = $db->sql_in_set('p.poster_id', $author_ary);
+		}
 		$sql_fora		= (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
 		$sql_topic_id	= ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
 		$sql_time		= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
diff -x .svn -aruN 3.0.5.src/includes/search/fulltext_native.php 3.0.6.src/includes/search/fulltext_native.php
--- 3.0.5.src/includes/search/fulltext_native.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/search/fulltext_native.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package search
-* @version $Id: fulltext_native.php 9473 2009-04-18 17:46:34Z acydburn $
+* @version $Id: fulltext_native.php 9931 2009-08-05 15:28:46Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -392,16 +392,17 @@
 	* Performs a search on keywords depending on display specific params. You have to run split_keywords() first.
 	*
 	* @param	string		$type				contains either posts or topics depending on what should be searched for
-	* @param	string		&$fields			contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
-	* @param	string		&$terms				is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
-	* @param	array		&$sort_by_sql		contains SQL code for the ORDER BY part of a query
-	* @param	string		&$sort_key			is the key of $sort_by_sql for the selected sorting
-	* @param	string		&$sort_dir			is either a or d representing ASC and DESC
-	* @param	string		&$sort_days			specifies the maximum amount of days a post may be old
-	* @param	array		&$ex_fid_ary		specifies an array of forum ids which should not be searched
-	* @param	array		&$m_approve_fid_ary	specifies an array of forum ids in which the searcher is allowed to view unapproved posts
-	* @param	int			&$topic_id			is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
-	* @param	array		&$author_ary		an array of author ids if the author should be ignored during the search the array is empty
+	* @param	string		$fields				contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
+	* @param	string		$terms				is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
+	* @param	array		$sort_by_sql		contains SQL code for the ORDER BY part of a query
+	* @param	string		$sort_key			is the key of $sort_by_sql for the selected sorting
+	* @param	string		$sort_dir			is either a or d representing ASC and DESC
+	* @param	string		$sort_days			specifies the maximum amount of days a post may be old
+	* @param	array		$ex_fid_ary			specifies an array of forum ids which should not be searched
+	* @param	array		$m_approve_fid_ary	specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+	* @param	int			$topic_id			is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+	* @param	array		$author_ary			an array of author ids if the author should be ignored during the search the array is empty
+	* @param	string		$author_name		specifies the author match, when ANONYMOUS is also a search-match
 	* @param	array		&$id_ary			passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
 	* @param	int			$start				indicates the first index of the page
 	* @param	int			$per_page			number of ids each page is supposed to contain
@@ -409,7 +410,7 @@
 	*
 	* @access	public
 	*/
-	function keyword_search($type, &$fields, &$terms, &$sort_by_sql, &$sort_key, &$sort_dir, &$sort_days, &$ex_fid_ary, &$m_approve_fid_ary, &$topic_id, &$author_ary, &$id_ary, $start, $per_page)
+	function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
 	{
 		global $config, $db;
 
@@ -432,7 +433,8 @@
 			$topic_id,
 			implode(',', $ex_fid_ary),
 			implode(',', $m_approve_fid_ary),
-			implode(',', $author_ary)
+			implode(',', $author_ary),
+			$author_name,
 		)));
 
 		// try reading the results from cache
@@ -623,7 +625,16 @@
 
 		if (sizeof($author_ary))
 		{
-			$sql_where[] = $db->sql_in_set('p.poster_id', $author_ary);
+			if ($author_name)
+			{
+				// first one matches post of registered users, second one guests and deleted users
+				$sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+			}
+			else
+			{
+				$sql_author = $db->sql_in_set('p.poster_id', $author_ary);
+			}
+			$sql_where[] = $sql_author;
 		}
 
 		if (sizeof($ex_fid_ary))
@@ -773,14 +784,15 @@
 	*
 	* @param	string		$type				contains either posts or topics depending on what should be searched for
 	* @param	boolean		$firstpost_only		if true, only topic starting posts will be considered
-	* @param	array		&$sort_by_sql		contains SQL code for the ORDER BY part of a query
-	* @param	string		&$sort_key			is the key of $sort_by_sql for the selected sorting
-	* @param	string		&$sort_dir			is either a or d representing ASC and DESC
-	* @param	string		&$sort_days			specifies the maximum amount of days a post may be old
-	* @param	array		&$ex_fid_ary		specifies an array of forum ids which should not be searched
-	* @param	array		&$m_approve_fid_ary	specifies an array of forum ids in which the searcher is allowed to view unapproved posts
-	* @param	int			&$topic_id			is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
-	* @param	array		&$author_ary		an array of author ids
+	* @param	array		$sort_by_sql		contains SQL code for the ORDER BY part of a query
+	* @param	string		$sort_key			is the key of $sort_by_sql for the selected sorting
+	* @param	string		$sort_dir			is either a or d representing ASC and DESC
+	* @param	string		$sort_days			specifies the maximum amount of days a post may be old
+	* @param	array		$ex_fid_ary			specifies an array of forum ids which should not be searched
+	* @param	array		$m_approve_fid_ary	specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+	* @param	int			$topic_id			is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
+	* @param	array		$author_ary			an array of author ids
+	* @param	string		$author_name		specifies the author match, when ANONYMOUS is also a search-match
 	* @param	array		&$id_ary			passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
 	* @param	int			$start				indicates the first index of the page
 	* @param	int			$per_page			number of ids each page is supposed to contain
@@ -788,7 +800,7 @@
 	*
 	* @access	public
 	*/
-	function author_search($type, $firstpost_only, &$sort_by_sql, &$sort_key, &$sort_dir, &$sort_days, &$ex_fid_ary, &$m_approve_fid_ary, &$topic_id, &$author_ary, &$id_ary, $start, $per_page)
+	function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
 	{
 		global $config, $db;
 
@@ -810,7 +822,8 @@
 			$topic_id,
 			implode(',', $ex_fid_ary),
 			implode(',', $m_approve_fid_ary),
-			implode(',', $author_ary)
+			implode(',', $author_ary),
+			$author_name,
 		)));
 
 		// try reading the results from cache
@@ -823,7 +836,15 @@
 		$id_ary = array();
 
 		// Create some display specific sql strings
-		$sql_author		= $db->sql_in_set('p.poster_id', $author_ary);
+		if ($author_name)
+		{
+			// first one matches post of registered users, second one guests and deleted users
+			$sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
+		}
+		else
+		{
+			$sql_author = $db->sql_in_set('p.poster_id', $author_ary);
+		}
 		$sql_fora		= (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
 		$sql_time		= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
 		$sql_topic_id	= ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
diff -x .svn -aruN 3.0.5.src/includes/session.php 3.0.6.src/includes/session.php
--- 3.0.5.src/includes/session.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/session.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: session.php 9490 2009-04-28 08:34:30Z acydburn $
+* @version $Id: session.php 10178 2009-09-22 15:09:09Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -182,7 +182,7 @@
 			else
 			{
 				// Set to OS hostname or localhost
-				$host = (function_exists('php_uname')) ? gethostbyaddr(gethostbyname(php_uname('n'))) : 'localhost';
+				$host = (function_exists('php_uname')) ? php_uname('n') : 'localhost';
 			}
 		}
 
@@ -213,7 +213,7 @@
 		$this->update_session_page	= $update_session_page;
 		$this->browser				= (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : '';
 		$this->referer				= (!empty($_SERVER['HTTP_REFERER'])) ? htmlspecialchars((string) $_SERVER['HTTP_REFERER']) : '';
-		$this->forwarded_for		= (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? (string) $_SERVER['HTTP_X_FORWARDED_FOR'] : '';
+		$this->forwarded_for		= (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? htmlspecialchars((string) $_SERVER['HTTP_X_FORWARDED_FOR']) : '';
 
 		$this->host					= $this->extract_current_hostname();
 		$this->page					= $this->extract_current_page($phpbb_root_path);
@@ -221,10 +221,10 @@
 		// if the forwarded for header shall be checked we have to validate its contents
 		if ($config['forwarded_for_check'])
 		{
-			$this->forwarded_for = preg_replace('#, +#', ', ', $this->forwarded_for);
+			$this->forwarded_for = preg_replace('#[ ]{2,}#', ' ', str_replace(array(',', ' '), ' ', $this->forwarded_for));
 
 			// split the list of IPs
-			$ips = explode(', ', $this->forwarded_for);
+			$ips = explode(' ', $this->forwarded_for);
 			foreach ($ips as $ip)
 			{
 				// check IPv4 first, the IPv6 is hopefully only going to be used very seldomly
@@ -267,7 +267,28 @@
 
 		// Why no forwarded_for et al? Well, too easily spoofed. With the results of my recent requests
 		// it's pretty clear that in the majority of cases you'll at least be left with a proxy/cache ip.
-		$this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : '';
+		$this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars((string) $_SERVER['REMOTE_ADDR']) : '';
+		$this->ip = preg_replace('#[ ]{2,}#', ' ', str_replace(array(',', ' '), ' ', $this->ip));
+
+		// split the list of IPs
+		$ips = explode(' ', $this->ip);
+
+		// Default IP if REMOTE_ADDR is invalid
+		$this->ip = '127.0.0.1';
+
+		foreach ($ips as $ip)
+		{
+			// check IPv4 first, the IPv6 is hopefully only going to be used very seldomly
+			if (!empty($ip) && !preg_match(get_preg_expression('ipv4'), $ip) && !preg_match(get_preg_expression('ipv6'), $ip))
+			{
+				// Just break
+				break;
+			}
+
+			// Use the last in chain
+			$this->ip = $ip;
+		}
+
 		$this->load = false;
 
 		// Load limit check (if applicable)
@@ -396,6 +417,11 @@
 									WHERE session_id = '" . $db->sql_escape($this->session_id) . "'";
 								$db->sql_query($sql);
 							}
+
+							if ($this->data['user_id'] != ANONYMOUS && !empty($config['new_member_post_limit']) && $this->data['user_new'] && $config['new_member_post_limit'] <= $this->data['user_posts'])
+							{
+								$this->leave_newly_registered();
+							}
 						}
 
 						$this->data['is_registered'] = ($this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false;
@@ -601,7 +627,7 @@
 			}
 			else
 			{
-				$ips = explode(', ', $this->forwarded_for);
+				$ips = explode(' ', $this->forwarded_for);
 				$ips[] = $this->ip;
 				$this->check_ban($this->data['user_id'], $ips);
 			}
@@ -891,7 +917,7 @@
 	*/
 	function session_gc()
 	{
-		global $db, $config;
+		global $db, $config, $phpbb_root_path, $phpEx;
 
 		$batch_size = 10;
 
@@ -949,42 +975,17 @@
 					WHERE last_login < ' . (time() - (86400 * (int) $config['max_autologin_time']));
 				$db->sql_query($sql);
 			}
-			$this->confirm_gc();
-		}
 
-		return;
-	}
-
-	function confirm_gc($type = 0)
-	{
-		global $db, $config;
-
-		$sql = 'SELECT DISTINCT c.session_id
-				FROM ' . CONFIRM_TABLE . ' c
-				LEFT JOIN ' . SESSIONS_TABLE . ' s ON (c.session_id = s.session_id)
-				WHERE s.session_id IS NULL' .
-					((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type);
-		$result = $db->sql_query($sql);
-
-		if ($row = $db->sql_fetchrow($result))
-		{
-			$sql_in = array();
-			do
+			// only called from CRON; should be a safe workaround until the infrastructure gets going
+			if (!class_exists('captcha_factory'))
 			{
-				$sql_in[] = (string) $row['session_id'];
-			}
-			while ($row = $db->sql_fetchrow($result));
-
-			if (sizeof($sql_in))
-			{
-				$sql = 'DELETE FROM ' . CONFIRM_TABLE . '
-					WHERE ' . $db->sql_in_set('session_id', $sql_in);
-				$db->sql_query($sql);
+				include($phpbb_root_path . "includes/captcha/captcha_factory." . $phpEx);
 			}
+			phpbb_captcha_factory::garbage_collect($config['captcha_plugin']);
 		}
-		$db->sql_freeresult($result);
-	}
 
+		return;
+	}
 
 	/**
 	* Sets a cookie
@@ -1360,6 +1361,20 @@
 			WHERE user_id = ' . (int) $user_id;
 		$db->sql_query($sql);
 
+		// Update last visit info first before deleting sessions
+		$sql = 'SELECT session_time, session_page
+			FROM ' . SESSIONS_TABLE . '
+			WHERE session_user_id = ' . (int) $user_id . '
+			ORDER BY session_time DESC';
+		$result = $db->sql_query_limit($sql, 1);
+		$row = $db->sql_fetchrow($result);
+		$db->sql_freeresult($result);
+
+		$sql = 'UPDATE ' . USERS_TABLE . '
+			SET user_lastvisit = ' . (int) $row['session_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "'
+			WHERE user_id = " . (int) $user_id;
+		$db->sql_query($sql);
+
 		// Let's also clear any current sessions for the specified user_id
 		// If it's the current user then we'll leave this session intact
 		$sql_where = 'session_user_id = ' . (int) $user_id;
@@ -1384,6 +1399,8 @@
 	*/
 	function validate_referer($check_script_path = false)
 	{
+		global $config;
+
 		// no referer - nothing to validate, user's fault for turning it off (we only check on POST; so meta can't be the reason)
 		if (empty($this->referer) || empty($this->host))
 		{
@@ -1393,7 +1410,7 @@
 		$host = htmlspecialchars($this->host);
 		$ref = substr($this->referer, strpos($this->referer, '://') + 3);
 
-		if (!(stripos($ref, $host) === 0) && (!$config['force_server'] || !(stripos($ref, $config['server_name']) === 0)))
+		if (!(stripos($ref, $host) === 0) && (!$config['force_server_vars'] || !(stripos($ref, $config['server_name']) === 0)))
 		{
 			return false;
 		}
@@ -1451,8 +1468,8 @@
 	var $img_lang;
 	var $img_array = array();
 
-	// Able to add new option (id 7)
-	var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10);
+	// Able to add new options (up to id 31)
+	var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);
 	var $keyvalues = array();
 
 	/**
@@ -1554,7 +1571,7 @@
 		$this->add_lang($lang_set);
 		unset($lang_set);
 
-		if (!empty($_GET['style']) && $auth->acl_get('a_styles'))
+		if (!empty($_GET['style']) && $auth->acl_get('a_styles') && !defined('ADMIN_START'))
 		{
 			global $SID, $_EXTRA_URL;
 
@@ -1776,7 +1793,7 @@
 
 		// Disable board if the install/ directory is still present
 		// For the brave development army we do not care about this, else we need to comment out this everytime we develop locally
-		if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install'))
+		if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
 		{
 			// Adjust the message slightly according to the permissions
 			if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))
@@ -1853,7 +1870,7 @@
 
 		// Does the user need to change their password? If so, redirect to the
 		// ucp profile reg_details page ... of course do not redirect if we're already in the ucp
-		if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && $this->data['is_registered'] && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
+		if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && !empty($this->data['is_registered']) && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
 		{
 			if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != "ucp.$phpEx")
 			{
@@ -2026,6 +2043,34 @@
 				$language_filename = $this->lang_path . $this->lang_name . '/' . (($use_help) ? 'help_' : '') . $lang_file . '.' . $phpEx;
 			}
 
+			if (!file_exists($language_filename))
+			{
+				global $config;
+
+				if ($this->lang_name == 'en')
+				{
+					// The user's selected language is missing the file, the board default's language is missing the file, and the file doesn't exist in /en.
+					$language_filename = str_replace($this->lang_path . 'en', $this->lang_path . $this->data['user_lang'], $language_filename);
+					trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
+				}
+				else if ($this->lang_name == basename($config['default_lang']))
+				{
+					// Fall back to the English Language
+					$this->lang_name = 'en';
+					$this->set_lang($lang, $help, $lang_file, $use_db, $use_help);
+				}
+				else if ($this->lang_name == $this->data['user_lang'])
+				{
+					// Fall back to the board default language
+					$this->lang_name = basename($config['default_lang']);
+					$this->set_lang($lang, $help, $lang_file, $use_db, $use_help);
+				}
+
+				// Reset the lang name
+				$this->lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
+				return;
+			}
+
 			// Do not suppress error if in DEBUG_EXTRA mode
 			$include_result = (defined('DEBUG_EXTRA')) ? (include $language_filename) : (@include $language_filename);
 
@@ -2186,7 +2231,10 @@
 				return $img_data;
 			}
 
-			$img_data['src'] = $phpbb_root_path . 'styles/' . rawurlencode($this->theme['imageset_path']) . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename'];
+			// Use URL if told so
+			$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
+
+			$img_data['src'] = $root_path . 'styles/' . rawurlencode($this->theme['imageset_path']) . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename'];
 			$img_data['width'] = $this->img_array[$img]['image_width'];
 			$img_data['height'] = $this->img_array[$img]['image_height'];
 		}
@@ -2259,6 +2307,36 @@
 			return $var;
 		}
 	}
+
+	/**
+	* Funtion to make the user leave the NEWLY_REGISTERED system group.
+	* @access public
+	*/
+	function leave_newly_registered()
+	{
+		global $db;
+
+		if (empty($this->data['user_new']))
+		{
+			return false;
+		}
+
+		if (!function_exists('remove_newly_registered'))
+		{
+			global $phpbb_root_path, $phpEx;
+
+			include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+		}
+		if ($group = remove_newly_registered($this->data['user_id'], $this->data))
+		{
+			$this->data['group_id'] = $group;
+
+		}
+		$this->data['user_permissions'] = '';
+		$this->data['user_new'] = 0;
+
+		return true;
+	}
 }
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/template.php 3.0.6.src/includes/template.php
--- 3.0.5.src/includes/template.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/template.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: template.php 8943 2008-09-26 13:09:56Z acydburn $
+* @version $Id: template.php 10217 2009-10-09 11:12:37Z acydburn $
 * @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -39,6 +39,8 @@
 	var $files_inherit = array();
 	var $files_template = array();
 	var $inherit_root = '';
+	var $orig_tpl_storedb;
+	var $orig_tpl_inherits_id;
 
 	// this will hash handle names to the compiled/uncompiled code for that handle.
 	var $compiled_code = array();
@@ -55,7 +57,20 @@
 		{
 			$this->root = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template';
 			$this->cachepath = $phpbb_root_path . 'cache/tpl_' . str_replace('_', '-', $user->theme['template_path']) . '_';
-			
+
+			if ($this->orig_tpl_storedb === null)
+			{
+				$this->orig_tpl_storedb = $user->theme['template_storedb'];
+			}
+
+			if ($this->orig_tpl_inherits_id === null)
+			{
+				$this->orig_tpl_inherits_id = $user->theme['template_inherits_id'];
+			}
+
+			$user->theme['template_storedb'] = $this->orig_tpl_storedb;
+			$user->theme['template_inherits_id'] = $this->orig_tpl_inherits_id;
+
 			if ($user->theme['template_inherits_id'])
 			{
 				$this->inherit_root = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template';
@@ -75,13 +90,28 @@
 	* Set custom template location (able to use directory outside of phpBB)
 	* @access public
 	*/
-	function set_custom_template($template_path, $template_name)
+	function set_custom_template($template_path, $template_name, $template_mode = 'template')
 	{
-		global $phpbb_root_path;
+		global $phpbb_root_path, $user;
+
+		// Make sure $template_path has no ending slash
+		if (substr($template_path, -1) == '/')
+		{
+			$template_path = substr($template_path, 0, -1);
+		}
 
 		$this->root = $template_path;
 		$this->cachepath = $phpbb_root_path . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_';
 
+		// As the template-engine is used for more than the template (emails, etc.), we should not set $user->theme in all cases, but only on the real template.
+		if ($template_mode == 'template')
+		{
+			$user->theme['template_storedb'] = false;
+			$user->theme['template_inherits_id'] = false;
+		}
+
+		$this->_rootref = &$this->_tpldata['.'][0];
+
 		return true;
 	}
 
@@ -105,13 +135,13 @@
 
 			$this->filename[$handle] = $filename;
 			$this->files[$handle] = $this->root . '/' . $filename;
-			
+
 			if ($this->inherit_root)
 			{
 				$this->files_inherit[$handle] = $this->inherit_root . '/' . $filename;
 			}
 		}
-		
+
 		return true;
 	}
 
@@ -122,6 +152,7 @@
 	function destroy()
 	{
 		$this->_tpldata = array('.' => array(0 => array()));
+		$this->_rootref = &$this->_tpldata['.'][0];
 	}
 
 	/**
@@ -209,7 +240,7 @@
 
 		return true;
 	}
-	
+
 	/**
 	* Load a compiled template if possible, if not, recompile it
 	* @access private
@@ -218,9 +249,14 @@
 	{
 		global $user, $phpEx, $config;
 
+		if (!isset($this->filename[$handle]))
+		{
+			trigger_error("template->_tpl_load(): No file specified for handle $handle", E_USER_ERROR);
+		}
+
 		$filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . $phpEx;
-		$this->files_template[$handle] = $user->theme['template_id'];
-		
+		$this->files_template[$handle] = (isset($user->theme['template_id'])) ? $user->theme['template_id'] : 0;
+
 		$recompile = false;
 		if (!file_exists($filename) || @filesize($filename) === 0)
 		{
@@ -236,7 +272,7 @@
 			}
 			$recompile = (@filemtime($filename) < filemtime($this->files[$handle])) ? true : false;
 		}
-		
+
 		// Recompile page if the original template is newer, otherwise load the compiled version
 		if (!$recompile)
 		{
@@ -249,14 +285,14 @@
 		{
 			include($phpbb_root_path . 'includes/functions_template.' . $phpEx);
 		}
-		
+
 		// Inheritance - we point to another template file for this one. Equality is also used for store_db
 		if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'] && !file_exists($this->files[$handle]))
 		{
 			$this->files[$handle] = $this->files_inherit[$handle];
 			$this->files_template[$handle] = $user->theme['template_inherits_id'];
 		}
-		
+
 		$compile = new template_compile($this);
 
 		// If we don't have a file assigned to this handle, die.
@@ -282,7 +318,7 @@
 				$ids[] = $user->theme['template_inherits_id'];
 			}
 			$ids[] = $user->theme['template_id'];
-			
+
 			foreach ($ids as $id)
 			{
 				$sql = 'SELECT *
@@ -290,7 +326,7 @@
 				WHERE template_id = ' . $id . "
 					AND (template_filename = '" . $db->sql_escape($this->filename[$handle]) . "'
 						OR template_included " . $db->sql_like_expression($db->any_char . $this->filename[$handle] . ':' . $db->any_char) . ')';
-			
+
 				$result = $db->sql_query($sql);
 				while ($row = $db->sql_fetchrow($result))
 				{
@@ -298,7 +334,7 @@
 				}
 				$db->sql_freeresult($result);
 			}
-					
+
 			if (sizeof($rows))
 			{
 				foreach ($rows as $row)
@@ -326,7 +362,7 @@
 					{
 						$this->files_template[$row['template_filename']] = $user->theme['template_id'];
 					}
-					
+
 					if ($force_reload || $row['template_mtime'] < filemtime($file))
 					{
 						if ($row['template_filename'] == $this->filename[$handle])
@@ -468,7 +504,7 @@
 			{
 				unset($this->_tpldata[$blockname][($s_row_count - 1)]['S_LAST_ROW']);
 			}
-			
+
 			// Add a new iteration to this block with the variable assignments we were given.
 			$this->_tpldata[$blockname][] = $vararray;
 		}
@@ -511,7 +547,7 @@
 			// Nested blocks are not supported
 			return false;
 		}
-		
+
 		// Change key to zero (change first position) if false and to last position if true
 		if ($key === false || $key === true)
 		{
@@ -614,6 +650,25 @@
 			eval(' ?>' . $this->compiled_code[$handle] . '<?php ');
 		}
 	}
+
+	/**
+	* Include a php-file
+	* @access private
+	*/
+	function _php_include($filename)
+	{
+		global $phpbb_root_path;
+
+		$file = $phpbb_root_path . $filename;
+
+		if (!file_exists($file))
+		{
+			// trigger_error cannot be used here, as the output already started
+			echo 'template->_php_include(): File ' . htmlspecialchars($file) . ' does not exist or is empty';
+			return;
+		}
+		include($file);
+	}
 }
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_confirm.php 3.0.6.src/includes/ucp/ucp_confirm.php
--- 3.0.5.src/includes/ucp/ucp_confirm.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_confirm.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,8 +2,8 @@
 /**
 *
 * @package VC
-* @version $Id: ucp_confirm.php 8655 2008-06-13 19:39:01Z acydburn $
-* @copyright (c) 2005 phpBB Group
+* @version $Id: ucp_confirm.php 9524 2009-06-02 14:12:23Z Kellanved $
+* @copyright (c) 2005 2008 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
 */
@@ -37,42 +37,10 @@
 	{
 		global $db, $user, $phpbb_root_path, $config, $phpEx;
 
-		// Do we have an id? No, then just exit
-		$confirm_id = request_var('id', '');
-		$type = request_var('type', 0);
-
-		if (!$confirm_id || !$type)
-		{
-			exit;
-		}
-
-		// Try and grab code for this id and session
-		$sql = 'SELECT code, seed
-			FROM ' . CONFIRM_TABLE . "
-			WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
-				AND confirm_id = '" . $db->sql_escape($confirm_id) . "'
-				AND confirm_type = $type";
-		$result = $db->sql_query($sql);
-		$row = $db->sql_fetchrow($result);
-		$db->sql_freeresult($result);
-
-		// If we have a row then grab data else create a new id
-		if (!$row)
-		{
-			exit;
-		}
-
-		if ($config['captcha_gd'])
-		{
-			include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
-		}
-		else
-		{
-			include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
-		}
-
-		$captcha = new captcha();
-		$captcha->execute($row['code'], $row['seed']);
+		include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
+		$captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+		$captcha->init(request_var('type', 0));
+		$captcha->execute();
 
 		garbage_collection();
 		exit_handler();
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_groups.php 3.0.6.src/includes/ucp/ucp_groups.php
--- 3.0.5.src/includes/ucp/ucp_groups.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_groups.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp_groups.php 9396 2009-03-19 13:28:15Z Kellanved $
+* @version $Id: ucp_groups.php 10155 2009-09-17 07:52:35Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -41,7 +41,7 @@
 		switch ($mode)
 		{
 			case 'membership':
-		
+
 				$this->page_title = 'UCP_USERGROUPS_MEMBER';
 
 				if ($submit || isset($_POST['change_default']))
@@ -414,7 +414,7 @@
 				$this->page_title = 'UCP_USERGROUPS_MANAGE';
 				$action		= (isset($_POST['addusers'])) ? 'addusers' : request_var('action', '');
 				$group_id	= request_var('g', 0);
-				
+
 				include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
 
 				add_form_key('ucp_groups');
@@ -438,10 +438,10 @@
 					{
 						trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . $return_page, E_USER_WARNING);
 					}
-					
+
 					$group_name = $group_row['group_name'];
 					$group_type = $group_row['group_type'];
-					
+
 					$avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_root_path . 'adm/images/no_avatar.gif" alt="" />';
 
 					$template->assign_vars(array(
@@ -450,7 +450,7 @@
 						'GROUP_COLOUR'			=> (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
 						'GROUP_DESC_DISP'		=> generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),
 						'GROUP_TYPE'			=> $group_row['group_type'],
-						
+
 						'AVATAR'				=> $avatar_img,
 						'AVATAR_IMAGE'			=> $avatar_img,
 						'AVATAR_WIDTH'			=> (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '',
@@ -604,13 +604,26 @@
 								// Only set the rank, colour, etc. if it's changed or if we're adding a new
 								// group. This prevents existing group members being updated if no changes
 								// were made.
-						
+
 								$group_attributes = array();
-								$test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients');
-								foreach ($test_variables as $test)
+								$test_variables = array(
+									'rank'			=> 'int',
+									'colour'		=> 'string',
+									'avatar'		=> 'string',
+									'avatar_type'	=> 'int',
+									'avatar_width'	=> 'int',
+									'avatar_height'	=> 'int',
+									'receive_pm'	=> 'int',
+									'legend'		=> 'int',
+									'message_limit'	=> 'int',
+									'max_recipients'=> 'int',
+								);
+
+								foreach ($test_variables as $test => $type)
 								{
-									if ($action == 'add' || (isset($submit_ary[$test]) && $group_row['group_' . $test] != $submit_ary[$test]))
+									if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
 									{
+										settype($submit_ary[$test], $type);
 										$group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test];
 									}
 								}
@@ -675,29 +688,32 @@
 
 						$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
 
-						if ($config['allow_avatar_local'] && $display_gallery)
+						if ($config['allow_avatar'] && $config['allow_avatar_local'] && $display_gallery)
 						{
 							avatar_gallery($category, $avatar_select, 4);
 						}
-						
-						$avatars_enabled = ($can_upload || ($config['allow_avatar_local'] || $config['allow_avatar_remote'])) ? true : false;
+
+						$avatars_enabled = ($config['allow_avatar'] && (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;
 
 						$template->assign_vars(array(
 							'S_EDIT'			=> true,
 							'S_INCLUDE_SWATCH'	=> true,
-							'S_CAN_UPLOAD'		=> $can_upload,
-							'S_FORM_ENCTYPE'	=> ($can_upload) ? ' enctype="multipart/form-data"' : '',
+							'S_FORM_ENCTYPE'	=> ($config['allow_avatar'] && $can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) ? ' enctype="multipart/form-data"' : '',
 							'S_ERROR'			=> (sizeof($error)) ? true : false,
 							'S_SPECIAL_GROUP'	=> ($group_type == GROUP_SPECIAL) ? true : false,
 							'S_AVATARS_ENABLED'	=> $avatars_enabled,
-							'S_DISPLAY_GALLERY'	=> ($config['allow_avatar_local'] && !$display_gallery) ? true : false,
+							'S_DISPLAY_GALLERY'	=> ($config['allow_avatar'] && $config['allow_avatar_local'] && !$display_gallery) ? true : false,
 							'S_IN_GALLERY'		=> ($config['allow_avatar_local'] && $display_gallery) ? true : false,
 
+							'S_UPLOAD_AVATAR_FILE'	=> ($config['allow_avatar'] && $config['allow_avatar_upload'] && $can_upload) ? true : false,
+							'S_UPLOAD_AVATAR_URL'	=> ($config['allow_avatar'] && $config['allow_avatar_remote_upload'] && $can_upload) ? true : false,
+							'S_LINK_AVATAR'			=> ($config['allow_avatar'] && $config['allow_avatar_remote']) ? true : false,
+
 							'ERROR_MSG'				=> (sizeof($error)) ? implode('<br />', $error) : '',
 							'GROUP_RECEIVE_PM'		=> (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '',
 							'GROUP_MESSAGE_LIMIT'	=> (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
 							'GROUP_MAX_RECIPIENTS'	=> (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
-							
+
 							'GROUP_DESC'			=> $group_desc_data['text'],
 							'S_DESC_BBCODE_CHECKED'	=> $group_desc_data['allow_bbcode'],
 							'S_DESC_URLS_CHECKED'	=> $group_desc_data['allow_urls'],
@@ -839,6 +855,7 @@
 							'PAGINATION'		=> generate_pagination($this->u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start),
 
 							'U_ACTION'			=> $this->u_action . "&amp;g=$group_id",
+							'S_UCP_ACTION'		=> $this->u_action . "&amp;g=$group_id",
 							'U_FIND_USERNAME'	=> append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=ucp&amp;field=usernames'),
 						));
 
@@ -896,7 +913,7 @@
 							if (!sizeof($mark_ary))
 							{
 								$start = 0;
-				
+
 								do
 								{
 									$sql = 'SELECT user_id
@@ -948,6 +965,9 @@
 							);
 						}
 
+						// redirect to last screen
+						redirect($this->u_action . '&amp;action=list&amp;g=' . $group_id);
+
 					break;
 
 					case 'deleteusers':
@@ -994,6 +1014,9 @@
 							);
 						}
 
+						// redirect to last screen
+						redirect($this->u_action . '&amp;action=list&amp;g=' . $group_id);
+
 					break;
 
 					case 'addusers':
@@ -1027,7 +1050,7 @@
 						$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
 
 						$default = request_var('default', 0);
-						
+
 						if (confirm_box(true))
 						{
 							// Add user/s to group
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_pm_compose.php 3.0.6.src/includes/ucp/ucp_pm_compose.php
--- 3.0.5.src/includes/ucp/ucp_pm_compose.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_pm_compose.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp_pm_compose.php 9494 2009-04-28 16:16:24Z acydburn $
+* @version $Id: ucp_pm_compose.php 10251 2009-11-03 14:40:25Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -46,6 +46,9 @@
 	$draft_id		= request_var('d', 0);
 	$lastclick		= request_var('lastclick', 0);
 
+	// Reply to all triggered (quote/reply)
+	$reply_to_all	= request_var('reply_to_all', 0);
+
 	// Do NOT use request_var or specialchars here
 	$address_list	= isset($_REQUEST['address_list']) ? $_REQUEST['address_list'] : array();
 
@@ -85,6 +88,10 @@
 		redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'));
 	}
 
+	// Since viewtopic.php language entries are used in several modes,
+	// we include the language file here
+	$user->add_lang('viewtopic');
+
 	// Output PM_TO box if message composing
 	if ($action != 'edit')
 	{
@@ -310,13 +317,14 @@
 
 			if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !sizeof($address_list) && !$refresh && !$submit && !$preview)
 			{
-				if ($action == 'quotepost')
+				// Add the original author as the recipient if quoting a post or only replying and not having checked "reply to all"
+				if ($action == 'quotepost' || !$reply_to_all)
 				{
 					$address_list = array('u' => array($post['author_id'] => 'to'));
 				}
 				else
 				{
-					// We try to include every previously listed member from the TO Header
+					// We try to include every previously listed member from the TO Header - Reply to all
 					$address_list = rebuild_header(array('to' => $post['to_address']));
 
 					// Add the author (if he is already listed then this is no shame (it will be overwritten))
@@ -439,7 +447,7 @@
 	$max_recipients = (!$max_recipients) ? $config['pm_max_recipients'] : $max_recipients;
 
 	// If this is a quote/reply "to all"... we may increase the max_recpients to the number of original recipients
-	if (($action == 'reply' || $action == 'quote') && $max_recipients)
+	if (($action == 'reply' || $action == 'quote') && $max_recipients && $reply_to_all)
 	{
 		// We try to include every previously listed member from the TO Header
 		$list = rebuild_header(array('to' => $post['to_address']));
@@ -631,7 +639,7 @@
 	// Load Drafts
 	if ($load && $drafts)
 	{
-		load_drafts(0, 0, $id);
+		load_drafts(0, 0, $id, $action, $msg_id);
 	}
 
 	if ($submit || $preview || $refresh)
@@ -746,7 +754,6 @@
 	// Preview
 	if (!sizeof($error) && $preview)
 	{
-		$user->add_lang('viewtopic');
 		$preview_message = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false);
 
 		$preview_signature = $user->data['user_sig'];
@@ -804,7 +811,7 @@
 	}
 
 	// Decode text for message display
-	$bbcode_uid = (($action == 'quote' || $action == 'forward') && !$preview && !$refresh && !sizeof($error)) ? $bbcode_uid : $message_parser->bbcode_uid;
+	$bbcode_uid = (($action == 'quote' || $action == 'forward') && !$preview && !$refresh && (!sizeof($error) || (sizeof($error) && !$submit))) ? $bbcode_uid : $message_parser->bbcode_uid;
 
 	$message_parser->decode_message($bbcode_uid);
 
@@ -1141,8 +1148,14 @@
 
 		global $refresh, $submit, $preview;
 
-		$refresh = $preview = true;
+		$refresh = true;
 		$submit = false;
+
+		// Preview is only true if there was also a message entered
+		if (request_var('message', ''))
+		{
+			$preview = true;
+		}
 	}
 
 	// Add User/Group [TO]
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_pm_options.php 3.0.6.src/includes/ucp/ucp_pm_options.php
--- 3.0.5.src/includes/ucp/ucp_pm_options.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_pm_options.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp_pm_options.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: ucp_pm_options.php 9612 2009-06-18 10:44:38Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -109,6 +109,10 @@
 				$db->sql_query($sql);
 				$msg = $user->lang['FOLDER_ADDED'];
 			}
+			else
+			{
+				$msg = $user->lang['FOLDER_NAME_EMPTY'];
+			}
 		}
 		else
 		{
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_pm.php 3.0.6.src/includes/ucp/ucp_pm.php
--- 3.0.5.src/includes/ucp/ucp_pm.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_pm.php	2009-11-16 11:10:10.000000000 -0600
@@ -1,7 +1,7 @@
 <?php
 /**
 * @package ucp
-* @version $Id: ucp_pm.php 8521 2008-04-21 13:20:13Z acydburn $
+* @version $Id: ucp_pm.php 10204 2009-10-04 11:08:12Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -119,7 +119,14 @@
 
 				if (!$auth->acl_get('u_sendpm'))
 				{
-					trigger_error('NO_AUTH_SEND_MESSAGE');
+					// trigger_error('NO_AUTH_SEND_MESSAGE');
+					$template->assign_vars(array(
+						'S_NO_AUTH_SEND_MESSAGE'	=> true,
+						'S_COMPOSE_PM_VIEW'			=> true,
+					));
+
+					$tpl_file = 'ucp_pm_viewfolder';
+					break;
 				}
 
 				include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx);
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_pm_viewfolder.php 3.0.6.src/includes/ucp/ucp_pm_viewfolder.php
--- 3.0.5.src/includes/ucp/ucp_pm_viewfolder.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_pm_viewfolder.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp_pm_viewfolder.php 9454 2009-04-17 13:15:44Z acydburn $
+* @version $Id: ucp_pm_viewfolder.php 10204 2009-10-04 11:08:12Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -115,82 +115,9 @@
 			// Build Recipient List if in outbox/sentbox - max two additional queries
 			if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX)
 			{
-				$recipient_list = $address = array();
-
-				foreach ($folder_info['rowset'] as $message_id => $row)
-				{
-					$address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address']));
-					$_save = array('u', 'g');
-					foreach ($_save as $save)
-					{
-						if (isset($address[$message_id][$save]) && sizeof($address[$message_id][$save]))
-						{
-							foreach (array_keys($address[$message_id][$save]) as $ug_id)
-							{
-								$recipient_list[$save][$ug_id] = array('name' => $user->lang['NA'], 'colour' => '');
-							}
-						}
-					}
-				}
-
-				$_types = array('u', 'g');
-				foreach ($_types as $ug_type)
-				{
-					if (!empty($recipient_list[$ug_type]))
-					{
-						if ($ug_type == 'u')
-						{
-							$sql = 'SELECT user_id as id, username as name, user_colour as colour
-								FROM ' . USERS_TABLE . '
-								WHERE ';
-						}
-						else
-						{
-							$sql = 'SELECT group_id as id, group_name as name, group_colour as colour, group_type
-								FROM ' . GROUPS_TABLE . '
-								WHERE ';
-						}
-						$sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type])));
-
-						$result = $db->sql_query($sql);
-
-						while ($row = $db->sql_fetchrow($result))
-						{
-							if ($ug_type == 'g')
-							{
-								$row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name'];
-							}
-
-							$recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']);
-						}
-						$db->sql_freeresult($result);
-					}
-				}
-
-				foreach ($address as $message_id => $adr_ary)
-				{
-					foreach ($adr_ary as $type => $id_ary)
-					{
-						foreach ($id_ary as $ug_id => $_id)
-						{
-							if ($type == 'u')
-							{
-								$address_list[$message_id][] = get_username_string('full', $ug_id, $recipient_list[$type][$ug_id]['name'], $recipient_list[$type][$ug_id]['colour']);
-							}
-							else
-							{
-								$user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : '';
-								$link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $ug_id) . '"' . $user_colour . '>';
-								$address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '</a>' : '');
-							}
-						}
-					}
-				}
-				unset($recipient_list, $address);
+				$address_list = get_recipient_strings($folder_info['rowset']);
 			}
 
-			$data = array();
-
 			foreach ($folder_info['pm_list'] as $message_id)
 			{
 				$row = &$folder_info['rowset'][$message_id];
@@ -267,7 +194,8 @@
 		else
 		{
 			// Build Recipient List if in outbox/sentbox
-			$address = array();
+			$address = $data = array();
+
 			if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX)
 			{
 				foreach ($folder_info['rowset'] as $message_id => $row)
@@ -457,12 +385,12 @@
 	if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX)
 	{
 		$sort_by_text = array('t' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
-		$sort_by_sql = array('t' => 'p.msg_id', 's' => 'p.message_subject');
+		$sort_by_sql = array('t' => 'p.message_time', 's' => array('p.message_subject', 'p.message_time'));
 	}
 	else
 	{
 		$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
-		$sort_by_sql = array('a' => 'u.username_clean', 't' => 'p.msg_id', 's' => 'p.message_subject');
+		$sort_by_sql = array('a' => array('u.username_clean', 'p.message_time'), 't' => 'p.message_time', 's' => array('p.message_subject', 'p.message_time'));
 	}
 
 	$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
@@ -505,7 +433,7 @@
 
 		'POST_IMG'		=> (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'),
 
-		'L_NO_MESSAGES'	=> (!$auth->acl_get('u_sendpm')) ? $user->lang['POST_PM_LOCKED'] : $user->lang['NO_MESSAGES'],
+		'S_NO_AUTH_SEND_MESSAGE'	=> !$auth->acl_get('u_sendpm'),
 
 		'S_SELECT_SORT_DIR'		=> $s_sort_dir,
 		'S_SELECT_SORT_KEY'		=> $s_sort_key,
@@ -532,16 +460,26 @@
 		}
 
 		// Select the sort order
-		$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
+		$direction = ($sort_dir == 'd') ? 'ASC' : 'DESC';
 		$sql_start = max(0, $pm_count - $sql_limit - $start);
 	}
 	else
 	{
 		// Select the sort order
-		$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
+		$direction = ($sort_dir == 'd') ? 'DESC' : 'ASC';
 		$sql_start = $start;
 	}
 
+	// Sql sort order
+	if (is_array($sort_by_sql[$sort_key]))
+	{
+		$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
+	}
+	else
+	{
+		$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
+	}
+
 	$sql = 'SELECT t.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.username_clean, u.user_colour
 		FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u
 		WHERE t.user_id = $user_id
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_pm_viewmessage.php 3.0.6.src/includes/ucp/ucp_pm_viewmessage.php
--- 3.0.5.src/includes/ucp/ucp_pm_viewmessage.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_pm_viewmessage.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp_pm_viewmessage.php 9483 2009-04-24 20:52:00Z toonarmy $
+* @version $Id: ucp_pm_viewmessage.php 10126 2009-09-09 21:41:51Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -29,6 +29,7 @@
 	$msg_id		= (int) $msg_id;
 	$folder_id	= (int) $folder_id;
 	$author_id	= (int) $message_row['author_id'];
+	$view		= request_var('view', '');
 
 	// Not able to view message, it was deleted by the sender
 	if ($message_row['pm_deleted'])
@@ -168,6 +169,9 @@
 
 	$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
 
+	// Number of "to" recipients
+	$num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match);
+
 	$template->assign_vars(array(
 		'MESSAGE_AUTHOR_FULL'		=> get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
 		'MESSAGE_AUTHOR_COLOUR'		=> get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
@@ -178,7 +182,7 @@
 		'RANK_IMG'			=> $user_info['rank_image'],
 		'AUTHOR_AVATAR'		=> (isset($user_info['avatar'])) ? $user_info['avatar'] : '',
 		'AUTHOR_JOINED'		=> $user->format_date($user_info['user_regdate']),
-		'AUTHOR_POSTS'		=> (!empty($user_info['user_posts'])) ? $user_info['user_posts'] : '',
+		'AUTHOR_POSTS'		=> (int) $user_info['user_posts'],
 		'AUTHOR_FROM'		=> (!empty($user_info['user_from'])) ? $user_info['user_from'] : '',
 
 		'ONLINE_IMG'		=> (!$config['load_onlinetrack']) ? '' : ((isset($user_info['online']) && $user_info['online']) ? $user->img('icon_user_online', $user->lang['ONLINE']) : $user->img('icon_user_offline', $user->lang['OFFLINE'])),
@@ -189,10 +193,11 @@
 		'EMAIL_IMG'			=> $user->img('icon_contact_email', $user->lang['SEND_EMAIL']),
 		'QUOTE_IMG'			=> $user->img('icon_post_quote', $user->lang['POST_QUOTE_PM']),
 		'REPLY_IMG'			=> $user->img('button_pm_reply', $user->lang['POST_REPLY_PM']),
+		'REPORT_IMG'		=> $user->img('icon_post_report', 'REPORT_PM'),
 		'EDIT_IMG'			=> $user->img('icon_post_edit', $user->lang['POST_EDIT_PM']),
 		'MINI_POST_IMG'		=> $user->img('icon_post_target', $user->lang['PM']),
 
-		'SENT_DATE'			=> $user->format_date($message_row['message_time']),
+		'SENT_DATE'			=> ($view == 'print') ? $user->format_date($message_row['message_time'], false, true) : $user->format_date($message_row['message_time']),
 		'SUBJECT'			=> $message_row['message_subject'],
 		'MESSAGE'			=> $message,
 		'SIGNATURE'			=> ($message_row['enable_sig']) ? $signature : '',
@@ -209,16 +214,21 @@
 
 		'U_DELETE'			=> ($auth->acl_get('u_pm_delete')) ? "$url&amp;mode=compose&amp;action=delete&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
 		'U_EMAIL'			=> $user_info['email'],
+		'U_REPORT'			=> ($config['allow_pm_report']) ? append_sid("{$phpbb_root_path}report.$phpEx", "pm=" . $message_row['msg_id']) : '',
 		'U_QUOTE'			=> ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=quote&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
 		'U_EDIT'			=> (($message_row['message_time'] > time() - ($config['pm_edit_time'] * 60) || !$config['pm_edit_time']) && $folder_id == PRIVMSGS_OUTBOX && $auth->acl_get('u_pm_edit')) ? "$url&amp;mode=compose&amp;action=edit&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
 		'U_POST_REPLY_PM'	=> ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=reply&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
+		'U_POST_REPLY_ALL'	=> ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=reply&amp;f=$folder_id&amp;reply_to_all=1&amp;p=" . $message_row['msg_id'] : '',
 		'U_PREVIOUS_PM'		=> "$url&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] . "&amp;view=previous",
 		'U_NEXT_PM'			=> "$url&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] . "&amp;view=next",
 
+		'U_PM_ACTION'		=> $url . '&amp;mode=compose&amp;f=' . $folder_id . '&amp;p=' . $message_row['msg_id'],
+
 		'S_HAS_ATTACHMENTS'	=> (sizeof($attachments)) ? true : false,
 		'S_DISPLAY_NOTICE'	=> $display_notice && $message_row['message_attachment'],
 		'S_AUTHOR_DELETED'	=> ($author_id == ANONYMOUS) ? true : false,
 		'S_SPECIAL_FOLDER'	=> in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)),
+		'S_PM_RECIPIENTS'	=> $num_recipients,
 
 		'U_PRINT_PM'		=> ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] . "&amp;view=print" : '',
 		'U_FORWARD_PM'		=> ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&amp;mode=compose&amp;action=forward&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '')
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_prefs.php 3.0.6.src/includes/ucp/ucp_prefs.php
--- 3.0.5.src/includes/ucp/ucp_prefs.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_prefs.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp_prefs.php 8990 2008-10-09 15:41:19Z acydburn $
+* @version $Id: ucp_prefs.php 9734 2009-07-08 13:03:43Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -282,7 +282,7 @@
 					'S_AVATARS'			=> $data['avatars'],
 					'S_DISABLE_CENSORS'	=> $data['wordcensor'],
 
-					'S_CHANGE_CENSORS'		=> ($auth->acl_get('u_chgcensors')) ? true : false,
+					'S_CHANGE_CENSORS'		=> ($auth->acl_get('u_chgcensors') && $config['allow_nocensors']) ? true : false,
 
 					'S_TOPIC_SORT_DAYS'		=> $s_limit_topic_days,
 					'S_TOPIC_SORT_KEY'		=> $s_sort_topic_key,
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_profile.php 3.0.6.src/includes/ucp/ucp_profile.php
--- 3.0.5.src/includes/ucp/ucp_profile.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_profile.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp_profile.php 9389 2009-03-17 15:50:19Z acydburn $
+* @version $Id: ucp_profile.php 10060 2009-08-28 09:26:43Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -110,7 +110,7 @@
 							'username'			=> ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $data['username'] : $user->data['username'],
 							'username_clean'	=> ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? utf8_clean_string($data['username']) : $user->data['username_clean'],
 							'user_email'		=> ($auth->acl_get('u_chgemail')) ? $data['email'] : $user->data['user_email'],
-							'user_email_hash'	=> ($auth->acl_get('u_chgemail')) ? crc32($data['email']) . strlen($data['email']) : $user->data['user_email_hash'],
+							'user_email_hash'	=> ($auth->acl_get('u_chgemail')) ? phpbb_email_hash($data['email']) : $user->data['user_email_hash'],
 							'user_password'		=> ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? phpbb_hash($data['new_password']) : $user->data['user_password'],
 							'user_passchg'		=> ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? time() : 0,
 						);
@@ -380,25 +380,7 @@
 						$db->sql_query($sql);
 
 						// Update Custom Fields
-						if (sizeof($cp_data))
-						{
-							$sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
-								SET ' . $db->sql_build_array('UPDATE', $cp_data) . '
-								WHERE user_id = ' . $user->data['user_id'];
-							$db->sql_query($sql);
-
-							if (!$db->sql_affectedrows())
-							{
-								$cp_data['user_id'] = (int) $user->data['user_id'];
-
-								$db->sql_return_on_error(true);
-
-								$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data);
-								$db->sql_query($sql);
-
-								$db->sql_return_on_error(false);
-							}
-						}
+						$cp->update_profile_field_data($user->data['user_id'], $cp_data);
 
 						meta_refresh(3, $this->u_action);
 						$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
@@ -474,9 +456,9 @@
 				include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
 				include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
 
-				$enable_bbcode	= ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', !$user->optionget('bbcode'))) ? false : true) : false;
-				$enable_smilies	= ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', !$user->optionget('smilies'))) ? false : true) : false;
-				$enable_urls	= ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
+				$enable_bbcode	= ($config['allow_sig_bbcode']) ? (bool) $user->optionget('sig_bbcode') : false;
+				$enable_smilies	= ($config['allow_sig_smilies']) ? (bool) $user->optionget('sig_smilies') : false;
+				$enable_urls	= ($config['allow_sig_links']) ? (bool) $user->optionget('sig_links') : false;
 
 				$signature		= utf8_normalize_nfc(request_var('signature', (string) $user->data['user_sig'], true));
 
@@ -486,6 +468,10 @@
 				{
 					include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
 
+					$enable_bbcode	= ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', false)) ? false : true) : false;
+					$enable_smilies	= ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', false)) ? false : true) : false;
+					$enable_urls	= ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
+
 					if (!sizeof($error))
 					{
 						$message_parser = new parse_message($signature);
@@ -505,8 +491,13 @@
 
 						if (!sizeof($error) && $submit)
 						{
+							$user->optionset('sig_bbcode', $enable_bbcode);
+							$user->optionset('sig_smilies', $enable_smilies);
+							$user->optionset('sig_links', $enable_urls);
+
 							$sql_ary = array(
 								'user_sig'					=> (string) $message_parser->message,
+								'user_options'				=> $user->data['user_options'],
 								'user_sig_bbcode_uid'		=> (string) $message_parser->bbcode_uid,
 								'user_sig_bbcode_bitfield'	=> $message_parser->bbcode_bitfield
 							);
@@ -573,7 +564,7 @@
 				$avatar_select = basename(request_var('avatar_select', ''));
 				$category = basename(request_var('category', ''));
 
-				$can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+				$can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
 
 				add_form_key('ucp_avatar');
 
@@ -596,33 +587,44 @@
 					$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
 				}
 
+				if (!$config['allow_avatar'] && $user->data['user_avatar_type'])
+				{
+					$error[] = $user->lang['AVATAR_NOT_ALLOWED'];
+				}
+				else if ((($user->data['user_avatar_type'] == AVATAR_UPLOAD) && !$config['allow_avatar_upload']) ||
+				 (($user->data['user_avatar_type'] == AVATAR_REMOTE) && !$config['allow_avatar_remote']) ||
+				 (($user->data['user_avatar_type'] == AVATAR_GALLERY) && !$config['allow_avatar_local']))
+				{
+					$error[] = $user->lang['AVATAR_TYPE_NOT_ALLOWED'];
+				}
+
 				$template->assign_vars(array(
 					'ERROR'			=> (sizeof($error)) ? implode('<br />', $error) : '',
-					'AVATAR'		=> get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
+					'AVATAR'		=> get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height'], 'USER_AVATAR', true),
 					'AVATAR_SIZE'	=> $config['avatar_filesize'],
 
 					'U_GALLERY'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=avatar&amp;display_gallery=1'),
 
-					'S_FORM_ENCTYPE'	=> ($can_upload) ? ' enctype="multipart/form-data"' : '',
+					'S_FORM_ENCTYPE'	=> ($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) ? ' enctype="multipart/form-data"' : '',
 
 					'L_AVATAR_EXPLAIN'	=> sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),
 				));
 
-				if ($display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'])
+				if ($config['allow_avatar'] && $display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'])
 				{
 					avatar_gallery($category, $avatar_select, 4);
 				}
-				else
+				else if ($config['allow_avatar'])
 				{
-					$avatars_enabled = ($can_upload || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;
+					$avatars_enabled = (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;
 
 					$template->assign_vars(array(
 						'AVATAR_WIDTH'	=> request_var('width', $user->data['user_avatar_width']),
 						'AVATAR_HEIGHT'	=> request_var('height', $user->data['user_avatar_height']),
 
 						'S_AVATARS_ENABLED'		=> $avatars_enabled,
-						'S_UPLOAD_AVATAR_FILE'	=> $can_upload,
-						'S_UPLOAD_AVATAR_URL'	=> $can_upload,
+						'S_UPLOAD_AVATAR_FILE'	=> ($can_upload && $config['allow_avatar_upload']) ? true : false,
+						'S_UPLOAD_AVATAR_URL'	=> ($can_upload && $config['allow_avatar_remote_upload']) ? true : false,
 						'S_LINK_AVATAR'			=> ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false,
 						'S_DISPLAY_GALLERY'		=> ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false)
 					);
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_register.php 3.0.6.src/includes/ucp/ucp_register.php
--- 3.0.5.src/includes/ucp/ucp_register.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_register.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp_register.php 9511 2009-05-08 11:48:51Z Kellanved $
+* @version $Id: ucp_register.php 10095 2009-09-03 20:06:57Z Kellanved $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -37,13 +37,11 @@
 
 		include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
 
-		$confirm_id			= request_var('confirm_id', '');
-		$confirm_refresh	= (isset($_POST['confirm_refresh']) && $config['confirm_refresh']) ? ((!empty($_POST['confirm_refresh'])) ? 1 : 0) : false;
-		$coppa				= (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
-		$agreed				= (!empty($_POST['agreed'])) ? 1 : 0;
-		$submit				= (isset($_POST['submit'])) ? true : false;
-		$change_lang		= request_var('change_lang', '');
-		$user_lang			= request_var('lang', $user->lang_name);
+		$coppa			= (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
+		$agreed			= (!empty($_POST['agreed'])) ? 1 : 0;
+		$submit			= (isset($_POST['submit'])) ? true : false;
+		$change_lang	= request_var('change_lang', '');
+		$user_lang		= request_var('lang', $user->lang_name);
 
 		if ($agreed)
 		{
@@ -54,7 +52,6 @@
 			add_form_key('ucp_register_terms');
 		}
 
-
 		if ($change_lang || $user_lang != $config['default_lang'])
 		{
 			$use_lang = ($change_lang) ? basename($change_lang) : basename($user_lang);
@@ -69,8 +66,9 @@
 					$agreed = (empty($_GET['change_lang'])) ? 0 : $agreed;
 				}
 
-				$user->lang_name = $lang = $use_lang;
+				$user->lang_name = $user_lang = $use_lang;
 				$user->lang = array();
+				$user->data['user_lang'] = $user->lang_name;
 				$user->add_lang(array('common', 'ucp'));
 			}
 			else
@@ -80,17 +78,19 @@
 			}
 		}
 
+
 		$cp = new custom_profile();
 
 		$error = $cp_data = $cp_error = array();
 
-
 		if (!$agreed || ($coppa === false && $config['coppa_enable']) || ($coppa && !$config['coppa_enable']))
 		{
 			$add_lang = ($change_lang) ? '&amp;change_lang=' . urlencode($change_lang) : '';
 			$add_coppa = ($coppa !== false) ? '&amp;coppa=' . $coppa : '';
 
-			$s_hidden_fields = ($confirm_id) ? array('confirm_id' => $confirm_id) : array();
+			$s_hidden_fields = array(
+				'change_lang'	=> $change_lang,
+			);
 
 			// If we change the language, we want to pass on some more possible parameter.
 			if ($change_lang)
@@ -100,12 +100,23 @@
 					'username'			=> utf8_normalize_nfc(request_var('username', '', true)),
 					'email'				=> strtolower(request_var('email', '')),
 					'email_confirm'		=> strtolower(request_var('email_confirm', '')),
-					'confirm_code'		=> request_var('confirm_code', ''),
-					'confirm_id'		=> request_var('confirm_id', ''),
 					'lang'				=> $user->lang_name,
 					'tz'				=> request_var('tz', (float) $config['board_timezone']),
 				));
+
+			}
+
+			// Checking amount of available languages
+			$sql = 'SELECT lang_id
+				FROM ' . LANG_TABLE;
+			$result = $db->sql_query($sql);
+
+			$lang_row = array();
+			while ($row = $db->sql_fetchrow($result))
+			{
+				$lang_row[] = $row;
 			}
+			$db->sql_freeresult($result);
 
 			if ($coppa === false && $config['coppa_enable'])
 			{
@@ -114,6 +125,7 @@
 				unset($now);
 
 				$template->assign_vars(array(
+					'S_LANG_OPTIONS'	=> (sizeof($lang_row) > 1) ? language_select($user_lang) : '',
 					'L_COPPA_NO'		=> sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday),
 					'L_COPPA_YES'		=> sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday),
 
@@ -128,6 +140,7 @@
 			else
 			{
 				$template->assign_vars(array(
+					'S_LANG_OPTIONS'	=> (sizeof($lang_row) > 1) ? language_select($user_lang) : '',
 					'L_TERMS_OF_USE'	=> sprintf($user->lang['TERMS_OF_USE_CONTENT'], $config['sitename'], generate_board_url()),
 
 					'S_SHOW_COPPA'		=> false,
@@ -137,11 +150,20 @@
 					)
 				);
 			}
+			unset($lang_row);
 
 			$this->tpl_name = 'ucp_agreement';
 			return;
 		}
-
+		
+		
+		// The CAPTCHA kicks in here. We can't help that the information gets lost on language change. 
+		if ($config['enable_confirm'])
+		{
+			include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
+			$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+			$captcha->init(CONFIRM_REG);
+		}
 
 		// Try to manually determine the timezone and adjust the dst if the server date/time complies with the default setting +/- 1
 		$timezone = date('Z') / 3600;
@@ -168,7 +190,6 @@
 			'password_confirm'	=> request_var('password_confirm', '', true),
 			'email'				=> strtolower(request_var('email', '')),
 			'email_confirm'		=> strtolower(request_var('email_confirm', '')),
-			'confirm_code'		=> request_var('confirm_code', ''),
 			'lang'				=> basename(request_var('lang', $user->lang_name)),
 			'tz'				=> request_var('tz', (float) $timezone),
 		);
@@ -188,17 +209,32 @@
 					array('string', false, 6, 60),
 					array('email')),
 				'email_confirm'		=> array('string', false, 6, 60),
-				'confirm_code'		=> array('string', !$config['enable_confirm'], CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS),
 				'tz'				=> array('num', false, -14, 14),
 				'lang'				=> array('match', false, '#^[a-z_\-]{2,}$#i'),
 			));
+
 			if (!check_form_key('ucp_register'))
 			{
 				$error[] = $user->lang['FORM_INVALID'];
 			}
+
 			// Replace "error" strings with their real, localised form
 			$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
 
+			if ($config['enable_confirm'])
+			{
+				$vc_response = $captcha->validate($data);
+				if ($vc_response !== false)
+				{
+					$error[] = $vc_response;
+				}
+
+				if ($config['max_reg_attempts'] && $captcha->get_attempt_count() > $config['max_reg_attempts'])
+				{
+					$error[] = $user->lang['TOO_MANY_REGISTERS'];
+				}
+			}
+
 			// DNSBL check
 			if ($config['check_dnsbl'])
 			{
@@ -211,50 +247,6 @@
 			// validate custom profile fields
 			$cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error);
 
-			// Visual Confirmation handling
-			$wrong_confirm = false;
-			if ($config['enable_confirm'])
-			{
-				if (!$confirm_id)
-				{
-					$error[] = $user->lang['CONFIRM_CODE_WRONG'];
-					$wrong_confirm = true;
-				}
-				else
-				{
-					$sql = 'SELECT code
-						FROM ' . CONFIRM_TABLE . "
-						WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
-							AND session_id = '" . $db->sql_escape($user->session_id) . "'
-							AND confirm_type = " . CONFIRM_REG;
-					$result = $db->sql_query($sql);
-					$row = $db->sql_fetchrow($result);
-					$db->sql_freeresult($result);
-
-					if ($row)
-					{
-						if (strcasecmp($row['code'], $data['confirm_code']) === 0)
-						{
-							$sql = 'DELETE FROM ' . CONFIRM_TABLE . "
-								WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
-									AND session_id = '" . $db->sql_escape($user->session_id) . "'
-									AND confirm_type = " . CONFIRM_REG;
-							$db->sql_query($sql);
-						}
-						else
-						{
-							$error[] = $user->lang['CONFIRM_CODE_WRONG'];
-							$wrong_confirm = true;
-						}
-					}
-					else
-					{
-						$error[] = $user->lang['CONFIRM_CODE_WRONG'];
-						$wrong_confirm = true;
-					}
-				}
-			}
-
 			if (!sizeof($error))
 			{
 				if ($data['new_password'] != $data['password_confirm'])
@@ -327,6 +319,11 @@
 					'user_inactive_time'	=> $user_inactive_time,
 				);
 
+				if ($config['new_member_post_limit'])
+				{
+					$user_row['user_new'] = 1;
+				}
+
 				// Register user...
 				$user_id = user_add($user_row, $cp_data);
 
@@ -441,85 +438,20 @@
 		{
 			$s_hidden_fields['coppa'] = $coppa;
 		}
-		$s_hidden_fields = build_hidden_fields($s_hidden_fields);
 
+		if ($config['enable_confirm'])
+		{
+			$s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields());
+		}
+		$s_hidden_fields = build_hidden_fields($s_hidden_fields);
 		$confirm_image = '';
 
 		// Visual Confirmation - Show images
-
 		if ($config['enable_confirm'])
 		{
-			if ($change_lang || $confirm_refresh)
-			{
-				$str = '&amp;change_lang=' . $change_lang;
-				$sql = 'SELECT code
-						FROM ' . CONFIRM_TABLE . "
-						WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
-							AND session_id = '" . $db->sql_escape($user->session_id) . "'
-							AND confirm_type = " . CONFIRM_REG;
-				$result = $db->sql_query($sql);
-				if (!$row = $db->sql_fetchrow($result))
-				{
-					$confirm_id = '';
-				}
-				$db->sql_freeresult($result);
-			}
-			else
-			{
-				$str = '';
-			}
-			if (!$change_lang || !$confirm_id || !$confirm_refresh)
-			{
-				$user->confirm_gc(CONFIRM_REG);
-
-				$sql = 'SELECT COUNT(session_id) AS attempts
-					FROM ' . CONFIRM_TABLE . "
-					WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
-						AND confirm_type = " . CONFIRM_REG;
-				$result = $db->sql_query($sql);
-				$attempts = (int) $db->sql_fetchfield('attempts');
-				$db->sql_freeresult($result);
-
-				if ($config['max_reg_attempts'] && $attempts > $config['max_reg_attempts'])
-				{
-					trigger_error('TOO_MANY_REGISTERS');
-				}
-
-				$code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
-				$confirm_id = md5(unique_id($user->ip));
-				$seed = hexdec(substr(unique_id(), 4, 10));
-
-				// compute $seed % 0x7fffffff
-				$seed -= 0x7fffffff * floor($seed / 0x7fffffff);
-
-				$sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
-					'confirm_id'	=> (string) $confirm_id,
-					'session_id'	=> (string) $user->session_id,
-					'confirm_type'	=> (int) CONFIRM_REG,
-					'code'			=> (string) $code,
-					'seed'			=> (int) $seed)
-				);
-				$db->sql_query($sql);
-			}
-			else if ($confirm_refresh)
-			{
-				$code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
-				$confirm_id = md5(unique_id($user->ip));
-				$seed = hexdec(substr(unique_id(), 4, 10));
-					// compute $seed % 0x7fffffff
-				$seed -= 0x7fffffff * floor($seed / 0x7fffffff);
-				$sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
-					'confirm_type'	=> (int) CONFIRM_REG,
-					'code'			=> (string) $code,
-					'seed'			=> (int) $seed)) . "
-					WHERE
-					confirm_id = '" . $db->sql_escape($confirm_id) . "' AND
-					session_id = '" . $db->sql_escape($session_id) . "' AND
-					confirm_type = " . (int) CONFIRM_REG;
-				$db->sql_query($sql);
-			}
-			$confirm_image = '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_REG . $str) . '" alt="" title="" />';
-			$s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />';
+			$template->assign_vars(array(
+				'CAPTCHA_TEMPLATE'		=> $captcha->get_template(),
+			));
 		}
 
 		//
@@ -542,22 +474,19 @@
 			'PASSWORD_CONFIRM'	=> $data['password_confirm'],
 			'EMAIL'				=> $data['email'],
 			'EMAIL_CONFIRM'		=> $data['email_confirm'],
-			'CONFIRM_IMG'		=> $confirm_image,
 
-			'L_CONFIRM_EXPLAIN'			=> sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
 			'L_REG_COND'				=> $l_reg_cond,
 			'L_USERNAME_EXPLAIN'		=> sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
 			'L_PASSWORD_EXPLAIN'		=> sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
 
 			'S_LANG_OPTIONS'	=> language_select($data['lang']),
 			'S_TZ_OPTIONS'		=> tz_select($data['tz']),
-			'S_CONFIRM_CODE'	=> ($config['enable_confirm']) ? true : false,
 			'S_CONFIRM_REFRESH'	=> ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false,
+			'S_REGISTRATION'	=> true,
 			'S_COPPA'			=> $coppa,
 			'S_HIDDEN_FIELDS'	=> $s_hidden_fields,
 			'S_UCP_ACTION'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
-			)
-		);
+		));
 
 		//
 		$user->profile_fields = array();
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_remind.php 3.0.6.src/includes/ucp/ucp_remind.php
--- 3.0.5.src/includes/ucp/ucp_remind.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_remind.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp_remind.php 8977 2008-10-06 14:04:33Z acydburn $
+* @version $Id: ucp_remind.php 10060 2009-08-28 09:26:43Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -38,7 +38,7 @@
 		{
 			$sql = 'SELECT user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason
 				FROM ' . USERS_TABLE . "
-				WHERE user_email = '" . $db->sql_escape($email) . "'
+				WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'
 					AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
 			$result = $db->sql_query($sql);
 			$user_row = $db->sql_fetchrow($result);
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_resend.php 3.0.6.src/includes/ucp/ucp_resend.php
--- 3.0.5.src/includes/ucp/ucp_resend.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_resend.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp_resend.php 9339 2009-02-23 17:53:24Z toonarmy $
+* @version $Id: ucp_resend.php 10060 2009-08-28 09:26:43Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -45,7 +45,7 @@
 
 			$sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey, user_inactive_reason
 				FROM ' . USERS_TABLE . "
-				WHERE user_email = '" . $db->sql_escape($email) . "'
+				WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'
 					AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
 			$result = $db->sql_query($sql);
 			$user_row = $db->sql_fetchrow($result);
diff -x .svn -aruN 3.0.5.src/includes/ucp/ucp_zebra.php 3.0.6.src/includes/ucp/ucp_zebra.php
--- 3.0.5.src/includes/ucp/ucp_zebra.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/ucp/ucp_zebra.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp_zebra.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: ucp_zebra.php 9597 2009-06-16 14:06:56Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -52,6 +52,18 @@
 			{
 				if (confirm_box(true))
 				{
+					// Remove users
+					if (!empty($data['usernames']))
+					{
+						$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
+							WHERE user_id = ' . $user->data['user_id'] . '
+								AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
+						$db->sql_query($sql);
+
+						$updated = true;
+					}
+
+					// Add users
 					if ($data['add'])
 					{
 						$data['add'] = array_map('trim', array_map('utf8_clean_string', explode("\n", $data['add'])));
@@ -124,6 +136,10 @@
 								{
 									$user_id_ary[] = $row['user_id'];
 								}
+								else if ($row['user_id'] != ANONYMOUS)
+								{
+									$error[] = $user->lang['NOT_ADDED_' . $l_mode . '_BOTS'];
+								}
 								else
 								{
 									$error[] = $user->lang['NOT_ADDED_' . $l_mode . '_ANONYMOUS'];
@@ -183,18 +199,6 @@
 							}
 						}
 					}
-					else if (sizeof($data['usernames']))
-					{
-						// Force integer values
-						$data['usernames'] = array_map('intval', $data['usernames']);
-
-						$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
-							WHERE user_id = ' . $user->data['user_id'] . '
-								AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
-						$db->sql_query($sql);
-
-						$updated = true;
-					}
 
 					if ($updated)
 					{
diff -x .svn -aruN 3.0.5.src/includes/utf/utf_tools.php 3.0.6.src/includes/utf/utf_tools.php
--- 3.0.5.src/includes/utf/utf_tools.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/includes/utf/utf_tools.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package utf
-* @version $Id: utf_tools.php 8510 2008-04-20 05:16:42Z davidmj $
+* @version $Id: utf_tools.php 10041 2009-08-21 21:47:19Z terrafrost $
 * @copyright (c) 2006 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -70,7 +70,7 @@
 		$pos = 0;
 		$len = strlen($str);
 		$ret = '';
-	
+
 		while ($pos < $len)
 		{
 			$ord = ord($str[$pos]) & 0xF0;
@@ -252,7 +252,7 @@
 		if (is_null($offset))
 		{
 			$ar	= explode($needle, $str);
-			
+
 			if (sizeof($ar) > 1)
 			{
 				// Pop off the end of the string where the last	match was made
@@ -527,7 +527,7 @@
 			$op = '^(?:' . $op . '.{' . $oy . '})';
 		}
 		else
-		{	
+		{
 			// offset == 0; just anchor the pattern
 			$op = '^';
 		}
@@ -560,7 +560,7 @@
 
 				$lx = (int) ($length / 65535);
 				$ly = $length % 65535;
-				
+
 				// negative length requires a captured group
 				// of length characters
 				if ($lx)
@@ -632,7 +632,7 @@
 	{
 		return array($str);
 	}
-	
+
 	preg_match_all('/.{' . $split_len . '}|[^\x00]{1,' . $split_len . '}$/us', $str, $ar);
 	return $ar[0];
 }
@@ -1917,4 +1917,79 @@
 	return implode($break, $new_lines);
 }
 
+/**
+* UTF8-safe basename() function
+*
+* basename() has some limitations and is dependent on the locale setting
+* according to the PHP manual. Therefore we provide our own locale independant
+* basename function.
+*
+* @param string $filename The filename basename() should be applied to
+* @return string The basenamed filename
+*/
+function utf8_basename($filename)
+{
+	// We always check for forward slash AND backward slash
+	// because they could be mixed or "sneaked" in. ;)
+	// You know, never trust user input...
+	if (strpos($filename, '/') !== false)
+	{
+		$filename = utf8_substr($filename, utf8_strrpos($filename, '/') + 1);
+	}
+
+	if (strpos($filename, '\\') !== false)
+	{
+		$filename = utf8_substr($filename, utf8_strrpos($filename, '\\') + 1);
+	}
+
+	return $filename;
+}
+
+/**
+* UTF8-safe str_replace() function
+*
+* @param string $search The value to search for
+* @param string $replace The replacement string
+* @param string $subject The target string
+* @return string The resultant string
+*/
+function utf8_str_replace($search, $replace, $subject)
+{
+	if (!is_array($search))
+	{
+		$search = array($search);
+		if (is_array($replace))
+		{
+			$replace = (string) $replace;
+			trigger_error('Array to string conversion', E_USER_NOTICE);
+		}
+	}
+
+	$length = sizeof($search);
+
+	if (!is_array($replace))
+	{
+		$replace = array_fill(0, $length, $replace);
+	}
+	else
+	{
+		$replace = array_pad($replace, $length, '');
+	}
+
+	for ($i = 0; $i < $length; $i++)
+	{
+		$search_length = utf8_strlen($search[$i]);
+		$replace_length = utf8_strlen($replace[$i]);
+
+		$offset = 0;
+		while (($start = utf8_strpos($subject, $search[$i], $offset)) !== false)
+		{
+			$subject = utf8_substr($subject, 0, $start) . $replace[$i] . utf8_substr($subject, $start + $search_length);
+			$offset = $start + $replace_length;
+		}
+	}
+
+	return $subject;
+}
+
 ?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/index.php 3.0.6.src/index.php
--- 3.0.5.src/index.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/index.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: index.php 8987 2008-10-09 14:17:02Z acydburn $
+* @version $Id: index.php 9614 2009-06-18 11:04:54Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -84,10 +84,13 @@
 if ($config['load_birthdays'] && $config['allow_birthdays'])
 {
 	$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
-	$sql = 'SELECT user_id, username, user_colour, user_birthday
-		FROM ' . USERS_TABLE . "
-		WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
-			AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+	$sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday
+		FROM ' . USERS_TABLE . ' u
+		LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid)
+		WHERE (b.ban_id IS NULL
+			OR b.ban_exclude = 1)
+			AND u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
+			AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
 	$result = $db->sql_query($sql);
 
 	while ($row = $db->sql_fetchrow($result))
diff -x .svn -aruN 3.0.5.src/language/en/acp/ban.php 3.0.6.src/language/en/acp/ban.php
--- 3.0.5.src/language/en/acp/ban.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/acp/ban.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_ban [English]
 *
 * @package language
-* @version $Id: ban.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: ban.php 9727 2009-07-07 13:33:53Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -48,6 +48,8 @@
 	'BAN_REASON'			=> 'Reason for ban',
 	'BAN_GIVE_REASON'		=> 'Reason shown to the banned',
 	'BAN_UPDATE_SUCCESSFUL'	=> 'The banlist has been updated successfully.',
+	'BANNED_UNTIL_DATE'		=> 'until %s', // Example: "until Mon 13.Jul.2009, 14:44"
+	'BANNED_UNTIL_DURATION'	=> '%1$s (until %2$s)', // Example: "7 days (until Tue 14.Jul.2009, 14:44)"
 
 	'EMAIL_BAN'					=> 'Ban one or more e-mail addresses',
 	'EMAIL_BAN_EXCLUDE_EXPLAIN'	=> 'Enable this to exclude the entered e-mail address from all current bans.',
@@ -67,7 +69,7 @@
 	'LENGTH_BAN_INVALID'		=> 'The date has to be formatted <kbd>YYYY-MM-DD</kbd>.',
 
 	'PERMANENT'		=> 'Permanent',
-	
+
 	'UNTIL'						=> 'Until',
 	'USER_BAN'					=> 'Ban one or more usernames',
 	'USER_BAN_EXCLUDE_EXPLAIN'	=> 'Enable this to exclude the entered users from all current bans.',
@@ -75,8 +77,6 @@
 	'USER_NO_BANNED'			=> 'No banned usernames',
 	'USER_UNBAN'				=> 'Un-ban or un-exclude usernames',
 	'USER_UNBAN_EXPLAIN'		=> 'You can unban (or un-exclude) multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded users are emphasised.',
-	
-
 ));
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/language/en/acp/board.php 3.0.6.src/language/en/acp/board.php
--- 3.0.5.src/language/en/acp/board.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/acp/board.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_board [English]
 *
 * @package language
-* @version $Id: board.php 9497 2009-04-29 16:00:59Z acydburn $
+* @version $Id: board.php 10080 2009-08-31 14:57:04Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -70,6 +70,10 @@
 	'ALLOW_NO_CENSORS'			=> 'Allow disabling of word censoring',
 	'ALLOW_NO_CENSORS_EXPLAIN'	=> 'Users can choose to disable the automatic word censoring of posts and private messages.',
 	'ALLOW_PM_ATTACHMENTS'		=> 'Allow attachments in private messages',
+	'ALLOW_PM_REPORT'			=> 'Allow users to report private messages',
+	'ALLOW_PM_REPORT_EXPLAIN'	=> 'If this setting is enabled, users have the option of reporting a private message they have received or sent to the board’s moderators. These private messages will then be visible in the Moderator Control Panel.',
+	'ALLOW_QUICK_REPLY'			=> 'Allow quick reply',
+	'ALLOW_QUICK_REPLY_EXPLAIN'	=> 'This setting defines if quick reply is enabled or not. If this setting is enabled, forums need to have their quick reply option enabled too.',
 	'ALLOW_SIG'					=> 'Allow signatures',
 	'ALLOW_SIG_BBCODE'			=> 'Allow BBCode in user signatures',
 	'ALLOW_SIG_FLASH'			=> 'Allow use of <code>[FLASH]</code> BBCode tag in user signatures',
@@ -87,9 +91,13 @@
 $lang = array_merge($lang, array(
 	'ACP_AVATAR_SETTINGS_EXPLAIN'	=> 'Avatars are generally small, unique images a user can associate with themselves. Depending on the style they are usually displayed below the username when viewing topics. Here you can determine how users can define their avatars. Please note that in order to upload avatars you need to have created the directory you name below and ensure it can be written to by the web server. Please also note that file size limits are only imposed on uploaded avatars, they do not apply to remotely linked images.',
 
+	'ALLOW_AVATARS'					=> 'Enable avatars',
+	'ALLOW_AVATARS_EXPLAIN'			=> 'Allow general usage of avatars;<br />If you disable avatars in general or avatars of a certain mode, the disabled avatars will no longer be shown on the board, but users will still be able to download their own avatars in the User Control Panel.',
 	'ALLOW_LOCAL'					=> 'Enable gallery avatars',
 	'ALLOW_REMOTE'					=> 'Enable remote avatars',
 	'ALLOW_REMOTE_EXPLAIN'			=> 'Avatars linked to from another website.',
+	'ALLOW_REMOTE_UPLOAD'			=> 'Enable remote avatar uploading',
+	'ALLOW_REMOTE_UPLOAD_EXPLAIN'	=> 'Allow uploading of avatars from another website.',
 	'ALLOW_UPLOAD'					=> 'Enable avatar uploading',
 	'AVATAR_GALLERY_PATH'			=> 'Avatar gallery path',
 	'AVATAR_GALLERY_PATH_EXPLAIN'	=> 'Path under your phpBB root directory for pre-loaded images, e.g. <samp>images/avatars/gallery</samp>.',
@@ -140,15 +148,12 @@
 	'ALLOW_POST_FLASH'					=> 'Allow use of <code>[FLASH]</code> BBCode tag in posts',
 	'ALLOW_POST_FLASH_EXPLAIN'			=> 'If disallowed the <code>[FLASH]</code> BBCode tag is disabled in posts. Otherwise the permission system controls which users can use the <code>[FLASH]</code> BBCode tag.',
 
-	'ENABLE_QUEUE_TRIGGER'			=> 'Enable queued posts',
-	'ENABLE_QUEUE_TRIGGER_EXPLAIN'	=> 'Ability to put registered users posts to post approval if their post count is lower than the specified value below. This setting has no effect on the permission setting for post/topic approval.',
-	'QUEUE_TRIGGER_POSTS'			=> 'Maximum post count for queued posts',
-	'QUEUE_TRIGGER_POSTS_EXPLAIN'	=> 'If queued posts is enabled, this is the post count the user need to reach in order to post without post approval. If the users post count is below this number, the post is stored in the queue automatically.',
-
 	'BUMP_INTERVAL'					=> 'Bump interval',
 	'BUMP_INTERVAL_EXPLAIN'			=> 'Number of minutes, hours or days between the last post to a topic and the ability to bump this topic.',
-	'CHAR_LIMIT'					=> 'Maximum characters per post',
-	'CHAR_LIMIT_EXPLAIN'			=> 'The number of characters allowed within a post. Set to 0 for unlimited characters.',
+	'CHAR_LIMIT'					=> 'Maximum characters per post/message',
+	'CHAR_LIMIT_EXPLAIN'			=> 'The number of characters allowed within a post/private message. Set to 0 for unlimited characters.',
+	'DELETE_TIME'					=> 'Limit deleting time',
+	'DELETE_TIME_EXPLAIN'			=> 'Limits the time available to delete a new post. Setting the value to 0 disables this behaviour.',
 	'DISPLAY_LAST_EDITED'			=> 'Display last edited time information',
 	'DISPLAY_LAST_EDITED_EXPLAIN'	=> 'Choose if the last edited by information to be displayed on posts.',
 	'EDIT_TIME'						=> 'Limit editing time',
@@ -166,12 +171,15 @@
 	'MAX_POST_IMG_WIDTH_EXPLAIN'	=> 'Maximum width of an image/flash file in postings. Set to 0 for unlimited size.',
 	'MAX_POST_URLS'					=> 'Maximum links per post',
 	'MAX_POST_URLS_EXPLAIN'			=> 'Maximum number of URLs in a post. Set to 0 for unlimited links.',
+	'MIN_CHAR_LIMIT'				=> 'Minimum characters per post/message',
+	'MIN_CHAR_LIMIT_EXPLAIN'		=> 'The minimum number of characters the user need to enter within a post/private message.',
 	'POSTING'						=> 'Posting',
 	'POSTS_PER_PAGE'				=> 'Posts per page',
 	'QUOTE_DEPTH_LIMIT'				=> 'Maximum nested quotes per post',
 	'QUOTE_DEPTH_LIMIT_EXPLAIN'		=> 'Maximum number of nested quotes in a post. Set to 0 for unlimited depth.',
 	'SMILIES_LIMIT'					=> 'Maximum smilies per post',
 	'SMILIES_LIMIT_EXPLAIN'			=> 'Maximum number of smilies in a post. Set to 0 for unlimited smilies.',
+	'SMILIES_PER_PAGE'				=> 'Smilies per page',
 	'TOPICS_PER_PAGE'				=> 'Topics per page',
 ));
 
@@ -197,8 +205,13 @@
 $lang = array_merge($lang, array(
 	'ACP_REGISTER_SETTINGS_EXPLAIN'		=> 'Here you are able to define registration and profile related settings.',
 
-	'ACC_ACTIVATION'			=> 'Account activation',
-	'ACC_ACTIVATION_EXPLAIN'	=> 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations.',
+	'ACC_ACTIVATION'				=> 'Account activation',
+	'ACC_ACTIVATION_EXPLAIN'		=> 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations.',
+	'NEW_MEMBER_POST_LIMIT'			=> 'New member post limit',
+	'NEW_MEMBER_POST_LIMIT_EXPLAIN'	=> 'New members are within the <em>Newly Registered Users</em> group until they reach this number of posts. You can use this group to keep them from using the PM system or to review their posts. <strong>A value of 0 disables this feature.</strong>',
+	'NEW_MEMBER_GROUP_DEFAULT'		=> 'Set Newly Registered Users group to default',
+	'NEW_MEMBER_GROUP_DEFAULT_EXPLAIN'	=> 'If set to yes and a new member post limit is specified newly registered users will be not only put into the <em>Newly Registered Users</em> group, but this group also being their default one. This may come in handy if you want to assign a group default rank and/or avatar the user then inherits.',
+
 	'ACC_ADMIN'					=> 'By Admin',
 	'ACC_DISABLE'				=> 'Disable',
 	'ACC_NONE'					=> 'None',
@@ -231,11 +244,45 @@
 	'USERNAME_LENGTH_EXPLAIN'	=> 'Minimum and maximum number of characters in usernames.',
 ));
 
-// Visual Confirmation Settings
+// Feeds
 $lang = array_merge($lang, array(
-	'ACP_VC_SETTINGS_EXPLAIN'		=> 'Here you are able to define visual confirmation defaults and CAPTCHA settings.',
+	'ACP_FEED_MANAGEMENT'				=> 'General Syndication Feeds settings',
+	'ACP_FEED_MANAGEMENT_EXPLAIN'		=> 'This Module makes available various ATOM Feeds, parsing any BBCode in posts to make them readable in external feeds.',
+
+	'ACP_FEED_ENABLE'					=> 'Enable Feeds',
+	'ACP_FEED_ENABLE_EXPLAIN'			=> 'Turns on or off ATOM Feeds for the entire board.<br />Disabling this switches off all Feeds, no matter how the options below are set.',
+	'ACP_FEED_LIMIT'					=> 'Number of items',
+	'ACP_FEED_LIMIT_EXPLAIN'			=> 'The maximum number of feed items to display.',
+
+	'ACP_FEED_OVERALL_FORUMS'			=> 'Enable overall forums feed',
+	'ACP_FEED_OVERALL_FORUMS_EXPLAIN'	=> 'This feed displays the latest posts from all forums topics.',
+	'ACP_FEED_OVERALL_FORUMS_LIMIT'		=> 'Number of items per page to display in the forums feed',
+
+	'ACP_FEED_OVERALL_TOPIC'			=> 'Enable overall topics feed',
+	'ACP_FEED_OVERALL_TOPIC_EXPLAIN'	=> 'Enables the “All Topics” feed',
+	'ACP_FEED_OVERALL_TOPIC_LIMIT'		=> 'Number of items per page to display in the topics feed',
+	'ACP_FEED_FORUM'					=> 'Enable Per-Forum Feeds',
+	'ACP_FEED_FORUM_EXPLAIN'			=> 'Single forum new posts.',
+	'ACP_FEED_TOPIC'					=> 'Enable Per-Topic Feeds',
+	'ACP_FEED_TOPIC_EXPLAIN'			=> 'Single topics new posts.',
+	'ACP_FEED_NEWS'						=> 'News Feeds',
+	'ACP_FEED_NEWS_EXPLAIN'				=> 'Pull the first post from these forums. Select no forums to disable news feed.<br />Select multiple forums by holding <samp>CTRL</samp> and clicking.',
+
+	'ACP_FEED_GENERAL'					=> 'General Feed Settings',
+
+	'ACP_FEED_ITEM_STATISTICS'			=> 'Item statistics',
+	'ACP_FEED_ITEM_STATISTICS_EXPLAIN'	=> 'Display individual statistics underneath feed items<br />(Posted by, date and time, Replies, Views)',
+	'ACP_FEED_EXCLUDE_ID'				=> 'Exclude these forums',
+	'ACP_FEED_EXCLUDE_ID_EXPLAIN'		=> 'Content from these will be <strong>not included in feeds</strong>. Select no forum to pull data from all forums.<br />Select/Deselect multiple forums by holding <samp>CTRL</samp> and clicking.',
+));
 
+// Visual Confirmation Settings
+$lang = array_merge($lang, array(
+	'ACP_VC_SETTINGS_EXPLAIN'				=> 'Here you can select and configure CAPTCHA plugins, which implement various ways to reject registration attempts from so-called spambots.',
+	'AVAILABLE_CAPTCHAS'					=> 'Available plugins',
+	'CAPTCHA_UNAVAILABLE'					=> 'The CAPTCHA cannot be selected as its requirements are not met.',
 	'CAPTCHA_GD'							=> 'GD CAPTCHA',
+	'CAPTCHA_GD_3D'							=> 'GD 3D Captcha',
 	'CAPTCHA_GD_FOREGROUND_NOISE'			=> 'GD CAPTCHA foreground noise',
 	'CAPTCHA_GD_EXPLAIN'					=> 'Use GD to make a more advanced CAPTCHA.',
 	'CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN'	=> 'Use foreground noise to make the GD based CAPTCHA harder.',
@@ -252,16 +299,23 @@
 	'CAPTCHA_FONT_DEFAULT'					=> 'Default',
 	'CAPTCHA_FONT_NEW'						=> 'New Shapes',
 	'CAPTCHA_FONT_LOWER'					=> 'Also use lowercase',
+	'CAPTCHA_NO_GD'							=> 'CAPTCHA without GD',
+	'CAPTCHA_PREVIEW_MSG'					=> 'Your changes to the visual confirmation setting were not saved. This is just a preview.',
+	'CAPTCHA_PREVIEW_EXPLAIN'				=> 'The CAPTCHA as it would look like using the current selection.',
 
+	'CAPTCHA_SELECT'						=> 'Installed CAPTCHA plugins',
+	'CAPTCHA_SELECT_EXPLAIN'				=> 'The dropdown holds the CAPTCHA plugins recognized by the board. Gray entries are not available right now and might need configuration prior to use.',
+	'CAPTCHA_CONFIGURE'						=> 'Configure CAPTCHAs',
+	'CAPTCHA_CONFIGURE_EXPLAIN'				=> 'Change the settings for the selected CAPTCHA.',
+	'CONFIGURE'								=> 'Configure',
+	'CAPTCHA_NO_OPTIONS'					=> 'This CAPTCHA has no configuration options.',
 
-	'CAPTCHA_PREVIEW_MSG'					=> 'Your changes to the visual confirmation setting were not saved. This is just a preview.',
-	'CAPTCHA_PREVIEW_EXPLAIN'				=> 'The CAPTCHA as it will look like using the current settings. Use the preview button to refresh. Note that captchas are randomized and will differ from one view to the next.',
 	'VISUAL_CONFIRM_POST'					=> 'Enable visual confirmation for guest postings',
 	'VISUAL_CONFIRM_POST_EXPLAIN'			=> 'Requires anonymous users to enter a random code matching an image to help prevent mass postings.',
 	'VISUAL_CONFIRM_REG'					=> 'Enable visual confirmation for registrations',
 	'VISUAL_CONFIRM_REG_EXPLAIN'			=> 'Requires new users to enter a random code matching an image to help prevent mass registrations.',
 	'VISUAL_CONFIRM_REFRESH'				=> 'Enable users to refresh the confirmation image',
-	'VISUAL_CONFIRM_REFRESH_EXPLAIN'		=> 'Allows users to request new confirmation codes, if they are unable to solve the VC during registration.',
+	'VISUAL_CONFIRM_REFRESH_EXPLAIN'		=> 'Allows users to request new confirmation codes, if they are unable to solve the VC during registration. Some plugins might not support this option.',
 ));
 
 // Cookie Settings
@@ -347,7 +401,7 @@
 	'ACP_SERVER_SETTINGS_EXPLAIN'	=> 'Here you define server and domain dependant settings. Please ensure the data you enter is accurate, errors will result in e-mails containing incorrect information. When entering the domain name remember it does include http:// or other protocol term. Only alter the port number if you know your server uses a different value, port 80 is correct in most cases.',
 
 	'ENABLE_GZIP'				=> 'Enable GZip compression',
-	'ENABLE_GZIP_EXPLAIN'		=> 'Generated content will be compressed prior to sending it to the user. This can reduce network traffic but will also increase CPU usage on both server and client side.',
+	'ENABLE_GZIP_EXPLAIN'		=> 'Generated content will be compressed prior to sending it to the user. This can reduce network traffic but will also increase CPU usage on both server and client side. Requires zlib PHP extension to be loaded.',
 	'FORCE_SERVER_VARS'			=> 'Force server URL settings',
 	'FORCE_SERVER_VARS_EXPLAIN'	=> 'If set to yes the server settings defined here will be used in favour of the automatically determined values.',
 	'ICONS_PATH'				=> 'Post icons storage path',
@@ -434,7 +488,7 @@
 	'EMAIL_SIG'						=> 'E-mail signature',
 	'EMAIL_SIG_EXPLAIN'				=> 'This text will be attached to all e-mails the board sends.',
 	'ENABLE_EMAIL'					=> 'Enable board-wide e-mails',
-	'ENABLE_EMAIL_EXPLAIN'			=> 'If this is set to disabled no e-mails will be sent by the board at all.',
+	'ENABLE_EMAIL_EXPLAIN'			=> 'If this is set to disabled no e-mails will be sent by the board at all. <em>Note the user and admin account activation settings require this setting to be enabled. If currently using “user” or “admin” activation in the activation settings, disabling this setting will require no activation of new accounts.</em>',
 	'SMTP_AUTH_METHOD'				=> 'Authentication method for SMTP',
 	'SMTP_AUTH_METHOD_EXPLAIN'		=> 'Only used if a username/password is set, ask your provider if you are unsure which method to use.',
 	'SMTP_CRAM_MD5'					=> 'CRAM-MD5',
diff -x .svn -aruN 3.0.5.src/language/en/acp/common.php 3.0.6.src/language/en/acp/common.php
--- 3.0.5.src/language/en/acp/common.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/acp/common.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_common [English]
 *
 * @package language
-* @version $Id: common.php 9382 2009-03-17 11:54:26Z acydburn $
+* @version $Id: common.php 10134 2009-09-10 15:32:16Z marshalrusty $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -88,6 +88,7 @@
 	'ACP_FORUM_MANAGEMENT'			=> 'Forum management',
 	'ACP_FORUM_MODERATORS'			=> 'Forum moderators',
 	'ACP_FORUM_PERMISSIONS'			=> 'Forum permissions',
+	'ACP_FORUM_PERMISSIONS_COPY'	=> 'Copy forum permissions',
 	'ACP_FORUM_ROLES'				=> 'Forum roles',
 
 	'ACP_GENERAL_CONFIGURATION'		=> 'General configuration',
@@ -148,11 +149,15 @@
 
 	'ACP_RESTORE'				=> 'Restore',
 
+	'ACP_FEED'					=> 'Feed management',
+	'ACP_FEED_SETTINGS'			=> 'Feed settings',
+
 	'ACP_SEARCH'				=> 'Search configuration',
 	'ACP_SEARCH_INDEX'			=> 'Search index',
 	'ACP_SEARCH_SETTINGS'		=> 'Search settings',
 
 	'ACP_SECURITY_SETTINGS'		=> 'Security settings',
+	'ACP_SEND_STATISTICS'		=> 'Send statistical information',
 	'ACP_SERVER_CONFIGURATION'	=> 'Server configuration',
 	'ACP_SERVER_SETTINGS'		=> 'Server settings',
 	'ACP_SIGNATURE_SETTINGS'	=> 'Signature settings',
@@ -161,6 +166,8 @@
 	'ACP_STYLE_MANAGEMENT'		=> 'Style management',
 	'ACP_STYLES'				=> 'Styles',
 
+	'ACP_SUBMIT_CHANGES'		=> 'Submit changes',
+
 	'ACP_TEMPLATES'				=> 'Templates',
 	'ACP_THEMES'				=> 'Themes',
 
@@ -181,8 +188,9 @@
 	'ACP_USER_ROLES'				=> 'User roles',
 	'ACP_USER_SECURITY'				=> 'User security',
 	'ACP_USER_SIG'					=> 'Signature',
+	'ACP_USER_WARNINGS'				=> 'Warnings',
 
-	'ACP_VC_SETTINGS'					=> 'Visual confirmation settings',
+	'ACP_VC_SETTINGS'					=> 'CAPTCHA module settings',
 	'ACP_VC_CAPTCHA_DISPLAY'			=> 'CAPTCHA image preview',
 	'ACP_VERSION_CHECK'					=> 'Check for updates',
 	'ACP_VIEW_ADMIN_PERMISSIONS'		=> 'View administrative permissions',
@@ -241,6 +249,8 @@
 
 	'MANAGE'				=> 'Manage',
 	'MENU_TOGGLE'			=> 'Hide or display the side menu',
+	'MORE'					=> 'More',			// Not used at the moment
+	'MORE_INFORMATION'		=> 'More information »',
 	'MOVE_DOWN'				=> 'Move down',
 	'MOVE_UP'				=> 'Move up',
 
@@ -267,10 +277,12 @@
 	'SELECT_ANONYMOUS'		=> 'Select anonymous user',
 	'SELECT_OPTION'			=> 'Select option',
 
-	'SETTING_TOO_LOW'		=> 'The entered value for the setting “%1$s” is too low. The minimal allowed value is %2$d.',
-	'SETTING_TOO_BIG'		=> 'The entered value for the setting “%1$s” is too big. The maximal allowed value is %2$d.',
-	'SETTING_TOO_LONG'		=> 'The entered value for the setting “%1$s” is too long. The maximal allowed length is %2$d.',
-	'SETTING_TOO_SHORT'		=> 'The entered value for the setting “%1$s” is not long enough. The minimal allowed length is %2$d.',
+	'SETTING_TOO_LOW'		=> 'The provided value for the setting “%1$s” is too low. The minimum acceptable value is %2$d.',
+	'SETTING_TOO_BIG'		=> 'The provided value for the setting “%1$s” is too high. The maximum acceptable value is %2$d.',
+	'SETTING_TOO_LONG'		=> 'The provided value for the setting “%1$s” is too long. The maximum acceptable length is %2$d.',
+	'SETTING_TOO_SHORT'		=> 'The provided value for the setting “%1$s” is too short. The minimum acceptable length is %2$d.',
+
+	'SHOW_ALL_OPERATIONS'	=> 'Show all operations',
 
 	'UCP'					=> 'User Control Panel',
 	'USERNAMES_EXPLAIN'		=> 'Place each username on a separate line.',
@@ -334,6 +346,10 @@
 	'PURGE_CACHE_CONFIRM'	=> 'Are you sure you wish to purge the cache?',
 	'PURGE_CACHE_EXPLAIN'	=> 'Purge all cache related items, this includes any cached template files or queries.',
 
+	'PURGE_SESSIONS'			=> 'Purge all sessions',
+	'PURGE_SESSIONS_CONFIRM'	=> 'Are you sure you wish to purge all sessions? This will log out all users.',
+	'PURGE_SESSIONS_EXPLAIN'	=> 'Purge all sessions. This will log out all users by truncating the session table.',
+
 	'RESET_DATE'					=> 'Reset board’s start date',
 	'RESET_DATE_CONFIRM'			=> 'Are you sure you wish to reset the board’s start date?',
 	'RESET_ONLINE'					=> 'Reset most users ever online',
@@ -357,9 +373,11 @@
 	'UPLOAD_DIR_SIZE'	=> 'Size of posted attachments',
 	'USERS_PER_DAY'		=> 'Users per day',
 
-	'VALUE'					=> 'Value',
-	'VIEW_ADMIN_LOG'		=> 'View administrator log',
-	'VIEW_INACTIVE_USERS'	=> 'View inactive users',
+	'VALUE'						=> 'Value',
+	'VERSIONCHECK_FAIL'			=> 'Failed to obtain latest version information.',
+	'VERSIONCHECK_FORCE_UPDATE'	=> 'Re-Check version',
+	'VIEW_ADMIN_LOG'			=> 'View administrator log',
+	'VIEW_INACTIVE_USERS'		=> 'View inactive users',
 
 	'WELCOME_PHPBB'			=> 'Welcome to phpBB',
 	'WRITABLE_CONFIG'		=> 'Your config file (config.php) is currently world-writable. We strongly encourage you to change the permissions to 640 or at least to 644 (for example: <a href="http://en.wikipedia.org/wiki/Chmod" rel="external">chmod</a> 640 config.php).',
@@ -384,10 +402,24 @@
 	'SORT_LAST_VISIT'	=> 'Last visit',
 	'SORT_REASON'		=> 'Reason',
 	'SORT_REG_DATE'		=> 'Registration date',
+	'SORT_LAST_REMINDER'=> 'Last reminded',
+	'SORT_REMINDER'		=> 'Reminder sent',
 
 	'USER_IS_INACTIVE'		=> 'User is inactive',
 ));
 
+// Send statistics page
+$lang = array_merge($lang, array(
+	'EXPLAIN_SEND_STATISTICS'	=> 'Please send information about your server and board configurations to phpBB for statistical analysis. All information that could identify you or your website has been removed - the data is entirely <strong>anonymous</strong>. We base decisions about future phpBB versions on this information. The statistics are made available publically. We also share this data with the PHP project, the programming language phpBB is made with.',
+	'EXPLAIN_SHOW_STATISTICS'	=> 'Using the button below you can preview all variables that will be transmitted.',
+	'DONT_SEND_STATISTICS'		=> 'Return to the ACP if you do not wish to send statistical information to phpBB.',
+	'GO_ACP_MAIN'				=> 'Go to the ACP start page',
+	'HIDE_STATISTICS'			=> 'Hide details',
+	'SEND_STATISTICS'			=> 'Send statistical information',
+	'SHOW_STATISTICS'			=> 'Show details',
+	'THANKS_SEND_STATISTICS'	=> 'Thank you for submitting your information.',
+));
+
 // Log Entries
 $lang = array_merge($lang, array(
 	'LOG_ACL_ADD_USER_GLOBAL_U_'		=> '<strong>Added or edited users’ user permissions</strong><br />» %s',
@@ -464,23 +496,26 @@
 	'LOG_CONFIG_MESSAGE'		=> '<strong>Altered private message settings</strong>',
 	'LOG_CONFIG_POST'			=> '<strong>Altered post settings</strong>',
 	'LOG_CONFIG_REGISTRATION'	=> '<strong>Altered user registration settings</strong>',
+	'LOG_CONFIG_FEED'			=> '<strong>Altered syndication feeds settings</strong>',
 	'LOG_CONFIG_SEARCH'			=> '<strong>Altered search settings</strong>',
 	'LOG_CONFIG_SECURITY'		=> '<strong>Altered security settings</strong>',
 	'LOG_CONFIG_SERVER'			=> '<strong>Altered server settings</strong>',
 	'LOG_CONFIG_SETTINGS'		=> '<strong>Altered board settings</strong>',
 	'LOG_CONFIG_SIGNATURE'		=> '<strong>Altered signature settings</strong>',
-	'LOG_CONFIG_VISUAL'			=> '<strong>Altered visual confirmation settings</strong>',
+	'LOG_CONFIG_VISUAL'			=> '<strong>Altered antibot settings</strong>',
 
 	'LOG_APPROVE_TOPIC'			=> '<strong>Approved topic</strong><br />» %s',
 	'LOG_BUMP_TOPIC'			=> '<strong>User bumped topic</strong><br />» %s',
-	'LOG_DELETE_POST'			=> '<strong>Deleted post</strong><br />» %s',
+	'LOG_DELETE_POST'			=> '<strong>Deleted post “%1$s” written by</strong><br />» %2$s',
 	'LOG_DELETE_SHADOW_TOPIC'	=> '<strong>Deleted shadow topic</strong><br />» %s',
-	'LOG_DELETE_TOPIC'			=> '<strong>Deleted topic</strong><br />» %s',
+	'LOG_DELETE_TOPIC'			=> '<strong>Deleted topic “%1$s” written by</strong><br />» %2$s',
 	'LOG_FORK'					=> '<strong>Copied topic</strong><br />» from %s',
 	'LOG_LOCK'					=> '<strong>Locked topic</strong><br />» %s',
 	'LOG_LOCK_POST'				=> '<strong>Locked post</strong><br />» %s',
 	'LOG_MERGE'					=> '<strong>Merged posts</strong> into topic<br />» %s',
 	'LOG_MOVE'					=> '<strong>Moved topic</strong><br />» from %1$s to %2$s',
+	'LOG_PM_REPORT_CLOSED'		=> '<strong>Closed PM report</strong><br />» %s',
+	'LOG_PM_REPORT_DELETED'		=> '<strong>Deleted PM report</strong><br />» %s',
 	'LOG_POST_APPROVED'			=> '<strong>Approved post</strong><br />» %s',
 	'LOG_POST_DISAPPROVED'		=> '<strong>Disapproved post “%1$s” with the following reason</strong><br />» %2$s',
 	'LOG_POST_EDITED'			=> '<strong>Edited post “%1$s” written by</strong><br />» %2$s',
@@ -511,6 +546,7 @@
 	'LOG_ERROR_EMAIL'		=> '<strong>E-mail error</strong><br />» %s',
 
 	'LOG_FORUM_ADD'							=> '<strong>Created new forum</strong><br />» %s',
+	'LOG_FORUM_COPIED_PERMISSIONS'			=> '<strong>Copied forum permissions</strong> from %1$s<br />» %2$s',
 	'LOG_FORUM_DEL_FORUM'					=> '<strong>Deleted forum</strong><br />» %s',
 	'LOG_FORUM_DEL_FORUMS'					=> '<strong>Deleted forum and its subforums</strong><br />» %s',
 	'LOG_FORUM_DEL_MOVE_FORUMS'				=> '<strong>Deleted forum and moved subforums</strong> to %1$s<br />» %2$s',
@@ -525,6 +561,8 @@
 	'LOG_FORUM_MOVE_UP'						=> '<strong>Moved forum</strong> %1$s <strong>above</strong> %2$s',
 	'LOG_FORUM_SYNC'						=> '<strong>Re-synchronised forum</strong><br />» %s',
 
+	'LOG_GENERAL_ERROR'	=> '<strong>A general error occured</strong>: %1$s <br />» %2$s',
+
 	'LOG_GROUP_CREATED'		=> '<strong>New usergroup created</strong><br />» %s',
 	'LOG_GROUP_DEFAULTS'	=> '<strong>Group “%1$s” made default for members</strong><br />» %2$s',
 	'LOG_GROUP_DELETE'		=> '<strong>Usergroup deleted</strong><br />» %s',
@@ -533,8 +571,11 @@
 	'LOG_GROUP_REMOVE'		=> '<strong>Members removed from usergroup</strong> %1$s<br />» %2$s',
 	'LOG_GROUP_UPDATED'		=> '<strong>Usergroup details updated</strong><br />» %s',
 	'LOG_MODS_ADDED'		=> '<strong>Added new leaders to usergroup</strong> %1$s<br />» %2$s',
-	'LOG_USERS_APPROVED'	=> '<strong>Users approved in usergroup</strong> %1$s<br />» %2$s',
 	'LOG_USERS_ADDED'		=> '<strong>Added new members to usergroup</strong> %1$s<br />» %2$s',
+	'LOG_USERS_APPROVED'	=> '<strong>Users approved in usergroup</strong> %1$s<br />» %2$s',
+	'LOG_USERS_PENDING'		=> '<strong>Users requested to join group “%1$s” and need to be approved</strong><br />» %2$s',
+
+	'LOG_IMAGE_GENERATION_ERROR'	=> '<strong>Error while creating image</strong><br />» Error in %1$s on line %2$s: %3$s',
 
 	'LOG_IMAGESET_ADD_DB'			=> '<strong>Added new imageset to database</strong><br />» %s',
 	'LOG_IMAGESET_ADD_FS'			=> '<strong>Add new imageset on filesystem</strong><br />» %s',
@@ -603,6 +644,8 @@
 	'LOG_PRUNE_USER_DEL_ANON'	=> '<strong>Users pruned and posts retained</strong><br />» %s',
 
 	'LOG_PURGE_CACHE'			=> '<strong>Purged cache</strong>',
+	'LOG_PURGE_SESSIONS'		=> '<strong>Purged sessions</strong>',
+
 
 	'LOG_RANK_ADDED'		=> '<strong>Added new rank</strong><br />» %s',
 	'LOG_RANK_REMOVED'		=> '<strong>Removed rank</strong><br />» %s',
@@ -654,12 +697,15 @@
 	'LOG_USER_DELETED'		=> '<strong>Deleted user</strong><br />» %s',
 	'LOG_USER_DEL_ATTACH'	=> '<strong>Removed all attachments made by the user</strong><br />» %s',
 	'LOG_USER_DEL_AVATAR'	=> '<strong>Removed user avatar</strong><br />» %s',
+	'LOG_USER_DEL_OUTBOX'	=> '<strong>Emptied user outbox</strong><br />» %s',
 	'LOG_USER_DEL_POSTS'	=> '<strong>Removed all posts made by the user</strong><br />» %s',
 	'LOG_USER_DEL_SIG'		=> '<strong>Removed user signature</strong><br />» %s',
 	'LOG_USER_INACTIVE'		=> '<strong>User deactivated</strong><br />» %s',
 	'LOG_USER_MOVE_POSTS'	=> '<strong>Moved user posts</strong><br />» posts by “%1$s” to forum “%2$s”',
 	'LOG_USER_NEW_PASSWORD'	=> '<strong>Changed user password</strong><br />» %s',
 	'LOG_USER_REACTIVATE'	=> '<strong>Forced user account reactivation</strong><br />» %s',
+	'LOG_USER_REMOVED_NR'	=> '<strong>Removed newly registered flag from user</strong><br />» %s',
+
 	'LOG_USER_UPDATE_EMAIL'	=> '<strong>User “%1$s” changed e-mail</strong><br />» from “%2$s” to “%3$s”',
 	'LOG_USER_UPDATE_NAME'	=> '<strong>Changed username</strong><br />» from “%1$s” to “%2$s”',
 	'LOG_USER_USER_UPDATE'	=> '<strong>Updated user details</strong><br />» %s',
@@ -683,6 +729,10 @@
 	'LOG_USER_GROUP_JOIN_PENDING'	=> '<strong>User joined group and needs to be approved</strong><br />» %s',
 	'LOG_USER_GROUP_RESIGN'			=> '<strong>User resigned membership from group</strong><br />» %s',
 
+	'LOG_WARNING_DELETED'		=> '<strong>Deleted user warning</strong><br />» %s',
+	'LOG_WARNINGS_DELETED'		=> '<strong>Deleted %2$s user warnings</strong><br />» %1$s', // Example: '<strong>Deleted 2 user warnings</strong><br />» username'
+	'LOG_WARNINGS_DELETED_ALL'	=> '<strong>Deleted all user warnings</strong><br />» %s',
+
 	'LOG_WORD_ADD'			=> '<strong>Added word censor</strong><br />» %s',
 	'LOG_WORD_DELETE'		=> '<strong>Deleted word censor</strong><br />» %s',
 	'LOG_WORD_EDIT'			=> '<strong>Edited word censor</strong><br />» %s',
diff -x .svn -aruN 3.0.5.src/language/en/acp/database.php 3.0.6.src/language/en/acp/database.php
--- 3.0.5.src/language/en/acp/database.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/acp/database.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_database [English]
 *
 * @package language
-* @version $Id: database.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: database.php 9765 2009-07-17 10:11:10Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -54,6 +54,7 @@
 	'DOWNLOAD_BACKUP'	=> 'Download backup',
 
 	'FILE_TYPE'			=> 'File type',
+	'FILE_WRITE_FAIL'	=> 'Unable to write file to storage folder.',
 	'FULL_BACKUP'		=> 'Full',
 
 	'RESTORE_FAILURE'		=> 'The backup file may be corrupt.',
diff -x .svn -aruN 3.0.5.src/language/en/acp/forums.php 3.0.6.src/language/en/acp/forums.php
--- 3.0.5.src/language/en/acp/forums.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/acp/forums.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_forums [English]
 *
 * @package language
-* @version $Id: forums.php 9309 2009-01-27 19:16:29Z terrafrost $
+* @version $Id: forums.php 9896 2009-07-31 12:46:15Z Kellanved $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -44,9 +44,12 @@
 	'AUTO_PRUNE_VIEWED'			=> 'Auto-prune post viewed age',
 	'AUTO_PRUNE_VIEWED_EXPLAIN'	=> 'Number of days since topic was viewed after which topic is removed.',
 
+	'CONTINUE'						=> 'Continue',
 	'COPY_PERMISSIONS'				=> 'Copy permissions from',
+	'COPY_PERMISSIONS_EXPLAIN'		=> 'To ease up the permission setup for your new forum, you can copy the permissions of an existing forum.',
 	'COPY_PERMISSIONS_ADD_EXPLAIN'	=> 'Once created, the forum will have the same permissions as the one you select here. If no forum is selected the newly created forum will not be visible until permissions had been set.',
 	'COPY_PERMISSIONS_EDIT_EXPLAIN'	=> 'If you select to copy permissions, the forum will have the same permissions as the one you select here. This will overwrite any permissions you have previously set for this forum with the permissions of the forum you select here. If no forum is selected the current permissions will be kept.',
+	'COPY_TO_ACL'					=> 'Alternatively, you are also able to %sset up new permissions%s for this forum.',
 	'CREATE_FORUM'					=> 'Create new forum',
 
 	'DECIDE_MOVE_DELETE_CONTENT'		=> 'Delete content or move to forum',
@@ -62,6 +65,8 @@
 	'ENABLE_INDEXING_EXPLAIN'		=> 'If set to yes posts made to this forum will be indexed for searching.',
 	'ENABLE_POST_REVIEW'			=> 'Enable post review',
 	'ENABLE_POST_REVIEW_EXPLAIN'	=> 'If set to yes users are able to review their post if new posts were made to the topic while users wrote theirs. This should be disabled for chat forums.',
+	'ENABLE_QUICK_REPLY'			=> 'Enable quick reply',
+	'ENABLE_QUICK_REPLY_EXPLAIN'	=> 'If set to yes users get a quick reply box for this forum. If the global option for quick reply is disabled or the forum not postable to the quick reply box will not be displayed, even if set to yes here.',
 	'ENABLE_RECENT'					=> 'Display active topics',
 	'ENABLE_RECENT_EXPLAIN'			=> 'If set to yes topics made to this forum will be shown in the active topics list.',
 	'ENABLE_TOPIC_ICONS'			=> 'Enable topic icons',
diff -x .svn -aruN 3.0.5.src/language/en/acp/groups.php 3.0.6.src/language/en/acp/groups.php
--- 3.0.5.src/language/en/acp/groups.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/acp/groups.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_groups [English]
 *
 * @package language
-* @version $Id: groups.php 8911 2008-09-23 13:03:33Z acydburn $
+* @version $Id: groups.php 9701 2009-06-28 12:13:11Z toonarmy $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -88,16 +88,19 @@
 	'GROUP_PENDING'					=> 'Pending members',
 	'GROUP_MAX_RECIPIENTS'			=> 'Maximum number of allowed recipients per private message',
 	'GROUP_MAX_RECIPIENTS_EXPLAIN'	=> 'The maximum number of allowed recipients in a private message. If 0 is entered, the board-wide setting is used.',
+	'GROUP_OPTIONS_SAVE'			=> 'Group wide options',
 	'GROUP_PROMOTE'					=> 'Promote to group leader',
 	'GROUP_RANK'					=> 'Group rank',
 	'GROUP_RECEIVE_PM'				=> 'Group able to receive private messages',
 	'GROUP_RECEIVE_PM_EXPLAIN'		=> 'Please note that hidden groups are not able to be messaged, regardless of this setting.',
 	'GROUP_REQUEST'					=> 'Request',
 	'GROUP_SETTINGS_SAVE'			=> 'Group wide settings',
+	'GROUP_SKIP_AUTH'				=> 'Exempt group leader from permissions',
+	'GROUP_SKIP_AUTH_EXPLAIN'		=> 'If enabled group leader no longer inherit permissions from the group.',
 	'GROUP_TYPE'					=> 'Group type',
 	'GROUP_TYPE_EXPLAIN'			=> 'This determines which users can join or view this group.',
 	'GROUP_UPDATED'					=> 'Group preferences updated successfully.',
-	
+
 	'GROUP_USERS_ADDED'				=> 'New users added to group successfully.',
 	'GROUP_USERS_EXIST'				=> 'The selected users are already members.',
 	'GROUP_USERS_REMOVE'			=> 'Users removed from group and new defaults set successfully.',
diff -x .svn -aruN 3.0.5.src/language/en/acp/language.php 3.0.6.src/language/en/acp/language.php
--- 3.0.5.src/language/en/acp/language.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/acp/language.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_language [English]
 *
 * @package language
-* @version $Id: language.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: language.php 9649 2009-06-21 19:17:20Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -37,7 +37,7 @@
 
 $lang = array_merge($lang, array(
 	'ACP_FILES'						=> 'Admin language files',
-	'ACP_LANGUAGE_PACKS_EXPLAIN'	=> 'Here you are able to install/remove language packs.',
+	'ACP_LANGUAGE_PACKS_EXPLAIN'	=> 'Here you are able to install/remove language packs. The default language pack is marked with an asterisk (*).',
 
 	'EMAIL_FILES'			=> 'E-mail templates',
 
diff -x .svn -aruN 3.0.5.src/language/en/acp/permissions.php 3.0.6.src/language/en/acp/permissions.php
--- 3.0.5.src/language/en/acp/permissions.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/acp/permissions.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_permissions [English]
 *
 * @package language
-* @version $Id: permissions.php 9443 2009-04-12 13:28:12Z acydburn $
+* @version $Id: permissions.php 10017 2009-08-18 14:37:49Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -80,6 +80,7 @@
 	'ACP_ADMINISTRATORS_EXPLAIN'				=> 'Here you can assign administrator permissions to users or groups. All users with administrator permissions can view the administration control panel.',
 	'ACP_FORUM_MODERATORS_EXPLAIN'				=> 'Here you can assign users and groups as forum moderators. To assign users access to forums, to define global moderative permissions or administrators please use the appropriate page.',
 	'ACP_FORUM_PERMISSIONS_EXPLAIN'				=> 'Here you can alter which users and groups can access which forums. To assign moderators or define administrators please use the appropriate page.',
+	'ACP_FORUM_PERMISSIONS_COPY_EXPLAIN'		=> 'Here you can copy forum permissions from one forum to one or more other forums.',
 	'ACP_GLOBAL_MODERATORS_EXPLAIN'				=> 'Here you can assign global moderator permissions to users or groups. These moderators are like ordinary moderators except they have access to every forum on your board.',
 	'ACP_GROUPS_FORUM_PERMISSIONS_EXPLAIN'		=> 'Here you can assign forum permissions to groups.',
 	'ACP_GROUPS_PERMISSIONS_EXPLAIN'			=> 'Here you can assign global permissions to groups - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. Individual users permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group’s permissions.',
@@ -109,6 +110,12 @@
 	'APPLY_PERMISSIONS_EXPLAIN'	=> 'The permissions and role defined for this item will only be applied to this item and all checked items.',
 	'AUTH_UPDATED'				=> 'Permissions have been updated.',
 
+	'COPY_PERMISSIONS_CONFIRM'				=> 'Are you sure you wish to carry out this operation? Please be aware that this will overwrite any existing permissions on the selected targets.',
+	'COPY_PERMISSIONS_FORUM_FROM_EXPLAIN'	=> 'The source forum you want to copy permissions from.',
+	'COPY_PERMISSIONS_FORUM_TO_EXPLAIN'		=> 'The destination forums you want the copied permissions applied to.',
+	'COPY_PERMISSIONS_FROM'					=> 'Copy permissions from',
+	'COPY_PERMISSIONS_TO'					=> 'Apply permissions to',
+
 	'CREATE_ROLE'				=> 'Create role',
 	'CREATE_ROLE_FROM'			=> 'Use settings from…',
 	'CUSTOM'					=> 'Custom…',
@@ -164,6 +171,7 @@
 	'ROLE_FORUM_POLLS'			=> 'Standard Access + Polls',
 	'ROLE_FORUM_READONLY'		=> 'Read Only Access',
 	'ROLE_FORUM_STANDARD'		=> 'Standard Access',
+	'ROLE_FORUM_NEW_MEMBER'		=> 'Newly registered User',
 	'ROLE_MOD_FULL'				=> 'Full Moderator',
 	'ROLE_MOD_QUEUE'			=> 'Queue Moderator',
 	'ROLE_MOD_SIMPLE'			=> 'Simple Moderator',
@@ -173,6 +181,8 @@
 	'ROLE_USER_NOAVATAR'		=> 'No Avatar',
 	'ROLE_USER_NOPM'			=> 'No Private Messages',
 	'ROLE_USER_STANDARD'		=> 'Standard Features',
+	'ROLE_USER_NEW_MEMBER'		=> 'Newly registered User',
+
 
 	'ROLE_DESCRIPTION_ADMIN_FORUM'			=> 'Can access the forum management and forum permission settings.',
 	'ROLE_DESCRIPTION_ADMIN_FULL'			=> 'Has access to all administrative functions of this board.<br />Not recommended.',
@@ -187,6 +197,7 @@
 	'ROLE_DESCRIPTION_FORUM_POLLS'			=> 'Like Standard Access but can also create polls.',
 	'ROLE_DESCRIPTION_FORUM_READONLY'		=> 'Can read the forum, but cannot create new topics or reply to posts.',
 	'ROLE_DESCRIPTION_FORUM_STANDARD'		=> 'Can use most forum features including attachments and deleting own topics, but cannot lock own topics, and cannot create polls.',
+	'ROLE_DESCRIPTION_FORUM_NEW_MEMBER'		=> 'A role for members of the special newly registered users group; contains <samp>NEVER</samp> permissions to lock features for new users.',
 	'ROLE_DESCRIPTION_MOD_FULL'				=> 'Can use all moderating features, including banning.',
 	'ROLE_DESCRIPTION_MOD_QUEUE'			=> 'Can use the Moderation Queue to validate and edit posts, but nothing else.',
 	'ROLE_DESCRIPTION_MOD_SIMPLE'			=> 'Can only use basic topic actions. Cannot send warnings or use moderation queue.',
@@ -196,6 +207,7 @@
 	'ROLE_DESCRIPTION_USER_NOAVATAR'		=> 'Has a limited feature set and is not allowed to use the Avatar feature.',
 	'ROLE_DESCRIPTION_USER_NOPM'			=> 'Has a limited feature set, and is not allowed to use Private Messages.',
 	'ROLE_DESCRIPTION_USER_STANDARD'		=> 'Can access most but not all user features. Cannot change user name or ignore the flood limit, for instance.',
+	'ROLE_DESCRIPTION_USER_NEW_MEMBER'		=> 'A role for members of the special newly registered users group; contains <samp>NEVER</samp> permissions to lock features for new users.',
 
 	'ROLE_DESCRIPTION_EXPLAIN'		=> 'You are able to enter a short explanation of what the role is doing or for what it is meant for. The text you enter here will be displayed within the permissions screens too.',
 	'ROLE_DESCRIPTION_LONG'			=> 'The role description is too long, please limit it to 4000 characters.',
@@ -241,7 +253,7 @@
 	'TRACE_USER_GLOBAL_YES_TOTAL_NEVER'		=> 'The forum independent user permission evaluates to <samp>YES</samp> which overwrites the current local result <samp>NEVER</samp>. %sTrace global permission%s',
 	'TRACE_USER_GLOBAL_NEVER_TOTAL_KEPT'	=> 'The forum independent user permission evaluates to <samp>NEVER</samp> which doesn’t influence the local permission. %sTrace global permission%s',
 
-	'TRACE_USER_FOUNDER'					=> 'The user has the founder type set, therefore admin permissions are set to <samp>YES</samp> by default.',
+	'TRACE_USER_FOUNDER'					=> 'The user is a founder, therefore admin permissions are always set to <samp>YES</samp>.',
 	'TRACE_USER_KEPT'						=> 'The user’s permission is <samp>NO</samp> so the old total value is kept.',
 	'TRACE_USER_KEPT_LOCAL'					=> 'The user’s permission for this forum is <samp>NO</samp> so the old total value is kept.',
 	'TRACE_USER_NEVER_TOTAL_NEVER'			=> 'The user’s permission is set to <samp>NEVER</samp> and the total value is set to <samp>NEVER</samp>, so nothing is changed.',
diff -x .svn -aruN 3.0.5.src/language/en/acp/permissions_phpbb.php 3.0.6.src/language/en/acp/permissions_phpbb.php
--- 3.0.5.src/language/en/acp/permissions_phpbb.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/acp/permissions_phpbb.php	2009-11-16 11:10:10.000000000 -0600
@@ -3,7 +3,7 @@
 * acp_permissions_phpbb (phpBB Permission Set) [English]
 *
 * @package language
-* @version $Id: permissions_phpbb.php 8911 2008-09-23 13:03:33Z acydburn $
+* @version $Id: permissions_phpbb.php 9686 2009-06-26 11:52:54Z rxu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 */
@@ -121,10 +121,10 @@
 	'acl_u_pm_printpm'	=> array('lang' => 'Can print private messages', 'cat' => 'pm'),
 	'acl_u_pm_attach'	=> array('lang' => 'Can attach files in private messages', 'cat' => 'pm'),
 	'acl_u_pm_download'	=> array('lang' => 'Can download files in private messages', 'cat' => 'pm'),
-	'acl_u_pm_bbcode'	=> array('lang' => 'Can post BBCode in private messages', 'cat' => 'pm'),
-	'acl_u_pm_smilies'	=> array('lang' => 'Can post smilies in private messages', 'cat' => 'pm'),
-	'acl_u_pm_img'		=> array('lang' => 'Can post images in private messages', 'cat' => 'pm'),
-	'acl_u_pm_flash'	=> array('lang' => 'Can post Flash in private messages', 'cat' => 'pm'),
+	'acl_u_pm_bbcode'	=> array('lang' => 'Can use BBCode in private messages', 'cat' => 'pm'),
+	'acl_u_pm_smilies'	=> array('lang' => 'Can use smilies in private messages', 'cat' => 'pm'),
+	'acl_u_pm_img'		=> array('lang' => 'Can use [img] BBCode tag in private messages', 'cat' => 'pm'),
+	'acl_u_pm_flash'	=> array('lang' => 'Can use [flash] BBCode tag in private messages', 'cat' => 'pm'),
 
 	'acl_u_sendemail'	=> array('lang' => 'Can send e-mails', 'cat' => 'misc'),
 	'acl_u_sendim'		=> array('lang' => 'Can send instant messages', 'cat' => 'misc'),
@@ -151,10 +151,10 @@
 	'acl_f_attach'		=> array('lang' => 'Can attach files', 'cat' => 'content'),
 	'acl_f_download'	=> array('lang' => 'Can download files', 'cat' => 'content'),
 	'acl_f_sigs'		=> array('lang' => 'Can use signatures', 'cat' => 'content'),
-	'acl_f_bbcode'		=> array('lang' => 'Can post BBCode', 'cat' => 'content'),
-	'acl_f_smilies'		=> array('lang' => 'Can post smilies', 'cat' => 'content'),
-	'acl_f_img'			=> array('lang' => 'Can post images', 'cat' => 'content'),
-	'acl_f_flash'		=> array('lang' => 'Can post Flash', 'cat' => 'content'),
+	'acl_f_bbcode'		=> array('lang' => 'Can use BBCode', 'cat' => 'content'),
+	'acl_f_smilies'		=> array('lang' => 'Can use smilies', 'cat' => 'content'),
+	'acl_f_img'			=> array('lang' => 'Can use [img] BBCode tag', 'cat' => 'content'),
+	'acl_f_flash'		=> array('lang' => 'Can use [flash] BBCode tag', 'cat' => 'content'),
 
 	'acl_f_edit'		=> array('lang' => 'Can edit own posts', 'cat' => 'actions'),
 	'acl_f_delete'		=> array('lang' => 'Can delete own posts', 'cat' => 'actions'),
diff -x .svn -aruN 3.0.5.src/language/en/acp/posting.php 3.0.6.src/language/en/acp/posting.php
--- 3.0.5.src/language/en/acp/posting.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/acp/posting.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_posting [English]
 *
 * @package language
-* @version $Id: posting.php 9375 2009-03-16 16:47:16Z acydburn $
+* @version $Id: posting.php 9902 2009-08-01 11:07:48Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -68,7 +68,7 @@
 
 	'TOKEN'					=> 'Token',
 	'TOKENS'				=> 'Tokens',
-	'TOKENS_EXPLAIN'		=> 'Tokens are placeholders for user input. The input will be validated only if it matches the corresponding definition. If needed, you can number them by adding a number as the last character between the braces, e.g. {TEXT1}, {TEXT2}.<br /><br />Within the HTML replacement you can also use any language string present in your language/ directory like this: {L_<em>&lt;STRINGNAME&gt;</em>} where <em>&lt;STRINGNAME&gt;</em> is the name of the translated string you want to add. For example, {L_WROTE} will be displayed as &quot;wrote&quot; or its translation according to user’s locale.<br /><br /><strong>Please note that only tokens listed below are able to be used within custom BBCodes.</strong>',
+	'TOKENS_EXPLAIN'		=> 'Tokens are placeholders for user input. The input will be validated only if it matches the corresponding definition. If needed, you can number them by adding a number as the last character between the braces, e.g. {TEXT1}, {TEXT2}.<br /><br />Within the HTML replacement you can also use any language string present in your language/ directory like this: {L_<em>&lt;STRINGNAME&gt;</em>} where <em>&lt;STRINGNAME&gt;</em> is the name of the translated string you want to add. For example, {L_WROTE} will be displayed as “wrote” or its translation according to user’s locale.<br /><br /><strong>Please note that only tokens listed below are able to be used within custom BBCodes.</strong>',
 	'TOKEN_DEFINITION'		=> 'What can it be?',
 	'TOO_MANY_BBCODES'		=> 'You cannot create any more BBCodes. Please remove one or more BBCodes then try again.',
 
@@ -78,7 +78,7 @@
 		'IDENTIFIER'	=> 'Characters from the latin alphabet (A-Z), numbers, hyphen and underscore',
 		'NUMBER'		=> 'Any series of digits',
 		'EMAIL'			=> 'A valid e-mail address',
-		'URL'			=> 'A valid URL using any protocol (http, ftp, etc… cannot be used for javascript exploits). If none is given, &quot;http://&quot; is prefixed to the string.',
+		'URL'			=> 'A valid URL using any protocol (http, ftp, etc… cannot be used for javascript exploits). If none is given, “http://” is prefixed to the string.',
 		'LOCAL_URL'		=> 'A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol.',
 		'COLOR'			=> 'A HTML colour, can be either in the numeric form <samp>#FF1234</samp> or a <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-color">CSS colour keyword</a> such as <samp>fuchsia</samp> or <samp>InactiveBorder</samp>'
 	)
@@ -180,6 +180,8 @@
 	'SMILIES_URL'				=> 'Smiley image file',
 	'SMILIES_WIDTH'				=> 'Smiley width',
 
+	'TOO_MANY_SMILIES'			=> 'Limit of %d smilies reached.',
+
 	'WRONG_PAK_TYPE'	=> 'The specified package does not contain the appropriate data.',
 ));
 
@@ -217,6 +219,7 @@
 	'RANK_ADDED'			=> 'The rank was successfully added.',
 	'RANK_IMAGE'			=> 'Rank image',
 	'RANK_IMAGE_EXPLAIN'	=> 'Use this to define a small image associated with the rank. The path is relative to the root phpBB directory.',
+	'RANK_IMAGE_IN_USE'		=> '(In use)',
 	'RANK_MINIMUM'			=> 'Minimum posts',
 	'RANK_REMOVED'			=> 'The rank was successfully deleted.',
 	'RANK_SPECIAL'			=> 'Set as special rank',
diff -x .svn -aruN 3.0.5.src/language/en/acp/profile.php 3.0.6.src/language/en/acp/profile.php
--- 3.0.5.src/language/en/acp/profile.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/acp/profile.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_profile [English]
 *
 * @package language
-* @version $Id: profile.php 9342 2009-02-26 23:46:46Z terrafrost $
+* @version $Id: profile.php 9916 2009-08-03 15:46:56Z Kellanved $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -66,6 +66,8 @@
 	'DISPLAY_AT_PROFILE_EXPLAIN'	=> 'The user is able to change this profile field within the user control panel.',
 	'DISPLAY_AT_REGISTER'			=> 'Display on registration screen',
 	'DISPLAY_AT_REGISTER_EXPLAIN'	=> 'If this option is enabled, the field will be displayed on registration.',
+	'DISPLAY_ON_VT'					=> 'Display on viewtopic screen',
+	'DISPLAY_ON_VT_EXPLAIN'			=> 'If this option is enabled, the field will be displayed in the mini-profile on the topic screen.',
 	'DISPLAY_PROFILE_FIELD'			=> 'Publicly display profile field',
 	'DISPLAY_PROFILE_FIELD_EXPLAIN'	=> 'The profile field will be shown in all locations allowed within the load settings. Setting this to “no” will hide the field from topic pages, profiles and the memberlist.',
 	'DROPDOWN_ENTRIES_EXPLAIN'		=> 'Enter your options now, every option in one line.',
diff -x .svn -aruN 3.0.5.src/language/en/acp/prune.php 3.0.6.src/language/en/acp/prune.php
--- 3.0.5.src/language/en/acp/prune.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/acp/prune.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_prune [English]
 *
 * @package language
-* @version $Id: prune.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: prune.php 9933 2009-08-06 09:12:21Z marshalrusty $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -37,23 +37,23 @@
 
 // User pruning
 $lang = array_merge($lang, array(
-	'ACP_PRUNE_USERS_EXPLAIN'	=> 'Here you can delete (or deactivate) users from your board. This can be done in a variety of ways; by post count, last activity, etc. Each of these criteria can be combined, i.e. you can prune users last active before 2002-01-01 with fewer than 10 posts. Alternatively you can enter a list of users directly into the text box, any criteria entered will be ignored. Take care with this facility! Once a user is deleted there is no way back.',
+	'ACP_PRUNE_USERS_EXPLAIN'	=> 'This section allows you to delete or deactivate users on your board. Accounts can be filtered in a variety of ways; by post count, most recent activity, etc. Criteria may be combined to narrow down which accounts are affected. For example, you can prune users with fewer than 10 posts, who were also inactive after 2002-01-01. Alternatively, you may skip the criteria selection completely by entering a list of users (each on a separate line) into the text field. Take care with this facility! Once a user is deleted, there is no way to reverse the action.',
 
 	'DEACTIVATE_DELETE'			=> 'Deactivate or delete',
-	'DEACTIVATE_DELETE_EXPLAIN'	=> 'Choose whether to deactivate users or delete them entirely, note there is no undo!',
+	'DEACTIVATE_DELETE_EXPLAIN'	=> 'Choose whether to deactivate users or delete them entirely. Please note that deleted users cannot be restored!',
 	'DELETE_USERS'				=> 'Delete',
 	'DELETE_USER_POSTS'			=> 'Delete pruned user posts',
 	'DELETE_USER_POSTS_EXPLAIN' => 'Removes posts made by deleted users, has no effect if users are deactivated.',
 
 	'JOINED_EXPLAIN'			=> 'Enter a date in <kbd>YYYY-MM-DD</kbd> format.',
 
-	'LAST_ACTIVE_EXPLAIN'		=> 'Enter a date in <kbd>YYYY-MM-DD</kbd> format.',
+	'LAST_ACTIVE_EXPLAIN'		=> 'Enter a date in <kbd>YYYY-MM-DD</kbd> format. Enter <kbd>0000-00-00</kbd> to prune users who never logged in, <em>Before</em> and <em>After</em> conditions will be ignored.',
 
 	'PRUNE_USERS_LIST'				=> 'Users to be pruned',
 	'PRUNE_USERS_LIST_DELETE'		=> 'With the selected critera for pruning users the following accounts will be removed.',
 	'PRUNE_USERS_LIST_DEACTIVATE'	=> 'With the selected critera for pruning users the following accounts will be deactivated.',
 
-	'SELECT_USERS_EXPLAIN'		=> 'Enter specific usernames here, they will be used in preference to the criteria above.',
+	'SELECT_USERS_EXPLAIN'		=> 'Enter specific usernames here, they will be used in preference to the criteria above. Founders cannot be pruned.',
 
 	'USER_DEACTIVATE_SUCCESS'	=> 'The selected users have been deactivated successfully.',
 	'USER_DELETE_SUCCESS'		=> 'The selected users have been deleted successfully.',
diff -x .svn -aruN 3.0.5.src/language/en/acp/styles.php 3.0.6.src/language/en/acp/styles.php
--- 3.0.5.src/language/en/acp/styles.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/acp/styles.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_styles [English]
 *
 * @package language
-* @version $Id: styles.php 9046 2008-11-02 16:19:11Z acydburn $
+* @version $Id: styles.php 10074 2009-08-31 11:25:28Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -392,6 +392,7 @@
 	'TEMPLATE_LOCATION'			=> 'Store templates in',
 	'TEMPLATE_LOCATION_EXPLAIN'	=> 'Images are always stored on the filesystem.',
 	'TEMPLATE_NAME'				=> 'Template name',
+	'TEMPLATE_FILE_NOT_WRITABLE'=> 'Unable to write to template file %s. Please check the permissions for the directory and the files.',
 	'TEMPLATE_REFRESHED'		=> 'Template refreshed successfully.',
 
 	'THEME_ADDED'				=> 'New theme added on filesystem.',
diff -x .svn -aruN 3.0.5.src/language/en/acp/users.php 3.0.6.src/language/en/acp/users.php
--- 3.0.5.src/language/en/acp/users.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/acp/users.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * acp_users [English]
 *
 * @package language
-* @version $Id: users.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: users.php 9767 2009-07-17 11:27:50Z toonarmy $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -77,6 +77,7 @@
 	'MOVE_POSTS_EXPLAIN'	=> 'Please select the forum to which you wish to move all the posts this user has made.',
 
 	'NO_SPECIAL_RANK'		=> 'No special rank assigned',
+	'NO_WARNINGS'			=> 'No warnings.',
 	'NOT_MANAGE_FOUNDER'	=> 'You tried to manage a user with founder status. Only founders are allowed to manage other founders.',
 
 	'QUICK_TOOLS'			=> 'Quick tools',
@@ -102,21 +103,28 @@
 	'USER_ADMIN_DEACTIVED'			=> 'User deactivated successfully.',
 	'USER_ADMIN_DEL_ATTACH'			=> 'Delete all attachments',
 	'USER_ADMIN_DEL_AVATAR'			=> 'Delete avatar',
+	'USER_ADMIN_DEL_OUTBOX'			=> 'Empty PM outbox',
 	'USER_ADMIN_DEL_POSTS'			=> 'Delete all posts',
 	'USER_ADMIN_DEL_SIG'			=> 'Delete signature',
 	'USER_ADMIN_EXPLAIN'			=> 'Here you can change your users information and certain specific options.',
 	'USER_ADMIN_FORCE'				=> 'Force reactivation',
+	'USER_ADMIN_LEAVE_NR'			=> 'Remove from Newly Registered',
 	'USER_ADMIN_MOVE_POSTS'			=> 'Move all posts',
 	'USER_ADMIN_SIG_REMOVED'		=> 'Successfully removed signature from user account.',
 	'USER_ATTACHMENTS_REMOVED'		=> 'Successfully removed all attachments made by this user.',
+	'USER_AVATAR_NOT_ALLOWED'		=> 'The avatar cannot be displayed because avatars have been disallowed.',
 	'USER_AVATAR_UPDATED'			=> 'Successfully updated user avatars details.',
+	'USER_AVATAR_TYPE_NOT_ALLOWED'	=> 'The current avatar cannot be displayed because its type has been disallowed.',
 	'USER_CUSTOM_PROFILE_FIELDS'	=> 'Custom profile fields',
 	'USER_DELETED'					=> 'User deleted successfully.',
 	'USER_GROUP_ADD'				=> 'Add user to group',
 	'USER_GROUP_NORMAL'				=> 'User defined groups user is a member of',
 	'USER_GROUP_PENDING'			=> 'Groups user is in pending mode',
 	'USER_GROUP_SPECIAL'			=> 'Pre-defined groups user is a member of',
+	'USER_LIFTED_NR'				=> 'Successfully removed the user’s newly registered status.',
 	'USER_NO_ATTACHMENTS'			=> 'There are no attached files to display.',
+	'USER_OUTBOX_EMPTIED'			=> 'Successfully emptied user’s private message outbox.',
+	'USER_OUTBOX_EMPTY'				=> 'The user’s private message outbox was already empty.',
 	'USER_OVERVIEW_UPDATED'			=> 'User details updated.',
 	'USER_POSTS_DELETED'			=> 'Successfully removed all posts made by this user.',
 	'USER_POSTS_MOVED'				=> 'Successfully moved users posts to target forum.',
@@ -126,6 +134,7 @@
 	'USER_RANK'						=> 'User rank',
 	'USER_RANK_UPDATED'				=> 'User rank updated.',
 	'USER_SIG_UPDATED'				=> 'User signature successfully updated.',
+	'USER_WARNING_LOG_DELETED'		=> 'No information available. Possibly the log entry has been deleted.',
 	'USER_TOOLS'					=> 'Basic tools',
 ));
 
diff -x .svn -aruN 3.0.5.src/language/en/captcha_qa.php 3.0.6.src/language/en/captcha_qa.php
--- 3.0.5.src/language/en/captcha_qa.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/language/en/captcha_qa.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,63 @@
+<?php
+/**
+*
+* captcha_qa [English]
+*
+* @package language
+* @version $Id: captcha_qa.php 9966 2009-08-12 15:12:03Z Kellanved $
+* @copyright (c) 2009 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+if (empty($lang) || !is_array($lang))
+{
+	$lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+	'CAPTCHA_QA'				=> 'Q&amp;A CAPTCHA',
+	'CONFIRM_QUESTION_EXPLAIN'	=> 'This question is a means of identifying and preventing automated submissions.',
+	'CONFIRM_QUESTION_WRONG'	=> 'You have provided an invalid answer to the confirmation question.',
+
+	'QUESTION_ANSWERS'			=> 'Answers',
+	'ANSWERS_EXPLAIN'			=> 'Please enter valid answers to the question, one per line.',
+	'CONFIRM_QUESTION'			=> 'Question',
+
+	'ANSWER'					=> 'Answer',
+	'EDIT_QUESTION'				=> 'Edit Question',
+	'QUESTIONS'					=> 'Questions',
+	'QUESTIONS_EXPLAIN'			=> 'During registration, users will be asked one of the questions specified here. To use this plugin, at least one question must be set in the default language. These questions should be easy for your target audience to answer, but beyond the ability of a bot capable of running a Google™ search. Using a large and regulary changed set of questions will yield the best results. Enable the strict setting if your question relies on punctuation or capitalisation.',
+	'QUESTION_DELETED'			=> 'Question deleted',
+	'QUESTION_LANG'				=> 'Language',
+	'QUESTION_LANG_EXPLAIN'		=> 'The language that this question and its answers are written in.',
+	'QUESTION_STRICT'			=> 'Strict check',
+	'QUESTION_STRICT_EXPLAIN'	=> 'If enabled, capitalisation and whitespace will also be enforced.',
+
+	'QUESTION_TEXT'				=> 'Question',
+	'QUESTION_TEXT_EXPLAIN'		=> 'The question that will be asked on registration.',
+
+	'QA_ERROR_MSG'				=> 'Please fill in all fields and enter at least one answer.',
+));
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/language/en/captcha_recaptcha.php 3.0.6.src/language/en/captcha_recaptcha.php
--- 3.0.5.src/language/en/captcha_recaptcha.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/language/en/captcha_recaptcha.php	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,52 @@
+<?php
+/**
+*
+* recaptcha [English]
+*
+* @package language
+* @version $Id: captcha_recaptcha.php 9933 2009-08-06 09:12:21Z marshalrusty $
+* @copyright (c) 2009 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+if (empty($lang) || !is_array($lang))
+{
+	$lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+	'RECAPTCHA_LANG'				=> 'en',
+	'RECAPTCHA_NOT_AVAILABLE'		=> 'In order to use reCaptcha, you must create an account on <a href="http://recaptcha.net">reCaptcha.net</a>.',
+	'CAPTCHA_RECAPTCHA'				=> 'reCaptcha',
+	'RECAPTCHA_INCORRECT'			=> 'The visual confirmation code you submitted was incorrect',
+
+	'RECAPTCHA_PUBLIC'				=> 'Public reCaptcha key',
+	'RECAPTCHA_PUBLIC_EXPLAIN'		=> 'Your public reCaptcha key. Keys can be obtained on <a href="http://recaptcha.net">reCaptcha.net</a>.',
+	'RECAPTCHA_PRIVATE'				=> 'Private reCaptcha key',
+	'RECAPTCHA_PRIVATE_EXPLAIN'		=> 'Your private reCaptcha key. Keys can be obtained on <a href="http://recaptcha.net">reCaptcha.net</a>.',
+
+	'RECAPTCHA_EXPLAIN'				=> 'In an effort to prevent automatic submissions, we require that you enter both of the words displayed below into the text field underneath.',
+));
+
+?>
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/language/en/common.php 3.0.6.src/language/en/common.php
--- 3.0.5.src/language/en/common.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/common.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * common [English]
 *
 * @package language
-* @version $Id: common.php 9464 2009-04-17 15:52:40Z acydburn $
+* @version $Id: common.php 9845 2009-07-24 11:13:32Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -250,6 +250,7 @@
 	'G_REGISTERED'				=> 'Registered users',
 	'G_REGISTERED_COPPA'		=> 'Registered COPPA users',
 	'G_GLOBAL_MODERATORS'		=> 'Global moderators',
+	'G_NEWLY_REGISTERED'		=> 'Newly registered users',
 
 	'HIDDEN_USERS_ONLINE'			=> '%d hidden users online',
 	'HIDDEN_USERS_TOTAL'			=> '%d hidden',
@@ -383,6 +384,8 @@
 	'NO_ONLINE_USERS'			=> 'No registered users',
 	'NO_POSTS'					=> 'No posts',
 	'NO_POSTS_TIME_FRAME'		=> 'No posts exist inside this topic for the selected time frame.',
+	'NO_FEED_ENABLED'			=> 'Feeds are not available on this board.',
+	'NO_FEED'					=> 'The requested feed is not available.',
 	'NO_SUBJECT'				=> 'No subject specified',								// Used for posts having no subject defined but displayed within management pages.
 	'NO_SUCH_SEARCH_MODULE'		=> 'The specified search backend doesn’t exist.',
 	'NO_SUPPORTED_AUTH_METHODS'	=> 'No supported authentication methods.',
@@ -486,6 +489,8 @@
 	'RETURN_PAGE'				=> '%sReturn to the previous page%s',
 	'RETURN_TOPIC'				=> '%sReturn to the topic last visited%s',
 	'RETURN_TO'					=> 'Return to',
+	'FEED'						=> 'Feed',
+	'FEED_NEWS'					=> 'News',
 	'RULES_ATTACH_CAN'			=> 'You <strong>can</strong> post attachments in this forum',
 	'RULES_ATTACH_CANNOT'		=> 'You <strong>cannot</strong> post attachments in this forum',
 	'RULES_DELETE_CAN'			=> 'You <strong>can</strong> delete your posts in this forum',
@@ -517,6 +522,7 @@
 	'SEARCH_SELF'				=> 'View your posts',
 	'SEARCH_TOPIC'				=> 'Search this topic…',
 	'SEARCH_UNANSWERED'			=> 'View unanswered posts',
+	'SEARCH_UNREAD'				=> 'View unread posts',
 	'SECONDS'					=> 'Seconds',
 	'SELECT'					=> 'Select',
 	'SELECT_ALL_CODE'			=> 'Select all',
@@ -535,6 +541,7 @@
 	'SORT_JOINED'				=> 'Joined date',
 	'SORT_LOCATION'				=> 'Location',
 	'SORT_RANK'					=> 'Rank',
+	'SORT_POSTS'				=> 'Posts',
 	'SORT_TOPIC_TITLE'			=> 'Topic title',
 	'SORT_USERNAME'				=> 'Username',
 	'SPLIT_TOPIC'				=> 'Split topic',
@@ -598,6 +605,7 @@
 
 	'TOPIC'				=> 'Topic',
 	'TOPICS'			=> 'Topics',
+	'TOPICS_UNAPPROVED'	=> 'At least one topic in this forum has not been approved.',
 	'TOPIC_ICON'		=> 'Topic icon',
 	'TOPIC_LOCKED'		=> 'This topic is locked, you cannot edit posts or make further replies.',
 	'TOPIC_LOCKED_SHORT'=> 'Topic locked',
@@ -644,6 +652,8 @@
 	'USERS'					=> 'Users',
 	'USE_PERMISSIONS'		=> 'Test out user’s permissions',
 
+	'USER_NEW_PERMISSION_DISALLOWED'	=> 'We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more to be able to use this feature.',
+
 	'VARIANT_DATE_SEPARATOR'	=> ' / ',	// Used in date format dropdown, eg: "Today, 13:37 / 01 Jan 2007, 13:37" ... to join a relative date with calendar date
 	'VIEWED'					=> 'Viewed',
 	'VIEWING_FAQ'				=> 'Viewing FAQ',
diff -x .svn -aruN 3.0.5.src/language/en/email/admin_welcome_activated.txt 3.0.6.src/language/en/email/admin_welcome_activated.txt
--- 3.0.5.src/language/en/email/admin_welcome_activated.txt	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/email/admin_welcome_activated.txt	2009-11-16 11:10:10.000000000 -0600
@@ -2,6 +2,8 @@
 
 Hello {USERNAME},
 
-Your account on "{SITENAME}" has now been activated, you may login using the username and password you received in a previous e-mail.
+Your account on "{SITENAME}" has now been activated, you may login using the username you received in a previous e-mail.
+
+Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
 
 {EMAIL_SIG}
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/language/en/email/admin_welcome_inactive.txt 3.0.6.src/language/en/email/admin_welcome_inactive.txt
--- 3.0.5.src/language/en/email/admin_welcome_inactive.txt	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/email/admin_welcome_inactive.txt	2009-11-16 11:10:10.000000000 -0600
@@ -6,14 +6,13 @@
 
 ----------------------------
 Username: {USERNAME}
-Password: {PASSWORD}
 
 Board URL: {U_BOARD}
 ----------------------------
 
-Your account is currently inactive, the administrator of the board will need to activate it before you can log in. You will receive another e-mail when this has occurred.
+Your account is currently inactive and will need to be approved by an administrator before you can log in. Another email will be sent when this had occured.
 
-Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
+Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
 
 Thank you for registering.
 
diff -x .svn -aruN 3.0.5.src/language/en/email/coppa_resend_inactive.txt 3.0.6.src/language/en/email/coppa_resend_inactive.txt
--- 3.0.5.src/language/en/email/coppa_resend_inactive.txt	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/email/coppa_resend_inactive.txt	2009-11-16 11:10:10.000000000 -0600
@@ -2,9 +2,9 @@
 
 {WELCOME_MSG}
 
-In compliance with the COPPA your account is currently inactive.
+In compliance with the COPPA, your account is currently inactive.
 
-Please print this message out and have your parent or guardian sign and date it. Then fax it to:
+Please print this message and have your parent or guardian sign and date it. Then fax it to:
 
 {FAX_INFO}
 
@@ -33,9 +33,9 @@
 ------------------------------ CUT HERE ------------------------------
 
 
-Once the administrator has received the above form via fax or regular mail your account will be activated.
+Once the administrator has received the above form via fax or regular mail, your account will be activated.
 
-Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
+Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
 
 Thank you for registering.
 
diff -x .svn -aruN 3.0.5.src/language/en/email/coppa_welcome_inactive.txt 3.0.6.src/language/en/email/coppa_welcome_inactive.txt
--- 3.0.5.src/language/en/email/coppa_welcome_inactive.txt	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/email/coppa_welcome_inactive.txt	2009-11-16 11:10:10.000000000 -0600
@@ -2,9 +2,9 @@
 
 {WELCOME_MSG}
 
-In compliance with the COPPA your account is currently inactive.
+In compliance with the COPPA, your account is currently inactive.
 
-Please print this message out and have your parent or guardian sign and date it. Then fax it to:
+Please print this message and have your parent or guardian sign and date it. Then fax it to:
 
 {FAX_INFO}
 
@@ -16,7 +16,6 @@
 Permission to participate at "{SITENAME}" - {U_BOARD}
 
 Username: {USERNAME}
-Password: {PASSWORD}
 E-mail: {EMAIL_ADDRESS}
 
 I HAVE REVIEWED THE INFORMATION PROVIDED BY MY CHILD AND HEREBY GRANT PERMISSION TO "{SITENAME}" TO STORE THIS INFORMATION. 
@@ -34,9 +33,9 @@
 ------------------------------ CUT HERE ------------------------------
 
 
-Once the administrator has received the above form via fax or regular mail your account will be activated.
+Once the administrator has received the above form via fax or regular mail, your account will be activated.
 
-Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
+Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
 
 Thank you for registering.
 
diff -x .svn -aruN 3.0.5.src/language/en/email/installed.txt 3.0.6.src/language/en/email/installed.txt
--- 3.0.5.src/language/en/email/installed.txt	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/email/installed.txt	2009-11-16 11:10:10.000000000 -0600
@@ -4,17 +4,16 @@
 
 You have successfully installed phpBB on your server.
 
-This e-mail contains important information on your installation that you should keep safe. The password has been encrypted in the database and cannot be recovered, although you can request a new password should you lose this one.
+This e-mail contains important information regarding your installation and should be kept for reference. Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
 
 ----------------------------
 Username: {USERNAME}
-Password: {PASSWORD}
 
 Board URL: {U_BOARD}
 ----------------------------
 
-Useful information on your phpBB installation can be found in the docs folder of your installation and on phpBB.com's support page - http://www.phpbb.com/support/
+Useful information regarding the phpBB software can be found in the docs folder of your installation and on phpBB.com's support page - http://www.phpbb.com/support/
 
-In order to keep the board safe and secure, it is highly recommended that you keep current with software releases which can be easily done by subscribing to phpBB.com's mailing list, located at the above URL.
+In order to keep your board safe and secure, we highly recommended keeping current with software releases. For your convenience, a mailing list is available at the page referenced above.
 
 {EMAIL_SIG}
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/language/en/email/pm_report_closed.txt 3.0.6.src/language/en/email/pm_report_closed.txt
--- 3.0.5.src/language/en/email/pm_report_closed.txt	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/language/en/email/pm_report_closed.txt	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,8 @@
+Subject: Report closed - "{PM_SUBJECT}"
+
+Hello {USERNAME},
+
+You are receiving this notification because the report you filed regarding the private message "{PM_SUBJECT}" at "{SITENAME}" has been tended to by a moderator or administrator. The report is now closed. If you have further questions, please contact {CLOSER_NAME} by private message.
+
+
+{EMAIL_SIG}
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/language/en/email/pm_report_deleted.txt 3.0.6.src/language/en/email/pm_report_deleted.txt
--- 3.0.5.src/language/en/email/pm_report_deleted.txt	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/language/en/email/pm_report_deleted.txt	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,8 @@
+Subject: Report deleted - "{PM_SUBJECT}"
+
+Hello {USERNAME},
+
+You are receiving this notification because the report you filed regarding the private message "{PM_SUBJECT}" at "{SITENAME}" was deleted by a moderator or administrator.
+
+
+{EMAIL_SIG}
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/language/en/email/user_reactivate_account.txt 3.0.6.src/language/en/email/user_reactivate_account.txt
--- 3.0.5.src/language/en/email/user_reactivate_account.txt	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/email/user_reactivate_account.txt	2009-11-16 11:10:10.000000000 -0600
@@ -9,7 +9,7 @@
 Username: {USERNAME}
 ----------------------------
 
-Your password has been encrypted in our database. Should you forget your password you can request a new one which will be activated in the same way as this account.
+Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
 
 Please visit the following link to reactivate your account:
 
diff -x .svn -aruN 3.0.5.src/language/en/email/user_remind_inactive.txt 3.0.6.src/language/en/email/user_remind_inactive.txt
--- 3.0.5.src/language/en/email/user_remind_inactive.txt	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/email/user_remind_inactive.txt	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 
 Hello {USERNAME},
 
-On {REGISTER_DATE} you registered a new account at "{SITENAME}". To date you have not activated this account which is a prerequisite for board login. For your convenience the activation link is repeated below.
+This notification is a reminder that your account at "{SITENAME}", created on {REGISTER_DATE}, remains inactive. If you would like to activate this account, please visit the following link:
 
 {U_ACTIVATE}
 
diff -x .svn -aruN 3.0.5.src/language/en/email/user_resend_inactive.txt 3.0.6.src/language/en/email/user_resend_inactive.txt
--- 3.0.5.src/language/en/email/user_resend_inactive.txt	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/email/user_resend_inactive.txt	2009-11-16 11:10:10.000000000 -0600
@@ -8,9 +8,9 @@
 Username: {USERNAME}
 ----------------------------
 
-Your password has been encrypted in our database. Should you forget your password you can request a new one which will be activated in the same way as this account.
+Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
 
-Your account is currently inactive. You cannot use it until you visit the following link:
+Please visit the following link in order to activate your account:
 
 {U_ACTIVATE}
 
diff -x .svn -aruN 3.0.5.src/language/en/email/user_welcome_inactive.txt 3.0.6.src/language/en/email/user_welcome_inactive.txt
--- 3.0.5.src/language/en/email/user_welcome_inactive.txt	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/email/user_welcome_inactive.txt	2009-11-16 11:10:10.000000000 -0600
@@ -6,16 +6,15 @@
 
 ----------------------------
 Username: {USERNAME}
-Password: {PASSWORD}
 
 Board URL: {U_BOARD}
 ----------------------------
 
-Your account is currently inactive. You cannot use it until you visit the following link:
+Please visit the following link in order to activate your account:
 
 {U_ACTIVATE}
 
-Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
+Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
 
 Thank you for registering.
 
diff -x .svn -aruN 3.0.5.src/language/en/email/user_welcome.txt 3.0.6.src/language/en/email/user_welcome.txt
--- 3.0.5.src/language/en/email/user_welcome.txt	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/email/user_welcome.txt	2009-11-16 11:10:10.000000000 -0600
@@ -6,12 +6,11 @@
 
 ----------------------------
 Username: {USERNAME}
-Password: {PASSWORD}
 
 Board URL: {U_BOARD}
 ----------------------------
 
-Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
+Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
 
 Thank you for registering.
 
diff -x .svn -aruN 3.0.5.src/language/en/help_bbcode.php 3.0.6.src/language/en/help_bbcode.php
--- 3.0.5.src/language/en/help_bbcode.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/help_bbcode.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * help_bbcode [English]
 *
 * @package language
-* @version $Id: help_bbcode.php 9461 2009-04-17 15:23:17Z acydburn $
+* @version $Id: help_bbcode.php 9623 2009-06-18 18:12:28Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -78,6 +78,11 @@
 		0 => 'Creating an Ordered list',
 		1 => 'The second type of list, an ordered list, gives you control over what is output before each item. To create an ordered list you use <strong>[list=1][/list]</strong> to create a numbered list or alternatively <strong>[list=a][/list]</strong> for an alphabetical list. As with the unordered list, items are specified using <strong>[*]</strong>. For example:<br /><br /><strong>[list=1]</strong><br /><strong>[*]</strong>Go to the shops<br /><strong>[*]</strong>Buy a new computer<br /><strong>[*]</strong>Swear at computer when it crashes<br /><strong>[/list]</strong><br /><br />will generate the following:<ol style="list-style-type: decimal;"><li>Go to the shops</li><li>Buy a new computer</li><li>Swear at computer when it crashes</li></ol>Whereas for an alphabetical list you would use:<br /><br /><strong>[list=a]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol>'
 	),
+	// This block will switch the FAQ-Questions to the second template column
+	array(
+		0 => '--',
+		1 => '--'
+	),
 	array(
 		0 => '--',
 		1 => 'Creating Links'
diff -x .svn -aruN 3.0.5.src/language/en/help_faq.php 3.0.6.src/language/en/help_faq.php
--- 3.0.5.src/language/en/help_faq.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/help_faq.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * help_faq [English]
 *
 * @package language
-* @version $Id: help_faq.php 8896 2008-09-19 16:59:40Z acydburn $
+* @version $Id: help_faq.php 9623 2009-06-18 18:12:28Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -202,6 +202,11 @@
 		0 => 'What are topic icons?',
 		1 => 'Topic icons are author chosen images associated with posts to indicate their content. The ability to use topic icons depends on the permissions set by the board administrator.'
 	),
+	// This block will switch the FAQ-Questions to the second template column
+	array(
+		0 => '--',
+		1 => '--'
+	),
 	array(
 		0 => '--',
 		1 => 'User Levels and Groups'
diff -x .svn -aruN 3.0.5.src/language/en/install.php 3.0.6.src/language/en/install.php
--- 3.0.5.src/language/en/install.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/install.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * install [English]
 *
 * @package language
-* @version $Id: install.php 9508 2009-05-03 11:18:08Z acydburn $
+* @version $Id: install.php 10152 2009-09-16 13:02:13Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -133,6 +133,7 @@
 	'DB_PASSWORD'				=> 'Database password',
 	'DB_PORT'					=> 'Database server port',
 	'DB_PORT_EXPLAIN'			=> 'Leave this blank unless you know the server operates on a non-standard port.',
+	'DB_UPDATE_NOT_SUPPORTED'	=> 'We are sorry, but this script does not support updating from versions of phpBB prior to “%1$s”. The version you currently have installed is “%2$s”. Please update to a previous version before running this script. Assistance with this is available in the Support Forum on phpBB.com.',
 	'DB_USERNAME'				=> 'Database username',
 	'DB_TEST'					=> 'Test connection',
 	'DEFAULT_LANG'				=> 'Default board language',
@@ -166,6 +167,9 @@
 	'FILES_REQUIRED_EXPLAIN'	=> '<strong>Required</strong> - In order to function correctly phpBB needs to be able to access or write to certain files or directories. If you see “Not Found” you need to create the relevant file or directory. If you see “Unwritable” you need to change the permissions on the file or directory to allow phpBB to write to it.',
 	'FILLING_TABLE'				=> 'Filling table <strong>%s</strong>',
 	'FILLING_TABLES'			=> 'Filling tables',
+
+	'FIREBIRD_DBMS_UPDATE_REQUIRED'		=> 'phpBB no longer supports Firebird/Interbase prior to Version 2.1. Please update your Firebird installation to at least 2.1.0 before proceeding with the update.',
+
 	'FINAL_STEP'				=> 'Process final step',
 	'FORUM_ADDRESS'				=> 'Board address',
 	'FORUM_ADDRESS_EXPLAIN'		=> 'This is the URL of your former board, for example <samp>http://www.example.com/phpBB2/</samp>. If an address is entered here and not left empty every instance of this address will be replaced by your new board address within messages, private messages and signatures.',
@@ -184,11 +188,11 @@
 	'INITIAL_CONFIG_EXPLAIN'	=> 'Now that install has determined your server can run phpBB you need to supply some specific information. If you do not know how to connect to your database please contact your hosting provider (in the first instance) or use the phpBB support forums. When entering data please ensure you check it thoroughly before continuing.',
 	'INSTALL_CONGRATS'			=> 'Congratulations!',
 	'INSTALL_CONGRATS_EXPLAIN'	=> '
-		<p>You have now successfully installed phpBB %1$s. From here, you have two options as to what to do with your newly installed phpBB3:</p>
+		You have successfully installed phpBB %1$s. Please proceed by choosing one of the following options:</p>
 		<h2>Convert an existing board to phpBB3</h2>
-		<p>The phpBB Unified Convertor Framework supports the conversion of phpBB 2.0.x and other board systems to phpBB3. If you have an existing board that you wish to convert, please <a href="%2$s">proceed on to the convertor</a>.</p>
+		<p>The phpBB Unified Convertor Framework supports the conversion of phpBB 2.0.x and other board systems to phpBB3. If you have an existing board that you wish to convert, please <a href="%2$s">proceed to the convertor</a>.</p>
 		<h2>Go live with your phpBB3!</h2>
-		<p>Clicking the button below will take you to your Administration Control Panel (ACP). Take some time to examine the options available to you. Remember that help is available online via the <a href="http://www.phpbb.com/support/documentation/3.0/">Documentation</a> and the <a href="http://www.phpbb.com/community/viewforum.php?f=46">support forums</a>, see the <a href="%3$s">README</a> for further information.</p><p><strong>Please now delete, move or rename the install directory before you use your board. If this directory is still present, only the Administration Control Panel (ACP) will be accessible.</strong></p>',
+		<p>Clicking the button below will take you to a form for submitting statistical data to phpBB in your Administration Control Panel (ACP). We would appreciate it if you could help us by sending that information. Afterwards you should take some time to examine the options available to you. Remember that help is available online via the <a href="http://www.phpbb.com/support/documentation/3.0/">Documentation</a>, <a href="%3$s">README</a> and the <a href="http://www.phpbb.com/community/viewforum.php?f=46">Support Forums</a>.</p><p><strong>Please delete, move or rename the install directory before using your board. While this directory exists, only the Administration Control Panel (ACP) will be accessible.</strong>',
 	'INSTALL_INTRO'				=> 'Welcome to Installation',
 
 	'INSTALL_INTRO_BODY'		=> 'With this option, it is possible to install phpBB3 onto your server.</p><p>In order to proceed, you will need your database settings. If you do not know your database settings, please contact your host and ask for them. You will not be able to continue without them. You need:</p>
@@ -208,7 +212,7 @@
 		<li>MySQL 3.23 or above (MySQLi supported)</li>
 		<li>PostgreSQL 7.3+</li>
 		<li>SQLite 2.8.2+</li>
-		<li>Firebird 2.0+</li>
+		<li>Firebird 2.1+</li>
 		<li>MS SQL Server 2000 or above (directly or via ODBC)</li>
 		<li>Oracle</li>
 	</ul>
@@ -230,7 +234,7 @@
 	'INST_ERR_DB_NO_MYSQLI'		=> 'The version of MySQL installed on this machine is incompatible with the “MySQL with MySQLi Extension” option you have selected. Please try the “MySQL” option instead.',
 	'INST_ERR_DB_NO_SQLITE'		=> 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.',
 	'INST_ERR_DB_NO_ORACLE'		=> 'The version of Oracle installed on this machine requires you to set the <var>NLS_CHARACTERSET</var> parameter to <var>UTF8</var>. Either upgrade your installation to 9.2+ or change the parameter.',
-	'INST_ERR_DB_NO_FIREBIRD'	=> 'The version of Firebird installed on this machine is older than 2.0, please upgrade to a newer version.',
+	'INST_ERR_DB_NO_FIREBIRD'	=> 'The version of Firebird installed on this machine is older than 2.1, please upgrade to a newer version.',
 	'INST_ERR_DB_NO_FIREBIRD_PS'=> 'The database you selected for Firebird has a page size less than 8192, it must be at least 8192.',
 	'INST_ERR_DB_NO_POSTGRES'	=> 'The database you have selected was not created in <var>UNICODE</var> or <var>UTF8</var> encoding. Try installing with a database in <var>UNICODE</var> or <var>UTF8</var> encoding.',
 	'INST_ERR_DB_NO_NAME'		=> 'No database name specified.',
@@ -364,7 +368,7 @@
 
 // Updater
 $lang = array_merge($lang, array(
-	'ALL_FILES_UP_TO_DATE'		=> 'All files are up to date with the latest phpBB version. You should now <a href="../ucp.php?mode=login">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory!',
+	'ALL_FILES_UP_TO_DATE'		=> 'All files are up to date with the latest phpBB version. You should now <a href="../ucp.php?mode=login&amp;redirect=adm/index.php%3Fi=send_statistics%26mode=send_statistics">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the <a href="../ucp.php?mode=login&amp;redirect=adm/index.php%3Fi=send_statistics%26mode=send_statistics">Send statistics</a> module in your ACP.',
 	'ARCHIVE_FILE'				=> 'Source file within archive',
 
 	'BACK'				=> 'Back',
@@ -447,8 +451,8 @@
 
 	'MERGE_NO_MERGE_NEW_OPTION'	=> 'Do not merge - use new file',
 	'MERGE_NO_MERGE_MOD_OPTION'	=> 'Do not merge - use currently installed file',
-	'MERGE_MOD_FILE_OPTION'		=> 'Merge modifications (Loose new phpBB code within conflicting block)',
-	'MERGE_NEW_FILE_OPTION'		=> 'Merge modifications (Loose modified code within conflicting block)',
+	'MERGE_MOD_FILE_OPTION'		=> 'Merge modifications (removes new phpBB code within conflicting block)',
+	'MERGE_NEW_FILE_OPTION'		=> 'Merge modifications (removes modified code within conflicting block)',
 	'MERGE_SELECT_ERROR'		=> 'Conflicting file merge modes are not correctly selected.',
 	'MERGING_FILES'				=> 'Merging differences',
 	'MERGING_FILES_EXPLAIN'		=> 'Currently collecting final file changes.<br /><br />Please wait until phpBB has completed all operations on changed files.',
@@ -466,7 +470,7 @@
 	'NO_VISIBLE_CHANGES'			=> 'No visible changes',
 	'NOTICE'						=> 'Notice',
 	'NUM_CONFLICTS'					=> 'Number of conflicts',
-	'NUMBER_OF_FILES_COLLECTED'		=> 'Currently differences of %1$d of %2$d files have been checked.<br />Please wait until all files are checked.',
+	'NUMBER_OF_FILES_COLLECTED'		=> 'Currently differences from %1$d of %2$d files have been checked.<br />Please wait until all files are checked.',
 
 	'OLD_UPDATE_FILES'		=> 'Update files are out of date. The update files found are for updating from phpBB %1$s to phpBB %2$s but the latest version of phpBB is %3$s.',
 
@@ -559,14 +563,15 @@
 	'USER_ACTIVE'					=> 'Active user',
 	'USER_INACTIVE'					=> 'Inactive user',
 
-	'VERSION_CHECK'				=> 'Version check',
-	'VERSION_CHECK_EXPLAIN'		=> 'Checks to see if the version of phpBB you are currently running is up to date.',
-	'VERSION_NOT_UP_TO_DATE'	=> 'Your version of phpBB is not up to date. Please continue the update process.',
-	'VERSION_NOT_UP_TO_DATE_ACP'=> 'Your version of phpBB is not up to date.<br />Below you will find a link to the release announcement for the latest version as well as instructions on how to perform the update.',
-	'VERSION_UP_TO_DATE'		=> 'Your installation is up to date, no updates are available for your version of phpBB. You may want to continue anyway to perform a file validity check.',
-	'VERSION_UP_TO_DATE_ACP'	=> 'Your installation is up to date, no updates are available for your version of phpBB. You do not need to update your installation.',
-	'VIEWING_FILE_CONTENTS'		=> 'Viewing file contents',
-	'VIEWING_FILE_DIFF'			=> 'Viewing file differences',
+	'VERSION_CHECK'					=> 'Version check',
+	'VERSION_CHECK_EXPLAIN'			=> 'Checks to see if your phpBB installation is up to date.',
+	'VERSION_NOT_UP_TO_DATE'		=> 'Your phpBB installation is not up to date. Please continue the update process.',
+	'VERSION_NOT_UP_TO_DATE_ACP'	=> 'Your phpBB installation is not up to date.<br />Below is a link to the release announcement, which contains more information as well as instructions on updating.',
+	'VERSION_NOT_UP_TO_DATE_TITLE'	=> 'Your phpBB installation is not up to date.',
+	'VERSION_UP_TO_DATE'			=> 'Your phpBB installation is up to date. Although there are no updates available at this time, you may continue in order to perform a file validity check.',
+	'VERSION_UP_TO_DATE_ACP'		=> 'Your phpBB installation is up to date. There are no updates available at this time.',
+	'VIEWING_FILE_CONTENTS'			=> 'Viewing file contents',
+	'VIEWING_FILE_DIFF'				=> 'Viewing file differences',
 
 	'WRONG_INFO_FILE_FORMAT'	=> 'Wrong info file format',
 ));
diff -x .svn -aruN 3.0.5.src/language/en/mcp.php 3.0.6.src/language/en/mcp.php
--- 3.0.5.src/language/en/mcp.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/mcp.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * mcp [English]
 *
 * @package language
-* @version $Id: mcp.php 8940 2008-09-26 11:25:04Z toonarmy $
+* @version $Id: mcp.php 9854 2009-07-25 18:06:25Z naderman $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -46,6 +46,7 @@
 	'ALL_NOTES_DELETED'		=> 'Successfully removed all user notes.',
 	'ALL_REPORTS'			=> 'All reports',
 	'ALREADY_REPORTED'		=> 'This post has already been reported.',
+	'ALREADY_REPORTED_PM'	=> 'This private message has already been reported.',
 	'ALREADY_WARNED'		=> 'A warning has already been issued for this post.',
 	'APPROVE'				=> 'Approve',
 	'APPROVE_POST'			=> 'Approve post',
@@ -58,11 +59,19 @@
 	'CANNOT_WARN_SELF'		=> 'You cannot warn yourself.',
 	'CAN_LEAVE_BLANK'		=> 'This can be left blank.',
 	'CHANGE_POSTER'			=> 'Change poster',
+	'CLOSE_PM_REPORT'		=> 'Close PM report',
+	'CLOSE_PM_REPORT_CONFIRM'	=> 'Are you sure you want to close the selected PM report?',
+	'CLOSE_PM_REPORTS'		=> 'Close PM reports',
+	'CLOSE_PM_REPORTS_CONFIRM'	=> 'Are you sure you want to close the selected PM reports?',
 	'CLOSE_REPORT'			=> 'Close report',
 	'CLOSE_REPORT_CONFIRM'	=> 'Are you sure you want to close the selected report?',
 	'CLOSE_REPORTS'			=> 'Close reports',
 	'CLOSE_REPORTS_CONFIRM'	=> 'Are you sure you want to close the selected reports?',
 
+	'DELETE_PM_REPORT'			=> 'Delete PM report',
+	'DELETE_PM_REPORT_CONFIRM'	=> 'Are you sure you want to delete the selected PM report?',
+	'DELETE_PM_REPORTS'			=> 'Delete PM reports',
+	'DELETE_PM_REPORTS_CONFIRM'	=> 'Are you sure you want to delete the selected PM reports?',
 	'DELETE_POSTS'				=> 'Delete posts',
 	'DELETE_POSTS_CONFIRM'		=> 'Are you sure you want to delete these posts?',
 	'DELETE_POST_CONFIRM'		=> 'Are you sure you want to delete this post?',
@@ -106,6 +115,7 @@
 
 	'LATEST_LOGS'				=> 'Latest 5 logged actions',
 	'LATEST_REPORTED'			=> 'Latest 5 reports',
+	'LATEST_REPORTED_PMS'		=> 'Latest 5 PM reports',
 	'LATEST_UNAPPROVED'			=> 'Latest 5 posts awaiting approval',
 	'LATEST_WARNING_TIME'		=> 'Latest warning issued',
 	'LATEST_WARNINGS'			=> 'Latest 5 warnings',
@@ -170,7 +180,14 @@
 
 	'MCP_POST_REPORTS'				=> 'Reports issued on this post',
 
-	'MCP_REPORTS'					=> 'Reported posts',
+	'MCP_PM_REPORTS'				=> 'Reported PMs',
+	'MCP_PM_REPORT_DETAILS'			=> 'PM Report details',
+	'MCP_PM_REPORTS_CLOSED'			=> 'Closed PM reports',
+	'MCP_PM_REPORTS_CLOSED_EXPLAIN'	=> 'This is a list of all reports about private messages which have previously been resolved.',
+	'MCP_PM_REPORTS_OPEN'			=> 'Open PM reports',
+	'MCP_PM_REPORTS_OPEN_EXPLAIN'	=> 'This is a list of all reported private messages which are still to be handled.',
+
+	'MCP_REPORTS'					=> 'Reported messages',
 	'MCP_REPORT_DETAILS'			=> 'Report details',
 	'MCP_REPORTS_CLOSED'			=> 'Closed reports',
 	'MCP_REPORTS_CLOSED_EXPLAIN'	=> 'This is a list of all reports about posts which have previously been resolved.',
@@ -232,6 +249,13 @@
 	'ONLY_TOPIC'			=> 'Only topic “%s”',
 	'OTHER_USERS'			=> 'Other users posting from this IP',
 
+	'PM_REPORT_CLOSED_SUCCESS'	=> 'The selected PM report has been closed successfully.',
+	'PM_REPORT_DELETED_SUCCESS'	=> 'The selected PM report has been deleted successfully.',
+	'PM_REPORTED_SUCCESS'		=> 'This private message has been successfully reported.',
+	'PM_REPORT_TOTAL'			=> 'In total there is <strong>1</strong> PM report to review.',
+	'PM_REPORTS_TOTAL'			=> 'In total there are <strong>%d</strong> PM reports to review.',
+	'PM_REPORTS_ZERO_TOTAL'		=> 'There are no PM reports to review.',
+	'PM_REPORT_DETAILS'			=> 'Private message report details',
 	'POSTER'					=> 'Poster',
 	'POSTS_APPROVED_SUCCESS'	=> 'The selected posts have been approved.',
 	'POSTS_DELETED_SUCCESS'		=> 'The selected posts have been successfully removed from the database.',
@@ -264,7 +288,7 @@
 	'REPORT_DELETED_SUCCESS'	=> 'The selected report has been deleted successfully.',
 	'REPORT_DETAILS'			=> 'Report details',
 	'REPORT_MESSAGE'			=> 'Report this message',
-	'REPORT_MESSAGE_EXPLAIN'	=> 'Use this form to report the selected message. Reporting should generally be used only if the message breaks forum rules.',
+	'REPORT_MESSAGE_EXPLAIN'	=> 'Use this form to report the selected private message. Reporting should generally be used only if the message breaks forum rules. <strong>Reporting a private message will make its contents visible to all moderators.</strong>',
 	'REPORT_NOTIFY'				=> 'Notify me',
 	'REPORT_NOTIFY_EXPLAIN'		=> 'Informs you when your report is dealt with.',
 	'REPORT_POST_EXPLAIN'		=> 'Use this form to report the selected post to the forum moderators and board administrators. Reporting should generally be used only if the post breaks forum rules.',
@@ -275,6 +299,7 @@
 	'RETURN_MESSAGE'			=> '%sReturn to the message%s',
 	'RETURN_NEW_FORUM'			=> '%sGo to the new forum%s',
 	'RETURN_NEW_TOPIC'			=> '%sGo to the new topic%s',
+	'RETURN_PM'					=> '%sReturn to the private message%s',
 	'RETURN_POST'				=> '%sReturn to the post%s',
 	'RETURN_QUEUE'				=> '%sReturn to the queue%s',
 	'RETURN_REPORTS'			=> '%sReturn to the reports%s',
@@ -346,6 +371,7 @@
 	'USER_WARNING_ADDED'			=> 'User warned successfully.',
 
 	'VIEW_DETAILS'			=> 'View details',
+	'VIEW_PM'				=> 'View private message',
 	'VIEW_POST'				=> 'View post',
 
 	'WARNED_USERS'			=> 'Warned users',
@@ -365,10 +391,10 @@
 			'OTHER'		=> 'Other',
 		),
 		'DESCRIPTION' => array(
-			'WAREZ'		=> 'The post contains links to illegal or pirated software.',
-			'SPAM'		=> 'The reported post has the only purpose to advertise for a website or another product.',
-			'OFF_TOPIC'	=> 'The reported post is off topic.',
-			'OTHER'		=> 'The reported post does not fit into any other category, please use the further information field.',
+			'WAREZ'		=> 'The message contains links to illegal or pirated software.',
+			'SPAM'		=> 'The reported message has the only purpose to advertise for a website or another product.',
+			'OFF_TOPIC'	=> 'The reported message is off topic.',
+			'OTHER'		=> 'The reported message does not fit into any other category, please use the further information field.',
 		)
 	),
 ));
diff -x .svn -aruN 3.0.5.src/language/en/memberlist.php 3.0.6.src/language/en/memberlist.php
--- 3.0.5.src/language/en/memberlist.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/memberlist.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * memberlist [English]
 *
 * @package language
-* @version $Id: memberlist.php 8574 2008-05-29 13:59:47Z Kellanved $
+* @version $Id: memberlist.php 9933 2009-08-06 09:12:21Z marshalrusty $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -81,7 +81,7 @@
 	'IM_MESSAGE'			=> 'Your message',
 	'IM_MSNM'				=> 'Please note that you need Windows Messenger installed to use this.',
 	'IM_MSNM_BROWSER'		=> 'Your browser does not support this.',
-	'IM_MSNM_CONNECT'		=> 'MSNM is not connected.\nYou have to connect to MSNM to continue.',		
+	'IM_MSNM_CONNECT'		=> 'MSNM is not connected.\nYou have to connect to MSNM to continue.',
 	'IM_NAME'				=> 'Your Name',
 	'IM_NO_DATA'			=> 'There is no suitable contact information for this user.',
 	'IM_NO_JABBER'			=> 'Sorry, direct messaging of Jabber users is not supported on this board. You will need a Jabber client installed on your system to contact the recipient above.',
@@ -90,7 +90,7 @@
 	'IM_SEND_MESSAGE'		=> 'Send message',
 	'IM_SENT_JABBER'		=> 'Your message to %1$s has been sent successfully.',
 	'IM_USER'				=> 'Send an instant message',
-	
+
 	'LAST_ACTIVE'				=> 'Last active',
 	'LESS_THAN'					=> 'Less than',
 	'LIST_USER'					=> '1 user',
@@ -134,6 +134,10 @@
 	'USER_ADMIN'			=> 'Administrate user',
 	'USER_BAN'				=> 'Banning',
 	'USER_FORUM'			=> 'User statistics',
+	'USER_LAST_REMINDED'	=> array(
+		0		=> 'No reminder sent at this time',
+		1		=> '%1$d reminder sent<br />» %2$s',
+	),
 	'USER_ONLINE'			=> 'Online',
 	'USER_PRESENCE'			=> 'Board presence',
 
diff -x .svn -aruN 3.0.5.src/language/en/posting.php 3.0.6.src/language/en/posting.php
--- 3.0.5.src/language/en/posting.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/posting.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * posting [English]
 *
 * @package language
-* @version $Id: posting.php 9464 2009-04-17 15:52:40Z acydburn $
+* @version $Id: posting.php 9742 2009-07-09 10:34:40Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -167,6 +167,8 @@
 	'POST_ICON'					=> 'Post icon',
 	'POST_NORMAL'				=> 'Normal',
 	'POST_REVIEW'				=> 'Post review',
+	'POST_REVIEW_EDIT'			=> 'Post review',
+	'POST_REVIEW_EDIT_EXPLAIN'	=> 'This post has been altered by another user while you were editing it. You may wish to review the current version of this post and adjust your edits.',
 	'POST_REVIEW_EXPLAIN'		=> 'At least one new post has been made to this topic. You may wish to review your post in light of this.',
 	'POST_STORED'				=> 'This message has been posted successfully.',
 	'POST_STORED_MOD'			=> 'This message has been submitted successfully, but it will need to be approved by a moderator before it is publicly viewable.',
@@ -184,10 +186,11 @@
 	'SMILIES_ARE_ON'			=> 'Smilies are <em>ON</em>',
 	'STICKY_ANNOUNCE_TIME_LIMIT'=> 'Sticky/Announcement time limit',
 	'STICK_TOPIC_FOR'			=> 'Stick topic for',
-	'STICK_TOPIC_FOR_EXPLAIN'	=> 'Enter 0 or leave blank for a never ending Sticky/Announcement.',
+	'STICK_TOPIC_FOR_EXPLAIN'	=> 'Enter 0 or leave blank for a never ending Sticky/Announcement. Please note that this number is relative to the date of the post.',
 	'STYLES_TIP'				=> 'Tip: Styles can be applied quickly to selected text.',
 
 	'TOO_FEW_CHARS'				=> 'Your message contains too few characters.',
+	'TOO_FEW_CHARS_LIMIT'		=> 'Your message contains %1$d characters. The minimum number of characters you need to enter is %2$d.',
 	'TOO_FEW_POLL_OPTIONS'		=> 'You must enter at least two poll options.',
 	'TOO_MANY_ATTACHMENTS'		=> 'Cannot add another attachment, %d is the maximum.',
 	'TOO_MANY_CHARS'			=> 'Your message contains too many characters.',
diff -x .svn -aruN 3.0.5.src/language/en/search.php 3.0.6.src/language/en/search.php
--- 3.0.5.src/language/en/search.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/language/en/search.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * search [English]
 *
 * @package language
-* @version $Id: search.php 9438 2009-04-11 11:09:45Z acydburn $
+* @version $Id: search.php 10004 2009-08-17 13:25:04Z rxu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -53,6 +53,7 @@
 	'JUMP_TO_POST'			=> 'Jump to post',
 
 	'LOGIN_EXPLAIN_EGOSEARCH'	=> 'The board requires you to be registered and logged in to view your own posts.',
+	'LOGIN_EXPLAIN_UNREADSEARCH'=> 'The board requires you to be registered and logged in to view your unread posts.',
 
 	'MAX_NUM_SEARCH_KEYWORDS_REFINE'	=> 'You specified too many words to search for. Please do not enter more than %1$d words.',
 
diff -x .svn -aruN 3.0.5.src/language/en/ucp.php 3.0.6.src/language/en/ucp.php
--- 3.0.5.src/language/en/ucp.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/ucp.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * ucp [English]
 *
 * @package language
-* @version $Id: ucp.php 9478 2009-04-22 13:08:23Z acydburn $
+* @version $Id: ucp.php 10138 2009-09-11 14:38:23Z Kellanved $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -79,6 +79,7 @@
 	'ADD_NEW_RULE'					=> 'Add new rule',
 	'ADD_RULE'						=> 'Add rule',
 	'ADD_TO'						=> 'Add [To]',
+	'ADD_USERS_UCP_EXPLAIN'			=> 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Please enter each username on a separate line.',
 	'ADMIN_EMAIL'					=> 'Administrators can e-mail me information',
 	'AGREE'							=> 'I agree to these terms',
 	'ALLOW_PM'						=> 'Allow users to send you private messages',
@@ -92,7 +93,9 @@
 	'AVATAR_FEATURES_DISABLED'		=> 'The avatar functionality is currently disabled.',
 	'AVATAR_GALLERY'				=> 'Local gallery',
 	'AVATAR_GENERAL_UPLOAD_ERROR'	=> 'Could not upload avatar to %s.',
+	'AVATAR_NOT_ALLOWED'			=> 'Your avatar cannot be displayed because avatars have been disallowed.',
 	'AVATAR_PAGE'					=> 'Page',
+	'AVATAR_TYPE_NOT_ALLOWED'		=> 'Your current avatar cannot be displayed because its type has been disallowed.',
 
 	'BACK_TO_DRAFTS'			=> 'Back to saved drafts',
 	'BACK_TO_LOGIN'				=> 'Back to login screen',
@@ -197,6 +200,7 @@
 	'FOES_UPDATED'				=> 'Your foes list has been updated successfully.',
 	'FOLDER_ADDED'				=> 'Folder successfully added.',
 	'FOLDER_MESSAGE_STATUS'		=> '%1$d from %2$d messages stored',
+	'FOLDER_NAME_EMPTY'			=> 'You must enter a name for this folder.',
 	'FOLDER_NAME_EXIST'			=> 'Folder <strong>%s</strong> already exists.',
 	'FOLDER_OPTIONS'			=> 'Folder options',
 	'FOLDER_RENAMED'			=> 'Folder successfully renamed.',
@@ -273,10 +277,12 @@
 	'NOTIFY_METHOD_IM'				=> 'Jabber only',
 	'NOTIFY_ON_PM'					=> 'Notify me on new private messages',
 	'NOT_ADDED_FRIENDS_ANONYMOUS'	=> 'You cannot add the anonymous user to your friends list.',
+	'NOT_ADDED_FRIENDS_BOTS'		=> 'You cannot add bots to your friends list.',
 	'NOT_ADDED_FRIENDS_FOES'		=> 'You cannot add users to your friends list who are on your foes list.',
 	'NOT_ADDED_FRIENDS_SELF'		=> 'You cannot add yourself to the friends list.',
 	'NOT_ADDED_FOES_MOD_ADMIN'		=> 'You cannot add administrators and moderators to your foes list.',
 	'NOT_ADDED_FOES_ANONYMOUS'		=> 'You cannot add the anonymous user to your foes list.',
+	'NOT_ADDED_FOES_BOTS'			=> 'You cannot add bots to your foes list.',
 	'NOT_ADDED_FOES_FRIENDS'		=> 'You cannot add users to your foes list who are on your friends list.',
 	'NOT_ADDED_FOES_SELF'			=> 'You cannot add yourself to the foes list.',
 	'NOT_AGREE'						=> 'I do not agree to these terms',
@@ -346,7 +352,7 @@
 	'POST_EDIT_PM'				=> 'Edit message',
 	'POST_FORWARD_PM'			=> 'Forward message',
 	'POST_NEW_PM'				=> 'Compose message',
-	'POST_PM_LOCKED'			=> 'Private messaging is locked',
+	'POST_PM_LOCKED'			=> 'Private messaging is locked.',
 	'POST_PM_POST'				=> 'Quote post',
 	'POST_QUOTE_PM'				=> 'Quote message',
 	'POST_REPLY_PM'				=> 'Reply to message',
@@ -368,6 +374,8 @@
 	'RENAME'							=> 'Rename',
 	'RENAME_FOLDER'						=> 'Rename folder',
 	'REPLIED_MESSAGE'					=> 'Replied to message',
+	'REPLY_TO_ALL'						=> 'Reply to sender and all recipients.',
+	'REPORT_PM'							=> 'Report private message',
 	'RESIGN_SELECTED'					=> 'Resign selected',
 	'RETURN_FOLDER'						=> '%1$sReturn to previous folder%2$s',
 	'RETURN_UCP'						=> '%sReturn to the User Control Panel%s',
@@ -417,7 +425,7 @@
 	'UCP_MAIN_FRONT'			=> 'Front page',
 	'UCP_MAIN_SUBSCRIBED'		=> 'Manage subscriptions',
 
-	'UCP_MSNM'					=> 'MSN Messenger',
+	'UCP_MSNM'					=> 'WL/MSN Messenger',
 	'UCP_NO_ATTACHMENTS'		=> 'You have posted no files.',
 
 	'UCP_PREFS'					=> 'Board preferences',
diff -x .svn -aruN 3.0.5.src/language/en/viewtopic.php 3.0.6.src/language/en/viewtopic.php
--- 3.0.5.src/language/en/viewtopic.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/language/en/viewtopic.php	2009-11-16 11:10:10.000000000 -0600
@@ -4,7 +4,7 @@
 * viewtopic [English]
 *
 * @package language
-* @version $Id: viewtopic.php 8775 2008-08-21 15:41:12Z Kellanved $
+* @version $Id: viewtopic.php 9972 2009-08-14 08:42:46Z Kellanved $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -48,6 +48,7 @@
 	'BUMP_TOPIC'			=> 'Bump topic',
 
 	'CODE'					=> 'Code',
+	'COLLAPSE_QR'			=> 'Hide Quick Reply',
 
 	'DELETE_TOPIC'			=> 'Delete topic',
 	'DOWNLOAD_NOTICE'		=> 'You do not have the required permissions to view the files attached to this post.',
@@ -59,7 +60,8 @@
 
 	'FILE_NOT_FOUND_404'	=> 'The file <strong>%s</strong> does not exist.',
 	'FORK_TOPIC'			=> 'Copy topic',
-
+	'FULL_EDITOR'			=> 'Full Editor',
+	
 	'LINKAGE_FORBIDDEN'		=> 'You are not authorised to view, download or link from/to this site.',
 	'LOGIN_NOTIFY_TOPIC'	=> 'You have been notified about this topic, please login to view it.',
 	'LOGIN_VIEWTOPIC'		=> 'The board requires you to be registered and logged in to view this topic.',
@@ -86,11 +88,13 @@
 	'PRINT_TOPIC'			=> 'Print view',
 
 	'QUICK_MOD'				=> 'Quick-mod tools',
+	'QUICKREPLY'			=> 'Quick Reply',
 	'QUOTE'					=> 'Quote',
 
 	'REPLY_TO_TOPIC'		=> 'Reply to topic',
 	'RETURN_POST'			=> '%sReturn to the post%s',
 
+	'SHOW_QR'				=> 'Quick Reply',
 	'SUBMIT_VOTE'			=> 'Submit vote',
 
 	'TOTAL_VOTES'			=> 'Total votes',
diff -x .svn -aruN 3.0.5.src/mcp.php 3.0.6.src/mcp.php
--- 3.0.5.src/mcp.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/mcp.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package mcp
-* @version $Id: mcp.php 9414 2009-03-30 11:09:51Z acydburn $
+* @version $Id: mcp.php 9830 2009-07-22 13:33:54Z naderman $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -77,6 +77,7 @@
 $post_id = request_var('p', 0);
 $topic_id = request_var('t', 0);
 $forum_id = request_var('f', 0);
+$report_id = request_var('r', 0);
 $user_id = request_var('u', 0);
 $username = utf8_normalize_nfc(request_var('username', '', true));
 
@@ -211,11 +212,16 @@
 	$module->set_display('queue', 'approve_details', false);
 }
 
-if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed')
+if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' || $mode == 'pm_reports' || $mode == 'pm_reports_closed' || $mode == 'pm_report_details')
 {
 	$module->set_display('reports', 'report_details', false);
 }
 
+if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' || $mode == 'pm_reports' || $mode == 'pm_reports_closed' || $mode == 'report_details')
+{
+	$module->set_display('pm_reports', 'pm_report_details', false);
+}
+
 if (!$topic_id)
 {
 	$module->set_display('main', 'topic_view', false);
@@ -323,13 +329,14 @@
 
 function extra_url()
 {
-	global $forum_id, $topic_id, $post_id, $user_id;
+	global $forum_id, $topic_id, $post_id, $report_id, $user_id;
 
 	$url_extra = '';
 	$url_extra .= ($forum_id) ? "&amp;f=$forum_id" : '';
 	$url_extra .= ($topic_id) ? "&amp;t=$topic_id" : '';
 	$url_extra .= ($post_id) ? "&amp;p=$post_id" : '';
 	$url_extra .= ($user_id) ? "&amp;u=$user_id" : '';
+	$url_extra .= ($report_id) ? "&amp;r=$report_id" : '';
 
 	return $url_extra;
 }
@@ -564,9 +571,51 @@
 }
 
 /**
+* Get simple pm data
+*/
+function get_pm_data($pm_ids)
+{
+	global $db, $auth, $config, $user;
+
+	$rowset = array();
+
+	if (!sizeof($pm_ids))
+	{
+		return array();
+	}
+
+	$sql_array = array(
+		'SELECT'	=> 'p.*, u.*',
+
+		'FROM'		=> array(
+			USERS_TABLE			=> 'u',
+			PRIVMSGS_TABLE		=> 'p',
+		),
+
+		'WHERE'		=> $db->sql_in_set('p.msg_id', $pm_ids) . '
+			AND u.user_id = p.author_id',
+	);
+
+	$sql = $db->sql_build_query('SELECT', $sql_array);
+	$result = $db->sql_query($sql);
+	unset($sql_array);
+
+	while ($row = $db->sql_fetchrow($result))
+	{
+		$rowset[$row['msg_id']] = $row;
+	}
+	$db->sql_freeresult($result);
+
+	return $rowset;
+}
+
+/**
 * sorting in mcp
 *
 * @param string $where_sql should either be WHERE (default if ommited) or end with AND or OR
+*
+* $mode reports and reports_closed: the $where parameters uses aliases p for posts table and r for report table
+* $mode unapproved_posts: the $where parameters uses aliases p for posts table and t for topic table
 */
 function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE')
 {
@@ -614,12 +663,14 @@
 			$type = 'posts';
 			$default_key = 't';
 			$default_dir = 'd';
-			$where_sql .= ($topic_id) ? ' topic_id = ' . $topic_id . ' AND' : '';
+			$where_sql .= ($topic_id) ? ' p.topic_id = ' . $topic_id . ' AND' : '';
 
-			$sql = 'SELECT COUNT(post_id) AS total
-				FROM ' . POSTS_TABLE . "
-				$where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
-					AND post_approved = 0';
+			$sql = 'SELECT COUNT(p.post_id) AS total
+				FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
+				$where_sql " . $db->sql_in_set('p.forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
+					AND p.post_approved = 0
+					AND t.topic_id = p.topic_id
+					AND t.topic_first_post_id <> p.post_id';
 
 			if ($min_time)
 			{
@@ -643,40 +694,55 @@
 			}
 		break;
 
+		case 'pm_reports':
+		case 'pm_reports_closed':
 		case 'reports':
 		case 'reports_closed':
-			$type = 'reports';
+			$pm = (strpos($mode, 'pm_') === 0) ? true : false;
+
+			$type = ($pm) ? 'pm_reports' : 'reports';
 			$default_key = 't';
 			$default_dir = 'd';
 			$limit_time_sql = ($min_time) ? "AND r.report_time >= $min_time" : '';
 
 			if ($topic_id)
 			{
-				$where_sql .= ' p.topic_id = ' . $topic_id;
+				$where_sql .= ' p.topic_id = ' . $topic_id . ' AND ';
 			}
 			else if ($forum_id)
 			{
-				$where_sql .= ' p.forum_id = ' . $forum_id;
+				$where_sql .= ' p.forum_id = ' . $forum_id . ' AND ';
 			}
-			else
+			else if (!$pm)
 			{
-				$where_sql .= ' ' . $db->sql_in_set('p.forum_id', get_forum_list(array('!f_read', '!m_report')), true, true);
+				$where_sql .= ' ' . $db->sql_in_set('p.forum_id', get_forum_list(array('!f_read', '!m_report')), true, true) . ' AND ';
 			}
 
-			if ($mode == 'reports')
+			if ($mode == 'reports' || $mode == 'pm_reports')
 			{
-				$where_sql .= ' AND r.report_closed = 0';
+				$where_sql .= ' r.report_closed = 0 AND ';
 			}
 			else
 			{
-				$where_sql .= ' AND r.report_closed = 1';
+				$where_sql .= ' r.report_closed = 1 AND ';
 			}
 
-			$sql = 'SELECT COUNT(r.report_id) AS total
-				FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . " p
-				$where_sql
-					AND p.post_id = r.post_id
-					$limit_time_sql";
+			if ($pm)
+			{
+				$sql = 'SELECT COUNT(r.report_id) AS total
+					FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . " p
+					$where_sql r.post_id = 0
+						AND p.msg_id = r.pm_id
+						$limit_time_sql";
+			}
+			else
+			{
+				$sql = 'SELECT COUNT(r.report_id) AS total
+					FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . " p
+					$where_sql r.pm_id = 0
+						AND p.post_id = r.post_id
+						$limit_time_sql";
+			}
 		break;
 
 		case 'viewlogs':
@@ -719,6 +785,12 @@
 			$sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => 'p.post_time', 't' => 'r.report_time', 's' => 'p.post_subject');
 		break;
 
+		case 'pm_reports':
+			$limit_days = array(0 => $user->lang['ALL_REPORTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
+			$sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']);
+			$sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => 'p.message_time', 't' => 'r.report_time', 's' => 'p.message_subject');
+		break;
+
 		case 'logs':
 			$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
 			$sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
diff -x .svn -aruN 3.0.5.src/memberlist.php 3.0.6.src/memberlist.php
--- 3.0.5.src/memberlist.php	2009-05-31 05:58:33.000000000 -0500
+++ 3.0.6.src/memberlist.php	2009-11-16 11:10:09.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: memberlist.php 9482 2009-04-24 17:27:10Z terrafrost $
+* @version $Id: memberlist.php 10257 2009-11-07 15:11:40Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -500,7 +500,31 @@
 
 		$poster_avatar = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']);
 
-		$template->assign_vars(show_profile($member));
+		// We need to check if the modules 'zebra' ('friends' & 'foes' mode),  'notes' ('user_notes' mode) and  'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links
+		$zebra_enabled = $friends_enabled = $foes_enabled = $user_notes_enabled = $warn_user_enabled = false;
+
+		// Only check if the user is logged in
+		if ($user->data['is_registered'])
+		{
+			if (!class_exists('p_master'))
+			{
+				include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
+			}
+			$module = new p_master();
+
+			$module->list_modules('ucp');
+			$module->list_modules('mcp');
+
+			$user_notes_enabled = ($module->loaded('notes', 'user_notes')) ? true : false;
+			$warn_user_enabled = ($module->loaded('warn', 'warn_user')) ? true : false;
+			$zebra_enabled = ($module->loaded('zebra')) ? true : false;
+			$friends_enabled = ($module->loaded('zebra', 'friends')) ? true : false;
+			$foes_enabled = ($module->loaded('zebra', 'foes')) ? true : false;
+
+			unset($module);
+		}
+
+		$template->assign_vars(show_profile($member, $user_notes_enabled, $warn_user_enabled));
 
 		// Custom Profile Fields
 		$profile_fields = array();
@@ -512,21 +536,6 @@
 			$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields[$user_id]) : array();
 		}
 
-		// We need to check if the module 'zebra' is accessible
-		$zebra_enabled = false;
-
-		if ($user->data['user_id'] != $user_id && $user->data['is_registered'])
-		{
-			include_once($phpbb_root_path . 'includes/functions_module.' . $phpEx);
-			$module = new p_master();
-			$module->list_modules('ucp');
-			$module->set_active('zebra');
-
-			$zebra_enabled = ($module->active_module === false) ? false : true;
-
-			unset($module);
-		}
-
 		// If the user has m_approve permission or a_user permission, then list then display unapproved posts
 		if ($auth->acl_getf_global('m_approve') || $auth->acl_get('a_user'))
 		{
@@ -573,13 +582,15 @@
 			'U_USER_BAN'			=> ($auth->acl_get('m_ban') && $user_id != $user->data['user_id']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=ban&amp;mode=user&amp;u=' . $user_id, true, $user->session_id) : '',
 			'U_MCP_QUEUE'			=> ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',
 
-			'U_SWITCH_PERMISSIONS'	=> ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_id}") : '',
+			'U_SWITCH_PERMISSIONS'	=> ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_id}&amp;hash=" . generate_link_hash('switchperm')) : '',
 
+			'S_USER_NOTES'		=> ($user_notes_enabled) ? true : false,
+			'S_WARN_USER'		=> ($warn_user_enabled) ? true : false,
 			'S_ZEBRA'			=> ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false,
-			'U_ADD_FRIEND'		=> (!$friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
-			'U_ADD_FOE'			=> (!$foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;mode=foes&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
-			'U_REMOVE_FRIEND'	=> ($friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;usernames[]=' . $user_id) : '',
-			'U_REMOVE_FOE'		=> ($foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;mode=foes&amp;usernames[]=' . $user_id) : '',
+			'U_ADD_FRIEND'		=> (!$friend && !$foe && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
+			'U_ADD_FOE'			=> (!$friend && !$foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;mode=foes&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
+			'U_REMOVE_FRIEND'	=> ($friend && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;usernames[]=' . $user_id) : '',
+			'U_REMOVE_FOE'		=> ($foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;mode=foes&amp;usernames[]=' . $user_id) : '',
 		));
 
 		if (!empty($profile_fields['row']))
@@ -965,9 +976,11 @@
 			$jabber		= request_var('jabber', '');
 			$search_group_id	= request_var('search_group_id', 0);
 
+			// when using these, make sure that we actually have values defined in $find_key_match
 			$joined_select	= request_var('joined_select', 'lt');
 			$active_select	= request_var('active_select', 'lt');
 			$count_select	= request_var('count_select', 'eq');
+
 			$joined			= explode('-', request_var('joined', ''));
 			$active			= explode('-', request_var('active', ''));
 			$count			= (request_var('count', '') !== '') ? request_var('count', 0) : '';
@@ -1005,9 +1018,9 @@
 			$sql_where .= ($yahoo) ? ' AND u.user_yim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $yahoo)) . ' ' : '';
 			$sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', $db->any_char, $msn)) . ' ' : '';
 			$sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->any_char, $jabber)) . ' ' : '';
-			$sql_where .= (is_numeric($count)) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : '';
-			$sql_where .= (sizeof($joined) > 1) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : '';
-			$sql_where .= ($auth->acl_get('u_viewonline') && sizeof($active) > 1) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : '';
+			$sql_where .= (is_numeric($count) && isset($find_key_match[$count_select])) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : '';
+			$sql_where .= (sizeof($joined) > 1 && isset($find_key_match[$joined_select])) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : '';
+			$sql_where .= ($auth->acl_get('u_viewonline') && sizeof($active) > 1 && isset($find_key_match[$active_select])) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : '';
 			$sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id AND ug.user_pending = 0 " : '';
 
 			if ($search_group_id)
@@ -1238,7 +1251,7 @@
 			'joined'		=> array('joined', ''),
 			'active'		=> array('active', ''),
 			'count'			=> (request_var('count', '') !== '') ? array('count', 0) : array('count', ''),
-			'ipdomain'		=> array('ip', ''),
+			'ip'			=> array('ip', ''),
 			'first_char'	=> array('first_char', ''),
 		);
 
@@ -1522,7 +1535,7 @@
 }
 
 // Output the page
-page_header($page_title);
+page_header($page_title, false);
 
 $template->set_filenames(array(
 	'body' => $template_html)
@@ -1534,7 +1547,7 @@
 /**
 * Prepare profile data
 */
-function show_profile($data)
+function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false)
 {
 	global $config, $auth, $template, $user, $phpEx, $phpbb_root_path;
 
@@ -1620,9 +1633,11 @@
 		'ICQ_STATUS_IMG'	=> (!empty($data['user_icq'])) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data['user_icq'] . '&amp;img=5" width="18" height="18" />' : '',
 		'S_JABBER_ENABLED'	=> ($config['jab_enable']) ? true : false,
 
+		'S_WARNINGS'	=> ($auth->acl_getf_global('m_') || $auth->acl_get('m_warn')) ? true : false,
+
 		'U_SEARCH_USER'	=> ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&amp;sr=posts") : '',
-		'U_NOTES'		=> $auth->acl_getf_global('m_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $user_id, true, $user->session_id) : '',
-		'U_WARN'		=> $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $user_id, true, $user->session_id) : '',
+		'U_NOTES'		=> ($user_notes_enabled && $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $user_id, true, $user->session_id) : '',
+		'U_WARN'		=> ($warn_user_enabled && $auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $user_id, true, $user->session_id) : '',
 		'U_PM'			=> ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($data['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $user_id) : '',
 		'U_EMAIL'		=> $email,
 		'U_WWW'			=> (!empty($data['user_website'])) ? $data['user_website'] : '',
diff -x .svn -aruN 3.0.5.src/posting.php 3.0.6.src/posting.php
--- 3.0.5.src/posting.php	2009-05-31 05:58:33.000000000 -0500
+++ 3.0.6.src/posting.php	2009-11-16 11:10:09.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: posting.php 9499 2009-04-30 08:15:32Z acydburn $
+* @version $Id: posting.php 10253 2009-11-03 15:03:14Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -39,12 +39,18 @@
 $delete		= (isset($_POST['delete'])) ? true : false;
 $cancel		= (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false;
 
-$refresh	= (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false;
+$refresh	= (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['full_editor']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false;
 $mode		= ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', '');
 
 $error = $post_data = array();
 $current_time = time();
 
+if ($config['enable_post_confirm'] && !$user->data['is_registered'])
+{
+	include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
+	$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+	$captcha->init(CONFIRM_POST);
+}
 
 // Was cancel pressed? If so then redirect to the appropriate page
 if ($cancel || ($current_time - $lastclick < 2 && $submit))
@@ -89,7 +95,8 @@
 			FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
 			WHERE t.topic_id = $topic_id
 				AND (f.forum_id = t.forum_id
-					OR f.forum_id = $forum_id)";
+					OR f.forum_id = $forum_id)" .
+			(($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1');
 	break;
 
 	case 'quote':
@@ -164,6 +171,13 @@
 	trigger_error(($mode == 'post' || $mode == 'bump' || $mode == 'reply') ? 'NO_TOPIC' : 'NO_POST');
 }
 
+// Not able to reply to unapproved posts/topics
+// TODO: add more descriptive language key
+if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && !$post_data['topic_approved']) || ($mode == 'quote' && !$post_data['post_approved'])))
+{
+	trigger_error(($mode == 'reply' || $mode == 'bump') ? 'TOPIC_UNAPPROVED' : 'POST_UNAPPROVED');
+}
+
 if ($mode == 'popup')
 {
 	upload_popup($post_data['forum_style']);
@@ -364,6 +378,7 @@
 }
 
 $post_data['post_edit_locked']	= (isset($post_data['post_edit_locked'])) ? (int) $post_data['post_edit_locked'] : 0;
+$post_data['post_subject_md5']	= (isset($post_data['post_subject']) && $mode == 'edit') ? md5($post_data['post_subject']) : '';
 $post_data['post_subject']		= (in_array($mode, array('quote', 'edit'))) ? $post_data['post_subject'] : ((isset($post_data['topic_title'])) ? $post_data['topic_title'] : '');
 $post_data['topic_time_limit']	= (isset($post_data['topic_time_limit'])) ? (($post_data['topic_time_limit']) ? (int) $post_data['topic_time_limit'] / 86400 : (int) $post_data['topic_time_limit']) : 0;
 $post_data['poll_length']		= (!empty($post_data['poll_length'])) ? (int) $post_data['poll_length'] / 86400 : 0;
@@ -488,11 +503,11 @@
 
 // HTML, BBCode, Smilies, Images and Flash status
 $bbcode_status	= ($config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_id)) ? true : false;
-$smilies_status	= ($bbcode_status && $config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)) ? true : false;
+$smilies_status	= ($config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)) ? true : false;
 $img_status		= ($bbcode_status && $auth->acl_get('f_img', $forum_id)) ? true : false;
 $url_status		= ($config['allow_post_links']) ? true : false;
 $flash_status	= ($bbcode_status && $auth->acl_get('f_flash', $forum_id) && $config['allow_post_flash']) ? true : false;
-$quote_status	= ($auth->acl_get('f_reply', $forum_id)) ? true : false;
+$quote_status	= true;
 
 // Save Draft
 if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ($mode == 'reply' || $mode == 'post' || $mode == 'quote'))
@@ -538,6 +553,47 @@
 				)
 			);
 
+			$hidden_fields = array(
+				'icon_id'			=> 0,
+
+				'disable_bbcode'	=> false,
+				'disable_smilies'	=> false,
+				'disable_magic_url'	=> false,
+				'attach_sig'		=> true,
+				'lock_topic'		=> false,
+
+				'topic_type'		=> POST_NORMAL,
+				'topic_time_limit'	=> 0,
+
+				'poll_title'		=> '',
+				'poll_option_text'	=> '',
+				'poll_max_options'	=> 1,
+				'poll_length'		=> 0,
+				'poll_vote_change'	=> false,
+			);
+
+			foreach ($hidden_fields as $name => $default)
+			{
+				if (!isset($_POST[$name]))
+				{
+					// Don't include it, if its not available
+					unset($hidden_fields[$name]);
+					continue;
+				}
+
+				if (is_bool($default))
+				{
+					// Use the string representation
+					$hidden_fields[$name] = request_var($name, '');
+				}
+				else
+				{
+					$hidden_fields[$name] = request_var($name, $default);
+				}
+			}
+
+			$s_hidden_fields .= build_hidden_fields($hidden_fields);
+
 			confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);
 		}
 	}
@@ -586,7 +642,6 @@
 	load_drafts($topic_id, $forum_id);
 }
 
-$solved_captcha = false;
 
 if ($submit || $preview || $refresh)
 {
@@ -600,7 +655,11 @@
 	$post_data['orig_topic_type']	= $post_data['topic_type'];
 	$post_data['topic_type']		= request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL));
 	$post_data['topic_time_limit']	= request_var('topic_time_limit', (($mode != 'post') ? (int) $post_data['topic_time_limit'] : 0));
-	$post_data['icon_id']			= request_var('icon', 0);
+
+	if ($post_data['enable_icons'] && $auth->acl_get('f_icons', $forum_id))
+	{
+		$post_data['icon_id'] = request_var('icon', (int) $post_data['icon_id']);
+	}
 
 	$post_data['enable_bbcode']		= (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true;
 	$post_data['enable_smilies']	= (!$smilies_status || isset($_POST['disable_smilies'])) ? false : true;
@@ -695,9 +754,44 @@
 	// Grab md5 'checksum' of new message
 	$message_md5 = md5($message_parser->message);
 
+	// If editing and checksum has changed we know the post was edited while we're editing
+	// Notify and show user the changed post
+	if ($mode == 'edit' && $post_data['forum_flags'] & FORUM_FLAG_POST_REVIEW)
+	{
+		$edit_post_message_checksum = request_var('edit_post_message_checksum', '');
+		$edit_post_subject_checksum = request_var('edit_post_subject_checksum', '');
+
+		// $post_data['post_checksum'] is the checksum of the post submitted in the meantime
+		// $message_md5 is the checksum of the post we're about to submit
+		// $edit_post_message_checksum is the checksum of the post we're editing
+		// ...
+
+		// We make sure nobody else made exactly the same change
+		// we're about to submit by also checking $message_md5 != $post_data['post_checksum']
+		if (($edit_post_message_checksum !== '' && $edit_post_message_checksum != $post_data['post_checksum'] && $message_md5 != $post_data['post_checksum'])
+		 || ($edit_post_subject_checksum !== '' && $edit_post_subject_checksum != $post_data['post_subject_md5'] && md5($post_data['post_subject']) != $post_data['post_subject_md5']))
+		{
+			if (topic_review($topic_id, $forum_id, 'post_review_edit', $post_id))
+			{
+				$template->assign_vars(array(
+					'S_POST_REVIEW'			=> true,
+
+					'L_POST_REVIEW'			=> $user->lang['POST_REVIEW_EDIT'],
+					'L_POST_REVIEW_EXPLAIN'	=> $user->lang['POST_REVIEW_EDIT_EXPLAIN'],
+				));
+			}
+
+			$submit = false;
+			$refresh = true;
+		}
+	}
+
 	// Check checksum ... don't re-parse message if the same
 	$update_message = ($mode != 'edit' || $message_md5 != $post_data['post_checksum'] || $status_switch || strlen($post_data['bbcode_uid']) < BBCODE_UID_LEN) ? true : false;
 
+	// Also check if subject got updated...
+	$update_subject = $mode != 'edit' || ($post_data['post_subject_md5'] && $post_data['post_subject_md5'] != md5($post_data['post_subject']));
+
 	// Parse message
 	if ($update_message)
 	{
@@ -763,25 +857,15 @@
 
 	if ($config['enable_post_confirm'] && !$user->data['is_registered'] && in_array($mode, array('quote', 'post', 'reply')))
 	{
-		$confirm_id = request_var('confirm_id', '');
-		$confirm_code = request_var('confirm_code', '');
-
-		$sql = 'SELECT code
-			FROM ' . CONFIRM_TABLE . "
-			WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
-				AND session_id = '" . $db->sql_escape($user->session_id) . "'
-				AND confirm_type = " . CONFIRM_POST;
-		$result = $db->sql_query($sql);
-		$confirm_row = $db->sql_fetchrow($result);
-		$db->sql_freeresult($result);
-
-		if (empty($confirm_row['code']) || strcasecmp($confirm_row['code'], $confirm_code) !== 0)
-		{
-			$error[] = $user->lang['CONFIRM_CODE_WRONG'];
-		}
-		else
+		$captcha_data = array(
+			'message'	=> utf8_normalize_nfc(request_var('message', '', true)),
+			'subject'	=> utf8_normalize_nfc(request_var('subject', '', true)),
+			'username'	=> utf8_normalize_nfc(request_var('username', '', true)),
+		);
+		$vc_response = $captcha->validate($captcha_data);
+		if ($vc_response)
 		{
-			$solved_captcha = true;
+			$error[] = $vc_response;
 		}
 	}
 
@@ -1020,10 +1104,16 @@
 				$data['topic_replies'] = $post_data['topic_replies'];
 			}
 
-			$redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message);
+			// The last parameter tells submit_post if search indexer has to be run
+			$redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
+
+			if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === true) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
+			{
+				$captcha->reset();
+			}
 
-			// Check the permissions for post approval, as well as the queue trigger where users are put on approval with a post count lower than specified. Moderators are not affected.
-			if ((($config['enable_queue_trigger'] && $user->data['user_posts'] < $config['queue_trigger_posts']) || !$auth->acl_get('f_noapprove', $data['forum_id'])) && !$auth->acl_get('m_approve', $data['forum_id']))
+			// Check the permissions for post approval. Moderators are not affected.
+			if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) || !empty($post_data['force_approved_state']))
 			{
 				meta_refresh(10, $redirect_url);
 				$message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD'];
@@ -1150,7 +1240,26 @@
 
 if ($mode == 'quote' && !$submit && !$preview && !$refresh)
 {
-	$message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
+	if ($config['allow_bbcode'])
+	{
+		$message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
+	}
+	else
+	{
+		$offset = 0;
+		$quote_string = "&gt; ";
+		$message = censor_text(trim($message_parser->message));
+		// see if we are nesting. It's easily tricked but should work for one level of nesting
+		if (strpos($message, "&gt;") !== false)
+		{
+			$offset = 10;
+		}
+		$message = utf8_wordwrap($message, 75 + $offset, "\n");
+
+		$message = $quote_string . $message;
+		$message = str_replace("\n", "\n" . $quote_string, $message);
+		$message_parser->message =  $post_data['quote_username'] . " " . $user->lang['WROTE'] . " :\n" . $message . "\n";
+	}
 }
 
 if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh)
@@ -1179,7 +1288,10 @@
 
 // Forum moderators?
 $moderators = array();
-get_moderators($moderators, $forum_id);
+if ($config['load_moderators'])
+{
+	get_moderators($moderators, $forum_id);
+}
 
 // Generate smiley listing
 generate_smilies('inline', $forum_id);
@@ -1240,36 +1352,13 @@
 // Build Forum Rules
 generate_forum_rules($post_data);
 
-if ($config['enable_post_confirm'] && !$user->data['is_registered'] && $solved_captcha === false && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
+// Posting uses is_solved for legacy reasons. Plugins have to use is_solved to force themselves to be displayed.
+if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === false) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
 {
-	// Show confirm image
-	$sql = 'DELETE FROM ' . CONFIRM_TABLE . "
-		WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
-			AND confirm_type = " . CONFIRM_POST;
-	$db->sql_query($sql);
-
-	// Generate code
-	$code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
-	$confirm_id = md5(unique_id($user->ip));
-	$seed = hexdec(substr(unique_id(), 4, 10));
-
-	// compute $seed % 0x7fffffff
-	$seed -= 0x7fffffff * floor($seed / 0x7fffffff);
-
-	$sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
-		'confirm_id'	=> (string) $confirm_id,
-		'session_id'	=> (string) $user->session_id,
-		'confirm_type'	=> (int) CONFIRM_POST,
-		'code'			=> (string) $code,
-		'seed'			=> (int) $seed)
-	);
-	$db->sql_query($sql);
 
 	$template->assign_vars(array(
 		'S_CONFIRM_CODE'			=> true,
-		'CONFIRM_ID'				=> $confirm_id,
-		'CONFIRM_IMAGE'				=> '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_POST) . '" alt="" title="" />',
-		'L_POST_CONFIRM_EXPLAIN'	=> sprintf($user->lang['POST_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
+		'CAPTCHA_TEMPLATE'			=> $captcha->get_template(),
 	));
 }
 
@@ -1277,13 +1366,18 @@
 $s_hidden_fields .= '<input type="hidden" name="lastclick" value="' . $current_time . '" />';
 $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . request_var('draft_loaded', $draft_id) . '" />' : '';
 
-// Add the confirm id/code pair to the hidden fields, else an error is displayed on next submit/preview
-if ($solved_captcha !== false)
+if ($mode == 'edit')
 {
 	$s_hidden_fields .= build_hidden_fields(array(
-		'confirm_id'		=> request_var('confirm_id', ''),
-		'confirm_code'		=> request_var('confirm_code', ''))
-	);
+		'edit_post_message_checksum'	=> $post_data['post_checksum'],
+		'edit_post_subject_checksum'	=> $post_data['post_subject_md5'],
+	));
+}
+
+// Add the confirm id/code pair to the hidden fields, else an error is displayed on next submit/preview
+if (isset($captcha) && $captcha->is_solved() !== false)
+{
+	$s_hidden_fields .= build_hidden_fields($captcha->get_hidden_fields());
 }
 
 $form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || !$config['allow_attachments'] || !$auth->acl_get('u_attach') || !$auth->acl_get('f_attach', $forum_id)) ? '' : ' enctype="multipart/form-data"';
@@ -1325,7 +1419,7 @@
 	'S_EDIT_REASON'				=> ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false,
 	'S_DISPLAY_USERNAME'		=> (!$user->data['is_registered'] || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS)) ? true : false,
 	'S_SHOW_TOPIC_ICONS'		=> $s_topic_icons,
-	'S_DELETE_ALLOWED'			=> ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id))) ? true : false,
+	'S_DELETE_ALLOWED'			=> ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time'])) || $auth->acl_get('m_delete', $forum_id))) ? true : false,
 	'S_BBCODE_ALLOWED'			=> $bbcode_status,
 	'S_BBCODE_CHECKED'			=> ($bbcode_checked) ? ' checked="checked"' : '',
 	'S_SMILIES_ALLOWED'			=> $smilies_status,
@@ -1384,7 +1478,7 @@
 posting_gen_attachment_entry($attachment_data, $filename_data, $allowed);
 
 // Output page ...
-page_header($page_title);
+page_header($page_title, false);
 
 $template->set_filenames(array(
 	'body' => 'posting_body.html')
@@ -1412,7 +1506,7 @@
 
 	($forum_style) ? $user->setup('posting', $forum_style) : $user->setup('posting');
 
-	page_header($user->lang['PROGRESS_BAR']);
+	page_header($user->lang['PROGRESS_BAR'], false);
 
 	$template->set_filenames(array(
 		'popup'	=> 'posting_progress_bar.html')
@@ -1437,7 +1531,7 @@
 	global $phpbb_root_path, $phpEx;
 
 	// If moderator removing post or user itself removing post, present a confirmation screen
-	if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])))
+	if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time'])))
 	{
 		$s_hidden_fields = build_hidden_fields(array(
 			'p'		=> $post_id,
@@ -1461,17 +1555,18 @@
 			);
 
 			$next_post_id = delete_post($forum_id, $topic_id, $post_id, $data);
+			$post_username = ($post_data['poster_id'] == ANONYMOUS && !empty($post_data['post_username'])) ? $post_data['post_username'] : $post_data['username'];
 
 			if ($next_post_id === false)
 			{
-				add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_TOPIC', $post_data['topic_title']);
+				add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_TOPIC', $post_data['topic_title'], $post_username);
 
 				$meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id");
 				$message = $user->lang['POST_DELETED'];
 			}
 			else
 			{
-				add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_POST', $post_data['post_subject']);
+				add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_POST', $post_data['post_subject'], $post_username);
 
 				$meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p=$next_post_id") . "#p$next_post_id";
 				$message = $user->lang['POST_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $meta_info . '">', '</a>');
diff -x .svn -aruN 3.0.5.src/report.php 3.0.6.src/report.php
--- 3.0.5.src/report.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/report.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: report.php 8479 2008-03-29 00:22:48Z naderman $
+* @version $Id: report.php 10164 2009-09-19 10:46:19Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -24,18 +24,29 @@
 
 $forum_id		= request_var('f', 0);
 $post_id		= request_var('p', 0);
+$pm_id			= request_var('pm', 0);
 $reason_id		= request_var('reason_id', 0);
 $report_text	= utf8_normalize_nfc(request_var('report_text', '', true));
 $user_notify	= ($user->data['is_registered']) ? request_var('notify', 0) : false;
 
 $submit = (isset($_POST['submit'])) ? true : false;
 
-if (!$post_id)
+if (!$post_id && (!$pm_id || !$config['allow_pm_report']))
 {
 	trigger_error('NO_POST_SELECTED');
 }
 
-$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;p=$post_id") . "#p$post_id";
+if ($post_id)
+{
+	$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;p=$post_id") . "#p$post_id";
+	$pm_id = 0;
+}
+else
+{
+	$redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&p=$pm_id");
+	$post_id = 0;
+	$forum_id = 0;
+}
 
 // Has the report been cancelled?
 if (isset($_POST['cancel']))
@@ -43,52 +54,80 @@
 	redirect($redirect_url);
 }
 
-// Grab all relevant data
-$sql = 'SELECT t.*, p.*
-	FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
-	WHERE p.post_id = $post_id
-		AND p.topic_id = t.topic_id";
-$result = $db->sql_query($sql);
-$report_data = $db->sql_fetchrow($result);
-$db->sql_freeresult($result);
-
-if (!$report_data)
+if ($post_id)
 {
-	trigger_error('POST_NOT_EXIST');
-}
+	// Grab all relevant data
+	$sql = 'SELECT t.*, p.*
+		FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
+		WHERE p.post_id = $post_id
+			AND p.topic_id = t.topic_id";
+	$result = $db->sql_query($sql);
+	$report_data = $db->sql_fetchrow($result);
+	$db->sql_freeresult($result);
+
+	if (!$report_data)
+	{
+		trigger_error('POST_NOT_EXIST');
+	}
 
-$forum_id = (int) ($report_data['forum_id']) ? $report_data['forum_id'] : $forum_id;
-$topic_id = (int) $report_data['topic_id'];
+	$forum_id = (int) ($report_data['forum_id']) ? $report_data['forum_id'] : $forum_id;
+	$topic_id = (int) $report_data['topic_id'];
 
-$sql = 'SELECT *
-	FROM ' . FORUMS_TABLE . '
-	WHERE forum_id = ' . $forum_id;
-$result = $db->sql_query($sql);
-$forum_data = $db->sql_fetchrow($result);
-$db->sql_freeresult($result);
+	$sql = 'SELECT *
+		FROM ' . FORUMS_TABLE . '
+		WHERE forum_id = ' . $forum_id;
+	$result = $db->sql_query($sql);
+	$forum_data = $db->sql_fetchrow($result);
+	$db->sql_freeresult($result);
 
-if (!$forum_data)
-{
-	trigger_error('FORUM_NOT_EXIST');
-}
+	if (!$forum_data)
+	{
+		trigger_error('FORUM_NOT_EXIST');
+	}
 
-// Check required permissions
-$acl_check_ary = array('f_list' => 'POST_NOT_EXIST', 'f_read' => 'USER_CANNOT_READ', 'f_report' => 'USER_CANNOT_REPORT');
+	// Check required permissions
+	$acl_check_ary = array('f_list' => 'POST_NOT_EXIST', 'f_read' => 'USER_CANNOT_READ', 'f_report' => 'USER_CANNOT_REPORT');
 
-foreach ($acl_check_ary as $acl => $error)
-{
-	if (!$auth->acl_get($acl, $forum_id))
+	foreach ($acl_check_ary as $acl => $error)
 	{
-		trigger_error($error);
+		if (!$auth->acl_get($acl, $forum_id))
+		{
+			trigger_error($error);
+		}
 	}
-}
-unset($acl_check_ary);
+	unset($acl_check_ary);
 
-if ($report_data['post_reported'])
+	if ($report_data['post_reported'])
+	{
+		$message = $user->lang['ALREADY_REPORTED'];
+		$message .= '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
+		trigger_error($message);
+	}
+}
+else
 {
-	$message = $user->lang['ALREADY_REPORTED'];
-	$message .= '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
-	trigger_error($message);
+	// Grab all relevant data
+	$sql = 'SELECT p.*, pt.*
+		FROM ' . PRIVMSGS_TABLE . ' p, ' . PRIVMSGS_TO_TABLE . " pt
+		WHERE p.msg_id = $pm_id
+			AND p.msg_id = pt.msg_id
+			AND (p.author_id = " . $user->data['user_id'] . " OR pt.user_id = " . $user->data['user_id'] . ")";
+	$result = $db->sql_query($sql);
+	$report_data = $db->sql_fetchrow($result);
+	$db->sql_freeresult($result);
+
+	if (!$report_data)
+	{
+		$user->add_lang('ucp');
+		trigger_error('NO_MESSAGE');
+	}
+
+	if ($report_data['message_reported'])
+	{
+		$message = $user->lang['ALREADY_REPORTED_PM'];
+		$message .= '<br /><br />' . sprintf($user->lang['RETURN_PM'], '<a href="' . $redirect_url . '">', '</a>');
+		trigger_error($message);
+	}
 }
 
 // Submit report?
@@ -109,6 +148,7 @@
 	$sql_ary = array(
 		'reason_id'		=> (int) $reason_id,
 		'post_id'		=> $post_id,
+		'pm_id'			=> $pm_id,
 		'user_id'		=> (int) $user->data['user_id'],
 		'user_notify'	=> (int) $user_notify,
 		'report_closed'	=> 0,
@@ -120,26 +160,55 @@
 	$db->sql_query($sql);
 	$report_id = $db->sql_nextid();
 
-	if (!$report_data['post_reported'])
+	if ($post_id)
 	{
 		$sql = 'UPDATE ' . POSTS_TABLE . '
 			SET post_reported = 1
 			WHERE post_id = ' . $post_id;
 		$db->sql_query($sql);
-	}
 
-	if (!$report_data['topic_reported'])
+		if (!$report_data['topic_reported'])
+		{
+			$sql = 'UPDATE ' . TOPICS_TABLE . '
+				SET topic_reported = 1
+				WHERE topic_id = ' . $report_data['topic_id'] . '
+					OR topic_moved_id = ' . $report_data['topic_id'];
+			$db->sql_query($sql);
+		}
+
+		$lang_return = $user->lang['RETURN_TOPIC'];
+		$lang_success = $user->lang['POST_REPORTED_SUCCESS'];
+	}
+	else
 	{
-		$sql = 'UPDATE ' . TOPICS_TABLE . '
-			SET topic_reported = 1
-			WHERE topic_id = ' . $report_data['topic_id'] . '
-				OR topic_moved_id = ' . $report_data['topic_id'];
+		$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
+			SET message_reported = 1
+			WHERE msg_id = ' . $pm_id;
 		$db->sql_query($sql);
+
+		$sql_ary = array(
+			'msg_id'		=> $pm_id,
+			'user_id'		=> ANONYMOUS,
+			'author_id'		=> (int) $report_data['author_id'],
+			'pm_deleted'	=> 0,
+			'pm_new'		=> 0,
+			'pm_unread'		=> 0,
+			'pm_replied'	=> 0,
+			'pm_marked'		=> 0,
+			'pm_forwarded'	=> 0,
+			'folder_id'		=> PRIVMSGS_INBOX,
+		);
+
+		$sql = 'INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+		$db->sql_query($sql);
+
+		$lang_return = $user->lang['RETURN_PM'];
+		$lang_success = $user->lang['PM_REPORTED_SUCCESS'];
 	}
 
 	meta_refresh(3, $redirect_url);
 
-	$message = $user->lang['POST_REPORTED_SUCCESS'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
+	$message = $lang_success . '<br /><br />' . sprintf($lang_return, '<a href="' . $redirect_url . '">', '</a>');
 	trigger_error($message);
 }
 
@@ -147,8 +216,9 @@
 display_reasons($reason_id);
 
 $template->assign_vars(array(
+	'S_REPORT_POST'		=> ($pm_id) ? false : true,
 	'REPORT_TEXT'		=> $report_text,
-	'S_REPORT_ACTION'	=> append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&amp;p=' . $post_id),
+	'S_REPORT_ACTION'	=> append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&amp;p=' . $post_id . '&amp;pm=' . $pm_id),
 
 	'S_NOTIFY'			=> $user_notify,
 	'S_CAN_NOTIFY'		=> ($user->data['is_registered']) ? true : false)
diff -x .svn -aruN 3.0.5.src/search.php 3.0.6.src/search.php
--- 3.0.5.src/search.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/search.php	2009-11-16 11:10:11.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: search.php 9488 2009-04-26 15:12:54Z acydburn $
+* @version $Id: search.php 10120 2009-09-08 08:53:01Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -95,8 +95,16 @@
 		}
 	}
 
+	// search for unread posts needs user to be logged in
+	// if topics tracking for guests is disabled
+	if ($search_id == 'unreadposts' && !$config['load_anon_lastread'] && !$user->data['is_registered'])
+	{
+		login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
+	}
+
 	// If we are looking for authors get their ids
 	$author_id_ary = array();
+	$sql_author_match = '';
 	if ($author_id)
 	{
 		$author_id_ary[] = $author_id;
@@ -113,7 +121,7 @@
 		$sql = 'SELECT user_id
 			FROM ' . USERS_TABLE . "
 			WHERE $sql_where
-				AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+				AND user_type <> " . USER_IGNORE;
 		$result = $db->sql_query_limit($sql, 100);
 
 		while ($row = $db->sql_fetchrow($result))
@@ -122,6 +130,22 @@
 		}
 		$db->sql_freeresult($result);
 
+		$sql_where = (strpos($author, '*') !== false) ? ' post_username ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " post_username = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
+
+		$sql = 'SELECT 1 as guest_post
+			FROM ' . POSTS_TABLE . "
+			WHERE $sql_where
+				AND poster_id = " . ANONYMOUS;
+		$result = $db->sql_query_limit($sql, 1);
+		$found_guest_post = $db->sql_fetchfield('guest_post');
+		$db->sql_freeresult($result);
+
+		if ($found_guest_post)
+		{
+			$author_id_ary[] = ANONYMOUS;
+			$sql_author_match = (strpos($author, '*') !== false) ? ' ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
+		}
+
 		if (!sizeof($author_id_ary))
 		{
 			trigger_error('NO_SEARCH_RESULTS');
@@ -155,7 +179,7 @@
 
 	$not_in_fid = (sizeof($ex_fid_ary)) ? 'WHERE ' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . " OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')' : "";
 
-	$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id
+	$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, f.forum_flags, fa.user_id
 		FROM ' . FORUMS_TABLE . ' f
 		LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
 			AND fa.session_id = '" . $db->sql_escape($user->session_id) . "')
@@ -173,6 +197,13 @@
 			continue;
 		}
 
+		// Exclude forums from active topics
+		if (!($row['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) && ($search_id == 'active_topics'))
+		{
+			$ex_fid_ary[] = (int) $row['forum_id'];
+			continue;
+		}
+
 		if (sizeof($search_forum))
 		{
 			if ($search_child)
@@ -308,7 +339,6 @@
 					$last_post_time = '';
 				}
 
-
 				if ($sort_key == 'a')
 				{
 					$sort_join = USERS_TABLE . ' u, ';
@@ -341,6 +371,34 @@
 				}
 			break;
 
+			case 'unreadposts':
+				$l_search_title = $user->lang['SEARCH_UNREAD'];
+				// force sorting
+				$show_results = 'topics';
+				$sort_key = 't';
+				$sort_by_sql['t'] = 't.topic_last_post_time';
+				$sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+
+				$sql_where = 'AND t.topic_moved_id = 0
+					' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
+					' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '');
+
+				gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
+				$s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = '';
+
+				$unread_list = array();
+				$unread_list = get_unread_topics($user->data['user_id'], $sql_where, $sql_sort);
+
+				if (!empty($unread_list))
+				{
+					$sql = 'SELECT t.topic_id
+						FROM ' . TOPICS_TABLE . ' t
+						WHERE ' . $db->sql_in_set('t.topic_id', array_keys($unread_list)) . "
+						$sql_sort";
+					$field = 'topic_id';
+				}
+			break;
+
 			case 'newposts':
 				$l_search_title = $user->lang['SEARCH_NEW'];
 				// force sorting
@@ -429,12 +487,12 @@
 
 	if (!empty($search->search_query))
 	{
-		$total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $id_ary, $start, $per_page);
+		$total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
 	}
 	else if (sizeof($author_id_ary))
 	{
 		$firstpost_only = ($search_fields === 'firstpost' || $search_fields == 'titleonly') ? true : false;
-		$total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $id_ary, $start, $per_page);
+		$total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
 	}
 
 	// For some searches we need to print out the "no results" page directly to allow re-sorting/refining the search options.
@@ -484,12 +542,12 @@
 	$hilit = (strspn($hilit, '*') === strlen($hilit)) ? '' : $hilit;
 
 	$u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
-	$u_show_results = ($show_results != 'posts') ? '&amp;sr=' . $show_results : '';
+	$u_show_results = '&amp;sr=' . $show_results;
 	$u_search_forum = implode('&amp;fid%5B%5D=', $search_forum);
 
 	$u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results);
 	$u_search .= ($search_id) ? '&amp;search_id=' . $search_id : '';
-	$u_search .= ($u_hilit) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($search->search_query)) : '';
+	$u_search .= ($u_hilit) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
 	$u_search .= ($search_terms != 'all') ? '&amp;terms=' . $search_terms : '';
 	$u_search .= ($topic_id) ? '&amp;t=' . $topic_id : '';
 	$u_search .= ($author) ? '&amp;author=' . urlencode(htmlspecialchars_decode($author)) : '';
@@ -945,7 +1003,6 @@
 	page_footer();
 }
 
-
 // Search forum
 $s_forums = '';
 $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id, f.forum_password, f.enable_indexing, fa.user_id
diff -x .svn -aruN 3.0.5.src/style.php 3.0.6.src/style.php
--- 3.0.5.src/style.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/style.php	2009-11-16 11:10:11.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: style.php 9366 2009-03-11 17:47:31Z acydburn $
+* @version $Id: style.php 10056 2009-08-25 12:19:57Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -91,8 +91,9 @@
 	$recompile = $config['load_tplcompile'];
 	if (!$user)
 	{
-		$id			= $config['default_style'];
-		$recompile	= false;
+		$id			= ($id) ? $id : $config['default_style'];
+//		Commented out because calls do not always include the SID anymore
+//		$recompile	= false;
 		$user		= array('user_id' => ANONYMOUS);
 	}
 
diff -x .svn -aruN 3.0.5.src/styles/prosilver/imageset/imageset.cfg 3.0.6.src/styles/prosilver/imageset/imageset.cfg
--- 3.0.5.src/styles/prosilver/imageset/imageset.cfg	2009-05-31 05:58:33.000000000 -0500
+++ 3.0.6.src/styles/prosilver/imageset/imageset.cfg	2009-11-16 11:10:09.000000000 -0600
@@ -19,7 +19,7 @@
 # General Information about this style
 name = prosilver
 copyright = &copy; phpBB Group, 2007
-version = 3.0.5
+version = 3.0.6
 
 # Images
 img_site_logo = site_logo.gif*52*139
diff -x .svn -aruN 3.0.5.src/styles/prosilver/style.cfg 3.0.6.src/styles/prosilver/style.cfg
--- 3.0.5.src/styles/prosilver/style.cfg	2009-05-31 05:58:33.000000000 -0500
+++ 3.0.6.src/styles/prosilver/style.cfg	2009-11-16 11:10:09.000000000 -0600
@@ -19,4 +19,4 @@
 # General Information about this style
 name = prosilver
 copyright = &copy; phpBB Group, 2007
-version = 3.0.5
\ No newline at end of file
+version = 3.0.6
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/captcha_default.html 3.0.6.src/styles/prosilver/template/captcha_default.html
--- 3.0.5.src/styles/prosilver/template/captcha_default.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/styles/prosilver/template/captcha_default.html	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,24 @@
+<!-- IF S_TYPE == 1 -->
+<div class="panel">
+	<div class="inner"><span class="corners-top"><span></span></span>
+
+	<h3>{L_CONFIRMATION}</h3>
+	<p>{L_CONFIRM_EXPLAIN}</p>
+
+	<fieldset class="fields2">
+<!-- ENDIF -->
+
+	<dl>
+		<dt><label for="confirm_code">{L_CONFIRM_CODE}:</label></dt>
+		<dd><img src="{CONFIRM_IMAGE_LINK}" alt="{L_CONFIRM_CODE}" /></dd>
+		<dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" tabindex="{$CAPTCHA_TAB_INDEX}" class="inputbox narrow" title="{L_CONFIRM_CODE}" />
+		<!-- IF S_CONFIRM_REFRESH --><input type="submit" name="refresh_vc" id="refresh_vc" class="button2" value="{L_VC_REFRESH}" /><!-- ENDIF -->
+		<input type="hidden" name="confirm_id" id="confirm_id" value="{CONFIRM_ID}" /></dd>
+		<dd>{L_CONFIRM_CODE_EXPLAIN}</dd>
+	</dl>
+
+<!-- IF S_TYPE == 1 -->
+	</fieldset>
+	<span class="corners-bottom"><span></span></span></div>
+</div>
+<!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/captcha_qa.html 3.0.6.src/styles/prosilver/template/captcha_qa.html
--- 3.0.5.src/styles/prosilver/template/captcha_qa.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/styles/prosilver/template/captcha_qa.html	2009-11-16 11:10:09.000000000 -0600
@@ -0,0 +1,21 @@
+<!-- IF S_TYPE == 1 -->
+<div class="panel">
+	<div class="inner"><span class="corners-top"><span></span></span>
+
+	<h3>{L_CONFIRMATION}</h3>
+	<fieldset class="fields2">
+<!-- ENDIF -->
+
+	<dl>
+	<dt><label>{QA_CONFIRM_QUESTION}:</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
+	<dd>
+		<input type="text" tabindex="{$CAPTCHA_TAB_INDEX}" name="qa_answer" id="answer" size="45"  class="inputbox autowidth" title="{L_ANSWER}" />
+		<input type="hidden" name="qa_confirm_id" id="qa_confirm_id" value="{QA_CONFIRM_ID}" />
+	</dd>
+	</dl>
+
+<!-- IF S_TYPE == 1 -->
+	</fieldset>
+	<span class="corners-bottom"><span></span></span></div>
+</div>
+<!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/captcha_recaptcha.html 3.0.6.src/styles/prosilver/template/captcha_recaptcha.html
--- 3.0.5.src/styles/prosilver/template/captcha_recaptcha.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/styles/prosilver/template/captcha_recaptcha.html	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,49 @@
+<!-- IF S_TYPE == 1 -->
+<div class="panel">
+	<div class="inner"><span class="corners-top"><span></span></span>
+
+	<h3>{L_CONFIRMATION}</h3>
+	<p>{L_CONFIRM_EXPLAIN}</p>
+
+	<fieldset class="fields2">
+<!-- ENDIF -->
+
+<!-- IF S_RECAPTCHA_AVAILABLE -->
+	<dl>
+	<dt><label>{L_CONFIRM_CODE}</label>:<br /><span>{L_RECAPTCHA_EXPLAIN}</span></dt>
+	<dd>
+		<script type="text/javascript">
+		// <![CDATA[
+		var RecaptchaOptions = {
+			lang : '{L_RECAPTCHA_LANG}',
+			tabindex : <!-- IF $CAPTCHA_TAB_INDEX -->{$CAPTCHA_TAB_INDEX}<!-- ELSE -->10<!-- ENDIF -->
+		};
+		// ]]>
+		</script>
+		<script type="text/javascript" src="{RECAPTCHA_SERVER}/challenge?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}"></script>
+		<script type="text/javascript">
+		// <![CDATA[
+		<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
+			document.getElementById('recaptcha_table').style.direction = 'ltr';
+		<!-- ENDIF -->
+		// ]]>
+		</script>
+		<noscript>
+		<div>
+			<object data="{RECAPTCHA_SERVER}/noscript?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}" type="text/html" height="300" width="500"></object><br />
+			<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
+			<input type="hidden" name="recaptcha_response_field" value="manual_challenge" />
+		</div>
+		</noscript>
+
+	</dd>
+	</dl>
+<!-- ELSE -->
+{L_RECAPTCHA_NOT_AVAILABLE}
+<!-- ENDIF -->
+
+<!-- IF S_TYPE == 1 -->
+	</fieldset>
+	<span class="corners-bottom"><span></span></span></div>
+</div>
+<!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/drafts.html 3.0.6.src/styles/prosilver/template/drafts.html
--- 3.0.5.src/styles/prosilver/template/drafts.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/drafts.html	2009-11-16 11:10:09.000000000 -0600
@@ -10,7 +10,7 @@
 	<span class="corners-bottom"><span></span></span></div>
 </div>
 
-<div class="forumbg">
+<div class="<!-- IF not S_PRIVMSGS -->forumbg<!-- ELSE -->panel<!-- ENDIF -->">
 	<div class="inner"><span class="corners-top"><span></span></span>
 
 	<ul class="topiclist">
@@ -21,7 +21,7 @@
 			</dl>
 		</li>
 	</ul>
-	<ul class="topiclist topics">
+	<ul class="topiclist<!-- IF not S_PRIVMSGS --> topics<!-- ELSE --> cplist<!-- ENDIF -->">
 
 	<!-- BEGIN draftrow -->
 	<li class="row<!-- IF draftrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/editor.js 3.0.6.src/styles/prosilver/template/editor.js
--- 3.0.5.src/styles/prosilver/template/editor.js	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/editor.js	2009-11-16 11:10:10.000000000 -0600
@@ -7,6 +7,7 @@
 var imageTag = false;
 var theSelection = false;
 
+var bbcodeEnabled = true;
 // Check for Browser & Platform for PC & IE specific bits
 // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
 var clientPC = navigator.userAgent.toLowerCase(); // Get client info
@@ -14,7 +15,6 @@
 
 var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
 var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
-
 var baseHeight;
 
 /**
@@ -250,18 +250,65 @@
 
 	if (theSelection)
 	{
-		insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
+		if (bbcodeEnabled)
+		{
+			insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
+		}
+		else
+		{
+			var lines = split_lines(theSelection);
+			for (i = 0; i < lines.length; i++)
+			{
+				insert_text('> ' + lines[i] + '\n')
+			}
+		}
 	}
 
 	return;
 }
 
+function split_lines(text)
+{
+	var lines = text.split('\n');
+	var splitLines = new Array();
+	var j = 0;
+	for(i = 0; i < lines.length; i++)
+	{
+		if (lines[i].length <= 80)
+		{
+			splitLines[j] = lines[i];
+			j++;
+		}
+		else
+		{
+			var line = lines[i];
+			do
+			{
+				var splitAt = line.indexOf(' ', 80);
+				
+				if (splitAt == -1)
+				{
+					splitLines[j] = line;
+					j++
+				}
+				else
+				{
+					splitLines[j] = line.substring(0, splitAt);
+					line = line.substring(splitAt);
+					j++;
+				}
+			}
+			while(splitAt != -1)
+		}
+	}
+	return splitLines;
+}
 /**
 * From http://www.massless.org/mozedit/
 */
 function mozWrap(txtarea, open, close)
 {
-	var selLength = txtarea.textLength;
+	var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;
 	var selStart = txtarea.selectionStart;
 	var selEnd = txtarea.selectionEnd;
 	var scrollTop = txtarea.scrollTop;
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/faq_body.html 3.0.6.src/styles/prosilver/template/faq_body.html
--- 3.0.5.src/styles/prosilver/template/faq_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/faq_body.html	2009-11-16 11:10:09.000000000 -0600
@@ -7,7 +7,7 @@
 	<div class="inner"><span class="corners-top"><span></span></span>
 		<div class="column1">
 		<!-- BEGIN faq_block -->
-			<!-- IF faq_block.S_ROW_COUNT == 4 -->
+			<!-- IF faq_block.SWITCH_COLUMN or (SWITCH_COLUMN_MANUALLY and faq_block.S_ROW_COUNT == 4) -->
 				</div>
 
 				<div class="column2">
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/forum_fn.js 3.0.6.src/styles/prosilver/template/forum_fn.js
--- 3.0.5.src/styles/prosilver/template/forum_fn.js	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/forum_fn.js	2009-11-16 11:10:10.000000000 -0600
@@ -268,3 +268,171 @@
 	obj.SetControllerVisible(true);
 	obj.Play();
 }
+
+/**
+* Check if the nodeName of elem is name
+* @author jQuery
+*/
+function is_node_name(elem, name)
+{
+	return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
+}
+
+/**
+* Check if elem is in array, return position
+* @author jQuery
+*/
+function is_in_array(elem, array)
+{
+	for (var i = 0, length = array.length; i < length; i++)
+		// === is correct (IE)
+		if (array[i] === elem)
+			return i;
+
+	return -1;
+}
+
+/**
+* Find Element, type and class in tree
+* Not used, but may come in handy for those not using JQuery
+* @author jQuery.find, Meik Sievertsen
+*/
+function find_in_tree(node, tag, type, class_name)
+{
+	var result, element, i = 0, length = node.childNodes.length;
+
+	for (element = node.childNodes[0]; i < length; element = node.childNodes[++i])
+	{
+		if (!element || element.nodeType != 1) continue;
+
+		if ((!tag || is_node_name(element, tag)) && (!type || element.type == type) && (!class_name || is_in_array(class_name, (element.className || element).toString().split(/\s+/)) > -1))
+		{
+			return element;
+		}
+
+		if (element.childNodes.length)
+			result = find_in_tree(element, tag, type, class_name);
+
+		if (result) return result;
+	}
+}
+
+var in_autocomplete = false;
+var last_key_entered = '';
+
+/**
+* Check event key
+*/
+function phpbb_check_key(event)
+{
+	// Keycode is array down or up?
+	if (event.keyCode && (event.keyCode == 40 || event.keyCode == 38))
+		in_autocomplete = true;
+
+	// Make sure we are not within an "autocompletion" field
+	if (in_autocomplete)
+	{
+		// If return pressed and key changed we reset the autocompletion
+		if (!last_key_entered || last_key_entered == event.which)
+		{
+			in_autocompletion = false;
+			return true;
+		}
+	}
+
+	// Keycode is not return, then return. ;)
+	if (event.which != 13)
+	{
+		last_key_entered = event.which;
+		return true;
+	}
+
+	return false;
+}
+
+/**
+* Usually used for onkeypress event, to submit a form on enter
+*/
+function submit_default_button(event, selector, class_name)
+{
+	// Add which for key events
+	if (!event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode))
+		event.which = event.charCode || event.keyCode;
+
+	if (phpbb_check_key(event))
+		return true;
+
+	var current = selector['parentNode'];
+
+	// Search parent form element
+	while (current && (!current.nodeName || current.nodeType != 1 || !is_node_name(current, 'form')) && current != document)
+		current = current['parentNode'];
+
+	// Find the input submit button with the class name
+	//current = find_in_tree(current, 'input', 'submit', class_name);
+	var input_tags = current.getElementsByTagName('input');
+	current = false;
+
+	for (var i = 0, element = input_tags[0]; i < input_tags.length; element = input_tags[++i])
+	{
+		if (element.type == 'submit' && is_in_array(class_name, (element.className || element).toString().split(/\s+/)) > -1)
+			current = element;
+	}
+
+	if (!current)
+		return true;
+
+	// Submit form
+	current.focus();
+	current.click();
+	return false;
+}
+
+/**
+* Apply onkeypress event for forcing default submit button on ENTER key press
+* The jQuery snippet used is based on http://greatwebguy.com/programming/dom/default-html-button-submit-on-enter-with-jquery/
+* The non-jQuery code is a mimick of the jQuery code ;)
+*/
+function apply_onkeypress_event()
+{
+	// jQuery code in case jQuery is used
+	if (jquery_present)
+	{
+		$('form input').live('keypress', function (e)
+		{
+			var default_button = $(this).parents('form').find('input[type=submit].default-submit-action');
+			
+			if (!default_button || default_button.length <= 0)
+				return true;
+
+			if (phpbb_check_key(e))
+				return true;
+
+			if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13))
+			{
+				default_button.click();
+				return false;
+			}
+
+			return true;
+		});
+	
+		return;
+	}
+
+	var input_tags = document.getElementsByTagName('input');
+
+	for (var i = 0, element = input_tags[0]; i < input_tags.length ; element = input_tags[++i])
+	{
+		if (element.type == 'hidden')
+			continue;
+
+		// onkeydown is possible too
+		element.onkeypress = function (evt) { submit_default_button((evt || window.event), this, 'default-submit-action'); }; 
+	}
+}
+
+/**
+* Detect JQuery existance. We currently do not deliver it, but some styles do, so why not benefit from it. ;)
+*/
+var jquery_present = typeof jQuery == 'function';
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/forumlist_body.html 3.0.6.src/styles/prosilver/template/forumlist_body.html
--- 3.0.5.src/styles/prosilver/template/forumlist_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/forumlist_body.html	2009-11-16 11:10:09.000000000 -0600
@@ -27,6 +27,8 @@
 		<li class="row">
 			<dl class="icon" style="background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
 				<dt title="{forumrow.FORUM_FOLDER_IMG_ALT}">
+				<!-- IF S_ENABLE_FEEDS and forumrow.S_FEED_ENABLED --><!-- <a class="feed-icon-forum" title="{L_FEED} - {forumrow.FORUM_NAME}" href="{U_FEED}?f={forumrow.FORUM_ID}"><img src="{T_THEME_PATH}/images/feed.gif" alt="{L_FEED} - {forumrow.FORUM_NAME}" /></a> --><!-- ENDIF -->
+
 					<!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span><!-- ENDIF -->
 					<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br />
 					{forumrow.FORUM_DESC}
@@ -41,6 +43,7 @@
 					<dd class="topics">{forumrow.TOPICS} <dfn>{L_TOPICS}</dfn></dd>
 					<dd class="posts">{forumrow.POSTS} <dfn>{L_POSTS}</dfn></dd>
 					<dd class="lastpost"><span>
+						<!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a><!-- ENDIF -->
 						<!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn> {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
 						<!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{forumrow.LAST_POST_TIME}<!-- ELSE -->{L_NO_POSTS}<br />&nbsp;<!-- ENDIF --></span>
 					</dd>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/index_body.html 3.0.6.src/styles/prosilver/template/index_body.html
--- 3.0.5.src/styles/prosilver/template/index_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/index_body.html	2009-11-16 11:10:10.000000000 -0600
@@ -6,7 +6,7 @@
 <!-- IF S_DISPLAY_SEARCH or (S_USER_LOGGED_IN and not S_IS_BOT) -->
 <ul class="linklist">
 	<!-- IF S_DISPLAY_SEARCH -->
-		<li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
+		<li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
 	<!-- ENDIF -->
 	<!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF -->
 </ul>
@@ -18,7 +18,7 @@
 	<form method="post" action="{S_LOGIN_ACTION}" class="headerspace">
 	<h3><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a><!-- IF S_REGISTER_ENABLED -->&nbsp; &bull; &nbsp;<a href="{U_REGISTER}">{L_REGISTER}</a><!-- ENDIF --></h3>
 		<fieldset class="quick-login">
-			<label for="username">{L_USERNAME}:</label>&nbsp;<input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" />  
+			<label for="username">{L_USERNAME}:</label>&nbsp;<input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" />
 			<label for="password">{L_PASSWORD}:</label>&nbsp;<input type="password" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" />
 			<!-- IF S_AUTOLOGIN_ENABLED -->
 				| <label for="autologin">{L_LOG_ME_IN} <input type="checkbox" name="autologin" id="autologin" /></label>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/login_body.html 3.0.6.src/styles/prosilver/template/login_body.html
--- 3.0.5.src/styles/prosilver/template/login_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/login_body.html	2009-11-16 11:10:09.000000000 -0600
@@ -6,7 +6,7 @@
 
 	<div class="content">
 		<h2><!-- IF LOGIN_EXPLAIN -->{LOGIN_EXPLAIN}<!-- ELSE -->{L_LOGIN}<!-- ENDIF --></h2>
-		
+
 		<fieldset <!-- IF not S_CONFIRM_CODE -->class="fields1"<!-- ELSE -->class="fields2"<!-- ENDIF -->>
 		<!-- IF LOGIN_ERROR --><div class="error">{LOGIN_ERROR}</div><!-- ENDIF -->
 		<dl>
@@ -21,31 +21,28 @@
 				<!-- IF U_RESEND_ACTIVATION --><dd><a href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a></dd><!-- ENDIF -->
 			<!-- ENDIF -->
 		</dl>
-		
-		<!-- IF S_CONFIRM_CODE -->
-		<dl>
-			<dt><label for="confirm_code">{L_CONFIRM_CODE}:</label><br /><span>{L_CONFIRM_CODE_EXPLAIN}</span></dt>
-				<dd><input type="hidden" name="confirm_id" value="{CONFIRM_ID}" />{CONFIRM_IMAGE}</dd>
-				<dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" tabindex="3" class="inputbox narrow" title="{L_CONFIRM_CODE}" /></dd>
-		</dl>
+		<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
+			<!-- DEFINE $CAPTCHA_TAB_INDEX = 3 -->
+			<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
 		<!-- ENDIF -->
-		
 		<!-- IF S_DISPLAY_FULL_LOGIN -->
 		<dl>
 			<!-- IF S_AUTOLOGIN_ENABLED --><dd><label for="autologin"><input type="checkbox" name="autologin" id="autologin" tabindex="4" /> {L_LOG_ME_IN}</label></dd><!-- ENDIF -->
 			<dd><label for="viewonline"><input type="checkbox" name="viewonline" id="viewonline" tabindex="5" /> {L_HIDE_ME}</label></dd>
 		</dl>
 		<!-- ENDIF -->
+
 		<dl>
 			<dt>&nbsp;</dt>
 			<dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="6" value="{L_LOGIN}" class="button1" /></dd>
 		</dl>
-	
+
 		</fieldset>
 	</div>
 	<span class="corners-bottom"><span></span></span></div>
 </div>
 
+
 <!-- IF not S_ADMIN_AUTH and S_REGISTER_ENABLED -->
 	<div class="panel">
 		<div class="inner"><span class="corners-top"><span></span></span>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/mcp_forum.html 3.0.6.src/styles/prosilver/template/mcp_forum.html
--- 3.0.5.src/styles/prosilver/template/mcp_forum.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/mcp_forum.html	2009-11-16 11:10:09.000000000 -0600
@@ -35,7 +35,7 @@
 		<!-- BEGIN topicrow -->
 		<li class="row<!-- IF topicrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->">
 			<dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
-				<dt <!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS -->style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
+				<dt <!-- IF topicrow.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
 					<!-- IF topicrow.S_SELECT_TOPIC --><a href="{topicrow.U_SELECT_TOPIC}" class="topictitle">[ {L_SELECT_MERGE} ]</a>&nbsp;&nbsp; <!-- ENDIF -->
 					<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
 					<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/mcp_front.html 3.0.6.src/styles/prosilver/template/mcp_front.html
--- 3.0.5.src/styles/prosilver/template/mcp_front.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/mcp_front.html	2009-11-16 11:10:09.000000000 -0600
@@ -51,6 +51,7 @@
 
 	<!-- IF .unapproved -->
 	<fieldset class="display-actions">
+		{S_HIDDEN_FIELDS}
 		<input class="button2" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" />&nbsp;
 		<input class="button1" type="submit" name="action[approve]" value="{L_APPROVE}" />
 		<div><a href="#" onclick="marklist('mcp_queue', 'post_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp_queue', 'post_id_list', false); return false;">{L_UNMARK_ALL}</a></div>
@@ -100,6 +101,47 @@
 	</div>
 <!-- ENDIF -->
 
+<!-- IF S_SHOW_PM_REPORTS -->
+	<div class="panel">
+		<div class="inner"><span class="corners-top"><span></span></span>
+
+		<h3>{L_LATEST_REPORTED_PMS}</h3>
+		<!-- IF S_HAS_PM_REPORTS --><p>{L_PM_REPORTS_TOTAL}</p><!-- ENDIF -->
+
+		<!-- IF .pm_report -->
+			<ul class="topiclist">
+				<li class="header">
+					<dl>
+						<dt>{L_VIEW_DETAILS}</dt>
+						<dd class="moderation"><span>{L_REPORTER}</span></dd>
+					</dl>
+				</li>
+			</ul>
+			<ul class="topiclist cplist">
+
+			<!-- BEGIN pm_report -->
+			<li class="row<!-- IF report.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
+				<dl>
+					<dt>
+						<a href="{pm_report.U_PM_DETAILS}" class="topictitle">{pm_report.PM_SUBJECT}</a> {pm_report.ATTACH_ICON_IMG}<br />
+						<span>{L_MESSAGE_BY_AUTHOR} {pm_report.PM_AUTHOR_FULL} &raquo; {pm_report.PM_TIME}</span><br />
+						<span>{L_MESSAGE_TO} {pm_report.RECIPIENTS}</span>
+					</dt>
+					<dd class="moderation">
+						<span>{L_REPORTED} {L_POST_BY_AUTHOR} {pm_report.REPORTER_FULL} {L_REPORTED_ON_DATE} {pm_report.REPORT_TIME}</span>
+					</dd>
+				</dl>
+			</li>
+			<!-- END pm_report -->
+			</ul>
+		<!-- ELSE -->
+			<p>{L_PM_REPORTS_ZERO_TOTAL}</p>
+		<!-- ENDIF -->
+
+		<span class="corners-bottom"><span></span></span></div>
+	</div>
+<!-- ENDIF -->
+
 <!-- IF S_SHOW_LOGS -->
 	<div class="panel">
 		<div class="inner"><span class="corners-top"><span></span></span>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/mcp_logs.html 3.0.6.src/styles/prosilver/template/mcp_logs.html
--- 3.0.5.src/styles/prosilver/template/mcp_logs.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/mcp_logs.html	2009-11-16 11:10:10.000000000 -0600
@@ -8,6 +8,9 @@
 	<div class="inner"><span class="corners-top"><span></span></span>
 
 	<ul class="linklist">
+		<li class="leftside">
+			{L_SEARCH_KEYWORDS}: <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
+		</li>
 		<li class="rightside pagination">
 			<!-- IF TOTAL -->{TOTAL} <!-- ENDIF -->
 			<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
@@ -71,7 +74,7 @@
 			<fieldset class="display-actions">
 				<input class="button2" type="submit" name="action[del_all]" value="{L_DELETE_ALL}" />
 				&nbsp;<input class="button1" type="submit" value="{L_DELETE_MARKED}" name="action[del_marked]" />
-	
+
 				<div><a href="#" onclick="marklist('mcp', 'mark', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'mark', false); return false;">{L_UNMARK_ALL}</a></div>
 			</fieldset>
 		<!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/mcp_notes_user.html 3.0.6.src/styles/prosilver/template/mcp_notes_user.html
--- 3.0.5.src/styles/prosilver/template/mcp_notes_user.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/mcp_notes_user.html	2009-11-16 11:10:10.000000000 -0600
@@ -42,15 +42,18 @@
 </div>
 
 <fieldset class="submit-buttons">
-	{S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp; 
+	{S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
 	<input type="submit" name="action[add_feedback]" value="{L_SUBMIT}" class="button1" />
 	{S_FORM_TOKEN}
 </fieldset>
 
 <div class="panel">
-	<div class="inner"><span class="corners-top"><span></span></span>		
+	<div class="inner"><span class="corners-top"><span></span></span>
 
 	<ul class="linklist">
+		<li class="leftside">
+			{L_SEARCH_KEYWORDS}: <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
+		</li>
 		<li class="rightside pagination">
 			<!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} <!-- ENDIF -->
 			<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
@@ -90,8 +93,8 @@
 	<fieldset class="display-options">
 		<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
 		<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
-		<label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label>
-		<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>		
+		<label>{L_DISPLAY_LOG}: {S_SELECT_SORT_DAYS}</label>
+		<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
 		<input type="submit" name="sort" value="{L_GO}" class="button2" />
 	</fieldset>
 
@@ -105,7 +108,7 @@
 	</ul>
 
 	<span class="corners-bottom"><span></span></span></div>
-</div>	
+</div>
 
 <!-- IF S_CLEAR_ALLOWED -->
 <fieldset class="display-actions">
@@ -114,7 +117,7 @@
 </fieldset>
 
 <fieldset class="display-actions">
-	<div><a href="#" onclick="marklist('mcp', 'marknote', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('mcp', 'marknote', false); return false;">{L_UNMARK_ALL}</a></div>		
+	<div><a href="#" onclick="marklist('mcp', 'marknote', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('mcp', 'marknote', false); return false;">{L_UNMARK_ALL}</a></div>
 </fieldset>
 <!-- ENDIF -->
 </form>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/mcp_post.html 3.0.6.src/styles/prosilver/template/mcp_post.html
--- 3.0.5.src/styles/prosilver/template/mcp_post.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/mcp_post.html	2009-11-16 11:10:09.000000000 -0600
@@ -1,14 +1,18 @@
 <!-- INCLUDE mcp_header.html -->
 
 <!-- IF S_MCP_REPORT -->
+	<!-- IF S_PM -->
+	<h2>{L_PM_REPORT_DETAILS}</h2>
+	<!-- ELSE -->
 	<h2>{L_REPORT_DETAILS}</h2>
+	<!-- ENDIF -->
 
 	<div id="report" class="panel">
 		<div class="inner"><span class="corners-top"><span></span></span>
 
 		<div class="postbody">
 			<h3>{L_REPORT_REASON}: {REPORT_REASON_TITLE}</h3>
-			<p class="author">{L_REPORTED} {L_POST_BY_AUTHOR} {REPORTER_FULL} {L_REPORTED_ON_DATE}  {REPORT_DATE}</p>
+			<p class="author">{L_REPORTED} {L_POST_BY_AUTHOR} {REPORTER_FULL} &laquo; {REPORT_DATE}</p>
 		<!-- IF not S_POST_REPORTED -->
 			<p class="rules">{L_REPORT_CLOSED}</p>
 		<!-- ENDIF -->
@@ -51,7 +55,16 @@
 		<!-- ENDIF -->
 
 		<h3><a href="{U_VIEW_POST}">{POST_SUBJECT}</a></h3>
+		<!-- IF S_PM -->
+		<p class="author">
+			<strong>{L_SENT_AT}:</strong> {POST_DATE}
+			<br /><strong>{L_PM_FROM}:</strong> {POST_AUTHOR_FULL}
+			<!-- IF S_TO_RECIPIENT --><br /><strong>{L_TO}:</strong> <!-- BEGIN to_recipient --><!-- IF to_recipient.NAME_FULL -->{to_recipient.NAME_FULL}<!-- ELSE --><a href="{to_recipient.U_VIEW}" style="color:<!-- IF to_recipient.COLOUR -->{to_recipient.COLOUR}<!-- ELSEIF to_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{to_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END to_recipient --><!-- ENDIF -->
+			<!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}:</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}" style="color:<!-- IF bcc_recipient.COLOUR -->{bcc_recipient.COLOUR}<!-- ELSEIF bcc_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{bcc_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END bcc_recipient --><!-- ENDIF -->
+		</p>
+		<!-- ELSE -->
 		<p class="author">{MINI_POST_IMG} {L_POSTED} {L_POST_BY_AUTHOR} {POST_AUTHOR_FULL} &raquo; {POST_DATE}</p>
+		<!-- ENDIF -->
 
 		<!-- IF S_POST_UNAPPROVED -->
 			<form method="post" id="mcp_approve" action="{U_APPROVE_ACTION}">
@@ -152,7 +165,7 @@
 	<div class="panel">
 		<div class="inner"><span class="corners-top"><span></span></span>
 
-		<p><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS} | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></p>
+		<p><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS}<!-- IF not S_PM --> | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ENDIF --><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></p>
 
 		<span class="corners-bottom"><span></span></span></div>
 	</div>
@@ -171,7 +184,7 @@
 				<h3>{L_FEEDBACK}</h3>
 
 				<!-- BEGIN usernotes -->
-					<span class="small"><strong>{L_REPORTED_BY}: {usernotes.REPORT_BY} {L_REPORTED_ON_DATE} {usernotes.REPORT_AT}</strong></span>
+					<span class="small"><strong>{L_REPORTED_BY}: {usernotes.REPORT_BY} &laquo; {usernotes.REPORT_AT}</strong></span>
 					<!-- IF S_CLEAR_ALLOWED --><div class="right-box"><input type="checkbox" name="marknote[]" value="{usernotes.ID}" /></div><!-- ENDIF -->
 					<div class="postbody">{usernotes.ACTION}</div>
 
@@ -211,7 +224,7 @@
 			<h3>{L_MCP_POST_REPORTS}</h3>
 
 			<!-- BEGIN reports -->
-				<span class="small"><strong>{L_REPORTED_BY}: <!-- IF reports.U_REPORTER --><a href="{reports.U_REPORTER}">{reports.REPORTER}</a><!-- ELSE -->{reports.REPORTER}<!-- ENDIF --> {L_REPORTED_ON_DATE} {reports.REPORT_TIME}</strong></span>
+				<span class="small"><strong>{L_REPORTED_BY}: <!-- IF reports.U_REPORTER --><a href="{reports.U_REPORTER}">{reports.REPORTER}</a><!-- ELSE -->{reports.REPORTER}<!-- ENDIF --> &laquo; {reports.REPORT_TIME}</strong></span>
 				<p><em>{reports.REASON_TITLE}: {reports.REASON_DESC}</em><!-- IF reports.REPORT_TEXT --><br />{reports.REPORT_TEXT}<!-- ENDIF --></p>
 			<!-- END reports -->
 
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/mcp_reports.html 3.0.6.src/styles/prosilver/template/mcp_reports.html
--- 3.0.5.src/styles/prosilver/template/mcp_reports.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/mcp_reports.html	2009-11-16 11:10:09.000000000 -0600
@@ -2,11 +2,13 @@
 
 <form id="mcp" method="post" action="{S_MCP_ACTION}">
 
+<!-- IF not S_PM -->
 <fieldset class="forum-selection">
 	<label for="fo">{L_FORUM}: <select name="f" id="fo">{S_FORUM_OPTIONS}</select></label>
 	<input type="submit" name="sort" value="{L_GO}" class="button2" />
 	{S_FORM_TOKEN}
 </fieldset>
+<!-- ENDIF -->
 
 <h2>{L_TITLE}</h2>
 
@@ -26,7 +28,7 @@
 			<li class="header">
 				<dl>
 					<dt>{L_VIEW_DETAILS}</dt>
-					<dd class="moderation"><span>{L_REPORTER} &amp; {L_FORUM}</span></dd>
+					<dd class="moderation"><span>{L_REPORTER}<!-- IF not S_PM --> &amp; {L_FORUM}<!-- ENDIF --></span></dd>
 					<dd class="mark">{L_MARK}</dd>
 				</dl>
 			</li>
@@ -36,14 +38,25 @@
 		<!-- BEGIN postrow -->
 			<li class="row<!-- IF postrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
 				<dl>
+					<!-- IF S_PM -->
+					<dt>
+						<a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.PM_SUBJECT}</a> {postrow.ATTACH_ICON_IMG}<br />
+						<span>{L_MESSAGE_BY_AUTHOR} {postrow.PM_AUTHOR_FULL} &raquo; {postrow.PM_TIME}</span><br />
+						<span>{L_MESSAGE_TO} {postrow.RECIPIENTS}</span>
+					</dt>
+					<dd class="moderation">
+						<span>{postrow.REPORTER_FULL} &laquo; {postrow.REPORT_TIME}</span>
+					</dd>
+					<!-- ELSE -->
 					<dt>
 						<a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.POST_SUBJECT}</a> {postrow.ATTACH_ICON_IMG}<br />
 						<span>{L_POSTED} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} &raquo; {postrow.POST_TIME}</span>
 					</dt>
 					<dd class="moderation">
-						<span>{postrow.REPORTER_FULL} {L_REPORTED_ON_DATE} {postrow.REPORT_TIME}<br />
+						<span>{postrow.REPORTER_FULL} &laquo; {postrow.REPORT_TIME}<br />
 						{L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a></span>
 					</dd>
+					<!-- ENDIF -->
 					<dd class="mark"><input type="checkbox" name="report_id_list[]" value="{postrow.REPORT_ID}" /></dd>
 				</dl>
 			</li>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/mcp_topic.html 3.0.6.src/styles/prosilver/template/mcp_topic.html
--- 3.0.5.src/styles/prosilver/template/mcp_topic.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/mcp_topic.html	2009-11-16 11:10:09.000000000 -0600
@@ -106,14 +106,14 @@
 			<div class="inner"><span class="corners-top"><span></span></span>
 
 			<div class="postbody" id="pr{postrow.POST_ID}">
-				<div class="right-box"><a href="{postrow.U_POST_DETAILS}">{L_POST_DETAILS}</a> | {L_SELECT}: <input type="checkbox" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></div>
+				<ul class="profile-icons"><li class="info-icon"><a href="{postrow.U_POST_DETAILS}" title="{L_POST_DETAILS}"><span>{L_POST_DETAILS}</span></a></li><li>{L_SELECT}: <input type="checkbox" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></li></ul>
 
 				<h3><a href="{postrow.U_POST_DETAILS}">{postrow.POST_SUBJECT}</a></h3>
 				<p class="author"><a href="#pr{postrow.POST_ID}">{postrow.MINI_POST_IMG}</a> {L_POSTED} {postrow.POST_DATE} {L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong><!-- IF postrow.U_MCP_DETAILS --> [ <a href="{postrow.U_MCP_DETAILS}">{L_POST_DETAILS}</a> ]<!-- ENDIF --></p>
 
 				<!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED -->
 				<p class="rules">
-					<!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><!-- ENDIF -->
+					<!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><br /><!-- ENDIF -->
 					<!-- IF postrow.S_POST_REPORTED -->{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF -->
 				</p>
 				<!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/memberlist_body.html 3.0.6.src/styles/prosilver/template/memberlist_body.html
--- 3.0.5.src/styles/prosilver/template/memberlist_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/memberlist_body.html	2009-11-16 11:10:09.000000000 -0600
@@ -131,7 +131,7 @@
 
 	<tr class="<!-- IF memberrow.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
 		<td><!-- IF memberrow.RANK_IMG --><span class="rank-img">{memberrow.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{memberrow.RANK_TITLE}</span><!-- ENDIF --><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input type="checkbox" name="user" value="{memberrow.USERNAME}" /> <!-- ENDIF -->{memberrow.USERNAME_FULL}<!-- IF S_SELECT_SINGLE --><br />[&nbsp;<a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a>&nbsp;]<!-- ENDIF --></td>
-		<td class="posts"><!-- IF memberrow.POSTS --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td>
+		<td class="posts"><!-- IF memberrow.POSTS and S_DISPLAY_SEARCH --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td>
 		<td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}: {memberrow.U_WWW}">{memberrow.U_SHORT_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
 		<td>{memberrow.JOINED}</td>
 		<!-- IF S_VIEWONLINE --><td>{memberrow.VISITED}&nbsp;</td><!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/memberlist_im.html 3.0.6.src/styles/prosilver/template/memberlist_im.html
--- 3.0.5.src/styles/prosilver/template/memberlist_im.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/memberlist_im.html	2009-11-16 11:10:10.000000000 -0600
@@ -7,13 +7,13 @@
 
 <div class="panel bg2">
 	<div class="inner"><span class="corners-top"><span></span></span>
-	
+
 	<p>{L_SEND_IM_EXPLAIN}</p>
 
 	<fieldset>
 	<dl class="fields2">
 		<dt><label>{L_IM_RECIPIENT}:</label></dt>
-		<dd><strong>{USERNAME}</strong><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM --> [ {IM_CONTACT} ]<!-- ENDIF --><!-- IF PRESENCE_IMG --> {PRESENCE_IMG}<!-- ENDIF --></dd>
+		<dd><strong>{USERNAME}</strong><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM or S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --><!-- IF PRESENCE_IMG --> {PRESENCE_IMG}<!-- ENDIF --></dd>
 	</dl>
 
 	<!-- IF S_SEND_ICQ -->
@@ -81,9 +81,10 @@
 
 	<span class="corners-bottom"><span></span></span></div>
 </div>
-<a  href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
 </form>
 
+<a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
+
 <script type="text/javascript">
 // <![CDATA[
 
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/memberlist_view.html 3.0.6.src/styles/prosilver/template/memberlist_view.html
--- 3.0.5.src/styles/prosilver/template/memberlist_view.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/memberlist_view.html	2009-11-16 11:10:10.000000000 -0600
@@ -34,14 +34,16 @@
 		<!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}:</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF -->
 		<!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields -->
 		<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
-			<!-- IF U_ADD_FRIEND and U_ADD_FOE-->
-				<dt>&nbsp;</dt> <dd><a href="{U_ADD_FRIEND}"><strong>{L_ADD_FRIEND}</strong></a></dd>
-				<dt>&nbsp;</dt> <dd><a href="{U_ADD_FOE}"><strong>{L_ADD_FOE}</strong></a></dd>
+			<!-- IF U_REMOVE_FRIEND -->
+				<dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
+			<!-- ELSEIF U_REMOVE_FOE -->
+				<dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FOE}"><strong>{L_REMOVE_FOE}</strong></a></dd>
 			<!-- ELSE -->
-				<!-- IF U_REMOVE_FRIEND -->
-					<dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
-				<!-- ELSE -->
-					<dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FOE}"><strong>{L_REMOVE_FOE}</strong></a></dd>
+				<!-- IF U_ADD_FRIEND -->
+					<dt>&nbsp;</dt> <dd><a href="{U_ADD_FRIEND}"><strong>{L_ADD_FRIEND}</strong></a></dd>
+				<!-- ENDIF -->
+				<!-- IF U_ADD_FOE -->
+					<dt>&nbsp;</dt> <dd><a href="{U_ADD_FOE}"><strong>{L_ADD_FOE}</strong></a></dd>
 				<!-- ENDIF -->
 			<!-- ENDIF -->
 		<!-- ENDIF -->
@@ -59,14 +61,13 @@
 		<dl class="details">
 		<!-- IF U_EMAIL --><dt>{L_EMAIL_ADDRESS}:</dt> <dd><a href="{U_EMAIL}">{L_SEND_EMAIL_USER} {USERNAME}</a></dd><!-- ENDIF -->
 		<!-- IF U_WWW --><dt>{L_WEBSITE}:</dt> <dd><a href="{U_WWW}" title="{L_VISIT_WEBSITE}: {U_WWW}">{U_WWW}</a></dd><!-- ENDIF -->
-		<!-- IF U_PM --><dt>{L_PM}:</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd>
-		<!-- ENDIF -->
+		<!-- IF U_PM --><dt>{L_PM}:</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd><!-- ENDIF -->
 		<!-- IF U_MSN or USER_MSN --><dt>{L_MSNM}:</dt> <dd><!-- IF U_MSN --><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_MSNM_MESSAGE}</a><!-- ELSE -->{USER_MSN}<!-- ENDIF --></dd><!-- ENDIF -->
 		<!-- IF U_YIM or USER_YIM --><dt>{L_YIM}:</dt> <dd><!-- IF U_YIM --><a href="{U_YIM}" onclick="popup(this.href, 780, 550); return false;">{L_SEND_YIM_MESSAGE}</a><!-- ELSE -->{USER_YIM}<!-- ENDIF --></dd><!-- ENDIF -->
 		<!-- IF U_AIM or USER_AIM --><dt>{L_AIM}:</dt> <dd><!-- IF U_AIM --><a href="{U_AIM}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_AIM_MESSAGE}</a><!-- ELSE -->{USER_AIM}<!-- ENDIF --></dd><!-- ENDIF -->
 		<!-- IF U_ICQ or USER_ICQ --><dt>{L_ICQ}:</dt> <dd><!-- IF U_ICQ --><a href="{U_ICQ}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_ICQ_MESSAGE}</a><!-- ELSE -->{USER_ICQ}<!-- ENDIF --></dd><!-- ENDIF -->
 		<!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}:</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}:</dt> <dd>{USER_JABBER}</dd><!-- ENDIF -->
-		<!-- IF S_PROFILE_FIELD_1 -->
+		<!-- IF S_PROFILE_FIELD1 -->
 			<!-- NOTE: Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
 			<dt>{postrow.PROFILE_FIELD1_NAME}:</dt> <dd>{postrow.PROFILE_FIELD1_VALUE}</dd>
 		<!-- ENDIF -->
@@ -78,12 +79,12 @@
 		<dl class="details">
 			<dt>{L_JOINED}:</dt> <dd>{JOINED}</dd>
 			<dt>{L_VISITED}:</dt> <dd>{VISITED}</dd>
-			<!-- IF U_NOTES or U_WARN -->
+			<!-- IF S_WARNINGS -->
 			<dt>{L_WARNINGS}: </dt>
-			<dd><strong>{WARNINGS}</strong> [ <a href="{U_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_WARN --> | <a href="{U_WARN}">{L_WARN_USER}</a> <!-- ENDIF -->]</dd>
+			<dd><strong>{WARNINGS}</strong><!-- IF U_NOTES or U_WARN --> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]<!-- ENDIF --></dd>
 			<!-- ENDIF -->
 			<dt>{L_TOTAL_POSTS}:</dt>
-				<dd>{POSTS} | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong>
+				<dd>{POSTS} <!-- IF S_DISPLAY_SEARCH -->| <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong><!-- ENDIF -->
 					<!-- IF POSTS_PCT --><br />({POSTS_PCT} / {POSTS_DAY})<!-- ENDIF -->
 					<!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --><br />(<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>)<!-- ELSEIF POSTS_IN_QUEUE --><br />({L_POSTS_IN_QUEUE})<!-- ENDIF -->
 				</dd>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/overall_footer.html 3.0.6.src/styles/prosilver/template/overall_footer.html
--- 3.0.5.src/styles/prosilver/template/overall_footer.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/overall_footer.html	2009-11-16 11:10:09.000000000 -0600
@@ -18,7 +18,7 @@
 
 		<span class="corners-bottom"><span></span></span></div>
 	</div>
-	
+
 <!--
 	We request you retain the full copyright notice below including the link to www.phpbb.com.
 	This not only gives respect to the large amount of time given freely by the developers
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/overall_header.html 3.0.6.src/styles/prosilver/template/overall_header.html
--- 3.0.5.src/styles/prosilver/template/overall_header.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/overall_header.html	2009-11-16 11:10:09.000000000 -0600
@@ -15,12 +15,21 @@
 {META}
 <title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
 
+<!-- IF S_ENABLE_FEEDS -->
+	<link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" />
+	<!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news" /><!-- ENDIF -->
+	<!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums" /><!-- ENDIF -->
+	<!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_TOPICS}" href="{U_FEED}?mode=topics" /><!-- ENDIF -->
+	<!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" /><!-- ENDIF -->
+	<!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&amp;t={S_TOPIC_ID}" /><!-- ENDIF -->
+<!-- ENDIF -->
+
 <!--
 	phpBB style name: prosilver
 	Based on style:   prosilver (this is the default phpBB3 style)
 	Original author:  Tom Beddard ( http://www.subBlue.com/ )
-	Modified by:      
-	
+	Modified by:
+
 	NOTE: This page was generated by phpBB, the free open-source bulletin board package.
 	      The phpBB Group is not responsible for the content of this page and forum. For more information
 	      about phpBB please visit http://www.phpbb.com
@@ -110,7 +119,7 @@
 			<div id="search-box">
 				<form action="{U_SEARCH}" method="post" id="search">
 				<fieldset>
-					<input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" /> 
+					<input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" />
 					<input class="button2" value="{L_SEARCH}" type="submit" /><br />
 					<a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH_ADV}</a> {S_SEARCH_HIDDEN_FIELDS}
 				</fieldset>
@@ -127,7 +136,7 @@
 			<ul class="linklist navlinks">
 				<li class="icon-home"><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a> <!-- BEGIN navlinks --> <strong>&#8249;</strong> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></li>
 
-				<li class="rightside"><a href="#" onclick="fontsizeup(); return false;" onkeypress="fontsizeup(); return false;" class="fontsize" title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li>
+				<li class="rightside"><a href="#" onclick="fontsizeup(); return false;" onkeypress="return fontsizeup(event);" class="fontsize" title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li>
 
 				<!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
 				<!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF -->
@@ -138,9 +147,11 @@
 			<!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
 			<ul class="linklist leftside">
 				<li class="icon-ucp">
-					<a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="u">{L_PROFILE}</a>
-						<!-- IF S_DISPLAY_PM --> (<a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF --> &bull; 
+					<a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="e">{L_PROFILE}</a>
+						<!-- IF S_DISPLAY_PM --> (<a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF -->
+					<!-- IF S_DISPLAY_SEARCH --> &bull;
 					<a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a>
+					<!-- ENDIF -->
 					<!-- IF U_RESTORE_PERMISSIONS --> &bull;
 					<a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a>
 					<!-- ENDIF -->
@@ -152,8 +163,8 @@
 				<li class="icon-faq"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li>
 				<!-- IF not S_IS_BOT -->
 					<!-- IF S_DISPLAY_MEMBERLIST --><li class="icon-members"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF -->
-					<!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED --><li class="icon-register"><a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF -->
-					<li class="icon-logout"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="l">{L_LOGIN_LOGOUT}</a></li>
+					<!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --><li class="icon-register"><a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF -->
+					<li class="icon-logout"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x">{L_LOGIN_LOGOUT}</a></li>
 				<!-- ENDIF -->
 			</ul>
 
@@ -164,11 +175,10 @@
 
 	<a name="start_here"></a>
 	<div id="page-body">
-		
-		 <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) --> 
-		<div id="message" class="rules">
+		<!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
+		<div id="information" class="rules">
 			<div class="inner"><span class="corners-top"><span></span></span>
 				<strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED}
 			<span class="corners-bottom"><span></span></span></div>
 		</div>
-		<!-- ENDIF -->
\ No newline at end of file
+		<!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/posting_editor.html 3.0.6.src/styles/prosilver/template/posting_editor.html
--- 3.0.5.src/styles/prosilver/template/posting_editor.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/posting_editor.html	2009-11-16 11:10:09.000000000 -0600
@@ -1,3 +1,9 @@
+<script type="text/javascript">
+// <![CDATA[
+	onload_functions.push('apply_onkeypress_event()');
+// ]]>
+</script>
+
 <fieldset class="fields1">
 	<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
 
@@ -88,9 +94,9 @@
 	<!-- ENDIF -->
 
 	<!-- IF not S_PRIVMSGS and S_DISPLAY_USERNAME -->
-	<dl>
+	<dl style="clear: left;">
 		<dt><label for="username">{L_USERNAME}:</label></dt>
-		<dd><input type="text" tabindex="1" name="username" id="username" size="25" value="{USERNAME}" class="inputbox" /></dd>
+		<dd><input type="text" tabindex="1" name="username" id="username" size="25" value="{USERNAME}" class="inputbox autowidth" /></dd>
 	</dl>
 	<!-- ENDIF -->
 
@@ -99,13 +105,10 @@
 		<dt><label for="subject">{L_SUBJECT}:</label></dt>
 		<dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
 	</dl>
-		<!-- IF S_CONFIRM_CODE -->
-		<dl>
-			<dt><label for="confirm_code">{L_CONFIRM_CODE}:</label><br /><span>{L_CONFIRM_CODE_EXPLAIN}</span></dt>
-				<dd><input type="hidden" name="confirm_id" value="{CONFIRM_ID}" />{CONFIRM_IMAGE}</dd>
-				<dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" tabindex="3" class="inputbox narrow" title="{L_CONFIRM_CODE}" /></dd>
-		</dl>
-		<!-- ENDIF -->
+	<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
+		<!-- DEFINE $CAPTCHA_TAB_INDEX = 3 -->
+		<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
+	<!-- ENDIF -->
 	<!-- ENDIF -->
 
 	<!-- INCLUDE posting_buttons.html -->
@@ -128,8 +131,8 @@
 			{IMG_STATUS}<br />
 			{FLASH_STATUS}<br />
 			{URL_STATUS}<br />
-			{SMILIES_STATUS}
 		<!-- ENDIF -->
+		{SMILIES_STATUS}
 		<!-- ENDIF -->
 		<!-- IF S_EDIT_DRAFT || S_DISPLAY_REVIEW -->
 			<!-- IF S_DISPLAY_REVIEW --><hr /><!-- ENDIF -->
@@ -139,7 +142,7 @@
 	</div>
 
 	<div id="message-box">
-		<textarea <!-- IF S_UCP_ACTION and not S_PRIVMSGS and not S_EDIT_DRAFT -->name="signature" id="signature" style="height: 9em;"<!-- ELSE -->name="message" id="message"<!-- ENDIF --> rows="15" cols="76" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" class="inputbox">{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}</textarea>
+		<textarea <!-- IF S_UCP_ACTION and not S_PRIVMSGS and not S_EDIT_DRAFT -->name="signature" id="signature" style="height: 9em;"<!-- ELSE -->name="message" id="message"<!-- ENDIF --> rows="15" cols="76" tabindex="4" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" class="inputbox">{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}</textarea>
 	</div>
 </fieldset>
 
@@ -184,10 +187,10 @@
 		<fieldset class="submit-buttons">
 			{S_HIDDEN_ADDRESS_FIELD}
 			{S_HIDDEN_FIELDS}
-			<!-- IF S_HAS_DRAFTS --><input type="submit" accesskey="d" tabindex="9" name="load" value="{L_LOAD}" class="button2" onclick="load_draft = true;" />&nbsp; <!-- ENDIF -->
-			<!-- IF S_SAVE_ALLOWED --><input type="submit" accesskey="k" tabindex="8" name="save" value="{L_SAVE}" class="button2" />&nbsp; <!-- ENDIF -->
+			<!-- IF S_HAS_DRAFTS --><input type="submit" accesskey="d" tabindex="8" name="load" value="{L_LOAD}" class="button2" onclick="load_draft = true;" />&nbsp; <!-- ENDIF -->
+			<!-- IF S_SAVE_ALLOWED --><input type="submit" accesskey="k" tabindex="7" name="save" value="{L_SAVE}" class="button2" />&nbsp; <!-- ENDIF -->
 			<input type="submit" tabindex="5" name="preview" value="{L_PREVIEW}" class="button1"<!-- IF not S_PRIVMSGS --> onclick="document.getElementById('postform').action += '#preview';"<!-- ENDIF --> />&nbsp;
-			<input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
+			<input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1 default-submit-action" />&nbsp;
 
 		</fieldset>
 
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/posting_preview.html 3.0.6.src/styles/prosilver/template/posting_preview.html
--- 3.0.5.src/styles/prosilver/template/posting_preview.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/posting_preview.html	2009-11-16 11:10:09.000000000 -0600
@@ -1,4 +1,4 @@
-<div class="post bg2" id="preview">
+<div class="post <!-- IF S_PRIVMSGS -->pm<!-- ELSE -->bg2<!-- ENDIF -->" id="preview">
 	<div class="inner"><span class="corners-top"><span></span></span>
 
 <!-- IF S_HAS_POLL_OPTIONS -->
@@ -19,16 +19,16 @@
 	<span class="corners-bottom"><span></span></span></div>
 </div>
 
-<div class="post <!-- IF S_PRIVMSGS --> pm<!-- ELSE --> bg2<!-- ENDIF -->">
+<div class="post bg2">
 	<div class="inner"><span class="corners-top"><span></span></span>
 
 <!-- ENDIF -->
 
 	<div class="postbody">
 		<h3>{L_PREVIEW}: {PREVIEW_SUBJECT}</h3>
-		
+
 		<div class="content">{PREVIEW_MESSAGE}</div>
-		
+
 		<!-- IF .attachment -->
 		<dl class="attachbox">
 			<dt>{L_ATTACHMENTS}</dt>
@@ -37,7 +37,7 @@
 			<!-- END attachment -->
 		</dl>
 		<!-- ENDIF -->
-		
+
 		<!-- IF PREVIEW_SIGNATURE --><div class="signature">{PREVIEW_SIGNATURE}</div><!-- ENDIF -->
 	</div>
 
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/posting_smilies.html 3.0.6.src/styles/prosilver/template/posting_smilies.html
--- 3.0.5.src/styles/prosilver/template/posting_smilies.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/posting_smilies.html	2009-11-16 11:10:09.000000000 -0600
@@ -12,11 +12,12 @@
 <div class="panel">
 	<div class="inner"><span class="corners-top"><span></span></span>
 		<!-- BEGIN smiley --> 
-			<a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a> 
+			<a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a> 
 		<!-- END smiley	-->
 	
 	<span class="corners-bottom"><span></span></span></div>
 </div>
+<div>{PAGINATION}</div>
 <a  href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
 
 <!-- INCLUDE simple_footer.html -->
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/posting_topic_review.html 3.0.6.src/styles/prosilver/template/posting_topic_review.html
--- 3.0.5.src/styles/prosilver/template/posting_topic_review.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/posting_topic_review.html	2009-11-16 11:10:09.000000000 -0600
@@ -5,6 +5,11 @@
 </h3>
 
 <div id="topicreview">
+<script type="text/javascript">
+// <![CDATA[
+	bbcodeEnabled = {S_BBCODE_ALLOWED};
+// ]]>
+</script>
 	<!-- BEGIN topic_review_row -->
 
 	<!-- IF topic_review_row.S_IGNORE_POST -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/quickreply_editor.html 3.0.6.src/styles/prosilver/template/quickreply_editor.html
--- 3.0.5.src/styles/prosilver/template/quickreply_editor.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/styles/prosilver/template/quickreply_editor.html	2009-11-16 11:10:09.000000000 -0600
@@ -0,0 +1,83 @@
+<script type="text/javascript">
+// <![CDATA[
+	function hide_qr(show)
+	{
+		dE('qr_editor_div');
+		dE('qr_showeditor_div');
+		if (show && document.getElementById('qr_editor_div').style.display != 'none')
+		{
+			document.getElementsByName('message')[0].focus();
+		}
+		return true;
+	}
+
+
+	function init_qr()
+	{
+		dE('qr_showeditor_div');
+		return true;
+	}
+	onload_functions.push('init_qr();');
+	// ]]>
+</script>
+<noscript>
+	<form method="post" action="{U_QR_ACTION}">
+		<div class="panel" id="qr_ns_editor_div">
+			<div class="inner"><span class="corners-top"><span></span></span>
+				<div class="content">
+					<h2>{L_QUICKREPLY}</h2>
+					<fieldset class="fields1">
+						<dl style="clear: left;">
+							<dt><label for="subject">{L_SUBJECT}:</label></dt>
+							<dd><input type="text" name="subject" id="subject-ns" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" class="inputbox autowidth" /></dd>
+						</dl>
+					<div id="message-box-ns">
+						<textarea style="height: 9em;" name="message" rows="7" cols="76" tabindex="3" class="inputbox"></textarea>
+					</div>
+					</fieldset>
+					<fieldset class="submit-buttons">
+						{S_FORM_TOKEN}
+						{QR_HIDDEN_FIELDS}
+						<input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
+						<input type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" class="button2" />&nbsp;
+					</fieldset>
+				</div>
+			<span class="corners-bottom"><span></span></span></div>
+		</div>
+	</form>
+</noscript>
+<form method="post" action="{U_QR_ACTION}">
+	<div class="panel" style="display: none" id="qr_editor_div">
+		<div class="inner"><span class="corners-top"><span></span></span>
+			<div class="content">
+				<h2>{L_QUICKREPLY}</h2>
+				<fieldset class="fields1">
+					<dl style="clear: left;">
+						<dt><label for="subject">{L_SUBJECT}:</label></dt>
+						<dd><input type="text" name="subject" id="subject" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" class="inputbox autowidth" /></dd>
+					</dl>
+				<div id="message-box">
+					<textarea style="height: 9em;" name="message" rows="7" cols="76" tabindex="3" class="inputbox"></textarea>
+				</div>
+				</fieldset>
+				<fieldset class="submit-buttons">
+					{S_FORM_TOKEN}
+					{QR_HIDDEN_FIELDS}
+					<input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
+					<input type="submit" accesskey="f" tabindex="6" name="full_editor" value="{L_FULL_EDITOR}" class="button2" />&nbsp;
+				</fieldset>
+				<a href="" class="right-box up" onclick="hide_qr(false); return false;" title="{L_COLLAPSE_QR}">{L_COLLAPSE_QR}</a>
+			</div>
+		<span class="corners-bottom"><span></span></span></div>
+	</div>
+	<div class="panel" style="display: none" id="qr_showeditor_div" >
+		<div class="inner"><span class="corners-top"><span></span></span>
+
+			<div class="content">
+				<fieldset class="submit-buttons">
+					<input type="submit" name="show_qr" tabindex="1" class="button2" value="{L_SHOW_QR}" onclick="hide_qr(true);return false;"/>
+				</fieldset>
+			</div>
+		<span class="corners-bottom"><span></span></span></div>
+	</div>
+</form>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/search_body.html 3.0.6.src/styles/prosilver/template/search_body.html
--- 3.0.5.src/styles/prosilver/template/search_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/search_body.html	2009-11-16 11:10:09.000000000 -0600
@@ -7,7 +7,7 @@
 <div class="panel">
 	<div class="inner"><span class="corners-top"><span></span></span>
 	<h3>{L_SEARCH_QUERY}</h3>
-	
+
 	<fieldset>
 	<dl>
 		<dt><label for="keywords">{L_SEARCH_KEYWORDS}:</label><br /><span>{L_SEARCH_KEYWORDS_EXPLAIN}</span></dt>
@@ -28,7 +28,7 @@
 	<div class="inner"><span class="corners-top"><span></span></span>
 
 	<h3>{L_SEARCH_OPTIONS}</h3>
-	
+
 	<fieldset>
 	<dl>
 		<dt><label for="search_forum">{L_SEARCH_FORUMS}:</label><br /><span>{L_SEARCH_FORUMS_EXPLAIN}</span></dt>
@@ -37,7 +37,7 @@
 	<dl>
 		<dt><label for="search_child1">{L_SEARCH_SUBFORUMS}:</label></dt>
 		<dd>
-			<label for="search_child1"><input type="radio" name="sc" id="search_child1" value="1" checked="checked" /> {L_YES}</label> 
+			<label for="search_child1"><input type="radio" name="sc" id="search_child1" value="1" checked="checked" /> {L_YES}</label>
 			<label for="search_child2"><input type="radio" name="sc" id="search_child2" value="0" /> {L_NO}</label>
 		</dd>
 	</dl>
@@ -54,14 +54,14 @@
 	<dl>
 		<dt><label for="show_results1">{L_DISPLAY_RESULTS}:</label></dt>
 		<dd>
-			<label for="show_results1"><input type="radio" name="sr" id="show_results1" value="posts" checked="checked" /> {L_POSTS}</label> 
+			<label for="show_results1"><input type="radio" name="sr" id="show_results1" value="posts" checked="checked" /> {L_POSTS}</label>
 			<label for="show_results2"><input type="radio" name="sr" id="show_results2" value="topics" /> {L_TOPICS}</label>
 		</dd>
 	</dl>
 	<dl>
 		<dt><label for="sd">{L_RESULT_SORT}:</label></dt>
 		<dd>{S_SELECT_SORT_KEY}&nbsp;
-			<label for="sa"><input type="radio" name="sd" id="sa" value="a" /> {L_SORT_ASCENDING}</label> 
+			<label for="sa"><input type="radio" name="sd" id="sa" value="a" /> {L_SORT_ASCENDING}</label>
 			<label for="sd"><input type="radio" name="sd" id="sd" value="d" checked="checked" /> {L_SORT_DESCENDING}</label>
 		</dd>
 	</dl>
@@ -82,7 +82,7 @@
 	<div class="inner"><span class="corners-top"><span></span></span>
 
 	<fieldset class="submit-buttons">
-		{S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp; 
+		{S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
 		<input type="submit" name="submit" value="{L_SEARCH}" class="button1" />
 	</fieldset>
 
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/search_results.html 3.0.6.src/styles/prosilver/template/search_results.html
--- 3.0.5.src/styles/prosilver/template/search_results.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/search_results.html	2009-11-16 11:10:09.000000000 -0600
@@ -18,7 +18,6 @@
 		<div class="search-box">
 			<!-- IF SEARCH_IN_RESULTS -->
 				<label for="add_keywords">{L_SEARCH_IN_RESULTS}: <input type="text" name="add_keywords" id="add_keywords" value="" class="inputbox narrow" /></label>
-				<input type="hidden" name="show_results" value="posts" />
 				<input class="button2" type="submit" name="submit" value="{L_SEARCH}" />
 			<!-- ENDIF -->
 		</div>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/styleswitcher.js 3.0.6.src/styles/prosilver/template/styleswitcher.js
--- 3.0.5.src/styles/prosilver/template/styleswitcher.js	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/styleswitcher.js	2009-11-16 11:10:09.000000000 -0600
@@ -1,6 +1,12 @@
 
-function fontsizeup()
+function fontsizeup(event)
 {
+	// Skip tabs; 9 being the ASCII code for a tab
+	if (event && getKeyCode(event) == 9)
+	{
+		return true;
+	}
+
 	var active = getActiveStyleSheet();
 
 	switch (active)
@@ -29,11 +35,19 @@
 			setActiveStyleSheet('A');
 		break;
 	}
+
+	return false;
 }
 
-function fontsizedown()
+function fontsizedown(event)
 {
-	active = getActiveStyleSheet();
+	// Skip tabs
+	if (event && getKeyCode(event) == 9)
+	{
+		return true;
+	}
+
+	var active = getActiveStyleSheet();
 
 	switch (active)
 	{
@@ -60,6 +74,24 @@
 			setActiveStyleSheet('A--');
 		break;
 	}
+
+	return false;
+}
+
+function getKeyCode(event)
+{
+	// IE doesn't fire the onkeypress event for tabs
+	// Reference: http://www.quirksmode.org/js/keys.html
+
+	var code = (event.keyCode) ? event.keyCode : 0;
+
+	// Probably using FF
+	if (!code && event.charCode)
+	{
+		code = event.charCode;
+	}
+
+	return code;
 }
 
 function setActiveStyleSheet(title)
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/template.cfg 3.0.6.src/styles/prosilver/template/template.cfg
--- 3.0.5.src/styles/prosilver/template/template.cfg	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/template.cfg	2009-11-16 11:10:09.000000000 -0600
@@ -19,7 +19,7 @@
 # General Information about this template
 name = prosilver
 copyright = &copy; phpBB Group, 2007
-version = 3.0.5
+version = 3.0.6
 
 # Defining a different template bitfield
 template_bitfield = lNg=
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/ucp_agreement.html 3.0.6.src/styles/prosilver/template/ucp_agreement.html
--- 3.0.5.src/styles/prosilver/template/ucp_agreement.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/ucp_agreement.html	2009-11-16 11:10:10.000000000 -0600
@@ -1,8 +1,33 @@
 <!-- INCLUDE overall_header.html -->
 
-
 <!-- IF S_SHOW_COPPA or S_REGISTRATION -->
 
+<!-- IF S_LANG_OPTIONS -->
+<script type="text/javascript">
+// <![CDATA[
+	/**
+	* Change language
+	*/
+	function change_language(lang_iso)
+	{
+		document.forms['register'].change_lang.value = lang_iso;
+		document.forms['register'].submit();
+	}
+
+// ]]>
+</script>
+
+	<form method="post" action="{S_UCP_ACTION}" id="register">
+		<p class="rightside">
+			<label for="lang">{L_LANGUAGE}:</label><select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select>
+			{S_HIDDEN_FIELDS}
+		</p>
+	</form>
+
+	<div class="clear"></div>
+
+<!-- ENDIF -->
+
 	<form method="post" action="{S_UCP_ACTION}" id="agreement">
 
 	<div class="panel">
@@ -45,4 +70,4 @@
 
 <!-- ENDIF -->
 
-<!-- INCLUDE overall_footer.html -->
\ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/ucp_avatar_options.html 3.0.6.src/styles/prosilver/template/ucp_avatar_options.html
--- 3.0.5.src/styles/prosilver/template/ucp_avatar_options.html	2008-06-10 02:55:55.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/ucp_avatar_options.html	2009-11-09 10:30:48.000000000 -0600
@@ -13,21 +13,21 @@
 		<dd><label for="delete"><input type="checkbox" name="delete" id="delete" /> {L_DELETE_AVATAR}</label></dd>
 	</dl>
 
-	<!-- IF S_UPLOAD_AVATAR_FILE or S_CAN_UPLOAD -->
+	<!-- IF S_UPLOAD_AVATAR_FILE -->
 		<dl>
 			<dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt>
 			<dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" /><input type="file" name="uploadfile" id="uploadfile" class="inputbox autowidth" /></dd>
 		</dl>
 	<!-- ENDIF -->
 
-	<!-- IF S_UPLOAD_AVATAR_URL or S_EDIT -->
+	<!-- IF S_UPLOAD_AVATAR_URL -->
 		<dl>
 			<dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt>
 			<dd><input type="text" name="uploadurl" id="uploadurl" value="{AVATAR_URL}" class="inputbox" /></dd>
 		</dl>
 	<!-- ENDIF -->
 
-	<!-- IF S_LINK_AVATAR or S_EDIT -->
+	<!-- IF S_LINK_AVATAR -->
 		<dl>
 			<dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt>
 			<dd><input type="text" name="remotelink" id="remotelink" value="{AVATAR_REMOTE}" class="inputbox" /></dd>
@@ -41,7 +41,7 @@
 		</dl>
 	<!-- ENDIF -->
 	</fieldset>
-	
+
 	<!-- IF S_IN_AVATAR_GALLERY -->
 		<span class="corners-bottom"><span></span></span></div>
 	</div>
@@ -50,7 +50,7 @@
 		<div class="inner"><span class="corners-top"><span></span></span>
 
 		<h3>{L_AVATAR_GALLERY}</h3>
-	
+
 		<fieldset>
 			<label for="category">{L_AVATAR_CATEGORY}: <select name="category" id="category">{S_CAT_OPTIONS}</select></label>
 			<input type="submit" value="{L_GO}" name="display_gallery" class="button2" />
@@ -63,7 +63,7 @@
 				<input type="radio" name="avatar_select" id="av-{avatar_row.S_ROW_COUNT}-{avatar_row.avatar_column.S_ROW_COUNT}" value="{avatar_row.avatar_column.AVATAR_FILE}" /></label>
 		<!-- END avatar_column --><!-- END avatar_row -->
 		</div>
-	
+
 	<!-- ENDIF -->
 
 	<span class="corners-bottom"><span></span></span></div>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/ucp_groups_manage.html 3.0.6.src/styles/prosilver/template/ucp_groups_manage.html
--- 3.0.5.src/styles/prosilver/template/ucp_groups_manage.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/ucp_groups_manage.html	2009-11-16 11:10:09.000000000 -0600
@@ -170,7 +170,7 @@
 
 	<h3>{L_ADD_USERS}</h3>
 
-	<p>{L_ADD_USERS_EXPLAIN}</p>
+	<p>{L_ADD_USERS_UCP_EXPLAIN}</p>
 
 	<fieldset>
 	<dl>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/ucp_main_front.html 3.0.6.src/styles/prosilver/template/ucp_main_front.html
--- 3.0.5.src/styles/prosilver/template/ucp_main_front.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/ucp_main_front.html	2009-11-16 11:10:09.000000000 -0600
@@ -33,7 +33,7 @@
 	<dl class="details">
 		<dt>{L_JOINED}:</dt> <dd>{JOINED}</dd>
 		<dt>{L_VISITED}:</dt> <dd>{LAST_VISIT_YOU}</dd>
-		<dt>{L_TOTAL_POSTS}:</dt> <dd><!-- IF POSTS_PCT -->{POSTS} | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_YOUR_POSTS}</a></strong><br />({POSTS_DAY} / {POSTS_PCT})<!-- ELSE -->{POSTS}<!-- ENDIF --></dd>
+		<dt>{L_TOTAL_POSTS}:</dt> <dd><!-- IF POSTS_PCT -->{POSTS}<!-- IF S_DISPLAY_SEARCH --> | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_YOUR_POSTS}</a></strong><!-- ENDIF --><br />({POSTS_DAY} / {POSTS_PCT})<!-- ELSE -->{POSTS}<!-- ENDIF --></dd>
 		<!-- IF ACTIVE_FORUM --><dt>{L_ACTIVE_IN_FORUM}:</dt> <dd><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})</dd><!-- ENDIF -->
 		<!-- IF ACTIVE_TOPIC --><dt>{L_ACTIVE_IN_TOPIC}:</dt> <dd><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})</dd><!-- ENDIF -->
 		<!-- IF WARNINGS --><dt>{L_YOUR_WARNINGS}:</dt> <dd class="error">{WARNING_IMG} [{WARNINGS}]</dd><!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/ucp_pm_history.html 3.0.6.src/styles/prosilver/template/ucp_pm_history.html
--- 3.0.5.src/styles/prosilver/template/ucp_pm_history.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/ucp_pm_history.html	2009-11-16 11:10:09.000000000 -0600
@@ -17,9 +17,9 @@
 			<!-- ENDIF -->
 
 			<h3><a href="{history_row.U_VIEW_MESSAGE}" <!-- IF history_row.S_CURRENT_MSG -->class="current"<!-- ENDIF -->>{history_row.SUBJECT}</a></h3>
-			<p class="author<!-- IF history_row.S_CURRENT_MSG --> current<!-- ENDIF -->">{history_row.MINI_POST_IMG} {L_SENT_AT}: <strong>{history_row.SENT_DATE}</strong><br />
+			<p class="author">{history_row.MINI_POST_IMG} {L_SENT_AT}: <strong>{history_row.SENT_DATE}</strong><br />
 				{L_MESSAGE_BY_AUTHOR} {history_row.MESSAGE_AUTHOR_FULL}</p>
-			<div class="content<!-- IF history_row.S_CURRENT_MSG --> current<!-- ENDIF -->">{history_row.MESSAGE}</div>
+			<div class="content">{history_row.MESSAGE}</div>
 			<div id="message_{history_row.MSG_ID}" style="display: none;">{history_row.DECODED_MESSAGE}</div>
 		</div>
 
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/ucp_pm_message_header.html 3.0.6.src/styles/prosilver/template/ucp_pm_message_header.html
--- 3.0.5.src/styles/prosilver/template/ucp_pm_message_header.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/ucp_pm_message_header.html	2009-11-16 11:10:09.000000000 -0600
@@ -1,22 +1,25 @@
 <h2>{L_TITLE}<!-- IF CUR_FOLDER_NAME -->: {CUR_FOLDER_NAME}<!-- ENDIF --></h2>
 
-<form id="viewfolder" method="post" action="{S_PM_ACTION}">
-
-<div class="panel">
+<div class="panel clearfix pm-panel-header<!-- IF S_VIEW_MESSAGE --> pm<!-- ENDIF -->">
 	<div class="inner"><span class="corners-top"><span></span></span>
 
 	<!-- IF FOLDER_STATUS and FOLDER_MAX_MESSAGES neq 0 --><p>{FOLDER_STATUS}</p><!-- ENDIF -->
-	
-		<!-- IF U_POST_REPLY_PM or U_POST_NEW_TOPIC or U_FORWARD_PM -->
+
+	<!-- IF U_POST_REPLY_PM or U_POST_NEW_TOPIC or U_FORWARD_PM -->
 		<div class="buttons">
-			<!-- IF U_POST_REPLY_PM --><div class="pmreply-icon"><a title="{L_POST_REPLY_PM}" href="{U_POST_REPLY_PM}"><span></span>{L_POST_REPLY_PM}</a></div>
+			<!-- IF U_POST_REPLY_PM --><div class="pmreply-icon clearfix"><a title="{L_POST_REPLY_PM}" href="{U_POST_REPLY_PM}"><span></span>{L_POST_REPLY_PM}</a></div>
 			<!-- ELSEIF U_POST_NEW_TOPIC --><div class="newpm-icon"><a href="{U_POST_NEW_TOPIC}" accesskey="n" title="{L_UCP_PM_COMPOSE}"><span></span>{L_UCP_PM_COMPOSE}</a></div><!-- ENDIF -->
 			<!-- IF U_FORWARD_PM --><div class="forwardpm-icon"><a title="{L_POST_FORWARD_PM}" href="{U_FORWARD_PM}"><span></span>{L_FORWARD_PM}</a></div><!-- ENDIF -->
 		</div>
+
+		<!-- IF U_POST_REPLY_PM and S_PM_RECIPIENTS gt 1 -->
+			<div class="reply-all"><a title="{L_REPLY_TO_ALL}" href="{U_POST_REPLY_ALL}">&raquo; {L_REPLY_TO_ALL}</a></div>
 		<!-- ENDIF -->
 
+	<!-- ENDIF -->
+
 		<!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE -->
-	<ul class="linklist">
+	<ul class="linklist pm-return-to">
 		<li class="rightside pagination">
 			<!-- IF S_VIEW_MESSAGE --><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO} {CUR_FOLDER_NAME}</a><!-- ENDIF -->
 			<!-- IF FOLDER_CUR_MESSAGES neq 0 -->
@@ -26,3 +29,7 @@
 		</li>
 	</ul>
 		<!-- ENDIF -->
+	</div>
+</div>
+
+<form id="viewfolder" method="post" action="{S_PM_ACTION}">
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/ucp_pm_viewfolder.html 3.0.6.src/styles/prosilver/template/ucp_pm_viewfolder.html
--- 3.0.5.src/styles/prosilver/template/ucp_pm_viewfolder.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/ucp_pm_viewfolder.html	2009-11-16 11:10:09.000000000 -0600
@@ -2,9 +2,9 @@
 
 <!-- IF not PROMPT -->
 	<!-- INCLUDE ucp_pm_message_header.html -->
+	<div class="panel pm-panel-message"><div>
 <!-- ENDIF -->
 
-
 <!-- IF PROMPT -->
 	<h2>{L_EXPORT_AS_CSV}</h2>
 	<form id="viewfolder" method="post" action="{S_PM_ACTION}">
@@ -83,7 +83,13 @@
 
 		</ul>
 	<!-- ELSE -->
-		<p><strong>{L_NO_MESSAGES}</strong></p>
+		<p><strong>
+			<!-- IF S_COMPOSE_PM_VIEW and S_NO_AUTH_SEND_MESSAGE -->
+				<!-- IF S_USER_NEW -->{L_USER_NEW_PERMISSION_DISALLOWED}<!-- ELSE -->{L_NO_AUTH_SEND_MESSAGE}<!-- ENDIF -->
+			<!-- ELSE -->
+				{L_NO_MESSAGES}
+			<!-- ENDIF -->
+		</strong></p>
 	<!-- ENDIF -->
 
 	<!-- IF FOLDER_CUR_MESSAGES neq 0 -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/ucp_pm_viewmessage.html 3.0.6.src/styles/prosilver/template/ucp_pm_viewmessage.html
--- 3.0.5.src/styles/prosilver/template/ucp_pm_viewmessage.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/ucp_pm_viewmessage.html	2009-11-16 11:10:09.000000000 -0600
@@ -1,27 +1,26 @@
-<!-- INCLUDE ucp_header.html -->
+	<!-- INCLUDE ucp_header.html -->
 
 <!-- INCLUDE ucp_pm_message_header.html -->
 
-	<span class="corners-bottom"><span></span></span></div>
-</div>
 
 <!-- IF S_DISPLAY_HISTORY and (U_VIEW_PREVIOUS_HISTORY or U_VIEW_NEXT_HISTORY) -->
-	<fieldset class="display-options clearfix">
+	<fieldset class="display-options clearfix bg1 pm-message-nav">
 		<!-- IF U_VIEW_PREVIOUS_HISTORY --><a href="{U_VIEW_PREVIOUS_HISTORY}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_HISTORY}</a><!-- ENDIF -->
 		<!-- IF U_VIEW_NEXT_HISTORY --><a href="{U_VIEW_NEXT_HISTORY}" class="right-box {S_CONTENT_FLOW_END}">{L_VIEW_NEXT_HISTORY}</a><!-- ENDIF -->
 	</fieldset>
 <!-- ENDIF -->
 
 
-<div id="post-{MESSAGE_ID}" class="post pm<!-- IF S_POST_UNAPPROVED or S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF S_ONLINE --> online<!-- ENDIF -->">
-	<div class="inner"><span class="corners-top"><span></span></span>
+<div id="post-{MESSAGE_ID}" class="panel clearfix post pm-panel-message pm<!-- IF S_POST_UNAPPROVED or S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF S_ONLINE --> online<!-- ENDIF -->">
+<div>
 
 	<div class="postbody">
 
-		<!-- IF U_DELETE or U_EDIT or U_QUOTE -->
+		<!-- IF U_DELETE or U_EDIT or U_QUOTE or U_REPORT -->
 		<ul class="profile-icons">
 			<!-- IF U_EDIT --><li class="edit-icon"><a href="{U_EDIT}" title="{L_POST_EDIT_PM}"><span>{L_POST_EDIT_PM}</span></a></li><!-- ENDIF -->
 			<!-- IF U_DELETE --><li class="delete-icon"><a href="{U_DELETE}" title="{L_DELETE_MESSAGE}"><span>{L_DELETE_MESSAGE}</span></a></li><!-- ENDIF -->
+			<!-- IF U_REPORT --><li class="report-icon"><a href="{U_REPORT}" title="{L_REPORT_PM}"><span>{L_REPORT_PM}</span></a></li><!-- ENDIF -->
 			<!-- IF U_QUOTE --><li class="quote-icon"><a href="{U_QUOTE}" title="{L_POST_QUOTE_PM}"><span>{L_POST_QUOTE_PM}</span></a></li><!-- ENDIF -->
 		</ul>
 		<!-- ENDIF -->
@@ -67,7 +66,7 @@
 		<!-- IF RANK_TITLE --><dd>{RANK_TITLE}</dd><!-- ENDIF -->
 		<!-- IF RANK_IMG --><dd>{RANK_IMG}</dd><!-- ENDIF -->
 		<dd>&nbsp;</dd>
-		<!-- IF AUTHOR_POSTS --><dd><strong>{L_POSTS}:</strong> {AUTHOR_POSTS}</dd><!-- ENDIF -->
+		<dd><strong>{L_POSTS}:</strong> {AUTHOR_POSTS}</dd>
 		<!-- IF AUTHOR_JOINED --><dd><strong>{L_JOINED}:</strong> {AUTHOR_JOINED}</dd><!-- ENDIF -->
 		<!-- IF AUTHOR_FROM --><dd><strong>{L_LOCATION}:</strong> {AUTHOR_FROM}</dd><!-- ENDIF -->
 		
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/ucp_profile_signature.html 3.0.6.src/styles/prosilver/template/ucp_profile_signature.html
--- 3.0.5.src/styles/prosilver/template/ucp_profile_signature.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/ucp_profile_signature.html	2009-11-16 11:10:09.000000000 -0600
@@ -8,7 +8,7 @@
 	<div class="panel">
 		<div class="inner"><span class="corners-top"><span></span></span>
 		<h3>{L_SIGNATURE_PREVIEW}</h3>
-		<div class="postbody pm">
+		<div class="postbody">
 			<div class="signature" style="border-top:none; margin-top: 0; ">{SIGNATURE_PREVIEW}</div>
 		</div>
 		<span class="corners-bottom"><span></span></span></div>
@@ -33,7 +33,7 @@
 		<!-- IF S_LINKS_ALLOWED -->
 			<div><label for="disable_magic_url"><input type="checkbox" name="disable_magic_url" id="disable_magic_url"{S_MAGIC_URL_CHECKED} /> {L_DISABLE_MAGIC_URL}</label></div>
 		<!-- ENDIF -->
-	
+
 	</fieldset>
 
 	<span class="corners-bottom"><span></span></span></div>
@@ -41,8 +41,8 @@
 
 <fieldset class="submit-buttons">
 	{S_HIDDEN_FIELDS}
-	<input type="reset" name="reset" value="{L_RESET}" class="button2" />&nbsp; 
-	<input type="submit" name="preview" value="{L_PREVIEW}" class="button2" />&nbsp; 
+	<input type="reset" name="reset" value="{L_RESET}" class="button2" />&nbsp;
+	<input type="submit" name="preview" value="{L_PREVIEW}" class="button2" />&nbsp;
 	<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
 	{S_FORM_TOKEN}
 </fieldset>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/ucp_register.html 3.0.6.src/styles/prosilver/template/ucp_register.html
--- 3.0.5.src/styles/prosilver/template/ucp_register.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/ucp_register.html	2009-11-16 11:10:09.000000000 -0600
@@ -11,6 +11,10 @@
 		document.forms['register'].submit.click();
 	}
 
+	<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_REFRESH -->
+	onload_functions.push('apply_onkeypress_event()');
+	<!-- ENDIF -->
+
 // ]]>
 </script>
 
@@ -26,10 +30,6 @@
 	<!-- IF L_REG_COND -->
 		<dl><dd><strong>{L_REG_COND}</strong></dd></dl>
 	<!-- ENDIF -->
-	<!-- IF .profile_fields -->
-		<dl><dd><strong>{L_ITEMS_REQUIRED}</strong></dd></dl>
-	<!-- ENDIF -->
-
 	<dl>
 		<dt><label for="username">{L_USERNAME}:</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt>
 		<dd><input type="text" tabindex="1" name="username" id="username" size="25" value="{USERNAME}" class="inputbox autowidth" title="{L_USERNAME}" /></dd>
@@ -48,20 +48,23 @@
 	</dl>
 	<dl>
 		<dt><label for="password_confirm">{L_CONFIRM_PASSWORD}:</label></dt>
-		<dd><input type="password" tabindex="5" name="password_confirm" id="password_confirm" size="25" value="{PASSWORD_CONFIRM}" class="inputbox autowidth" title="{L_CONFIRM_PASSWORD}" /></dd>
+		<dd><input type="password"  tabindex="5" name="password_confirm" id="password_confirm" size="25" value="{PASSWORD_CONFIRM}" class="inputbox autowidth" title="{L_CONFIRM_PASSWORD}" /></dd>
 	</dl>
 
 	<hr />
 
 	<dl>
 		<dt><label for="lang">{L_LANGUAGE}:</label></dt>
-		<dd><select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></dd>
+		<dd><select name="lang" id="lang" onchange="change_language(this.value); return false;" tabindex="6" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></dd>
 	</dl>
 	<dl>
 		<dt><label for="tz">{L_TIMEZONE}:</label></dt>
-		<dd><select name="tz" id="tz" class="autowidth">{S_TZ_OPTIONS}</select></dd>
+		<dd><select name="tz" id="tz" tabindex="7" class="autowidth">{S_TZ_OPTIONS}</select></dd>
 	</dl>
 
+	<!-- IF .profile_fields -->
+		<dl><dd><strong>{L_ITEMS_REQUIRED}</strong></dd></dl>
+
 	<!-- BEGIN profile_fields -->
 		<dl>
 			<dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}:<!-- IF profile_fields.S_REQUIRED --> *<!-- ENDIF --></label>
@@ -70,32 +73,18 @@
 			<dd>{profile_fields.FIELD}</dd>
 		</dl>
 	<!-- END profile_fields -->
-	</fieldset>
+	<!-- ENDIF -->
 
-<!-- IF S_CONFIRM_CODE -->
+	</fieldset>
 	<span class="corners-bottom"><span></span></span></div>
 </div>
-
-<div class="panel">
-	<div class="inner"><span class="corners-top"><span></span></span>
-
-	<h3>{L_CONFIRMATION}</h3>
-	<p>{L_CONFIRM_EXPLAIN}</p>
-
-	<fieldset class="fields2">
-	<dl>
-		<dt><label for="confirm_code">{L_CONFIRM_CODE}:</label></dt>
-		<dd>{CONFIRM_IMG}</dd>
-		<dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" class="inputbox narrow" title="{L_CONFIRM_CODE}" /></dd>
-		<dd>{L_CONFIRM_CODE_EXPLAIN}<!-- IF S_CONFIRM_REFRESH --> {L_VC_REFRESH_EXPLAIN}<!-- ENDIF --></dd>
-		<!-- IF S_CONFIRM_REFRESH --><dd><input type="submit" value="{L_VC_REFRESH}" class="button2" /></dd> <!-- ENDIF -->
-	</dl>
-	</fieldset>
+<!-- IF CAPTCHA_TEMPLATE -->
+	<!-- DEFINE $CAPTCHA_TAB_INDEX = 8 -->
+	<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
 <!-- ENDIF -->
 
 <!-- IF S_COPPA -->
-	<span class="corners-bottom"><span></span></span></div>
-</div>
+
 
 <div class="panel">
 	<div class="inner"><span class="corners-top"><span></span></span>
@@ -103,10 +92,9 @@
 	<h4>{L_COPPA_COMPLIANCE}</h4>
 
 	<p>{L_COPPA_EXPLAIN}</p>
-<!-- ENDIF -->
-
 	<span class="corners-bottom"><span></span></span></div>
 </div>
+<!-- ENDIF -->
 
 <div class="panel">
 	<div class="inner"><span class="corners-top"><span></span></span>
@@ -114,7 +102,7 @@
 	<fieldset class="submit-buttons">
 		{S_HIDDEN_FIELDS}
 		<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
-		<input type="submit" name="submit" id="submit" value="{L_SUBMIT}" class="button1" />
+		<input type="submit" tabindex="9" name="submit" id="submit" value="{L_SUBMIT}" class="button1 default-submit-action" />
 		{S_FORM_TOKEN}
 	</fieldset>
 
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/viewforum_body.html 3.0.6.src/styles/prosilver/template/viewforum_body.html
--- 3.0.5.src/styles/prosilver/template/viewforum_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/viewforum_body.html	2009-11-16 11:10:10.000000000 -0600
@@ -3,11 +3,11 @@
 <h2><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
 
 <!-- IF FORUM_DESC or MODERATORS or U_MCP -->
-<p>
+<div>
 	<!-- NOTE: remove the style="display: none" when you want to have the forum description on the forum body -->
-	<!-- IF FORUM_DESC --><span style="display: none">{FORUM_DESC}<br /></span><!-- ENDIF -->
+	<!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF -->
 	<!-- IF MODERATORS --><strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->:</strong> {MODERATORS}<!-- ENDIF -->
-</p>
+</div>
 <!-- ENDIF -->
 
 <!-- IF S_FORUM_RULES -->
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/viewtopic_body.html 3.0.6.src/styles/prosilver/template/viewtopic_body.html
--- 3.0.5.src/styles/prosilver/template/viewtopic_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/viewtopic_body.html	2009-11-16 11:10:09.000000000 -0600
@@ -2,7 +2,7 @@
 <!-- IF U_MCP --><p>[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ENDIF -->
 <h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
 <!-- NOTE: remove the style="display: none" when you want to have the forum description on the topic body -->
-<!-- IF FORUM_DESC --><span style="display: none">{FORUM_DESC}<br /></span><!-- ENDIF -->
+<!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF -->
 
 <!-- IF MODERATORS or U_MCP -->
 	<p>
@@ -123,7 +123,7 @@
 			<!-- ELSE -->
 
 		<!-- IF not S_IS_BOT -->
-			<!-- IF postrow.U_QUOTE or postrow.U_INFO or postrow.U_DELETE or postrow.U_EDIT -->
+			<!-- IF postrow.U_EDIT or postrow.U_DELETE or postrow.U_REPORT or postrow.U_WARN or postrow.U_INFO or postrow.U_QUOTE -->
 				<ul class="profile-icons">
 					<!-- IF postrow.U_EDIT --><li class="edit-icon"><a href="{postrow.U_EDIT}" title="{L_EDIT_POST}"><span>{L_EDIT_POST}</span></a></li><!-- ENDIF -->
 					<!-- IF postrow.U_DELETE --><li class="delete-icon"><a href="{postrow.U_DELETE}" title="{L_DELETE_POST}"><span>{L_DELETE_POST}</span></a></li><!-- ENDIF -->
@@ -140,7 +140,7 @@
 
 			<!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED -->
 				<p class="rules">
-					<!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><!-- ENDIF -->
+					<!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><br /><!-- ENDIF -->
 					<!-- IF postrow.S_POST_REPORTED -->{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF -->
 				</p>
 			<!-- ENDIF -->
@@ -163,7 +163,7 @@
 				</div>
 			<!-- ENDIF -->
 
-			<!-- IF postrow.BUMPED_MESSAGE --><div class="notice">{postrow.BUMPED_MESSAGE}</div><!-- ENDIF -->
+			<!-- IF postrow.BUMPED_MESSAGE --><div class="notice"><br /><br />{postrow.BUMPED_MESSAGE}</div><!-- ENDIF -->
 			<!-- IF postrow.SIGNATURE --><div id="sig{postrow.POST_ID}" class="signature">{postrow.SIGNATURE}</div><!-- ENDIF -->
 		<!-- ENDIF -->
 
@@ -222,7 +222,9 @@
 
 	<hr class="divider" />
 <!-- END postrow -->
-
+<!-- IF S_QUICK_REPLY -->
+	<!-- INCLUDE quickreply_editor.html -->
+<!-- ENDIF -->
 <!-- IF S_NUM_POSTS > 1 or PREVIOUS_PAGE -->
 	<form id="viewtopic" method="post" action="{S_TOPIC_ACTION}">
 
diff -x .svn -aruN 3.0.5.src/styles/prosilver/template/viewtopic_print.html 3.0.6.src/styles/prosilver/template/viewtopic_print.html
--- 3.0.5.src/styles/prosilver/template/viewtopic_print.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/template/viewtopic_print.html	2009-11-16 11:10:09.000000000 -0600
@@ -25,7 +25,7 @@
 	<div id="page-header">
 		<h1>{SITENAME}</h1>
 		<p>{SITE_DESCRIPTION}<br /><a href="{U_FORUM}">{U_FORUM}</a></p>
-		
+
 		<h2>{TOPIC_TITLE}</h2>
 		<p><a href="{U_TOPIC}">{U_TOPIC}</a></p>
 	</div>
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/bidi.css 3.0.6.src/styles/prosilver/theme/bidi.css
--- 3.0.5.src/styles/prosilver/theme/bidi.css	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/theme/bidi.css	2009-11-16 11:10:09.000000000 -0600
@@ -234,9 +234,33 @@
 	padding-right: 15px;
 }
 
+.rtl .skiplink {
+	/* invisible skip link, used for accessibility  */
+	position: relative;
+	width: 1px;
+	height: 1px;
+	overflow: hidden;
+	display: block;
+	left: 0;
+}
+
+.rtl a.feed-icon-forum {
+	float: left;
+}
+
 /**
 * content.css
 */
+.rtl ul.topiclist dfn {
+	/* Labels for post/view counts */
+	position: relative;
+	width: 1px;
+	height: 1px;
+	overflow: hidden;
+	display: block;
+	left: 0;
+}
+
 .rtl ul.topiclist dt {
 	float: right;
 }
@@ -347,11 +371,12 @@
 /* Quote block */
 .rtl blockquote {
 	margin: 0.5em 25px 0 1px;
+	background-position: 99% 5px;
 }
 
 .rtl blockquote blockquote {
 	/* Nested quotes */
-	margin: 0.5em 15px 0 1px;	
+	margin: 0.5em 15px 0 1px;
 }
 
 .rtl blockquote cite {
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/colours.css 3.0.6.src/styles/prosilver/theme/colours.css
--- 3.0.5.src/styles/prosilver/theme/colours.css	2009-05-31 05:58:33.000000000 -0500
+++ 3.0.6.src/styles/prosilver/theme/colours.css	2009-11-16 11:10:09.000000000 -0600
@@ -461,6 +461,10 @@
 	border-color:#DBDBCE;
 }
 
+.rtl blockquote {
+	background-image: url("{T_THEME_PATH}/images/quote_rtl.gif");
+}
+
 blockquote blockquote {
 	/* Nested quotes */
 	background-color:#EFEED9;
@@ -786,6 +790,11 @@
 	background-image: url("{T_THEME_PATH}/images/bg_menu.gif");
 }
 
+.rtl #navigation a {
+	background-image: url("{T_THEME_PATH}/images/bg_menu_rtl.gif");
+	background-position: 0 100%;
+}
+
 #navigation a:hover {
 	background-color: #aabac6;
 	color: #BC2A4D;
@@ -861,7 +870,13 @@
 ----------------------------------------*/
 /* PM Message history */
 .current {
-	color: #999999 !important;
+	color: #000000 !important;
+}
+
+/* PM panel adjustments */
+.pm-panel-header,
+#cp-main .pm-message-nav {
+	border-bottom-color: #A4B3BF;
 }
 
 /* PM marking colours */
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/common.css 3.0.6.src/styles/prosilver/theme/common.css
--- 3.0.5.src/styles/prosilver/theme/common.css	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/theme/common.css	2009-11-16 11:10:09.000000000 -0600
@@ -10,8 +10,7 @@
 html {
 	font-size: 100%;
 	/* Always show a scrollbar for short pages - stops the jump when the scrollbar appears. non-IE browsers */
-	height: 100%;
-	margin-bottom: 1px;
+	height: 101%;
 }
 
 body {
@@ -611,6 +610,7 @@
 
 p.rules img {
 	vertical-align: middle;
+	padding-top: 5px;
 }
 
 p.rules a {
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/content.css 3.0.6.src/styles/prosilver/theme/content.css
--- 3.0.5.src/styles/prosilver/theme/content.css	2009-05-31 05:58:33.000000000 -0500
+++ 3.0.6.src/styles/prosilver/theme/content.css	2009-11-16 11:10:09.000000000 -0600
@@ -132,6 +132,18 @@
 	font-size: 1.2em;
 }
 
+/* List in forum description */
+dl.icon dt ol,
+dl.icon dt ul {
+	list-style-position: inside;
+	margin-left: 1em;
+}
+
+dl.icon dt li {
+	display: list-item;
+	list-style-type: inherit;
+}
+
 dd.lastpost {
 	width: 25%;
 	font-size: 1.1em;
@@ -295,6 +307,7 @@
 	font-family: "Lucida Grande", "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif;
 	font-size: 1em;
 	color: #333333;
+	padding-bottom: 1px;
 }
 
 .content h2, .panel h2 {
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/cp.css 3.0.6.src/styles/prosilver/theme/cp.css
--- 3.0.5.src/styles/prosilver/theme/cp.css	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/theme/cp.css	2009-11-16 11:10:09.000000000 -0600
@@ -348,6 +348,34 @@
 	line-height: 2.5em;
 }
 
+/* PM panel adjustments */
+.pm-panel-header {
+	margin: 0; 
+	padding-bottom: 10px; 
+	border-bottom: 1px dashed #A4B3BF;
+}
+
+.reply-all {
+	display: block; 
+	padding-top: 4px; 
+	clear: both;
+	float: left;
+}
+
+.pm-panel-message {
+	padding-top: 10px;
+}
+
+.pm-return-to {
+	padding-top: 23px;
+}
+
+#cp-main .pm-message-nav {
+	margin: 0; 
+	padding: 2px 10px 5px 10px; 
+	border-bottom: 1px dashed #A4B3BF;
+}
+
 /* PM Message history */
 .current {
 	color: #999999;
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/images/bg_menu_rtl.gif 3.0.6.src/styles/prosilver/theme/images/bg_menu_rtl.gif
--- 3.0.5.src/styles/prosilver/theme/images/bg_menu_rtl.gif	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/styles/prosilver/theme/images/bg_menu_rtl.gif	2009-11-09 10:30:38.000000000 -0600
@@ -0,0 +1,3 @@
+GIF89a    ޴ҵӺغطնӸֹ׶Թݻڷոּ۵ҽܴ,       `!^$K
+l+<04a3c<gH$2dP8!ЄBRV;N4`pdL+d-A;8@P2T
.-124368:=>A@EGJHLN
+PR	UVX[\^abdcfijlnrrty{}()+/79;FMOQSXY^_gilmosux}1 BC˛͞СӤ"RU7o	 ;
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/images/feed.gif 3.0.6.src/styles/prosilver/theme/images/feed.gif
--- 3.0.5.src/styles/prosilver/theme/images/feed.gif	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/styles/prosilver/theme/images/feed.gif	2009-11-09 10:30:38.000000000 -0600
@@ -0,0 +1,3 @@
+GIF89a   9C@6,BA<y+|@BA}@@5,4t0@EDAs-@-W#9}Bh95+4d(eA[7CZ{)wx,ULӰ?vëWCWw0$P-Az>뺚:1i3ǧŘ7{ٴ9Q7AGq.2W!~L018έ7u.Pv8;ƨ7o$n$17>>8}2CBTK̳.o%ʴA@@^>Y?s%&o,@ ˜3l-m!2i#w{@P@/e+-\)AM38Î>5(6|1;+K8$^=h(Afz^&é9=~d"~A;ZNV884{z46,ɲ1UB3                                                                                                                           !   ,        =3vKP`]h$RIˊ/8lf&(4sCxU&(0!jHV
+= C6T?ԚtHDkTjDZtz,Y5jV)jV㈍j b`BNMv 
+ՠ٢	EthqU&`l	% P494 ЪŠ 58S<ՀJ@'YEvQtIb!3Y$/Nxj0%)S)']<yad1H 2- ;
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/images/quote_rtl.gif 3.0.6.src/styles/prosilver/theme/images/quote_rtl.gif
--- 3.0.5.src/styles/prosilver/theme/images/quote_rtl.gif	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/styles/prosilver/theme/images/quote_rtl.gif	2009-11-09 10:30:38.000000000 -0600
@@ -0,0 +1 @@
+GIF89a    ppn???XWV||zKKKddb̕333!   ,       GIKQf-$80CN˩L̉T<ŃIאz IwxǰGx)<% pJZΓ ;
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/links.css 3.0.6.src/styles/prosilver/theme/links.css
--- 3.0.5.src/styles/prosilver/theme/links.css	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/theme/links.css	2009-11-16 11:10:09.000000000 -0600
@@ -205,3 +205,9 @@
 	left: -999px;
 	width: 990px;
 }
+
+/* Feed icon in forumlist_body.html */
+a.feed-icon-forum {
+	float: right;
+	margin: 3px;
+}
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/print.css 3.0.6.src/styles/prosilver/theme/print.css
--- 3.0.5.src/styles/prosilver/theme/print.css	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/theme/print.css	2009-11-16 11:10:09.000000000 -0600
@@ -25,6 +25,10 @@
 a:active	{ color: #000000; text-decoration: none; }
 
 img, .noprint, #sub-header, #sub-footer, .navbar, .box1, .divider, .signature { display: none; }
+/* Display smilies (Bug #47265) */
+.content img {
+	display: inline;
+}
 
 /* Container for the main body */
 #wrap {
@@ -108,7 +112,7 @@
 .grip-show { display:none; }
 
 /* Quote */
-.postquote {
+.postquote, blockquote {
 	font-size: 85%;
 	margin: 1em 18% 1em 4%;
 	padding: 0.5em;
@@ -120,7 +124,16 @@
 .postquote img { display: none; }
 .postquote span { display: block; }
 .postquote span .postquote { font-size: 100%; }
-.quote-by { font-weight: bold; }
+.quote-by, blockquote cite { 
+	color: black;
+	display : block;
+	font-weight: bold;
+}
+
+/* List */
+ol, ul {
+	margin-left: 15pt
+}
 
 /* Misc page elements */
 div.spacer { clear: both; }
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/theme.cfg 3.0.6.src/styles/prosilver/theme/theme.cfg
--- 3.0.5.src/styles/prosilver/theme/theme.cfg	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/theme/theme.cfg	2009-11-16 11:10:09.000000000 -0600
@@ -21,7 +21,7 @@
 # General Information about this theme
 name = prosilver
 copyright = &copy; phpBB Group, 2007
-version = 3.0.5
+version = 3.0.6
 
 # Some configuration options
 
diff -x .svn -aruN 3.0.5.src/styles/prosilver/theme/tweaks.css 3.0.6.src/styles/prosilver/theme/tweaks.css
--- 3.0.5.src/styles/prosilver/theme/tweaks.css	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/prosilver/theme/tweaks.css	2009-11-16 11:10:09.000000000 -0600
@@ -67,6 +67,11 @@
 	height: 35px;
 }
 
+* html li.row dl.icon dt {
+	height: 35px;
+	overflow: visible;
+}
+
 * html #search-box {
 	width: 25%;
 }
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/imageset/imageset.cfg 3.0.6.src/styles/subsilver2/imageset/imageset.cfg
--- 3.0.5.src/styles/subsilver2/imageset/imageset.cfg	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/imageset/imageset.cfg	2009-11-16 11:10:10.000000000 -0600
@@ -19,13 +19,13 @@
 # General Information about this style
 name = subsilver2
 copyright = &copy; phpBB Group, 2003
-version = 3.0.5
+version = 3.0.6
 
 # Images 
 img_site_logo = site_logo.gif*94*170
 img_upload_bar = upload_bar.gif*16*280
 img_poll_left = poll_left.gif*12*4
-img_poll_center = poll_center.gif*12*
+img_poll_center = poll_center.gif*12*1
 img_poll_right = poll_right.gif*12*4
 img_icon_friend =
 img_icon_foe =
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/imageset/site_logo.gif 3.0.6.src/styles/subsilver2/imageset/site_logo.gif
--- 3.0.5.src/styles/subsilver2/imageset/site_logo.gif	2008-06-10 02:55:53.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/imageset/site_logo.gif	2009-11-09 10:30:36.000000000 -0600
@@ -1,59 +1,32 @@
-GIF89a ^   %zwyڣ vHʲŭnzOٗ˄$L(gZ|DD߲o
-[hЩoպxȮw%r:oу͊%\27føQMl	HgB)SId٩"eJJz~)jfءO-BޮwފƨZЮ˔^
	TyΔ w#Zu̗GKF҇>Gzzǔ$r[D{.b~Jq?X<TqlE;աE]"DY_4Ejt5F@RKmmM=ǉ1y+~fMe>g\ü	a۸ߋʥو:}8V;y)Jj y((-Z# kU^[.".=Qm6bLj4l[:sUCq+HПзU
-} mR?\g<P=RSK~P+ $uOޞ=
OpFKG{h`QPWT>_>kc!     ,     ^   H*\ȰÇ#J(pŋ3jȱǏ CIɓ(S\ɲ˗0cʜI͛8sɳϟ@
-zџѣ-"=ы)J5qR z飯`2m5,ر7QTGҘKX>Kn҈C`bSY"1B{}ءބߏiXɔ?=i#z+mXk*;5lw.Md	.n.bJ`};7Mt|$%w=S8Ggc^P<HPHfB 
-H>ƄfpB}߆^H&A-X"
"h"(P"Ȍ͍8@.2j[x$"Œ-IБ-RO8Y'0[#MТSpw!)E?&CPXK-p)[B<ܐCEV@RQġE<\^RQ]R ɤyR8ç9}fen?.`hĢ(pz*R1FMhiJ+њ3cD>
xQdXÉ*HbGZm_u{Yj g"I6F,7,l]o'oPhk(Ǉv
-+xÕF>Y1jvf!rTH'F8cQ'x皈i Hx =~BsǑrUnYn榶
7hJTxo$B?mtHKlymgq(GoYHnvAk137M0D
밿^h$Oo4Yc+}y
-Y\hbFЫs<nq/d  GGx_~ￏόq|L;iFC^z&9	ыgaonC S_xW"@LbD0" @;C
lqxa	 @5q@&P@@bj=}Cnt @}Xq2 A?}#hq|P@Boha_Ck8@
-,$`d״8za3HARt by#R<QuJ~P+pXYPv#=G -_ UZ
-f`
&@űЅ|<3H|؁%CLKL7	!{
-`$@T>XQ0Ob0 S E
-r ia0 ͋a ]((	/}F;T,7Ӓ$ҩu3u3H0I(#I@/Y48թh K h(N	> Ѧ>
Q%cQ8Bq`ZRo+JWUr
-E(¦$">S2T*H"ȅ2O4 /V 
wx,YJ֊M$$XqpHBh!RrkX
-I#4CXD0Eb60)`ānu;H:%YN LYiO}*?p +R*o C.
-VFG,<ZSl &`C?Dʊ('(T9ef<E,B4qahg2αqckCcqzd_t^H;`p
-O3$L(DaM$ 0 * (RJUx@qb\da̀D	|dDq0L@ьH6TOoq ,WYW
D(`#n2 8	؂~ 	y(܊-&hRQ cIH20hQ6$P!fK3k]Y 7Q7"*Ol Hh7[!D+
-AױC[bIwLqhBܐ6΍3'<Qu;`9)6
_zzF}Mo
 @Ƒ994 5
-rνF+C\fS4CZ
-|ƶ63 ܲ .l)?󐊻;<o}[O< EK@} %#SLQB@ sW2/A 9B !
-;c.{cBC0ˡW}8=tn (=9~FǄIoz]αa7TPvwMP|s{M ȇŗ![ 
 }WX|siF_A_߀`	!p~F0z;h z}Evı }  2 s 0P\	H2  m
\(
- =s%HNAx;Ђ
-m  `	 @z,DXvGu,;F
}Sȅz/	g{WH0`wȅ;'ڷ}&oe`x
-p\!m0}	 ez(hB4s1eWq~gFPp&	 HXH 
-@xU8Xo}Qv
-؋Wȇ 8T@"4Ќ@
HG
՘u. $0P+!c30	{`!Oe,钶
-0D9pHLy
-`
-P~@2yQs{)DKX>I
 @4iO&#Rl `
K0ԑ&
;Y yPpi y y 
-V ]0Q@0h 	b	s9[9T\ iIw 86\  riPcUq|;IpyΙ!U0
-yy
-y
-J0uI>] xe9w`h
=3	)˙`
Ñ;	Ȁ*jG	0Yp `TY	
-P0ES>
-_Ƹo 9 )C
- ?r>Y. RР#"gK/0[J4
-
PQ㩢+ʢ
-VD;BB  VPDڟ0w 5  )	ǐ`D3 ^	bj
-&!
ˉ*IN
/z04ڧ 0bC:f  rE-H
-
-Nz7)L]_	 $zB!O0 k@:! ڮjf{p
--Z0J[@>Ɉ
-
-3
E*"${1+ >c%o:
Aг>{/ *lA<=B;iZ	@(0Z\(@ {P7?J 
- $@0*z'1*{Bp=PJ5	NyE۴0Z볏	۳G|
-{{|0aۢi P
-Țs3`m`$v&ktoP+~oV+V0@9=	/l0
X̗0 lG[盾"p 0
,
-9 ? K r+5`{:@;~[Lp_a, bXp8<
껾Ͱ267<ÍPh0	0W (` 穙О `nJV(Qe" ,J@!(Ll^ HHX _B<XgȎ0
<
-R \ʦ 	ůf
dl pƚ	$pb)v 1 l
- Lz,(BP?`,a
#-|2 p	YPH<ϩʞ@{a!\    8w<Ɛaf%	!# ̓ l=P
-ɰ
-{`%V	=
-p	:}	ؿ"0$mNP+~!%!q[7-:]`  Ԥ)j 
$pOm\9]ʣԩ@)
- r|~IM[p17i0k+	p少 &
-;
- "=l)z
-&;=1П0+ v0	;
 =p%m0P
 
Pho`1 \Wp\Q    P@OP@J vfn. 	m1P [[f.0JPQ 50 0 dV ǚΒ 
-k=ׄP "\J=n 	5    p`[ Q3  0  1P0 v  0!]ӎop0 	- ?`Jp	 'O 
53 	Q .10_ [ 1 
4 W0"0~yP~I]  
T3Pg0 [yN C>WSSpPgM Pa.z o >Q0N.
P.TP10 >  lgS oS4lo

 vM
@ @ 1 5@3SW?ƾ 0P;a0o 0@ >' V^m [   .P[E< @
	 /\	8㍱ά>iT   N"/
  T`T]+ P  j [ 	^?>N pMn 1 _43 "
-HPg
0V?.߉
 S F΍/Np/	7<_!5 T>+0#7<  ÇHxE#G|L0dy?'UE(JC0% KÃ)SPA4xA,0@ @O
@e)p?VڱS% A[Zą
$O<8Q-lfg4 @t4&@D_== *(3%kLVF
 ۮm{k۱?G|tc#g 
-pΏ:8P޼yH2u0=h b~|(<\>(hP
\pC@&U?D
-P4;hJp@I,D =WO!%#;K:" Lr$|I*DҳT3/8aLCB!NCSNѰoN<Sόѐ4+D9бsQ=3pGF#"/؄?/0DPB`CtTRK5%/T41V
ETSk8SdL[@UAZq5XduʚT7EvZjITMb[n
Ubw\FŘcUw]DWZr4E^|w_~_x`6`Vxava4b'  ;
\ No newline at end of file
+GIF89a ^      1y?>k mjqdH{"By>gy?EKKVa&BGKe.JjDIFPO;yR_Kyk^ʖҭٳ	a
+[	Ty	Hgj
OpqvZ|}"$ k%z$r^"e+~QmF6#ZuM7@?.b~:slyivاϺd)+(Q4lđHLP>UZԍmmMWT>q׻-]~ )VٿŸ#҇לѧpdɗׇ{n^
f$'2<ז3y,CHPSKR̗G[ءO[Wr:MگozOȄ\ʷϕ ,     ^   	H*\0ဇСC3jȱǁ=Hɓ(;^Lɲ˗#IK6sɳϟ@
+JѣH*]ʴӧPJɫXm[lZ֩+]R+hӪ]˶۷pʝW]tK64q!
+LÈ+1Ŋ;F,-Z~'k̹τ%KtE]<
װc/^lvv]]cNgڶݎ
i׎s?^պҫ'n:]G&}߽7X=E64X 5vׂ6`p")p<h
校Yχإa.>x900آ$d2#Xbh9H)>iڈه>LNFv$8Ȩ E$"#Qifd9 9y64LesyXe]>F!f"rśã>
+F>*=K6	Sz|F)XbC
Fqh"o>@r"*~ƘTN1?J 7j7p`ƫzc̖%,Į@k暻SM"k>K K{rkb2J*#>? mB<lZ[ӈ?v©(|l*"sDmD{|j4&WOTWm5dݲ0,D+a?OG+*-5Һ}|,
Xgmx
Dt`7ސr-Dj/$z <Mt+qlKW|4А}~#8Ob^.
+Fj#$R2!%!D/}=!6M{ OHUc
T,s/L]ֈP*|Aq[G!<я~DT
+RQ"
 酠zEFU
+Ig)Pu	nT)23}߽~v{n=!Qր
+xTXȢb@jbM DnPH$<(J1C
+#J_<cF1??0)ct#{!wD}XbkU-
c((B
!6؃^V n$ 
+IH) !P
j0-s]:B	>Ȧ6YyxSG<Qr?>C&8)NrIp7!23NJUq8|Pi" 	3 !	
+xk"[V F4 Ha%D Ȁ9{S@;A£B@w8QTy A?9J)JfE*PJU2G<K#L@Rk\̌ևA
hPWg`3E@a%X@>};6Yx
mga2gA+Zζg?(~e@FV+[,0'	@4T\{C,Vyk_ҵhCW@ b
խ.JRL/u<j@^>]lums+P0XG9uEKaKW
   PX"m((3J qu)Jϧ`g@x<f<wף0汌"2;Qr5^	ܱv7CA@y
s GPCB	p,=2pיL	9g= :bЈE;kD6ȅ |dx0N~<e0WNE"bN5?H@ Ie) 4Am5  D;XAc , J;@q=2=[QFT5Sх0"z=( E:dh% @y&$>?a2~fG5t#v:@~۔8qr?9Sm)Lp?W-|Hҗa( ЇE,KwïN7 	N[ 0g&ʋ,.Wc*`j;Ս`x&Ux3}F 	, _?Q֏P	^.19
90wK13P{B[=PX7Ցu0\_C"X7-hOwaWdgG|`T s&e[S0baqoV}g}f$@IoV~g&~Ks7vG,x8Ȃ Pw
lvg  P<xw|1[`6{y}^_X}@!8| p gp|-~hPvxxX쐃
} x  8\p4Љ؉68]0[@5bY[8	`'	x0`ڗoYzzƋfX #x	@8x
X}Q P3Xg 蘎@츎RRRPW bǨ0ti0z`#8	g(hxc7I`[ڸ 7HϐXpuEX0!Ȏx8(S lK}xI	}{tًYhXTyy i[9I(ug Ԩ04Y﨓8HJ{ 0xH	^0y	Zyjgl萍yhOmFɊ0Zp\Op@
!P֐^xX
+3𒮩0vyx(4wXu YI
+	phP0(z0v܉lpx	"
]	﹚	) (ӸўYmED#xyY~Мz g
+v`ͩiB}ǝމyhYv0.p9ݠ!AF
1
3Za
6pHJW60	JHxGYzye )@vYy0	YH[*ky z'
+p

07

 v'"
:jӘ` P	zS$c8F	pzP
+p)	s:vYZiZx@Z 	Pv)Jh 	ࢭ)
*وJ
cǣj=*z5PZPy	@@GyF9y[:uz
+	e׫y*y@*ypu``u769 `٠

߀۠

׀Y*˲.2 6pF{H{ lPxWPlKxZh `@gƚ,( 	K[˵J}J0' з~
}+'phϠ	`ɷ~۷+} 60ŠII{W0@p Ix0w<Pwpp[C	(oK+^l&߰
ٰиԛ
7 	``,x
[~pBpоɠ6@4`˪(z{ /@	s0t`i	f`PvAlٻʰ'	f	eP	‽dgP
v	/'
(Fp	ư{H`ȎB@ -		\lcňfz0		, t^zPv3	\q<.@|@	`G`p1  'W cɞWɽ[s 	<ɬʟ˝-P˵\
+AACL[5k@w8tmNrGv
pڼͷjOx,a<.`,ȹ{6͠ܾ{4P@B`e
̬ 
+mH&܌	}"P&} <26u0 eg<s-@B=}O@QO0<hģ̌	iB-{|p ֌@ph- e@ĈI24-,>}	@`C}Z9N@OU,\<Äzթ͕  \Հmfh	<`p{F00ד]h;	pyamjz\`P ,\ F w0	&0	
		0	e@\`me	 	j jw/p
+h	ڬ\% `hLj@p	 4
2ь->	`e@h 0	jjP zP
+PN`	e 	fz ޛ̨mk E0	w]p
+znzfPhNp
+^
	w`	`Jnz 	`Mp` h.@	\n  
+ ٚ]ɦ	r] j 	c->A	P	P`0n`
+PK 	) 	pj P0	O YXPfpknn		hޅe z  {)-kȐP02`h ˟<Ԝ>q Pꔠ
+搠	ڭc^	n	O^ny
+>Ϯ
+Nz`	8ގ08٬p`Y6 \ /p e !n
+c؃-?	N@	n 		P@ (ڮ	y`t3 gN U	P6	,nozP w.e@ E	@g?AȰ```f
=ِn}
+/
+f	
_Q/p'Pz	Ċ-- ~jP^X@	w \@hFk4)KH,P%%UpAG!-`JК_ƊdYLB9uyOD*NM,لN.j¨!MVZr=^5)5%N-`iM.`	˅xt{W<I=%EK6WPSRTiEf1a=Up"evNlaǶ{wB0zQ[GجX8"q"wΖ _G7hyРi:vO]G?p/gi}	Y0SCqD
:A49ckq_q	{P Dr$0Idҷl^{aƟ}iH)]01Ma| 0,ԒsA!,s!dWFU|tRJUHutRM%:^FS=^@FNgV\mjU]g-4N5X9
X:50@gZl{2Zjg`XFeur]Ӎtu]x㕷iEJrw3մYץS`V8mO[({xb{YXE28f;?ydK6d8dW8eWcgfcv9sY_h6ڀ>:Vi]ꬻk{.{WP[m^k{P{k&{vWXzpVpW|qwq{p/sCg)r`uKwu\}vko=vg_a~kxW~ywwx`^a^ի|[W{͗ӗ~~   ;
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/imageset/topic_read_hot.gif 3.0.6.src/styles/subsilver2/imageset/topic_read_hot.gif
--- 3.0.5.src/styles/subsilver2/imageset/topic_read_hot.gif	2008-06-10 02:55:53.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/imageset/topic_read_hot.gif	2009-11-09 10:30:36.000000000 -0600
@@ -1,14 +1,17 @@
-GIF89a  ? fffIvo鲳ↆ,vڇYttt555UUUi~GGG^h
ea83}X
-b$p􊭿9|zߎ̼!NETSCAPE2.0   !
- ? ,       Px@PH5l
-?D@
$V0e0Jd2(
-W̶n[F#KkNuax"6?` +/%x9<
-! :=)" 18'/+-(?)6,	B
 *2&CF>"04" @;h$2Ƙg+.`HI !
- ? ,   	  3/ "b
-b3)	 ӡ`12"<
h9~A%  ! ? ,  
-   QC e8DBI'4
"B2`"2ԄNVPOQA ! ? ,  
-   PP
⇈K1+s0*d0+,#p *~  w?RR!pbC^B^A ! ? ,  
-   NPhZFbA 9a2`~P
2_S::rG $SBRTGB?A ! ? ,   
  _p!9,͏a
`#8̯0@G@?OC  GNMB?A !2 ? ,   
  _ph8FoAW qBC B*`!3#N%!?i k?ICGTN\CCA !
+GIF89a  ? fffIvo鲳ↆ,vڇYttt555UUUi~GGG^h
ea83}X
+b$p􊭿9|zߎ̼                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                !NETSCAPE2.0   ! ? ,        xaaLx1+48@1@
+LaāBZ(a
+4|`  FXar	5@ d@ Yr8@ !D:E@@
+XPaJa@׷  , }K`
+2T0G8C qܰ Dm	 ^hg|P@(Ha	<,l}WB},-z*<Lp B p1fM?Т.u ! ? ,  
+   c @@  8px.20@
+B<CJ@ T ?$JdS01Qǀ ! ? ,  
+   a h@` `" B⇈0T	#'DP`JA@B;| A$P`"
+#  ! ? ,   
  t `A <@ 6ఁ6 x!p8@2(03 r Ar`~T0AЇP(t p@
8 (P(
vxG@ !2 ? ,   
  t haA ` "8Q E@G
+xa@I@ X B$#8TȰ@b	!: %?$`@D@
+PDc*t(a`@ !
  ? ,  
-   MB,
-h	m0Hb8CD:fXDWa\t(B&Y<8e XBGG?A ;
\ No newline at end of file
+   ` @8h! Fc"@0AQDl`F Y2C
+1lȐa>@G@`$Dу% !
+ ? ,   	  9 -A XD !B6xaC ؀A(QHY˗ !
+ ? ,   	  B  "0p *,0B"ЁFp06X8 C"`x@AM	 ;
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/imageset/topic_read_hot_mine.gif 3.0.6.src/styles/subsilver2/imageset/topic_read_hot_mine.gif
--- 3.0.5.src/styles/subsilver2/imageset/topic_read_hot_mine.gif	2008-06-10 02:55:53.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/imageset/topic_read_hot_mine.gif	2009-11-09 10:30:36.000000000 -0600
@@ -1,16 +1,15 @@
-GIF89a  ? fffIvo鲳ↆ,vڇYttt555UUUi~GGG^h
ea83}X
-b$p􊭿9|zߎ̼!NETSCAPE2.0   !
- ? ,       ]&6yOgA)l @P-%AO~e4f?!by|"6?( | +/,|9<
-! :=)" 18'D/+-(?)6,	O
 *2&PH>*ӧB&| B .p1f80\$0 !
- ? ,   	  3/ "b
-b3)	 ӡ`12"<
h9~A%  ! ? ,  
-   Q1@0 #A8%s @O4ʀh7&	#N%)P0D?NMBOQJJ??A ! ? ,  
-   OP
⇈ΣbV` U:!!9aWX o% @T8  v?QQ!oaC]B]A ! ? ,  
-   NPh bA1a	DT0P
 3#aS::sG (SBRTGB?A ! ? ,   
  _p%!9
-g%ς`#8̯0 G@?[C  GNMB?A !2 ? ,   
  _ph8
-;߀1ï ℆A+U`!
-3#N%!?h j?ICGSN[CCA !
+GIF89a  ? fffIvo鲳ↆ,vڇYttt555UUUi~GGG^h
ea83}X
+b$p􊭿9|zߎ̼                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                !NETSCAPE2.0   ! ? ,        @ą	P(1ŏ-p2H(N<PI%LP QD ` `+pC!l1#";`p@!DG@ 1 %*(Xa׷  ,(}K`
+2T0G
+"p(7D ㄁cx3r
+X<@
+Pd>Z@B	6 @+V!D>@B&| B p1f8F0\$0=  ! ? ,  
+   b @@  A8<  G!!A%fQ`WXЁA	   Q*#2iӗB(c@ ! ? ,  
+   a h@ " @ !",Qa T	 $#FP`LAB;| A$P`"
+#  ! ? ,   
  t `A% <@ ~p@A	!p8@2(03 r Ar`~T0AЍP(t p@
8 (P(
vxG@ !2 ? ,   
  t haA ` ~`A( C"D DDa I@ X "$#8TȰ b	!: % ?$`@D@
+LDpc*t(a`@ !
  ? ,  
-   Nd)Bcq\6h$Q1!
-b3X,~"0R6g:!f,
-p2 YBHH?A ;
\ No newline at end of file
+   a ,a`A
pA
 !E8` *,0`"0
+Pdbؐ!Â*0|68 CHJ15  !
+ ? ,   	  9 ;,0A	6 B6xaC ؀A(QHY˗ !
+ ? ,   	  B  "0p *,0B"ЁFp06X8 C"`x@AM	 ;
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/imageset/topic_unread_hot.gif 3.0.6.src/styles/subsilver2/imageset/topic_unread_hot.gif
--- 3.0.5.src/styles/subsilver2/imageset/topic_unread_hot.gif	2008-06-10 02:55:53.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/imageset/topic_unread_hot.gif	2009-11-09 10:30:36.000000000 -0600
@@ -1,11 +1,13 @@
-GIF89a  ? ӗ)tgMLKʱhHyofffچȱYqWզx555ƜquuueXK궁^ha~85}XMюƠ!NETSCAPE2.0   !
- ? ,       PZY6l
-FA-@NKrTR47fCnaP"?~% 4*	 3=
#& 678.%%06;,
-%y40 -9?."!/X?>-)CF:  !NP@   P^XC CȘ!'A  !
- ? ,   	  1P t*!x@#a0	$tai))|S ! ? ,  
-   P"yXB@t@@2VM_Ȅ$qV Jj0b=Za	?O&M$B0$PI?YA ! ? ,  
-   LP
U9XFP~g9pat~t bmB|CiRR$? G_?_A ! ? ,  
-   QPxς^Tz A'a
$dCS"@hJIH&g?	$0$ ?G?]A ! ? ,   
  \pA/T8RI<C@	d8*`m{0-1=&B+ $C 	#F!c GB%!F~BA !2 ? ,   
  ]pxÂ(Uz8h~	c<  D:\(H2?r	#}?	CT&	$F0$UGB_CCA !
+GIF89a  ? ӗ)tgMLKʱhHyofffچȱYqWզx555ƜquuueXK궁^ha~85}XMюƠ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                !NETSCAPE2.0   ! ? ,        gT1@Dp@ DP
+.BA
6x`AB09  UH!a( P,AXDl F,]j  0A&0l=q 3zThp᫄kW 7pĊ8`6vP1$xA4@OxX 9~HHBD "@:@@*8   ?vhQ: ! ? ,  
+   _ a@< @@%`@|  qA1 `F#3 y3F(H> ?| ! ? ,  
+   e x@$`0B'  	#0aA'4 q
+BXQ`,G!	$!A&		 ~,88 ! ? ,   
  q aAx@aJ QÁJt!	 ap	?H 	4C8@O&:| <8 ÈNXb$
+TZ"}
+ !2 ? ,   
  r xaA$<A0C N8$0hB`  H8p
+ ?d&>@DHA!*+[R !
  ? ,  
-   IB$
-(y `q$	bG2:8	u!9XMB$GG?A ;
\ No newline at end of file
+   \ @ "  $XpÊ @@"!p0d	  G~px E0B$2=x !
+ ? ,   	  8 /8@ 	%XC	  8a%tP0C	(\ !
+ ? ,   	  ?  P? q>H a'NP a	J !C$Xh@
+Ȁ% ;
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/imageset/topic_unread_hot_mine.gif 3.0.6.src/styles/subsilver2/imageset/topic_unread_hot_mine.gif
--- 3.0.5.src/styles/subsilver2/imageset/topic_unread_hot_mine.gif	2008-06-10 02:55:53.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/imageset/topic_unread_hot_mine.gif	2009-11-09 10:30:36.000000000 -0600
@@ -1,13 +1,14 @@
-GIF89a  ? ӗ)tgMLKʱhHyofffچȱYqWզx555ƜquuueXK궁^ha~85}XMюƠ!NETSCAPE2.0   !
- ? ,       _.ch*rVh
-j5"lA`@ԡR].*^Jр<`? |~ b&0s"?-g% 4/	 3=
 #& 678.%%06;,
-%~40 -9?."!/^?>-)PH:  ) @/?   !,  2@ ,,~"c !
- ? ,   	  1P t*!x@#a0	$tai))|S ! ? ,  
-   O"yX!1ID dD,	=I$<@haFz?N&L$B0$OI?XA ! ? ,  
-   KP ЯsFP~g9pat~t bmB|CiQQ$? G_`_A ! ? ,  
-   RPxgA!zMI~hx2Y)W J
-ǋh%$$&B	$0$ ?G?_A ! ? ,   
  ZpAT8RI<C@	d8P	hU6ZaZ\c{LB+ $C 	#F!c O|%!aCA !2 ? ,   
  ]pxÂ(	p
-=h~	c<  $:\(H2?r	#}?	CS&	$F0$TGB_CCA !
+GIF89a  ? ӗ)tgMLKʱhHyofffچȱYqWզx555ƜquuueXK궁^ha~85}XMюƠ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                !NETSCAPE2.0   ! ? ,        `a
+Z(QƏ/E2`@(NtBŅ*xP ȉ,Hx`,@&@<8	C@ D    bÏ-x0@NM  
/.L
a@ ;Gj!HHv
+8 qBXqL
+1&/`HjO ""$à@D(xG>(^  -R@Dyp
+@$@   P^_C?n1C ! ? ,  
+   ^ a@<  @p`@|  qA1 `F#3 y3FH>  ? ! ? ,  
+   f x@,HaA0@@$xOp(A ( bZX!C	H0!C$LA!@Xp
+ ! ? ,   
  o aAx@aJ QÁJt!	 ap	%XQYЁ
>\@ Ha',1ăy>(B֐ !2 ? ,   
  r xaA$<	~ @ N8$0hB`  H8p
+ ?d&>0DHA!(+[R !
  ? ,  
-   IB$
-(y `q$	bG2:8	u!9XMB$GG?A ;
\ No newline at end of file
+   \ @"  $XpÊ @@"!p0d	  G~px E0B$2=x !
+ ? ,   	  : M@ $@0	$@ &&8СC	XxP''\r˗0 !
+ ? ,   	  ?  P? q>H a'NP a	J !C$Xh@
+Ȁ% ;
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/style.cfg 3.0.6.src/styles/subsilver2/style.cfg
--- 3.0.5.src/styles/subsilver2/style.cfg	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/style.cfg	2009-11-16 11:10:10.000000000 -0600
@@ -19,4 +19,4 @@
 # General Information about this style
 name = subsilver2
 copyright = &copy; 2005 phpBB Group
-version = 3.0.5
+version = 3.0.6
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/captcha_default.html 3.0.6.src/styles/subsilver2/template/captcha_default.html
--- 3.0.5.src/styles/subsilver2/template/captcha_default.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/styles/subsilver2/template/captcha_default.html	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,15 @@
+	<tr>
+		<th colspan="2" valign="middle">{L_CONFIRM_CODE}</th>
+	</tr>
+	<tr>
+		<td class="row3" colspan="2"><span class="gensmall">{L_CONFIRM_EXPLAIN}</span></td>
+	</tr>
+	<tr>
+		<td class="row1" colspan="2" align="center"><img src="{CONFIRM_IMAGE_LINK}" alt="{L_CONFIRM_CODE}" />
+		<input type="hidden" name="confirm_id" id="confirm_id" value="{CONFIRM_ID}" /></td>
+	</tr>
+	<tr>
+		<td class="row1"><b class="genmed">{L_CONFIRM_CODE}:</b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
+		<td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8" />
+		<!-- IF S_CONFIRM_REFRESH --><input type="submit" name="refresh_vc" id="refresh_vc" class="button2" value="{L_VC_REFRESH}" /><!-- ENDIF --></td>
+	</tr>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/captcha_qa.html 3.0.6.src/styles/subsilver2/template/captcha_qa.html
--- 3.0.5.src/styles/subsilver2/template/captcha_qa.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/styles/subsilver2/template/captcha_qa.html	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,8 @@
+	<tr>
+		<th colspan="2" valign="middle">{QA_CONFIRM_QUESTION}</th>
+	</tr>
+	<tr>
+		<td class="row1"><b class="genmed">{QA_CONFIRM_QUESTION}:</b><br /></td>
+		<td class="row2"><input class="post" type="text" name="qa_answer" size="80" /></td>
+		<input type="hidden" name="qa_confirm_id" id="confirm_id" value="{QA_CONFIRM_ID}" /></td>
+	</tr>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/captcha_recaptcha.html 3.0.6.src/styles/subsilver2/template/captcha_recaptcha.html
--- 3.0.5.src/styles/subsilver2/template/captcha_recaptcha.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/styles/subsilver2/template/captcha_recaptcha.html	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,35 @@
+<!-- IF S_RECAPTCHA_AVAILABLE -->
+	<tr>
+		<th colspan="2" valign="middle">{L_CONFIRM_CODE}</th>
+	</tr>
+	<tr>
+		<td class="row1"><b class="genmed">{L_CONFIRM_CODE}:</b><br /><span class="gensmall">{L_RECAPTCHA_EXPLAIN}</span></td>
+		<td class="row2">
+		<script type="text/javascript">
+		// <![CDATA[
+		var RecaptchaOptions = {
+			lang : '{L_RECAPTCHA_LANG}',
+			tabindex : <!-- IF $CAPTCHA_TAB_INDEX -->{$CAPTCHA_TAB_INDEX}<!-- ELSE -->10<!-- ENDIF -->
+		};
+		// ]]>
+		</script>
+		<script type="text/javascript" src="{RECAPTCHA_SERVER}/challenge?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}" ></script>
+		<script type="text/javascript">
+		// <![CDATA[
+		<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
+			document.getElementById('recaptcha_table').style.direction = 'ltr';
+		<!-- ENDIF -->
+		// ]]>
+		</script>
+
+			<noscript>
+				<iframe src="{RECAPTCHA_SERVER}/noscript?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}" height="300" width="500" frameborder="0"></iframe><br />
+				<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
+				<input type="hidden" name="recaptcha_response_field" value="manual_challenge" />
+			</noscript>
+		</td>
+	</tr>
+
+<!-- ELSE -->
+{L_RECAPTCHA_NOT_AVAILABLE}
+<!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/editor.js 3.0.6.src/styles/subsilver2/template/editor.js
--- 3.0.5.src/styles/subsilver2/template/editor.js	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/editor.js	2009-11-16 11:10:10.000000000 -0600
@@ -261,7 +261,7 @@
 */
 function mozWrap(txtarea, open, close)
 {
-	var selLength = txtarea.textLength;
+	var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;
 	var selStart = txtarea.selectionStart;
 	var selEnd = txtarea.selectionEnd;
 	var scrollTop = txtarea.scrollTop;
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/forumlist_body.html 3.0.6.src/styles/subsilver2/template/forumlist_body.html
--- 3.0.5.src/styles/subsilver2/template/forumlist_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/forumlist_body.html	2009-11-16 11:10:10.000000000 -0600
@@ -19,11 +19,10 @@
 			<td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td>
 			<td class="row1">
 				<!-- IF forumrow.FORUM_IMAGE -->
-					<div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div><div style="float: {S_CONTENT_FLOW_BEGIN};">
+					<div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div>
 				<!-- ENDIF -->
 				<a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a>
 				<p class="forumdesc">{forumrow.FORUM_DESC}</p>
-				<!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF -->
 			</td>
 			<!-- IF forumrow.CLICKS -->
 				<td class="row2" colspan="3" align="center"><span class="genmed">{L_REDIRECTS}: {forumrow.CLICKS}</span></td>
@@ -42,7 +41,7 @@
 			<td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td>
 			<td class="row1" width="100%">
 				<!-- IF forumrow.FORUM_IMAGE -->
-					<div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div><div style="float: {S_CONTENT_FLOW_BEGIN};">
+					<div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div>
 				<!-- ENDIF -->
 				<a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a>
 				<p class="forumdesc">{forumrow.FORUM_DESC}</p>
@@ -52,13 +51,12 @@
 				<!-- IF forumrow.SUBFORUMS and forumrow.S_LIST_SUBFORUMS -->
 					<p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}</p>
 				<!-- ENDIF -->
-				<!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF -->
 			</td>
 			<td class="row2" align="center"><p class="topicdetails">{forumrow.TOPICS}</p></td>
 			<td class="row2" align="center"><p class="topicdetails">{forumrow.POSTS}</p></td>
 			<td class="row2" align="center" nowrap="nowrap">
 				<!-- IF forumrow.LAST_POST_TIME -->
-					<p class="topicdetails">{forumrow.LAST_POST_TIME}</p>
+					<p class="topicdetails"><!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a>&nbsp;<!-- ENDIF -->{forumrow.LAST_POST_TIME}</p>
 					<p class="topicdetails">{forumrow.LAST_POSTER_FULL}
 						<!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a><!-- ENDIF -->
 					</p>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/login_body.html 3.0.6.src/styles/subsilver2/template/login_body.html
--- 3.0.5.src/styles/subsilver2/template/login_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/login_body.html	2009-11-16 11:10:10.000000000 -0600
@@ -65,26 +65,13 @@
 	</td>
 </tr>
 
-<!-- IF S_CONFIRM_CODE -->
+<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
 </table>
 <table class="tablebg" width="100%" cellspacing="1">
-	<tr> 
-		<th colspan="2" valign="middle">{L_LOGIN_CONFIRMATION}</th>
-	</tr>
-	<tr> 
-		<td class="row3" colspan="2"><span class="gensmall">{L_LOGIN_CONFIRM_EXPLAIN}</span></td>
-	</tr>
-	<tr>
-		<td class="row1" colspan="2" align="center">
-			<input type="hidden" name="confirm_id" value="{CONFIRM_ID}" />
-			{CONFIRM_IMAGE}
-		</td>
-	</tr>
-	<tr> 
-		<td class="row1"><b class="genmed">{L_CONFIRM_CODE}: </b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
-		<td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8" /></td>
-	</tr>
+		
+	<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
 <!-- ENDIF -->
+
 <tr>
 	<td class="cat" <!-- IF not S_ADMIN_AUTH or S_CONFIRM_CODE -->colspan="2"<!-- ENDIF --> align="center">{S_HIDDEN_FIELDS}<input type="submit" name="login" class="btnmain" value="{L_LOGIN}" tabindex="5" /></td>
 </tr>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/mcp_front.html 3.0.6.src/styles/subsilver2/template/mcp_front.html
--- 3.0.5.src/styles/subsilver2/template/mcp_front.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/mcp_front.html	2009-11-16 11:10:10.000000000 -0600
@@ -35,7 +35,7 @@
 		</tr>
 	<!-- ENDIF -->
 	<tr>
-		<td class="cat" colspan="6" align="center"><input class="btnmain" type="submit" name="action[approve]" value="{L_APPROVE}" />&nbsp;&nbsp;<input class="btnlite" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" /></td>
+		<td class="cat" colspan="6" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="action[approve]" value="{L_APPROVE}" />&nbsp;&nbsp;<input class="btnlite" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" /></td>
 	</tr>
 	</table>
 	{S_FORM_TOKEN}
@@ -85,6 +85,43 @@
 	<br clear="all" /><br />
 <!-- ENDIF -->
 
+<!-- IF S_SHOW_PM_REPORTS -->
+	<table class="tablebg" width="100%" cellspacing="1">
+	<tr>
+		<td class="row3" colspan="6" align="center"><b class="gen">{L_LATEST_REPORTED_PMS}</b></td>
+	</tr>
+	<tr>
+		<th>&nbsp;{L_PM_SUBJECT}&nbsp;</th>
+		<th>&nbsp;{L_PM_FROM}&nbsp;</th>
+		<th>&nbsp;{L_TO} &amp; {L_BCC}&nbsp;</th>
+		<th>&nbsp;{L_SENT_AT}&nbsp;</th>
+		<th>&nbsp;{L_REPORTER}&nbsp;</th>
+		<th>&nbsp;{L_REPORT_TIME}&nbsp;</th>
+	</tr>
+	<!-- BEGIN pm_report -->
+		<tr>
+			<td class="row1" valign="top"><span class="gen">{pm_report.PM_SUBJECT}</span><br /><span class="gensmall">[ <a href="{pm_report.U_PM_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
+			<td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.PM_AUTHOR_FULL}</span></td>
+			<td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.RECIPIENTS}</span></td>
+			<td class="row2" align="center" width="10%" nowrap="nowrap" valign="top"><span class="gensmall">{pm_report.PM_TIME}</span></td>
+			<td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.REPORTER_FULL}</span></td>
+			<td class="row2" align="center" width="10%" nowrap="nowrap" valign="top"><span class="gensmall">{pm_report.REPORT_TIME}</span></td>
+		</tr>
+	<!-- BEGINELSE -->
+		<tr>
+			<td class="row1" colspan="6" align="center"><span class="gen">{L_PM_REPORTS_ZERO_TOTAL}</span></td>
+		</tr>
+	<!-- END pm_report -->
+	<!-- IF S_HAS_PM_REPORTS -->
+		<tr>
+			<td class="row3" colspan="6"><span class="gensmall">{L_PM_REPORTS_TOTAL}</span></td>
+		</tr>
+	<!-- ENDIF -->
+	</table>
+
+	<br clear="all" /><br />
+<!-- ENDIF -->
+
 <!-- IF S_SHOW_LOGS -->
 	<table class="tablebg" width="100%" cellspacing="1" cellpadding="4" border="0" align="{S_CONTENT_FLOW_END}">
 	<tr>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/mcp_logs.html 3.0.6.src/styles/subsilver2/template/mcp_logs.html
--- 3.0.5.src/styles/subsilver2/template/mcp_logs.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/mcp_logs.html	2009-11-16 11:10:10.000000000 -0600
@@ -22,6 +22,9 @@
 		</tr>
 	<!-- END log -->
 	<tr align="center">
+		<td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_SEARCH_KEYWORDS}:</span> <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" /></td>
+	</tr>
+	<tr align="center">
 		<td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
 	</tr>
 	<!-- IF S_CLEAR_ALLOWED -->
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/mcp_notes_user.html 3.0.6.src/styles/subsilver2/template/mcp_notes_user.html
--- 3.0.5.src/styles/subsilver2/template/mcp_notes_user.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/mcp_notes_user.html	2009-11-16 11:10:10.000000000 -0600
@@ -55,6 +55,9 @@
 <!-- IF S_USER_NOTES -->
 
 	<tr align="center">
+		<td colspan="5" class="row3"><span class="gensmall">{L_SEARCH_KEYWORDS}:</span> <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" /></td>
+	</tr>
+	<tr align="center">
 		<td colspan="5" class="row3"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}:</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
 	</tr>
 	<tr>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/mcp_post.html 3.0.6.src/styles/subsilver2/template/mcp_post.html
--- 3.0.5.src/styles/subsilver2/template/mcp_post.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/mcp_post.html	2009-11-16 11:10:10.000000000 -0600
@@ -5,7 +5,7 @@
 
 	<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
 	<tr>
-		<th colspan="2" align="center">{L_REPORT_DETAILS}</th>
+		<th colspan="2" align="center"><!-- IF S_PM -->{L_PM_REPORT_DETAILS}<!-- ELSE -->{L_REPORT_DETAILS}<!-- ENDIF --></th>
 	</tr>
 	<tr>
 		<td class="row1"><b class="gen">{L_REPORT_REASON}: </b></td>
@@ -43,17 +43,17 @@
 
 <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
 <tr>
-	<th colspan="2" align="center">{L_POST_DETAILS}</th>
+	<th colspan="2" align="center"><!-- IF S_PM -->{L_PM}<!-- ELSE -->{L_POST_DETAILS}<!-- ENDIF --></th>
 </tr>
 <tr>
-	<td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS} | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td>
+	<td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS}<!-- IF not S_PM --> | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ENDIF --><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td>
 </tr>
 <tr>
-	<td class="row1"><b class="gen">{L_POST_SUBJECT}: </b></td>
+	<td class="row1"><b class="gen"><!-- IF S_PM -->{L_PM_SUBJECT}<!-- ELSE -->{L_POST_SUBJECT}<!-- ENDIF -->: </b></td>
 	<td class="row2"><span class="gen">{POST_SUBJECT}</span> <!-- IF S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span> <!-- ENDIF --> <!-- IF S_POST_REPORTED and not S_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --></td>
 </tr>
 <tr>
-	<td class="row1" width="20%"><b class="gen">{L_POSTER}: </b></td>
+	<td class="row1" width="20%"><b class="gen"><!-- IF S_PM -->{L_PM_FROM}<!-- ELSE -->{L_POSTER}<!-- ENDIF -->: </b></td>
 	<td class="row2" width="80%"><span class="gen"<!-- IF POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{POST_AUTHOR}</span><span class="gen"> &nbsp; [ <!-- IF U_POST_AUTHOR --><a href="{U_POST_AUTHOR}">{L_READ_PROFILE}</a><!-- ENDIF --><!-- IF S_USER_NOTES --><!-- IF U_POST_AUTHOR --> | <!-- ENDIF --><a href="{U_MCP_USER_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_MCP_WARN_USER -->| <a href="{U_MCP_WARN_USER}">{L_WARN_USER}</a><!-- ENDIF --><!-- ENDIF --> ]</span></td>
 </tr>
 <!-- IF S_CAN_VIEWIP -->
@@ -69,9 +69,30 @@
 	</tr>
 <!-- ENDIF -->
 <tr>
-	<td class="row1"><b class="gen">{L_POSTED}: </b></td>
+	<td class="row1"><b class="gen"><!-- IF S_PM -->{L_SENT_AT}<!-- ELSE -->{L_POSTED}<!-- ENDIF -->: </b></td>
 	<td class="row2"><span class="postdetails">{POST_DATE}</span></td>
 </tr>
+<!-- IF S_TO_RECIPIENT -->
+	<tr>
+		<td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_TO}:</b></td>
+		<td class="row2 gen">
+		<!-- BEGIN to_recipient -->
+			<!-- IF to_recipient.IS_GROUP --><span class="sep"><a href="{to_recipient.U_VIEW}">{to_recipient.NAME}</a></span><!-- ELSE -->{to_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
+		<!-- END to_recipient -->
+		</td>
+	</tr>
+<!-- ENDIF -->
+
+<!-- IF S_BCC_RECIPIENT -->
+	<tr>
+		<td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_BCC}:</b></td>
+		<td class="row2 gen">
+		<!-- BEGIN bcc_recipient -->
+			<!-- IF bcc_recipient.IS_GROUP --><span class="sep"><a href="{bcc_recipient.U_VIEW}">{bcc_recipient.NAME}</a></span><!-- ELSE -->{bcc_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
+		<!-- END bcc_recipient -->
+		</td>
+	</tr>
+<!-- ENDIF -->
 <tr>
 	<th colspan="2" align="center">{L_PREVIEW}</th>
 </tr>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/mcp_reports.html 3.0.6.src/styles/subsilver2/template/mcp_reports.html
--- 3.0.5.src/styles/subsilver2/template/mcp_reports.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/mcp_reports.html	2009-11-16 11:10:10.000000000 -0600
@@ -7,11 +7,16 @@
 	<th colspan="5" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th>
 </tr>
 <tr>
-	<td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <b>{L_ONLY_TOPIC}</b> &nbsp; <!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
+	<td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- IF not S_PM -->&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <b>{L_ONLY_TOPIC}</b> &nbsp; <!-- ENDIF --><!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
 </tr>
 <tr> 
+	<!-- IF S_PM -->
+	<th>&nbsp;{L_PM}&nbsp;</th>
+	<th>&nbsp;{L_TO} &amp; {L_BCC}&nbsp;</th>
+	<!-- ELSE -->
 	<th>&nbsp;{L_POST}&nbsp;</th>
 	<th>&nbsp;{L_AUTHOR}&nbsp;</th>
+	<!-- ENDIF -->
 	<th>&nbsp;{L_REPORTER}&nbsp;</th>
 	<th>&nbsp;{L_REPORT_TIME}&nbsp;</th>
 	<th width="5%">&nbsp;{L_SELECT}&nbsp;</th>
@@ -19,10 +24,17 @@
 <!-- BEGIN postrow -->
 
 	<!-- IF postrow.S_ROW_ is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+		<!-- IF S_PM -->
+		<td style="padding: 4px;"><p class="topictitle"><a href="{postrow.U_VIEW_DETAILS}">{postrow.PM_SUBJECT}</a></p>
+			<span class="gensmall">{L_PM_FROM}: {postrow.PM_AUTHOR_FULL}</span></td>
+		<td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><span class="gen">{postrow.RECIPIENTS}</span><br />
+			<span class="gensmall">{L_SENT_AT}: {postrow.PM_TIME}</span></td>
+		<!-- ELSE -->
 		<td style="padding: 4px;"><p class="topictitle"><a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p>
 			<span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td>
 		<td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.POST_AUTHOR_FULL}</span><br />
 			<span class="gensmall">{postrow.POST_TIME}</span></td>
+		<!-- ENDIF -->
 		<td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.REPORTER_FULL}</span></td>
 		<td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.REPORT_TIME}</span><br />
 			<span class="gensmall">[ <a href="{postrow.U_VIEW_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/mcp_topic.html 3.0.6.src/styles/subsilver2/template/mcp_topic.html
--- 3.0.5.src/styles/subsilver2/template/mcp_topic.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/mcp_topic.html	2009-11-16 11:10:10.000000000 -0600
@@ -61,9 +61,7 @@
 	<td class="cat" colspan="3" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
 </tr>
 <tr>
-	<th nowrap="nowrap">{L_AUTHOR}</th>
-	<th nowrap="nowrap">{L_MESSAGE}</th>
-	<th nowrap="nowrap">{L_SELECT}</th>
+	<th nowrap="nowrap" colspan="3">{L_TOPIC_REVIEW}: {TOPIC_TITLE}</th>
 </tr>
 <tr>
 	<td class="row3" colspan="3" align="center"><span class="gensmall">{RETURN_TOPIC}</span></td>
@@ -81,19 +79,12 @@
 			</tr>
 			</table>
 		</td>
-		<td rowspan="2" width="5%" align="center"><input type="checkbox" class="radio" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></td>
+		<td width="5%" align="center"><a href="{postrow.U_POST_DETAILS}">{INFO_IMG}</a></td>
 	</tr>
 
 	<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
 
-		<td valign="bottom">
-			<table width="100%" cellspacing="0" cellpadding="0" border="0">
-			<tr valign="middle">
-				<td align="center"><span class="gensmall">[ <a href="{postrow.U_POST_DETAILS}">{L_POST_DETAILS}</a> ]</span></td>
-			</tr>
-			</table>
-		</td>
-		<td width="100%" valign="top">
+		<td width="100%" valign="top" colspan="2">
 			<table width="100%" cellspacing="0" cellpadding="2" border="0">
 			<tr>
 				<td valign="top">
@@ -120,8 +111,8 @@
 					<table width="100%" cellspacing="0" cellpadding="0" border="0">
 					<tr valign="middle">
 						<td width="100%">
-							<!-- IF postrow.S_POST_UNAPPROVED and postrow.U_MCP_APPROVE -->{UNAPPROVED_IMG} <span class="postapprove"><a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span><!-- ENDIF -->
-							<!-- IF postrow.S_POST_REPORTED and postrow.U_MCP_REPORT -->{REPORTED_IMG}<span class="postreported"><a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF -->
+							<!-- IF postrow.S_POST_UNAPPROVED and postrow.U_MCP_APPROVE --><span class="postapprove">{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span><br /><!-- ENDIF -->
+							<!-- IF postrow.S_POST_REPORTED and postrow.U_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF -->
 						</td>
 						<td width="10" nowrap="nowrap">{postrow.MINI_POST_IMG}</td>
 						<td class="gensmall" nowrap="nowrap"><b>{L_POSTED}:</b> {postrow.POST_DATE}</td>
@@ -131,6 +122,7 @@
 			</tr>
 			</table>
 		</td>
+		<td width="5%" align="center"><input type="checkbox" class="radio" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></td>
 	</tr>
 	<tr>
 		<td class="row3" colspan="3" height="1"><img src="images/spacer.gif" width="1" height="1" alt="" /></td>
@@ -156,4 +148,4 @@
 </tr>
 </table>
 
-<!-- INCLUDE mcp_footer.html -->
\ No newline at end of file
+<!-- INCLUDE mcp_footer.html -->
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/memberlist_im.html 3.0.6.src/styles/subsilver2/template/memberlist_im.html
--- 3.0.5.src/styles/subsilver2/template/memberlist_im.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/memberlist_im.html	2009-11-16 11:10:10.000000000 -0600
@@ -14,7 +14,7 @@
 	</tr>
 	<tr>
 		<td class="row1"><b class="genmed">{L_IM_RECIPIENT}: </b></td>
-		<td class="row2"><span class="gen"><b>{USERNAME}</b><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM --> [ {IM_CONTACT} ]<!-- ENDIF --></span> <!-- IF PRESENCE_IMG -->{PRESENCE_IMG}<!-- ENDIF --></td>
+		<td class="row2"><span class="gen"><b>{USERNAME}</b><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM or S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --></span> <!-- IF PRESENCE_IMG -->{PRESENCE_IMG}<!-- ENDIF --></td>
 	</tr>
 
 	<!-- IF S_SEND_AIM -->
@@ -131,9 +131,9 @@
 	<!-- ENDIF -->
 
 	</table>
-	<a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
 {S_FORM_TOKEN}
 </form>
 
+<a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
 
 <!-- INCLUDE simple_footer.html -->
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/memberlist_view.html 3.0.6.src/styles/subsilver2/template/memberlist_view.html
--- 3.0.5.src/styles/subsilver2/template/memberlist_view.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/memberlist_view.html	2009-11-16 11:10:10.000000000 -0600
@@ -51,7 +51,15 @@
 			<!-- ENDIF -->
 			<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
 				<tr>
-					<td class="genmed" align="center">[ <!-- IF U_ADD_FRIEND and U_ADD_FOE--><a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a> | <a href="{U_ADD_FOE}">{L_ADD_FOE}</a><!-- ENDIF --><!-- IF U_REMOVE_FRIEND --><a href="{U_REMOVE_FRIEND}">{L_REMOVE_FRIEND}</a><!-- ENDIF --><!-- IF U_REMOVE_FOE --><a href="{U_REMOVE_FOE}">{L_REMOVE_FOE}</a><!-- ENDIF --> ]</td>
+					<td class="genmed" align="center">[
+						<!-- IF U_REMOVE_FRIEND -->
+							<a href="{U_REMOVE_FRIEND}">{L_REMOVE_FRIEND}</a>
+						<!-- ELSEIF U_REMOVE_FOE -->
+							<a href="{U_REMOVE_FOE}">{L_REMOVE_FOE}</a>
+						<!-- ELSE -->
+							<!-- IF U_ADD_FRIEND --><a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a><!-- ENDIF --><!-- IF U_ADD_FOE --><!-- IF U_ADD_FRIEND --> | <!-- ENDIF --><a href="{U_ADD_FOE}">{L_ADD_FOE}</a><!-- ENDIF -->
+						<!-- ENDIF -->
+					]</td>
 				</tr>
 			<!-- ENDIF -->
 			</table>
@@ -66,17 +74,17 @@
 				<td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_VISITED}: </td>
 				<td width="100%"><b class="gen">{VISITED}</b></td>
 			</tr>
-			<!-- IF U_NOTES or U_WARN -->
+			<!-- IF S_WARNINGS -->
 				<tr>
 					<td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}: </td>
-					<td width="100%"><b class="gen">{WARNINGS}</b><br /><span class="genmed">[ <a href="{U_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_WARN --> | <a href="{U_WARN}">{L_WARN_USER}</a> <!-- ENDIF -->]</span></td>
+					<td width="100%"><b class="gen">{WARNINGS}</b><!-- IF U_NOTES or U_WARN --><br /><span class="genmed"> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]</span><!-- ENDIF --></td>
 				</tr>
 			<!-- ENDIF -->
 			<tr>
 				<td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}: </td>
 				<td><b class="gen">{POSTS}</b><span class="genmed"><!-- IF POSTS_PCT --><br />[{POSTS_PCT} / {POSTS_DAY}]<!-- ENDIF -->
 				<!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --><br />[<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>]<!-- ELSEIF POSTS_IN_QUEUE --><br />[{L_POSTS_IN_QUEUE}]<!-- ENDIF -->
-				<br /><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></span></td>
+				<!-- IF S_DISPLAY_SEARCH --><br /><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a><!-- ENDIF --></span></td>
 			</tr>
 			<!-- IF S_SHOW_ACTIVITY -->
 				<tr>
@@ -126,7 +134,7 @@
 			</tr>
 			<tr>
 				<td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_JABBER}: </td>
-				<td><!-- IF U_JABBER and S_JABBER_ENABLED --><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false">{JABBER_IMG}</a><!-- ELSEIF USER_JABBER -->{USER_JABBER_IMG}<!-- ENDIF --></td>
+				<td><!-- IF U_JABBER --><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false">{JABBER_IMG}</a><!-- ELSEIF USER_JABBER -->{USER_JABBER_IMG}<!-- ENDIF --></td>
 			</tr>
 			</table>
 		</td>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/overall_header.html 3.0.6.src/styles/subsilver2/template/overall_header.html
--- 3.0.5.src/styles/subsilver2/template/overall_header.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/overall_header.html	2009-11-16 11:10:10.000000000 -0600
@@ -15,6 +15,15 @@
 {META}
 <title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
 
+<!-- IF S_ENABLE_FEEDS -->
+	<link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" />
+	<!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news" /><!-- ENDIF -->
+	<!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums" /><!-- ENDIF -->
+	<!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_TOPICS}" href="{U_FEED}?mode=topics" /><!-- ENDIF -->
+	<!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" /><!-- ENDIF -->
+	<!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&amp;t={S_TOPIC_ID}" /><!-- ENDIF -->
+<!-- ENDIF -->
+
 <link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />
 
 <script type="text/javascript">
@@ -159,7 +168,7 @@
 				<!-- IF not S_IS_BOT -->
 					<!-- IF S_USER_LOGGED_IN -->
 						<!-- IF S_DISPLAY_PM --> &nbsp;<a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF -->
-					<!-- ELSEIF S_REGISTER_ENABLED --> &nbsp;<a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" alt="*" /> {L_REGISTER}</a>
+					<!-- ELSEIF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --> &nbsp;<a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" alt="*" /> {L_REGISTER}</a>
 					<!-- ENDIF -->
 				<!-- ENDIF -->
 			</td>
@@ -192,7 +201,7 @@
 	<p class="searchbar">
 		<span style="float: {S_CONTENT_FLOW_BEGIN};"><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a> | <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></span>
 		<!-- IF S_USER_LOGGED_IN -->
-		<span style="float: {S_CONTENT_FLOW_END};"><a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></span>
+		<span style="float: {S_CONTENT_FLOW_END};"><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a> | <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></span>
 		<!-- ENDIF -->
 	</p>
 	<!-- ENDIF -->
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/posting_body.html 3.0.6.src/styles/subsilver2/template/posting_body.html
--- 3.0.5.src/styles/subsilver2/template/posting_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/posting_body.html	2009-11-16 11:10:10.000000000 -0600
@@ -249,10 +249,10 @@
 		<tr>
 			<td class="gensmall">{URL_STATUS}</td>
 		</tr>
+		<!-- ENDIF -->
 		<tr>
 			<td class="gensmall">{SMILIES_STATUS}</td>
 		</tr>
-		<!-- ENDIF -->
 		</table>
 	</td>
 	<td class="row2">
@@ -332,24 +332,10 @@
 	</tr>
 <!-- ENDIF -->
 
-<!-- IF S_CONFIRM_CODE -->
-	<tr>
-		<th colspan="2" valign="middle">{L_POST_CONFIRMATION}</th>
-	</tr>
-	<tr>
-		<td class="row3" colspan="2"><span class="gensmall">{L_POST_CONFIRM_EXPLAIN}</span></td>
-	</tr>
-	<tr>
-		<td class="row1" colspan="2" align="center">
-			<input type="hidden" name="confirm_id" value="{CONFIRM_ID}" />
-			{CONFIRM_IMAGE}
-		</td>
-	</tr>
-	<tr>
-		<td class="row1"><b class="genmed">{L_CONFIRM_CODE}: </b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
-		<td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8" /></td>
-	</tr>
-<!-- ENDIF -->
+		<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
+		<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
+		<!-- ENDIF -->
+
 
 <!-- IF S_SHOW_ATTACH_BOX or S_SHOW_POLL_BOX -->
 	<tr>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/posting_smilies.html 3.0.6.src/styles/subsilver2/template/posting_smilies.html
--- 3.0.5.src/styles/subsilver2/template/posting_smilies.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/posting_smilies.html	2009-11-16 11:10:10.000000000 -0600
@@ -16,11 +16,10 @@
 			<th>{L_SMILIES}</th>
 		</tr>
 		<tr>
-			<td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td>
+			<td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br />{PAGINATION}<br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td>
 		</tr>
 		</table>
 	</td>
 </tr>
 </table>
-
 <!-- INCLUDE simple_footer.html -->
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/quickreply_editor.html 3.0.6.src/styles/subsilver2/template/quickreply_editor.html
--- 3.0.5.src/styles/subsilver2/template/quickreply_editor.html	1969-12-31 18:00:00.000000000 -0600
+++ 3.0.6.src/styles/subsilver2/template/quickreply_editor.html	2009-11-16 11:10:10.000000000 -0600
@@ -0,0 +1,27 @@
+<form method="post" action="{U_QR_ACTION}">
+
+	<table class="tablebg" width="100%" cellspacing="1">
+		<tr>
+			<th align="center" colspan="2">{L_QUICKREPLY}</th>
+		</tr>
+		<tr>
+			<td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td>
+			<td  class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" /></td>
+		</tr>
+		<tr>
+			<td class="row1" width="22%"><b class="genmed">{L_MESSAGE}:</b></td>
+			<td class="row2" valign="top" align="left" width="78%"><textarea name="message" rows="7" cols="76" tabindex="3"  style="width: 98%;"></textarea> </td>
+		</tr>
+		<tr>
+			<td class="cat" colspan="2" align="center">
+				<input class="btnmain" type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" />&nbsp;
+				<input class="btnlite" type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" />
+
+				{S_FORM_TOKEN}
+				{QR_HIDDEN_FIELDS}
+			</td>
+		</tr>
+	</table>
+	
+</form>
+<br clear="all" />
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/report_body.html 3.0.6.src/styles/subsilver2/template/report_body.html
--- 3.0.5.src/styles/subsilver2/template/report_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/report_body.html	2009-11-16 11:10:10.000000000 -0600
@@ -4,10 +4,10 @@
 
 <table class="tablebg" width="100%" cellspacing="1">
 <tr>
-	<th colspan="2">{L_REPORT_POST}</th>
+	<th colspan="2"><!-- IF S_REPORT_POST -->{L_REPORT_POST}<!-- ELSE -->{L_REPORT_MESSAGE}<!-- ENDIF --></th>
 </tr>
 <tr>
-	<td class="row3" colspan="2"><span class="gensmall">{L_REPORT_POST_EXPLAIN}</span></td>
+	<td class="row3" colspan="2"><span class="gensmall"><!-- IF S_REPORT_POST -->{L_REPORT_POST_EXPLAIN}<!-- ELSE -->{L_REPORT_MESSAGE_EXPLAIN}<!-- ENDIF --></span></td>
 </tr>
 <tr>
 	<td class="row1" width="22%"><b class="gen">{L_REASON}:</b></td>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/search_results.html 3.0.6.src/styles/subsilver2/template/search_results.html
--- 3.0.5.src/styles/subsilver2/template/search_results.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/search_results.html	2009-11-16 11:10:10.000000000 -0600
@@ -8,7 +8,7 @@
 </tr>
 <tr>
 	<td class="genmed"><!-- IF SEARCH_TOPIC -->{L_SEARCHED_TOPIC}: <a href="{U_SEARCH_TOPIC}"><b>{SEARCH_TOPIC}</b></a><br /><!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_SEARCHED_FOR}: <a href="{U_SEARCH_WORDS}"><b>{SEARCH_WORDS}</b></a><!-- ENDIF --><!-- IF IGNORED_WORDS --> {L_IGNORED_TERMS}: <b>{IGNORED_WORDS}</b><!-- ENDIF --></td>
-	<td align="{S_CONTENT_FLOW_END}"><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}: </span><input type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td>
+	<td align="{S_CONTENT_FLOW_END}"><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}: </span><input class="post" type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td>
 </tr>
 </table>
 
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/template.cfg 3.0.6.src/styles/subsilver2/template/template.cfg
--- 3.0.5.src/styles/subsilver2/template/template.cfg	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/template.cfg	2009-11-16 11:10:10.000000000 -0600
@@ -19,5 +19,5 @@
 # General Information about this template
 name = subsilver2
 copyright = &copy; phpBB Group, 2003
-version = 3.0.5
+version = 3.0.6
 
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/ucp_agreement.html 3.0.6.src/styles/subsilver2/template/ucp_agreement.html
--- 3.0.5.src/styles/subsilver2/template/ucp_agreement.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/ucp_agreement.html	2009-11-16 11:10:10.000000000 -0600
@@ -1,8 +1,31 @@
 <!-- INCLUDE overall_header.html -->
 
+<!-- IF S_SHOW_COPPA or S_REGISTRATION -->
 
+<!-- IF S_LANG_OPTIONS -->
+<script type="text/javascript">
+// <![CDATA[
+	/**
+	* Change language
+	*/
+	function change_language(lang_iso)
+	{
+		document.forms['register'].change_lang.value = lang_iso;
+		document.forms['register'].submit();
+	}
 
-<!-- IF S_SHOW_COPPA or S_REGISTRATION -->
+// ]]>
+</script>
+
+	<form method="post" action="{S_UCP_ACTION}" id="register">
+		<table width="100%" cellspacing="0">
+			<tr>
+				<td class="gensmall" align="{S_CONTENT_FLOW_END}">{L_LANGUAGE}: <select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></td>
+			</tr>
+		</table>
+		{S_HIDDEN_FIELDS}
+	</form>
+<!-- ENDIF -->
 
 	<form method="post" action="{S_UCP_ACTION}">
 
@@ -58,4 +81,4 @@
 
 <!-- ENDIF -->
 
-<!-- INCLUDE overall_footer.html -->
\ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/ucp_groups_manage.html 3.0.6.src/styles/subsilver2/template/ucp_groups_manage.html
--- 3.0.5.src/styles/subsilver2/template/ucp_groups_manage.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/ucp_groups_manage.html	2009-11-16 11:10:10.000000000 -0600
@@ -63,16 +63,19 @@
 		<td class="row2">{AVATAR_IMAGE}<br /><br /><input type="checkbox" class="radio" name="delete" />&nbsp;<span>{L_DELETE_AVATAR}</span></td>
 	</tr>
 	<!-- IF not S_IN_AVATAR_GALLERY -->
-		<!-- IF S_CAN_UPLOAD -->
+		<!-- IF S_UPLOAD_AVATAR_FILE -->
 			<tr>
 				<td class="row1" width="35%"><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></td>
 				<td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_MAX_FILESIZE}" /><input type="file" id="uploadfile" name="uploadfile" /></td>
 			</tr>
+		<!-- ENDIF -->
+		<!-- IF S_UPLOAD_AVATAR_URL -->
 			<tr>
 				<td class="row1" width="35%"><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td>
 				<td class="row2"><input name="uploadurl" type="text" id="uploadurl" value="" /></td>
 			</tr>
 		<!-- ENDIF -->
+		<!-- IF S_LINK_AVATAR -->
 		<tr>
 			<td class="row1" width="35%"><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td>
 			<td class="row2"><input name="remotelink" type="text" id="remotelink" value="" /></td>
@@ -81,6 +84,7 @@
 			<td class="row1" width="35%"><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></td>
 			<td class="row2"><input name="width" type="text" id="width" size="3" value="{AVATAR_WIDTH}" /> <span>px X </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>px</span></td>
 		</tr>
+		<!-- ENDIF -->
 		<!-- IF S_DISPLAY_GALLERY -->
 			<tr>
 				<td class="row1" width="35%"><label>{L_AVATAR_GALLERY}:</label></td>
@@ -193,7 +197,7 @@
 
 	<h1>{L_ADD_USERS}</h1>
 
-	<p>{L_ADD_USERS_EXPLAIN}</p>
+	<p>{L_ADD_USERS_UCP_EXPLAIN}</p>
 
 	<table class="tablebg" width="100%" cellspacing="1">
 	<tr>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/ucp_main_drafts.html 3.0.6.src/styles/subsilver2/template/ucp_main_drafts.html
--- 3.0.5.src/styles/subsilver2/template/ucp_main_drafts.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/ucp_main_drafts.html	2009-11-16 11:10:10.000000000 -0600
@@ -69,7 +69,7 @@
 			<table cellspacing="0" cellpadding="2" border="0">
 			<!-- INCLUDE posting_buttons.html -->
 			<tr>
-				<td colspan="9"><textarea class="post" name="message" rows="10" cols="70" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{DRAFT_MESSAGE}</textarea></td>
+				<td colspan="9"><textarea class="post" name="message" rows="10" cols="70" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();">{DRAFT_MESSAGE}</textarea></td>
 			</tr>
 			<tr>
 				<td colspan="9">
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/ucp_main_front.html 3.0.6.src/styles/subsilver2/template/ucp_main_front.html
--- 3.0.5.src/styles/subsilver2/template/ucp_main_front.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/ucp_main_front.html	2009-11-16 11:10:10.000000000 -0600
@@ -43,7 +43,7 @@
 		</tr>
 		<tr> 
 			<td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_TOTAL_POSTS}: </b></td>
-			<td><!-- IF POSTS_PCT --><b class="gen">{POSTS}</b><br /><span class="genmed">[{POSTS_PCT} / {POSTS_DAY}]<br /><a href="{U_SEARCH_SELF}">{L_SEARCH_YOUR_POSTS}</a></span><!-- ELSE --><b class="gen">{POSTS}<b><!-- ENDIF --></td>
+			<td><!-- IF POSTS_PCT --><b class="gen">{POSTS}</b><br /><span class="genmed">[{POSTS_PCT} / {POSTS_DAY}]<!-- IF S_DISPLAY_SEARCH --><br /><a href="{U_SEARCH_SELF}">{L_SEARCH_YOUR_POSTS}</a><!-- ENDIF --></span><!-- ELSE --><b class="gen">{POSTS}<b><!-- ENDIF --></td>
 		</tr>
 		<!-- IF S_SHOW_ACTIVITY -->
 			<tr>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/ucp_pm_viewfolder.html 3.0.6.src/styles/subsilver2/template/ucp_pm_viewfolder.html
--- 3.0.5.src/styles/subsilver2/template/ucp_pm_viewfolder.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/ucp_pm_viewfolder.html	2009-11-16 11:10:10.000000000 -0600
@@ -37,7 +37,7 @@
 
 </form>
 <!-- ELSE -->
-	
+
 	<table class="tablebg" width="100%" cellspacing="1" cellpadding="0" border="0">
 	<!-- IF NUM_NOT_MOVED or NUM_REMOVED -->
 		<tr>
@@ -74,7 +74,7 @@
 			<!-- ENDIF -->
 
 			<span class="topictitle">
-				{messagerow.ATTACH_ICON_IMG} 
+				{messagerow.ATTACH_ICON_IMG}
 				<!-- IF messagerow.S_PM_DELETED -->
 					{L_MESSAGE_REMOVED_FROM_OUTBOX}<br />
 					<a href="{messagerow.U_REMOVE_PM}" style="float: {S_CONTENT_FLOW_END};">{L_DELETE_MESSAGE}</a>
@@ -92,7 +92,13 @@
 		</tr>
 	<!-- BEGINELSE -->
 		<tr>
-			<td class="row1" colspan="{$COLSPAN}" height="30" align="center" valign="middle"><span class="gen">{L_NO_MESSAGES}</span></td>
+			<td class="row1" colspan="{$COLSPAN}" height="30" align="center" valign="middle"><span class="gen">
+			<!-- IF S_COMPOSE_PM_VIEW and S_NO_AUTH_SEND_MESSAGE -->
+				<!-- IF S_USER_NEW -->{L_USER_NEW_PERMISSION_DISALLOWED}<!-- ELSE -->{L_NO_AUTH_SEND_MESSAGE}<!-- ENDIF -->
+			<!-- ELSE -->
+				{L_NO_MESSAGES}
+			<!-- ENDIF -->
+			</span></td>
 		</tr>
 	<!-- END messagerow -->
 </table>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/ucp_pm_viewmessage.html 3.0.6.src/styles/subsilver2/template/ucp_pm_viewmessage.html
--- 3.0.5.src/styles/subsilver2/template/ucp_pm_viewmessage.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/ucp_pm_viewmessage.html	2009-11-16 11:10:10.000000000 -0600
@@ -93,7 +93,7 @@
 
 				<table width="100%" cellspacing="0">
 				<tr valign="middle">
-					<td class="gensmall" align="{S_CONTENT_FLOW_END}"> <!-- IF U_DELETE --><a href="{U_DELETE}">{DELETE_IMG}</a> <!-- ENDIF --></td>
+					<td class="gensmall" align="{S_CONTENT_FLOW_END}"> <!-- IF U_REPORT --><a href="{U_REPORT}">{REPORT_IMG}</a> <!-- ENDIF --><!-- IF U_DELETE --><a href="{U_DELETE}">{DELETE_IMG}</a> <!-- ENDIF --></td>
 				</tr>
 				</table>
 
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/ucp_profile_signature.html 3.0.6.src/styles/subsilver2/template/ucp_profile_signature.html
--- 3.0.5.src/styles/subsilver2/template/ucp_profile_signature.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/ucp_profile_signature.html	2009-11-16 11:10:10.000000000 -0600
@@ -27,7 +27,7 @@
 		<table cellspacing="0" cellpadding="2" border="0" width="99%">
 		<!-- INCLUDE posting_buttons.html -->
 		<tr>
-			<td colspan="2"><textarea class="post" name="signature" rows="10" cols="76" style="width: 90%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></td>
+			<td colspan="2"><textarea class="post" name="signature" rows="10" cols="76" style="width: 90%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();">{SIGNATURE}</textarea></td>
 		</tr>
 		<!-- IF S_BBCODE_ALLOWED -->
 		<tr>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/ucp_register.html 3.0.6.src/styles/subsilver2/template/ucp_register.html
--- 3.0.5.src/styles/subsilver2/template/ucp_register.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/ucp_register.html	2009-11-16 11:10:10.000000000 -0600
@@ -32,11 +32,6 @@
 		<td class="row2" colspan="2"><span class="gensmall">{L_REG_COND}</span></td>
 	</tr>
 <!-- ENDIF -->
-<!-- IF .profile_fields -->
-	<tr>
-		<td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td>
-	</tr>
-<!-- ENDIF -->
 
 <tr>
 	<td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td>
@@ -66,6 +61,10 @@
 	<td class="row1"><b class="genmed">{L_TIMEZONE}: </b></td>
 	<td class="row2"><select name="tz">{S_TZ_OPTIONS}</select></td>
 </tr>
+<!-- IF .profile_fields -->
+	<tr>
+		<td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td>
+	</tr>
 <!-- BEGIN profile_fields -->
 	<tr>
 		<td class="row1" width="35%">
@@ -75,24 +74,14 @@
 		</td>
 		<td class="row2">{profile_fields.FIELD}<!-- IF profile_fields.ERROR --><br /><span class="gensmall error">{profile_fields.ERROR}</span><!-- ENDIF --></td>
 	</tr>
+	
 <!-- END profile_fields -->
-
-<!-- IF S_CONFIRM_CODE -->
-	<tr>
-		<th colspan="2" valign="middle">{L_CONFIRMATION}</th>
-	</tr>
-	<tr>
-		<td class="row3" colspan="2"><span class="gensmall">{L_CONFIRM_EXPLAIN}</span></td>
-	</tr>
-	<tr>
-		<td class="row1" colspan="2" align="center">{CONFIRM_IMG}</td>
-	</tr>
-	<tr>
-		<td class="row1"><b class="genmed">{L_CONFIRM_CODE}: </b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN} <!-- IF S_CONFIRM_REFRESH -->{L_VC_REFRESH_EXPLAIN}<!-- ENDIF --></span></td>
-		<td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8" /><!-- IF S_CONFIRM_REFRESH -->&nbsp;<input type="submit" value="{L_VC_REFRESH}" class="btnlite" /><!-- ENDIF --></td>
-	</tr>
 <!-- ENDIF -->
 
+		<!-- IF CAPTCHA_TEMPLATE -->
+		<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
+		<!-- ENDIF -->
+
 <!-- IF S_COPPA -->
 	<tr>
 		<th colspan="2" valign="middle">{L_COPPA_COMPLIANCE}</th>
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/viewtopic_body.html 3.0.6.src/styles/subsilver2/template/viewtopic_body.html
--- 3.0.5.src/styles/subsilver2/template/viewtopic_body.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/viewtopic_body.html	2009-11-16 11:10:10.000000000 -0600
@@ -118,9 +118,9 @@
 		<!-- ENDIF -->
 			</table>
 			{S_HIDDEN_FIELDS}
-			
+			{S_FORM_TOKEN}
 			</form>
-			
+
 		</td>
 	</tr>
 <!-- ENDIF -->
@@ -155,7 +155,7 @@
 				</table>
 			</td>
 		</tr>
-		
+
 		<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
 
 			<td valign="top" class="profile">
@@ -180,6 +180,11 @@
 					<td>{postrow.POSTER_AVATAR}</td>
 				</tr>
 			<!-- ENDIF -->
+			<!-- IF not (postrow.ONLINE_IMG or postrow.RANK_TITLE or postrow.RANK_IMG or postrow.POSTER_AVATAR) -->
+				<tr>
+					<td></td>
+				</tr>
+			<!-- ENDIF -->
 				</table>
 
 				<span class="postdetails">
@@ -205,7 +210,7 @@
 					<!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED -->
 						<table width="100%" cellspacing="0">
 						<tr>
-							<td class="gensmall"><!-- IF postrow.S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span> <!-- ENDIF --> <!-- IF postrow.S_POST_REPORTED --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --></td>
+							<td class="gensmall"><!-- IF postrow.S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span><br /> <!-- ENDIF --> <!-- IF postrow.S_POST_REPORTED --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --></td>
 						</tr>
 						</table>
 
@@ -254,7 +259,7 @@
 					<!-- ENDIF -->
 
 					<!-- IF postrow.BUMPED_MESSAGE -->
-						<span class="gensmall">{postrow.BUMPED_MESSAGE}</span>
+						<span class="gensmall"><br /><br />{postrow.BUMPED_MESSAGE}</span>
 					<!-- ENDIF -->
 
 					<!-- IF not postrow.S_HAS_ATTACHMENTS --><br clear="all" /><br /><!-- ENDIF -->
@@ -280,7 +285,7 @@
 		<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
 
 			<td class="profile"><strong><a href="#wrapheader">{L_BACK_TO_TOP}</a></strong></td>
-			<td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF postrow.U_PROFILE --><a href="{postrow.U_PROFILE}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_PM --><a href="{postrow.U_PM}">{PM_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_EMAIL --><a href="{postrow.U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF not S_IS_BOT --><!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}">{EDIT_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}">{QUOTE_IMG}</a> <!-- ENDIF --> <!-- ENDIF -->&nbsp;</div></td>
+			<td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_PM --><a href="{postrow.U_PM}">{PM_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_EMAIL --><a href="{postrow.U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF not S_IS_BOT --><!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}">{EDIT_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}">{QUOTE_IMG}</a> <!-- ENDIF --> <!-- ENDIF -->&nbsp;</div></td>
 	<!-- ENDIF -->
 		</tr>
 
@@ -319,6 +324,9 @@
 <div id="pagefooter"></div>
 
 <br clear="all" />
+<!-- IF S_QUICK_REPLY -->
+<!-- INCLUDE quickreply_editor.html -->
+<!-- ENDIF -->
 
 <!-- INCLUDE breadcrumbs.html -->
 
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/template/viewtopic_print.html 3.0.6.src/styles/subsilver2/template/viewtopic_print.html
--- 3.0.5.src/styles/subsilver2/template/viewtopic_print.html	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/template/viewtopic_print.html	2009-11-16 11:10:10.000000000 -0600
@@ -24,12 +24,20 @@
 	line-height: 150%;
 }
 
-.code,
-.quote {
+.code, .codecontent, 
+.quote, .quotecontent {
+	margin: 0 5px 0 5px;
+	padding: 5px;
 	font-size: smaller;
 	border: black solid 1px;
 }
 
+.quotetitle {
+	color: black;
+	display : block;
+	font-weight: bold;
+}
+
 .forum {
 	font-family: Arial,Helvetica,sans-serif;
 	font-weight: bold;
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/theme/images/background.gif 3.0.6.src/styles/subsilver2/theme/images/background.gif
--- 3.0.5.src/styles/subsilver2/theme/images/background.gif	2008-06-10 02:55:51.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/theme/images/background.gif	2009-11-09 10:30:21.000000000 -0600
@@ -1 +1,2 @@
-GIF89a    G!     ,       pH,db8hT@JכV;vi`pn<^ͶtfGo\	x|m=>.-~||%yxvu8ss!po'ml*jj1gf"dd,aa /*XȰ!+"JXʅ-h( C|dIRK&KVȔ9f$8s$g@:Q)&OJJj ;
\ No newline at end of file
+GIF89a j      G                                                                                                                                                                                          !  A ,     j  !9 8
+7	65'&%$#":)(
-,+ b8PA*\hÇ;"F@E1Rȱ㌏'YdI(S$0ar9sM0rܹgO@:TѣH&uiOyHjU XغՇW=Jٳ  ;
\ No newline at end of file
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/theme/stylesheet.css 3.0.6.src/styles/subsilver2/theme/stylesheet.css
--- 3.0.5.src/styles/subsilver2/theme/stylesheet.css	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/theme/stylesheet.css	2009-11-16 11:10:10.000000000 -0600
@@ -34,12 +34,7 @@
 }
 
 #wrapheader {
-	min-height: 120px;
 	height: auto !important;
-	height: 120px;
-/*	background-image: url('./images/background.gif');
-	background-repeat: repeat-x;*/
-/*	padding: 0 25px 15px 25px;*/
 	padding: 0;
 }
 
@@ -62,10 +57,11 @@
 }
 
 #logodesc {
-	margin-bottom: 5px;
-	padding: 5px 25px;
-	background: #D9DFE4;
-	border-bottom: 1px solid #4787A7;
+	background-color: #C1CAD2;
+	background-image: url('./images/background.gif');
+	background-repeat: repeat-x;
+	background-position: center bottom;
+	padding: 0 25px 15px 25px;
 }
 
 #menubar {
@@ -227,6 +223,7 @@
 
 .postapprove img, .postreported img {
 	vertical-align: bottom;
+	padding-top: 5px;
 }
 
 .postauthor {
diff -x .svn -aruN 3.0.5.src/styles/subsilver2/theme/theme.cfg 3.0.6.src/styles/subsilver2/theme/theme.cfg
--- 3.0.5.src/styles/subsilver2/theme/theme.cfg	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/styles/subsilver2/theme/theme.cfg	2009-11-16 11:10:10.000000000 -0600
@@ -21,7 +21,7 @@
 # General Information about this theme
 name = subsilver2
 copyright = &copy; phpBB Group, 2003
-version = 3.0.5
+version = 3.0.6
 
 # Some configuration options
 
diff -x .svn -aruN 3.0.5.src/ucp.php 3.0.6.src/ucp.php
--- 3.0.5.src/ucp.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/ucp.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package ucp
-* @version $Id: ucp.php 8915 2008-09-23 13:30:52Z acydburn $
+* @version $Id: ucp.php 10090 2009-09-03 09:25:16Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -127,8 +127,8 @@
 			'AGREEMENT_TITLE'		=> $user->lang[$title],
 			'AGREEMENT_TEXT'		=> sprintf($user->lang[$message], $config['sitename'], generate_board_url()),
 			'U_BACK'				=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
-			'L_BACK'				=> $user->lang['BACK_TO_LOGIN'])
-		);
+			'L_BACK'				=> $user->lang['BACK_TO_LOGIN'],
+		));
 
 		page_footer();
 
@@ -143,6 +143,12 @@
 
 			foreach ($_COOKIE as $cookie_name => $cookie_data)
 			{
+				// Only delete board cookies, no other ones...
+				if (strpos($cookie_name, $config['cookie_name'] . '_') !== 0)
+				{
+					continue;
+				}
+
 				$cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name);
 
 				// Polls are stored as {cookie_name}_poll_{topic_id}, cookie_name_ got removed, therefore checking for poll_
@@ -186,7 +192,7 @@
 		$user_row = $db->sql_fetchrow($result);
 		$db->sql_freeresult($result);
 
-		if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'])
+		if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'] || !check_link_hash(request_var('hash', ''), 'switchperm'))
 		{
 			redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
 		}
@@ -215,11 +221,6 @@
 
 		$auth->acl_cache($user->data);
 
-		$sql = 'UPDATE ' . USERS_TABLE . "
-			SET user_perm_from = 0
-			WHERE user_id = " . $user->data['user_id'];
-		$db->sql_query($sql);
-
 		$sql = 'SELECT username
 			FROM ' . USERS_TABLE . '
 			WHERE user_id = ' . $user->data['user_perm_from'];
diff -x .svn -aruN 3.0.5.src/viewforum.php 3.0.6.src/viewforum.php
--- 3.0.5.src/viewforum.php	2009-05-31 05:58:35.000000000 -0500
+++ 3.0.6.src/viewforum.php	2009-11-16 11:10:11.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: viewforum.php 9459 2009-04-17 15:08:09Z acydburn $
+* @version $Id: viewforum.php 10067 2009-08-30 17:13:28Z acydburn $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -135,11 +135,14 @@
 else
 {
 	$template->assign_var('S_HAS_SUBFORUM', false);
-	get_moderators($moderators, $forum_id);
+	if ($config['load_moderators'])
+	{
+		get_moderators($moderators, $forum_id);
+	}
 }
 
 // Dump out the page header and load viewforum template
-page_header($user->lang['VIEW_FORUM'] . ' - ' . $forum_data['forum_name']);
+page_header($user->lang['VIEW_FORUM'] . ' - ' . $forum_data['forum_name'], true, $forum_id);
 
 $template->set_filenames(array(
 	'body' => 'viewforum_body.html')
@@ -163,8 +166,6 @@
 {
 	$template->assign_vars(array(
 		'S_NO_READ_ACCESS'		=> true,
-		'S_AUTOLOGIN_ENABLED'	=> ($config['allow_autologin']) ? true : false,
-		'S_LOGIN_ACTION'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') . '&amp;redirect=' . urlencode(str_replace('&amp;', '&', build_url())),
 	));
 
 	page_footer();
@@ -176,7 +177,8 @@
 	$token = request_var('hash', '');
 	if (check_link_hash($token, 'global'))
 	{
-		markread('topics', $forum_id);
+		// Add 0 to forums array to mark global announcements correctly
+		markread('topics', array($forum_id, 0));
 	}
 	$redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
 	meta_refresh(3, $redirect_url);
@@ -615,8 +617,8 @@
 		$view_topic_url_params = 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&amp;t=' . $topic_id;
 		$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
 
-		$topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
-		$posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
+		$topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', (($row['forum_id']) ? $row['forum_id'] : $forum_id))) ? true : false;
+		$posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', (($row['forum_id']) ? $row['forum_id'] : $forum_id))) ? true : false;
 		$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$topic_id", true, $user->session_id) : '';
 
 		// Send vars to template
diff -x .svn -aruN 3.0.5.src/viewonline.php 3.0.6.src/viewonline.php
--- 3.0.5.src/viewonline.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/viewonline.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: viewonline.php 9428 2009-04-08 17:33:51Z acydburn $
+* @version $Id: viewonline.php 9566 2009-06-09 15:52:03Z bantu $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -187,7 +187,7 @@
 		continue;
 	}
 
-	preg_match('#^([a-z/_]+)#i', $row['session_page'], $on_page);
+	preg_match('#^([a-z0-9/_-]+)#i', $row['session_page'], $on_page);
 	if (!sizeof($on_page))
 	{
 		$on_page[1] = '';
diff -x .svn -aruN 3.0.5.src/viewtopic.php 3.0.6.src/viewtopic.php
--- 3.0.5.src/viewtopic.php	2009-05-31 05:58:34.000000000 -0500
+++ 3.0.6.src/viewtopic.php	2009-11-16 11:10:10.000000000 -0600
@@ -2,7 +2,7 @@
 /**
 *
 * @package phpBB3
-* @version $Id: viewtopic.php 9470 2009-04-18 17:22:41Z acydburn $
+* @version $Id: viewtopic.php 10179 2009-09-23 08:19:22Z nickvergessen $
 * @copyright (c) 2005 phpBB Group
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
@@ -28,6 +28,9 @@
 $post_id	= request_var('p', 0);
 $voted_id	= request_var('vote_id', array('' => 0));
 
+$voted_id = (sizeof($voted_id) > 1) ? array_unique($voted_id) : $voted_id;
+
+
 $start		= request_var('start', 0);
 $view		= request_var('view', '');
 
@@ -41,6 +44,7 @@
 
 $update		= request_var('update', false);
 
+$s_can_vote = false;
 /**
 * @todo normalize?
 */
@@ -82,6 +86,7 @@
 			WHERE topic_id = $topic_id
 				" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') . "
 				AND post_time > $topic_last_read
+				AND forum_id = $forum_id
 			ORDER BY post_time ASC";
 		$result = $db->sql_query_limit($sql, 1);
 		$row = $db->sql_fetchrow($result);
@@ -184,6 +189,7 @@
 // The FROM-Order is quite important here, else t.* columns can not be correctly bound.
 if ($post_id)
 {
+	$sql_array['SELECT'] .= ', p.post_approved';
 	$sql_array['FROM'][POSTS_TABLE] = 'p';
 }
 
@@ -231,7 +237,7 @@
 }
 else
 {
-	$sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id" . ((!$auth->acl_get('m_approve', $forum_id)) ? ' AND p.post_approved = 1' : '');
+	$sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id";
 }
 
 $sql_array['WHERE'] .= ' AND (f.forum_id = t.forum_id';
@@ -259,6 +265,7 @@
 $topic_data = $db->sql_fetchrow($result);
 $db->sql_freeresult($result);
 
+// link to unapproved post or incorrect link
 if (!$topic_data)
 {
 	// If post_id was submitted, we try at least to display the topic as a last resort...
@@ -270,9 +277,21 @@
 	trigger_error('NO_TOPIC');
 }
 
+$forum_id = (int) $topic_data['forum_id'];
 // This is for determining where we are (page)
 if ($post_id)
 {
+	// are we where we are supposed to be?
+	if (!$topic_data['post_approved'] && !$auth->acl_get('m_approve', $topic_data['forum_id']))
+	{
+		// If post_id was submitted, we try at least to display the topic as a last resort...
+		if ($topic_id)
+		{
+			redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id" . (($forum_id) ? "&amp;f=$forum_id" : '')));
+		}
+
+		trigger_error('NO_TOPIC');
+	}
 	if ($post_id == $topic_data['topic_first_post_id'] || $post_id == $topic_data['topic_last_post_id'])
 	{
 		$check_sort = ($post_id == $topic_data['topic_first_post_id']) ? 'd' : 'a';
@@ -303,9 +322,7 @@
 	}
 }
 
-$forum_id = (int) $topic_data['forum_id'];
 $topic_id = (int) $topic_data['topic_id'];
-
 //
 $topic_replies = ($auth->acl_get('m_approve', $forum_id)) ? $topic_data['topic_replies_real'] : $topic_data['topic_replies'];
 
@@ -394,7 +411,8 @@
 $limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
 
 $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
-$sort_by_sql = array('a' => 'u.username_clean', 't' => 'p.post_time', 's' => 'p.post_subject');
+$sort_by_sql = array('a' => array('u.username_clean', 'p.post_id'), 't' => 'p.post_time', 's' => array('p.post_subject', 'p.post_id'));
+$join_user_sql = array('a' => true, 't' => false, 's' => false);
 
 $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
 
@@ -549,7 +567,10 @@
 
 // Moderators
 $forum_moderators = array();
-get_moderators($forum_moderators, $forum_id);
+if ($config['load_moderators'])
+{
+	get_moderators($forum_moderators, $forum_id);
+}
 
 // This is only used for print view so ...
 $server_path = (!$view) ? $phpbb_root_path : generate_board_url() . '/';
@@ -597,7 +618,7 @@
 	'UNAPPROVED_IMG'	=> $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
 	'WARN_IMG'			=> $user->img('icon_user_warn', 'WARN_USER'),
 
-	'S_IS_LOCKED'			=>($topic_data['topic_status'] == ITEM_UNLOCKED) ? false : true,
+	'S_IS_LOCKED'			=> ($topic_data['topic_status'] == ITEM_UNLOCKED && $topic_data['forum_status'] == ITEM_UNLOCKED) ? false : true,
 	'S_SELECT_SORT_DIR' 	=> $s_sort_dir,
 	'S_SELECT_SORT_KEY' 	=> $s_sort_key,
 	'S_SELECT_SORT_DAYS' 	=> $s_limit_days,
@@ -612,6 +633,7 @@
 
 	'S_DISPLAY_POST_INFO'	=> ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,
 	'S_DISPLAY_REPLY_INFO'	=> ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,
+	'S_ENABLE_FEEDS_TOPIC'	=> ($config['feed_topic'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $topic_data['forum_options'])) ? true : false,
 
 	'U_TOPIC'				=> "{$server_path}viewtopic.$phpEx?f=$forum_id&amp;t=$topic_id",
 	'U_FORUM'				=> $server_path,
@@ -683,13 +705,15 @@
 	$s_can_vote = ($auth->acl_get('f_vote', $forum_id) &&
 		(($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) &&
 		$topic_data['topic_status'] != ITEM_LOCKED &&
-		$topic_data['forum_status'] != ITEM_LOCKED) ? true : false;
+		$topic_data['forum_status'] != ITEM_LOCKED &&
+		(!sizeof($cur_voted_id) ||
+		($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']))) ? true : false;
 	$s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false;
 
 	if ($update && $s_can_vote)
 	{
 
-		if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id))
+		if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id) || !check_form_key('posting'))
 		{
 			$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start");
 
@@ -702,10 +726,14 @@
 			{
 				$message = 'TOO_MANY_VOTE_OPTIONS';
 			}
-			else
+			else if (in_array(VOTE_CONVERTED, $cur_voted_id))
 			{
 				$message = 'VOTE_CONVERTED';
 			}
+			else
+			{
+				$message = 'FORM_INVALID';
+			}
 
 			$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
 			trigger_error($message);
@@ -858,6 +886,7 @@
 // If the user is trying to reach the second half of the topic, fetch it starting from the end
 $store_reverse = false;
 $sql_limit = $config['posts_per_page'];
+$sql_sort_order = $direction = '';
 
 if ($start > $total_posts / 2)
 {
@@ -869,16 +898,25 @@
 	}
 
 	// Select the sort order
-	$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
+	$direction = (($sort_dir == 'd') ? 'ASC' : 'DESC');
 	$sql_start = max(0, $total_posts - $sql_limit - $start);
 }
 else
 {
 	// Select the sort order
-	$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
+	$direction = (($sort_dir == 'd') ? 'DESC' : 'ASC');
 	$sql_start = $start;
 }
 
+if (is_array($sort_by_sql[$sort_key]))
+{
+	$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
+}
+else
+{
+	$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
+}
+
 // Container for user details, only process once
 $post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = array();
 $has_attachments = $display_notice = false;
@@ -887,10 +925,10 @@
 
 // Go ahead and pull all data for this topic
 $sql = 'SELECT p.post_id
-	FROM ' . POSTS_TABLE . ' p' . (($sort_by_sql[$sort_key][0] == 'u') ? ', ' . USERS_TABLE . ' u': '') . "
+	FROM ' . POSTS_TABLE . ' p' . (($join_user_sql[$sort_key]) ? ', ' . USERS_TABLE . ' u': '') . "
 	WHERE p.topic_id = $topic_id
 		" . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . "
-		" . (($sort_by_sql[$sort_key][0] == 'u') ? 'AND u.user_id = p.poster_id': '') . "
+		" . (($join_user_sql[$sort_key]) ? 'AND u.user_id = p.poster_id': '') . "
 		$limit_posts_time
 	ORDER BY $sql_sort_order";
 $result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
@@ -1092,6 +1130,11 @@
 				'yim'			=> ($row['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($row['user_yim']) . '&amp;.src=pg' : '',
 				'jabber'		=> ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=jabber&amp;u=$poster_id") : '',
 				'search'		=> ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$poster_id&amp;sr=posts") : '',
+
+				'author_full'		=> get_username_string('full', $poster_id, $row['username'], $row['user_colour']),
+				'author_colour'		=> get_username_string('colour', $poster_id, $row['username'], $row['user_colour']),
+				'author_username'	=> get_username_string('username', $poster_id, $row['username'], $row['user_colour']),
+				'author_profile'	=> get_username_string('profile', $poster_id, $row['username'], $row['user_colour']),
 			);
 
 			get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
@@ -1150,7 +1193,22 @@
 	$cp = new custom_profile();
 
 	// Grab all profile fields from users in id cache for later use - similar to the poster cache
-	$profile_fields_cache = $cp->generate_profile_fields_template('grab', $id_cache);
+	$profile_fields_tmp = $cp->generate_profile_fields_template('grab', $id_cache);
+
+	// filter out fields not to be displayed on viewtopic. Yes, it's a hack, but this shouldn't break any MODs.
+	$profile_fields_cache = array();
+	foreach ($profile_fields_tmp as $profile_user_id => $profile_fields)
+	{
+		$profile_fields_cache[$profile_user_id] = array();
+		foreach ($profile_fields as $used_ident => $profile_field)
+		{
+			if ($profile_field['data']['field_show_on_vt'])
+			{
+				$profile_fields_cache[$profile_user_id][$used_ident] = $profile_field;
+			}
+		}
+	}
+	unset($profile_fields_tmp);
 }
 
 // Generate online information for user
@@ -1384,7 +1442,7 @@
 		// It is safe to grab the username from the user cache array, we are at the last
 		// post and only the topic poster and last poster are allowed to bump.
 		// Admins and mods are bound to the above rules too...
-		$l_bumped_by = '<br /><br />' . sprintf($user->lang['BUMPED_BY'], $user_cache[$topic_data['topic_bumper']]['username'], $user->format_date($topic_data['topic_last_post_time'], false, true));
+		$l_bumped_by = sprintf($user->lang['BUMPED_BY'], $user_cache[$topic_data['topic_bumper']]['username'], $user->format_date($topic_data['topic_last_post_time'], false, true));
 	}
 	else
 	{
@@ -1407,12 +1465,28 @@
 		$s_first_unread = $first_unread = true;
 	}
 
+	$edit_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_edit', $forum_id) || (
+		$user->data['user_id'] == $poster_id &&
+		$auth->acl_get('f_edit', $forum_id) &&
+		!$row['post_edit_locked'] &&
+		($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])
+	)));
+
+	$delete_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_delete', $forum_id) || (
+		$user->data['user_id'] == $poster_id &&
+		$auth->acl_get('f_delete', $forum_id) &&
+		$topic_data['topic_last_post_id'] == $row['post_id'] &&
+		($row['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']) &&
+		// we do not want to allow removal of the last post if a moderator locked it!
+		!$row['post_edit_locked']
+	)));
+
 	//
 	$postrow = array(
-		'POST_AUTHOR_FULL'		=> get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
-		'POST_AUTHOR_COLOUR'	=> get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
-		'POST_AUTHOR'			=> get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
-		'U_POST_AUTHOR'			=> get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
+		'POST_AUTHOR_FULL'		=> ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_full'] : get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
+		'POST_AUTHOR_COLOUR'	=> ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_colour'] : get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
+		'POST_AUTHOR'			=> ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_username'] : get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
+		'U_POST_AUTHOR'			=> ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_profile'] : get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
 
 		'RANK_TITLE'		=> $user_cache[$poster_id]['rank_title'],
 		'RANK_IMG'			=> $user_cache[$poster_id]['rank_image'],
@@ -1440,10 +1514,10 @@
 		'ONLINE_IMG'			=> ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
 		'S_ONLINE'				=> ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false),
 
-		'U_EDIT'			=> (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
+		'U_EDIT'			=> ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
 		'U_QUOTE'			=> ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
 		'U_INFO'			=> ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=post_details&amp;f=$forum_id&amp;p=" . $row['post_id'], true, $user->session_id) : '',
-		'U_DELETE'			=> (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && !$row['post_edit_locked'] && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
+		'U_DELETE'			=> ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
 
 		'U_PROFILE'		=> $user_cache[$poster_id]['profile'],
 		'U_SEARCH'		=> $user_cache[$poster_id]['search'],
@@ -1534,13 +1608,34 @@
 	}
 }
 
+// Get last post time for all global announcements
+// to keep proper forums tracking
+if ($topic_data['topic_type'] == POST_GLOBAL)
+{
+	$sql = 'SELECT topic_last_post_time as forum_last_post_time
+		FROM ' . TOPICS_TABLE . '
+		WHERE forum_id = 0
+		ORDER BY topic_last_post_time DESC';
+	$result = $db->sql_query_limit($sql, 1);
+	$topic_data['forum_last_post_time'] = (int) $db->sql_fetchfield('forum_last_post_time');
+	$db->sql_freeresult($result);
+
+	$sql = 'SELECT mark_time as forum_mark_time
+		FROM ' . FORUMS_TRACK_TABLE . '
+		WHERE forum_id = 0
+			AND user_id = ' . $user->data['user_id'];
+	$result = $db->sql_query($sql);
+	$topic_data['forum_mark_time'] = (int) $db->sql_fetchfield('forum_mark_time');
+	$db->sql_freeresult($result);
+}
+
 // Only mark topic if it's currently unread. Also make sure we do not set topic tracking back if earlier pages are viewed.
 if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id] && $max_post_time > $topic_tracking_info[$topic_id])
 {
-	markread('topic', $forum_id, $topic_id, $max_post_time);
+	markread('topic', (($topic_data['topic_type'] == POST_GLOBAL) ? 0 : $forum_id), $topic_id, $max_post_time);
 
 	// Update forum info
-	$all_marked_read = update_forum_tracking_info($forum_id, $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false);
+	$all_marked_read = update_forum_tracking_info((($topic_data['topic_type'] == POST_GLOBAL) ? 0 : $forum_id), $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false);
 }
 else
 {
@@ -1582,6 +1677,47 @@
 	}
 }
 
+// let's set up quick_reply
+$s_allowed_reply = ((!$auth->acl_get('f_reply', $forum_id) || ($topic_data['forum_status'] == ITEM_LOCKED) || ($topic_data['topic_status'] == ITEM_LOCKED)) && !$auth->acl_get('m_edit', $forum_id)) ? false : true;
+$s_quick_reply = $s_allowed_reply && $user->data['is_registered'] && $config['allow_quick_reply'] && ($topic_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY);
+
+if ($s_can_vote || $s_quick_reply)
+{
+	add_form_key('posting');
+
+	if ($s_quick_reply)
+	{
+		$s_attach_sig	= $config['allow_sig'] && $user->optionget('attachsig') && $auth->acl_get('f_sigs', $forum_id) && $auth->acl_get('u_sig');
+		$s_smilies		= $config['allow_smilies'] && $user->optionget('smilies') && $auth->acl_get('f_smilies', $forum_id);
+		$s_bbcode		= $config['allow_bbcode'] && $user->optionget('bbcode') && $auth->acl_get('f_bbcode', $forum_id);
+		$s_notify		= $config['allow_topic_notify'] && $user->data['user_notify'];
+
+		$qr_hidden_fields = array(
+			'topic_cur_post_id'		=> (int) $topic_data['topic_last_post_id'],
+			'lastclick'				=> (int) time(),
+			'topic_id'				=> (int) $topic_data['topic_id'],
+			'forum_id'				=> (int) $forum_id,
+		);
+
+		// Originally we use checkboxes and check with isset(), so we only provide them if they would be checked
+		(!$s_bbcode)					? $qr_hidden_fields['disable_bbcode'] = 1		: true;
+		(!$s_smilies)					? $qr_hidden_fields['disable_smilies'] = 1		: true;
+		(!$config['allow_post_links'])	? $qr_hidden_fields['disable_magic_url'] = 1	: true;
+		($s_attach_sig)					? $qr_hidden_fields['attach_sig'] = 1			: true;
+		($s_notify)						? $qr_hidden_fields['notify'] = 1				: true;
+		($topic_data['topic_status'] == ITEM_LOCKED) ? $qr_hidden_fields['lock_topic'] = 1 : true;
+
+		$template->assign_vars(array(
+			'S_QUICK_REPLY'			=> true,
+			'U_QR_ACTION'			=> append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&amp;f=$forum_id&amp;t=$topic_id"),
+			'QR_HIDDEN_FIELDS'		=> build_hidden_fields($qr_hidden_fields),
+			'SUBJECT'				=> 'Re: ' . censor_text($topic_data['topic_title']),
+		));
+	}
+}
+// now I have the urge to wash my hands :(
+
+
 // We overwrite $_REQUEST['f'] if there is no forum specified
 // to be able to display the correct online list.
 // One downside is that the user currently viewing this topic/post is not taken into account.
@@ -1591,7 +1727,7 @@
 }
 
 // Output the page
-page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title']);
+page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title'], true, $forum_id);
 
 $template->set_filenames(array(
 	'body' => ($view == 'print') ? 'viewtopic_print.html' : 'viewtopic_body.html')
